
@font-face {
  font-family: "Termina";
  src: url("/static/fonts/TerminaTest-Heavy.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

.font-termina {
  font-family: "Termina", "Inter", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
}

:root {
  --bg: #070708;
  --bg2: #0d0d0f;
  --bg3: #121216;
  --surface: rgba(255, 255, 255, 0.035);
  --surface2: rgba(255, 255, 255, 0.06);
  --glass: rgba(14, 14, 18, 0.82);
  --border: rgba(255, 255, 255, 0.07);
  --border-hi: rgba(255, 255, 255, 0.13);
  --text: #f4f4f5;
  --text2: rgba(244, 244, 245, 0.78);
  --muted: rgba(244, 244, 245, 0.48);
  --dim: rgba(244, 244, 245, 0.28);
  --lime: #c8ff00;
  --lime-dim: rgba(200, 255, 0, 0.1);
  --lime-glow: rgba(200, 255, 0, 0.22);
  --red: #ff4757;
  --red-dim: rgba(255, 71, 87, 0.12);
  --green: #2ed573;
  --purple: #a78bfa;
  --cyan: #22d3ee;
  --radius: 14px;
  --radius-sm: 8px;
  --sidebar-w: 0px;
  --header-h: 60px;
  --font: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.35);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 70% 45% at 85% -5%, rgba(200, 255, 0, 0.05), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

body::after { display: none; }

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}


.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 7, 8, 0.92);
  backdrop-filter: blur(12px);
  transition: padding 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}

.topbar.is-compact {
  padding: 0.38rem 1rem;
  background: rgba(7, 7, 8, 0.97);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.topbar.is-compact .brand-mark {
  width: calc(var(--brand-logo-size, 38px) * 0.68);
  height: calc(var(--brand-logo-size, 38px) * 0.68);
  font-size: 0.72rem;
}

.topbar.is-compact .brand-name {
  font-size: 0.82rem;
}

.topbar.is-compact .topbar-nav button {
  padding: 0.28rem 0.45rem;
  font-size: 0.72rem;
}

.topbar-left { display: flex; align-items: center; gap: 1.25rem; min-width: 0; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0.15rem 0;
  flex-shrink: 0;
}
.topbar-brand:hover .brand-name { color: var(--lime); }

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  line-height: 1.05;
  min-width: 0;
}
.brand-subtitle {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.topbar.is-compact .brand-subtitle {
  font-size: 0.55rem;
  letter-spacing: 0.06em;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
  padding-bottom: 2px;
}
.topbar-nav::-webkit-scrollbar { display: none; }
.topbar-nav .nav-indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: var(--lime);
  border-radius: 2px;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.topbar-nav button {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
}
.topbar-nav button:hover { color: var(--text2); background: var(--surface); }
.topbar-nav button.active { color: var(--lime); background: transparent; }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.share-btn.copied { color: var(--lime); border-color: rgba(200, 255, 0, 0.35); }

.topbar-meta {
  font-size: 0.68rem;
  color: var(--dim);
  font-family: var(--mono);
  white-space: nowrap;
}
.topbar-meta .mono { color: var(--muted); margin-left: 0.35rem; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.content {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
}


.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  overflow: hidden;
}
.panel-head {
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.panel-note {
  font-size: 0.72rem;
  color: var(--dim);
  margin-top: 0.15rem;
}
.panel-threat { display: flex; flex-direction: column; min-height: 320px; }
.panel-traffic { display: flex; flex-direction: column; min-height: 320px; }
.panel-traffic .chart-area-lg { flex: 1; min-height: 240px; }
.panel-chart .panel-head { padding-bottom: 0.5rem; }


.readout-summary { padding: 0.85rem 1rem 0.5rem; }
.readout-lead { font-size: 0.88rem; line-height: 1.45; color: var(--text2); }
.readout-lead strong { color: var(--text); font-weight: 600; }
.readout-sub { font-size: 0.74rem; color: var(--dim); margin-top: 0.35rem; }
.readout-empty { padding: 1rem; font-size: 0.82rem; color: var(--dim); }

.readout-list {
  padding: 0 1rem 1rem;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.readout-row-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
  margin-bottom: 0.25rem;
}
.readout-name { color: var(--text2); }
.readout-pct { color: var(--muted); font-size: 0.72rem; }
.readout-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}
.readout-bar span {
  display: block;
  height: 100%;
  background: var(--muted);
  border-radius: 2px;
}
.readout-row.sev-c .readout-bar span { background: var(--red); }
.readout-row.sev-h .readout-bar span { background: #d4a017; }
.readout-row.sev-m .readout-bar span { background: #888; }

.traffic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.35rem;
}


.kpi-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  margin-bottom: 0.85rem;
  overflow: hidden;
}
.kpi {
  padding: 0.75rem 0.85rem;
  border-right: 1px solid var(--border);
}
.kpi:last-child { border-right: none; }
.kpi-val {
  display: block;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text);
}
.kpi-lbl {
  display: block;
  font-size: 0.68rem;
  color: var(--dim);
  margin-top: 0.15rem;
}

.view-raw .topbar-nav { display: none; }
.view-raw .scroll-spy { display: none !important; }


.sidebar { display: none !important; }
.main-wrap { margin-left: 0; width: 100%; }

.brand-mark {
  width: var(--brand-logo-size, 38px);
  height: var(--brand-logo-size, 38px);
  background: linear-gradient(135deg, var(--lime), #9ecc00);
  color: #0a0a0a;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 0 24px rgba(200, 255, 0, 0.2);
  flex-shrink: 0;
  overflow: hidden;
}
.brand-mark.is-image {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.brand-mark .brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-name { font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; }
.brand-name span { color: var(--lime); }


.mode-upload .app { display: none !important; }
.mode-upload #forbidden-screen { display: none !important; }
.mode-dashboard #upload-landing { display: none; }
.mode-dashboard #forbidden-screen { display: none !important; }
.mode-forbidden #upload-landing { display: none !important; }
.mode-forbidden .app { display: none !important; }

.topbar-filename {
  max-width: min(220px, 32vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  color: var(--text2);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
}


.forbidden-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 1.5rem;
  position: relative;
  z-index: 3;
}

.forbidden-wrap {
  width: 100%;
  max-width: 420px;
}

.forbidden-card {
  padding: 2rem 1.75rem;
  text-align: center;
  border-color: rgba(255, 71, 87, 0.22);
  background: linear-gradient(165deg, rgba(255, 71, 87, 0.06), rgba(14, 14, 18, 0.9));
}

.forbidden-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid rgba(255, 71, 87, 0.25);
}

.forbidden-code {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--red);
  margin-bottom: 0.35rem;
}

.forbidden-title {
  font-size: 1.65rem;
  margin-bottom: 0.65rem;
}

.forbidden-lead {
  color: var(--text2);
  font-size: 0.92rem;
  margin-bottom: 0.55rem;
}

.forbidden-copy {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
  margin-bottom: 1.35rem;
}

.forbidden-copy strong { color: var(--text2); font-weight: 600; }

.forbidden-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.forbidden-screen .site-footer {
  position: relative;
  background: none;
  margin-top: 2rem;
  padding: 0.5rem 0 0;
}

.upload-landing {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem 1.5rem;
  position: relative;
  z-index: 2;
}

.upload-landing .site-footer {
  position: relative;
  background: none;
  margin-top: 2rem;
  padding: 0.5rem 0 0;
}

.landing-inner { width: 100%; max-width: 460px; }

.landing-brand { text-align: center; margin-bottom: 2rem; }

.landing-title { font-size: 2rem; line-height: 1.05; }
.landing-title span { color: var(--lime); }

.landing-tagline {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.55rem;
  letter-spacing: 0.01em;
}

.landing-card {
  padding: 1.35rem;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border-hi);
  box-shadow: var(--shadow);
}

.link-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.15rem 0 0.95rem;
  color: var(--dim);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.link-divider::before,
.link-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
}

.link-upload { display: flex; flex-direction: column; gap: 0.6rem; }

.link-upload-inner {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.8rem 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.link-upload.focused .link-upload-inner {
  border-color: rgba(200, 255, 0, 0.35);
  box-shadow: 0 0 0 3px rgba(200, 255, 0, 0.06);
}

.paste-hint {
  display: block;
  font-size: 0.65rem;
  color: var(--dim);
  margin-bottom: 0.3rem;
  font-family: var(--mono);
}
.paste-hint.hidden { display: none; }

.link-input {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}
.link-input::placeholder { color: var(--dim); }

.btn-analyze-link {
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--lime);
  color: #0a0a0a;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
}
.btn-analyze-link:hover { filter: brightness(1.05); transform: translateY(-1px); }

.dropzone {
  display: block;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 2.15rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  background: rgba(0, 0, 0, 0.25);
}
.dropzone:hover,
.dropzone.over {
  border-color: rgba(200, 255, 0, 0.45);
  background: rgba(200, 255, 0, 0.04);
  transform: translateY(-1px);
}
.dz-ring {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(200, 255, 0, 0.2);
  background: rgba(200, 255, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.85rem;
  color: var(--lime);
}
.dz-title { display: block; font-weight: 600; font-size: 0.92rem; color: var(--text); }
.dz-sub { display: block; color: var(--muted); font-size: 0.76rem; margin-top: 0.3rem; font-family: var(--mono); }

.progress-panel { display: none; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.progress-panel.active { display: block; }
.progress-label { font-size: 0.72rem; color: var(--lime); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.35rem; }
.progress-meta { display: flex; justify-content: space-between; font-size: 0.76rem; margin-bottom: 0.4rem; color: var(--text2); }
.progress-track { height: 4px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #9ecc00, var(--lime)); border-radius: 4px; transition: width 0.15s; }
.progress-stats { display: flex; gap: 1rem; margin-top: 0.4rem; font-family: var(--mono); font-size: 0.66rem; color: var(--muted); }

.site-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  text-align: center; padding: 0.85rem;
  font-size: 0.72rem; color: var(--dim);
  background: linear-gradient(transparent, rgba(7, 7, 8, 0.95));
  z-index: 10;
}
.dash-footer { position: relative; margin-top: 2rem; background: none; }
.site-footer a { color: var(--lime); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-dot { margin: 0 0.35rem; opacity: 0.4; }


.charts-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; margin-bottom: 1rem; }
.charts-row-2 { grid-template-columns: 1.55fr 0.85fr; }
.chart-card-pie { max-width: 100%; }
.chart-box { position: relative; height: 180px; padding: 0.5rem 0.75rem 0.75rem; }
.chart-box.chart-sm { height: 140px; }
.chart-box.chart-md { height: 200px; }
.chart-box.chart-area-lg { height: 300px; }
.chart-box.chart-pie-wrap { height: 200px; max-width: 220px; margin: 0 auto; }

.hero-radar, .hero-wide {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.hero-radar::before,
.hero-wide::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.hero-radar::before { background: linear-gradient(90deg, var(--red), transparent 70%); }
.hero-wide::before { background: linear-gradient(90deg, var(--lime), transparent 70%); }
.hero-wide { min-height: 380px; }
.hero-wide .chart-area-lg { flex: 1; min-height: 300px; }

.hero-threat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.hero-threat-stat {
  padding: 0.65rem 0.75rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.hero-threat-stat .hero-stat { font-size: 1.35rem; }
.hero-threat-stat .hero-sub { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.15rem; }

.threat-radar-bars { display: flex; flex-direction: column; gap: 0.5rem; margin-top: auto; }
.threat-radar-row {
  display: grid;
  grid-template-columns: 1fr 2.5fr 36px;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.72rem;
}
.threat-radar-name { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.threat-radar-track { height: 5px; background: rgba(255, 255, 255, 0.06); border-radius: 3px; overflow: hidden; }
.threat-radar-fill { height: 100%; background: var(--lime); border-radius: 3px; }
.threat-radar-fill.sev-c { background: var(--red); }
.threat-radar-fill.sev-h { background: #ffa502; }
.threat-radar-pct { font-family: var(--mono); font-size: 0.68rem; color: var(--text2); text-align: right; }

.view-toggle.active { border-color: var(--lime); color: var(--lime); background: var(--lime-dim); }
.hero-stats-row { display: flex; gap: 1rem; margin-bottom: 0.65rem; flex-wrap: wrap; }
.hero-mini {
  padding: 0.45rem 0.65rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 72px;
}
.hero-mini-val { display: block; font-family: var(--mono); font-size: 0.95rem; font-weight: 500; }
.hero-mini-lbl { font-size: 0.58rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.anim-fade-up { animation: fadeUp 0.5s ease both; }
.anim-stagger > * { animation: fadeUp 0.45s ease both; }
.anim-stagger > *:nth-child(1) { animation-delay: 0.04s; }
.anim-stagger > *:nth-child(2) { animation-delay: 0.08s; }
.anim-stagger > *:nth-child(3) { animation-delay: 0.12s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.48rem 0.75rem;
  margin-bottom: 1rem;
  color: var(--muted);
}
.sidebar-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.78rem;
  outline: none;
}
.sidebar-search input::placeholder { color: var(--dim); }

.sidebar-nav { flex: 1; overflow-y: auto; }

.nav-group { margin-bottom: 1.1rem; }
.nav-label {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  padding: 0 0.45rem;
  margin-bottom: 0.4rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.52rem 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  margin-bottom: 0.12rem;
}
.nav-item:hover { background: var(--surface); color: var(--text2); border-color: var(--border); }
.nav-item.active {
  background: var(--lime-dim);
  color: var(--lime);
  border-color: rgba(200, 255, 0, 0.2);
  box-shadow: inset 3px 0 0 var(--lime);
}

.sidebar-watchlist {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  margin-top: 0.25rem;
}
.watch-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.55rem;
  font-size: 0.76rem;
}
.watch-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.watch-dot.live { background: var(--lime); box-shadow: 0 0 10px var(--lime-glow); animation: pulse 2s ease infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.watch-label { color: var(--muted); flex: 1; }
.watch-val { color: var(--text2); font-weight: 600; }
.watch-val.mono { font-family: var(--mono); font-size: 0.66rem; }


.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.35rem;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 7, 8, 0.75);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-left { display: flex; align-items: center; gap: 0.85rem; }
.page-title { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.02em; }
.header-alerts { display: flex; gap: 0.35rem; }

.alert-chip {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  text-transform: lowercase;
}
.alert-chip.dim { color: var(--dim); }
.alert-chip.danger { background: var(--red-dim); color: var(--red); border-color: rgba(255, 71, 87, 0.22); }

.header-right { display: flex; align-items: center; gap: 0.45rem; }

.btn-primary {
  background: var(--lime);
  color: #0a0a0a;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.12s, transform 0.12s;
  white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }

.btn-ghost-sm {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.38rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text2);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.btn-ghost-sm:hover { border-color: var(--border-hi); color: var(--text); background: var(--surface); }

.icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.icon-btn:hover { color: var(--lime); border-color: rgba(200, 255, 0, 0.25); background: var(--lime-dim); }


.glass-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
}

.card-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.card-tag.danger { color: var(--red); }

.upload-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  max-width: 960px;
}
.upload-grid .upload-card { padding: 1.75rem; }
.upload-grid .upload-card h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.35rem; }
.upload-grid .upload-card > p { color: var(--muted); font-size: 0.88rem; margin-bottom: 1.25rem; }

.hints-card { padding: 1.5rem; }
.hints-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.85rem; }
.cmd-list code {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--purple);
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  word-break: break-all;
}
.cmd-list code:last-child { border-bottom: none; }

.error-banner {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: var(--red-dim);
  border: 1px solid rgba(255, 71, 87, 0.22);
  color: #ff8a96;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.hero-row {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: stretch;
}

.hero-card { padding: 1.15rem 1.25rem 1.25rem; min-height: 180px; }
.hero-top { margin-bottom: 0.65rem; }

.hero-stat {
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.hero-stat.lime { color: var(--lime); }
.hero-stat.red { color: var(--red); }
.hero-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }

.hero-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 0.45rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
}
.hero-change.up { background: var(--lime-dim); color: var(--lime); }
.hero-change.down { background: var(--red-dim); color: var(--red); }

.hero-bars { display: flex; align-items: flex-end; gap: 3px; height: 80px; margin-top: 1rem; }
.hero-bar { flex: 1; border-radius: 3px 3px 0 0; min-width: 4px; background: var(--lime); opacity: 0.85; }
.hero-bar.dim { background: var(--surface2); opacity: 0.5; }
.hero-sparkline { display: flex; align-items: flex-end; gap: 2px; height: 100px; margin-top: 0.5rem; }
.spark-bar { flex: 1; background: linear-gradient(180deg, var(--lime), rgba(200, 255, 0, 0.15)); border-radius: 2px 2px 0 0; min-width: 3px; }

.objectives-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  padding: 0;
  margin-bottom: 0.85rem;
  overflow: hidden;
}

.obj-item {
  padding: 0.95rem 1rem;
  border-right: 1px solid var(--border);
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}
.obj-item:last-child { border-right: none; }
.obj-item:hover { background: rgba(255, 255, 255, 0.025); }

.obj-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.obj-value {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}
.obj-mini-bar { display: flex; gap: 2px; margin-top: 0.45rem; height: 22px; align-items: flex-end; }
.obj-bar { flex: 1; background: var(--surface2); border-radius: 2px; min-height: 3px; }
.obj-bar.fill { background: linear-gradient(180deg, var(--lime), rgba(200, 255, 0, 0.35)); }


.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  align-items: start;
}
.dash-col { display: flex; flex-direction: column; gap: 0.85rem; }
.dash-section { display: flex; flex-direction: column; gap: 0.85rem; scroll-margin-top: calc(var(--header-h) + 16px); }

.dash-priority {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

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

.section-reveal {
  animation: sectionReveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.dash-priority .section-reveal:nth-child(1) { animation-delay: 0.04s; }
.dash-priority .section-reveal:nth-child(2) { animation-delay: 0.1s; }
.dash-grid .section-reveal:nth-child(1) { animation-delay: 0.08s; }

@keyframes sectionReveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.scroll-spy {
  position: fixed;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.5rem 0.35rem;
  border-radius: 999px;
  background: rgba(7, 7, 8, 0.55);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.scroll-spy-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  padding: 0;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.scroll-spy-dot:hover { background: rgba(255, 255, 255, 0.35); transform: scale(1.15); }

.scroll-spy-dot.active {
  background: var(--lime);
  transform: scale(1.35);
  box-shadow: 0 0 12px var(--lime-glow);
}

.scroll-spy-dot.active::before {
  content: "";
  position: absolute;
  right: calc(100% + 6px);
  top: 50%;
  width: 18px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--lime));
  transform: translateY(-50%);
  animation: spyPulse 0.35s ease;
}

@keyframes spyPulse {
  from { opacity: 0; width: 0; }
  to { opacity: 1; width: 18px; }
}

.raw-bytes-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }

.raw-bytes-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.raw-bytes-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  padding: 0.45rem 0.65rem;
  font-size: 0.72rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.raw-bytes-pre {
  margin: 0;
  padding: 0.65rem 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text2);
  overflow-x: auto;
  white-space: pre;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.card:hover { border-color: var(--border-hi); }
.card-danger { border-color: rgba(255, 71, 87, 0.18); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.card-title { font-size: 0.78rem; font-weight: 600; }
.card-badge {
  font-family: var(--mono);
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.card-body {
  padding: 0.45rem 0.85rem 0.7rem;
  max-height: 260px;
  overflow-y: auto;
}
.card-body::-webkit-scrollbar { width: 4px; }
.card-body::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 2px; }

.empty { color: var(--dim); font-size: 0.76rem; padding: 0.45rem 0; }


.table-wrap { margin: 0 -0.1rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
.data-table th {
  text-align: left;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  padding: 0.38rem 0.4rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.data-table td {
  padding: 0.42rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text2);
}
.data-table tr:hover td { background: rgba(200, 255, 0, 0.03); }
.data-table tr:last-child td { border-bottom: none; }
.data-table td.mono { font-family: var(--mono); font-size: 0.7rem; color: var(--text); }
.data-table td:last-child, .data-table th:last-child { text-align: right; width: 52px; }

.side-pill {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}
.side-pill.buy { background: var(--lime-dim); color: var(--lime); }
.side-pill.sell { background: var(--red-dim); color: var(--red); }

.copy-cell, .copy-inline, .btn-copy-sm {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.64rem;
  padding: 0.18rem 0.42rem;
  border-radius: 4px;
  font-family: var(--font);
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.copy-cell:hover, .copy-inline:hover, .btn-copy-sm:hover { color: var(--text2); border-color: var(--border-hi); }
.copy-cell.copied, .copy-inline.copied, .btn-copy-sm.copied {
  color: var(--lime);
  border-color: rgba(200, 255, 0, 0.25);
  background: var(--lime-dim);
}

.expand-btn {
  display: block; width: 100%;
  margin-top: 0.4rem;
  padding: 0.38rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.expand-btn:hover { color: var(--lime); border-color: rgba(200, 255, 0, 0.25); background: var(--lime-dim); }

.link { color: var(--lime); cursor: pointer; font-family: var(--mono); font-size: 0.7rem; text-decoration: none; }
.link:hover { text-decoration: underline; }
.dup-hint { font-size: 0.62rem; color: var(--dim); margin-top: 0.35rem; padding: 0 0.85rem 0.5rem; }


.pattern-list { display: flex; flex-direction: column; }
.pattern-item {
  display: grid;
  grid-template-columns: 3px 1fr auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.pattern-item:last-child { border-bottom: none; }
.pattern-sev { width: 3px; align-self: stretch; border-radius: 2px; background: var(--purple); }
.pattern-sev.sev-c { background: var(--red); }
.pattern-sev.sev-h { background: #ffa502; }
.pattern-sev.sev-m { background: var(--purple); }
.pattern-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.pattern-name { font-weight: 600; font-size: 0.82rem; color: var(--text); }
.pattern-conf { font-family: var(--mono); font-size: 0.7rem; color: var(--dim); }
.pattern-desc { font-size: 0.74rem; color: var(--muted); margin-top: 0.18rem; line-height: 1.45; }

.threat-row { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.threat-row:last-child { border-bottom: none; }
.threat-row.sev-c { border-left: 2px solid var(--red); padding-left: 0.55rem; }
.threat-row.sev-h { border-left: 2px solid #ffa502; padding-left: 0.55rem; }
.threat-row.sev-m { border-left: 2px solid var(--purple); padding-left: 0.55rem; }
.threat-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.threat-name { font-weight: 600; font-size: 0.82rem; }
.threat-badges { display: flex; gap: 0.25rem; }
.pill {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.12rem 0.4rem; border-radius: 4px; font-weight: 700;
}
.pill.sev-c { background: var(--red-dim); color: var(--red); }
.pill.sev-h { background: rgba(255, 165, 2, 0.15); color: #ffa502; }
.pill.sev-m { background: rgba(167, 139, 250, 0.15); color: var(--purple); }
.pill-dim { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.threat-desc { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; line-height: 1.45; }

.filter-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.filter-item:last-child { border-bottom: none; }
.filter-name { font-size: 0.74rem; grid-column: 1 / -1; color: var(--muted); }
.filter-bpf {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--purple);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  word-break: break-all;
  cursor: pointer;
  grid-column: 1;
  border: 1px solid var(--border);
  transition: border-color 0.12s;
}
.filter-bpf:hover { border-color: var(--border-hi); }

.mini-chart { display: flex; align-items: flex-end; gap: 1px; height: 56px; padding: 0.25rem 0; }
.chart-bar { flex: 1; min-width: 2px; background: var(--lime); border-radius: 2px 2px 0 0; opacity: 0.8; }
.chart-foot { display: flex; justify-content: space-between; font-size: 0.62rem; color: var(--dim); margin-top: 0.25rem; }

.port-block { margin-bottom: 0.55rem; }
.port-label { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.28rem; font-family: var(--mono); }
.len-item {
  display: grid; grid-template-columns: 42px 1fr 36px;
  gap: 0.35rem; align-items: center;
  margin-bottom: 0.18rem;
  font-size: 0.66rem; font-family: var(--mono); color: var(--dim);
}
.len-track { height: 3px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.len-fill { height: 100%; background: var(--lime); border-radius: 2px; }

.truncate-note { font-size: 0.72rem; color: var(--dim); margin-top: 0.75rem; text-align: center; }

.dash-raw { max-width: 920px; }
.raw-header { margin-bottom: 1.15rem; }
.raw-header h2 { font-size: 1.3rem; margin-bottom: 0.3rem; }
.raw-id { font-size: 0.76rem; color: var(--muted); }
.raw-id code { font-family: var(--mono); font-size: 0.7rem; color: var(--text2); }
.raw-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.raw-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.95rem;
  background: rgba(0, 0, 0, 0.22);
}
.raw-stat-val { display: block; font-family: var(--mono); font-size: 1.05rem; font-weight: 500; }
.raw-stat-lbl { font-size: 0.6rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.18rem; }
.raw-patterns { margin-bottom: 1rem; }
.raw-pattern { padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.raw-pattern:last-child { border-bottom: none; }
.raw-pattern p { font-size: 0.76rem; color: var(--muted); margin-top: 0.22rem; line-height: 1.45; }
.raw-bpf {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--purple);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.38rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  word-break: break-all;
}
.raw-bpf:hover { border-color: var(--border-hi); }
.raw-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 1rem 0 0.45rem;
}
.raw-hint { font-size: 0.66rem; color: var(--dim); margin-top: 0.3rem; padding: 0 0.85rem 0.45rem; }
.view-raw .sidebar-nav [data-scroll] { opacity: 0.35; pointer-events: none; }

.chart-card { overflow: hidden; }

.float-dock {
  position: fixed;
  bottom: 1.15rem;
  left: 50%;
  transform: translateX(calc(-50% + var(--sidebar-w) / 2));
  display: flex;
  gap: 0.25rem;
  padding: 0.35rem;
  background: rgba(10, 10, 12, 0.92);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  z-index: 50;
}
.dock-btn {
  width: 36px; height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.dock-btn:hover { background: var(--surface2); color: var(--text); }
.dock-btn.active { background: var(--lime); color: #0a0a0a; }


.drawer { position: fixed; inset: 0; z-index: 200; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(4px); }
.drawer-panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: min(480px, 92vw);
  border-radius: var(--radius) 0 0 var(--radius);
  display: flex; flex-direction: column;
  border-left: 1px solid var(--border-hi);
}
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}
.drawer-header h3 { font-size: 0.95rem; }
.drawer-actions { display: flex; gap: 0.45rem; align-items: center; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0.85rem 1rem; }


.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal.hidden { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(6px); }
.modal-card {
  position: relative;
  width: min(560px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.35rem;
  z-index: 1;
}
.modal-payload { max-width: 640px; width: 94vw; }
.modal-x { position: absolute; top: 0.85rem; right: 0.85rem; }
.modal-card h3 { font-size: 0.95rem; margin-bottom: 0.85rem; padding-right: 2rem; }

.sample-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.85rem;
  font-size: 0.76rem;
}
.sample-dl dt { color: var(--muted); }
.sample-dl dd { color: var(--text2); }
.sample-dl dd.mono { font-family: var(--mono); font-size: 0.72rem; }

.hex-panel {
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #050506;
  overflow: hidden;
}
.hex-dump {
  padding: 0.7rem 0.95rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.55;
  max-height: 280px;
  overflow: auto;
}
.hex-line { display: flex; gap: 0.75rem; white-space: pre; }
.hex-off { color: var(--dim); width: 2.5rem; flex-shrink: 0; user-select: none; }
.hex-bytes { flex: 1; letter-spacing: 0.02em; }
.hex-byte {
  display: inline-block;
  padding: 0 1px;
  border-radius: 2px;
  cursor: pointer;
  color: #8ec07c;
}
.hex-byte:hover { background: rgba(200, 255, 0, 0.12); color: var(--lime); }
.hex-byte.sel { background: rgba(200, 255, 0, 0.22); color: #fff; }
.hex-byte.gap { margin-right: 0.35rem; }
.hex-ascii { color: var(--dim); width: 1rem; flex-shrink: 0; overflow: hidden; }
.hex-inspect {
  padding: 0.48rem 0.75rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted);
  min-height: 2rem;
}
.hex-inspect b { color: var(--text2); font-weight: 500; }
.hex-hint { font-size: 0.64rem; color: var(--dim); margin-top: 0.45rem; }
.hex-hint code { font-family: var(--mono); font-size: 0.62rem; }

.code-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}
.code-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bpf-code { color: #c9a0ff !important; }
.code-block code {
  display: block; padding: 0.7rem 0.75rem;
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--purple); word-break: break-all;
  line-height: 1.5;
}

.toast {
  position: fixed; bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg3);
  border: 1px solid var(--border-hi);
  color: var(--text2);
  padding: 0.42rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  z-index: 500;
}

.hidden { display: none !important; }

@media (max-width: 1100px) {
  .hero-row { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(3) { border-right: none; }
  .charts-row, .charts-row-2 { grid-template-columns: 1fr; }
  .chart-box.chart-pie-wrap { max-width: 100%; }
  .raw-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .topbar { flex-wrap: wrap; padding: 0.55rem 0.85rem; }
  .topbar-left { flex-wrap: wrap; gap: 0.5rem; }
  .topbar-meta { display: none; }
  .topbar-right .btn-ghost-sm { display: none; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(2n) { border-right: none; }
  .dash-grid { grid-template-columns: 1fr; }
  .content { padding: 1rem 0.85rem 3rem; }
  .tl-body { grid-template-columns: 1fr; }
  .tl-shell { max-height: 96vh; }
}

body.tl-open { overflow: hidden; }

.tl-stage {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.tl-stage.hidden { display: none !important; }
.tl-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.82); backdrop-filter: blur(8px); }
.tl-shell {
  position: relative; z-index: 1;
  width: min(1180px, 98vw); max-height: 92vh;
  display: flex; flex-direction: column;
  padding: 1rem 1.1rem 0.85rem;
  border: 1px solid var(--border-hi); overflow: hidden;
}
.tl-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 0.75rem; }
.tl-title { font-size: 1.15rem; }
.tl-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.tl-header-stats { margin-left: auto; text-align: right; font-size: 0.72rem; color: var(--muted); display: flex; flex-direction: column; gap: 0.2rem; }
.tl-mal-stat { color: var(--red); }
.tl-sel-stat { color: var(--cyan); }
.tl-strip-wrap { padding: 0.5rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.2); }
.tl-strip { width: 100%; min-height: 28px; }
.tl-strip-canvas { width: 100%; height: 28px; display: block; cursor: crosshair; border-radius: 4px; }
.tl-scrub-wrap { padding: 0.65rem 0 0.35rem; }
.tl-heat { border-radius: 6px; overflow: hidden; margin-bottom: 0.35rem; border: 1px solid var(--border); }
.tl-heat-canvas { width: 100%; height: 36px; display: block; }
.tl-scrub-track { position: relative; }
.tl-cursor { position: absolute; top: 50%; width: 2px; height: 18px; background: var(--lime); transform: translate(-50%,-50%); pointer-events: none; box-shadow: 0 0 8px var(--lime-glow); z-index: 2; }
.tl-scrub { width: 100%; accent-color: var(--lime); cursor: pointer; }
.tl-time-row { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--muted); margin-top: 0.25rem; }
.tl-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.tl-ctl { border: 1px solid var(--border); background: var(--surface); color: var(--text2); font-size: 0.72rem; padding: 0.35rem 0.55rem; border-radius: 6px; cursor: pointer; }
.tl-ctl-play { background: var(--lime-dim); border-color: rgba(200,255,0,0.35); color: var(--lime); font-weight: 600; min-width: 4.5rem; }
.tl-speed-wrap, .tl-filter-wrap { margin-left: auto; font-size: 0.72rem; color: var(--muted); display: flex; align-items: center; gap: 0.35rem; }
.tl-speed { background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 0.25rem 0.35rem; }
.tl-body { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 0.75rem; flex: 1; min-height: 0; padding: 0.65rem 0 0.35rem; }
.tl-list-panel { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.tl-list-head { padding: 0.45rem 0.65rem; font-size: 0.72rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface); display: flex; justify-content: space-between; gap: 0.5rem; }
.tl-list-hint { font-weight: 400; color: var(--dim); font-size: 0.65rem; }
.tl-list { overflow-y: auto; max-height: 42vh; }
.tl-stream { display: flex; flex-direction: column; }
.tl-stream-head,
.tl-stream-row {
  display: grid;
  grid-template-columns: 1.2rem 2.5rem 5.5rem 3rem 1fr 2.5rem 5.5rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.65rem;
  font-size: 0.68rem;
  text-align: left;
}
.tl-stream-head {
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.6rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  position: sticky;
  top: 0;
  z-index: 1;
}
.tl-stream-body { display: flex; flex-direction: column; }
.tl-stream-row {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  transition: background 0.12s;
}
.tl-stream-row:hover { background: rgba(255,255,255,0.03); }
.tl-stream-row.active { background: rgba(200,255,0,0.05); }
.tl-stream-row.bad.active { background: rgba(255,71,87,0.07); }
.tl-stream-row.picked { box-shadow: inset 2px 0 0 var(--cyan); }
.tl-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(200,255,0,0.5);
}
.tl-status-dot.bad { background: var(--red); box-shadow: 0 0 6px rgba(255,71,87,0.45); }
.tl-col-time { color: var(--muted); font-size: 0.65rem; }
.tl-col-proto { font-weight: 600; font-size: 0.62rem; color: var(--text); }
.tl-col-flow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.65rem; }
.tl-col-len { color: var(--muted); text-align: right; }
.tl-col-tags { display: flex; align-items: center; justify-content: flex-end; gap: 0.35rem; }
.tl-tag-mini { font-style: normal; font-size: 0.58rem; color: #ff8a96; }
.tl-pick-mark { font-size: 0.55rem; color: var(--cyan); text-transform: uppercase; letter-spacing: 0.04em; }
.tl-list-note { font-size: 0.62rem; color: var(--dim); padding: 0.35rem 0.65rem; border-top: 1px solid var(--border); }
.tl-inspector { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem; overflow-y: auto; max-height: 42vh; background: rgba(0,0,0,0.15); }
.tl-empty { color: var(--muted); font-size: 0.78rem; padding: 0.75rem; text-align: center; }
.tl-hint { font-size: 0.65rem; color: var(--dim); text-align: center; padding: 0.45rem 0 0; }
.tl-teaser { display: flex; flex-direction: column; gap: 0.75rem; }
.tl-teaser-bad { color: var(--red); }
.tl-open-btn { align-self: flex-start; }

.tl-packet-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.65rem; margin-bottom: 0.65rem; }
.tl-packet-card.bad { border-color: rgba(255,71,87,0.35); background: rgba(255,71,87,0.04); }
.tl-packet-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.tl-packet-time { margin-left: auto; color: var(--muted); font-size: 0.72rem; }
.tl-inspect-badge { font-size: 0.65rem; font-weight: 700; padding: 0.2rem 0.45rem; border-radius: 999px; text-transform: uppercase; }
.tl-inspect-badge.ok { background: var(--lime-dim); color: var(--lime); border: 1px solid rgba(200,255,0,0.3); }
.tl-inspect-badge.bad { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,71,87,0.35); }
.tl-dl { margin-bottom: 0.55rem; }
.tl-bpf-block { margin-bottom: 0.65rem; padding: 0.55rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(0,0,0,0.25); }
.tl-bpf-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.25rem; }
.tl-bpf-label { font-size: 0.68rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.tl-bpf-code { display: block; font-family: var(--mono); font-size: 0.68rem; color: var(--lime); word-break: break-all; margin-bottom: 0.45rem; }
.tl-bpf-drop { color: #ff8a96; }
.tl-hex-label { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.35rem; }
.tl-hex-panel { max-height: 200px; overflow: auto; }
.tl-hex-wrap { display: flex; flex-direction: column; gap: 0.35rem; }
.tl-hex-hover {
  font-family: var(--mono); font-size: 0.68rem; line-height: 1.45;
  color: var(--lime); background: rgba(200,255,0,0.08);
  border: 1px solid rgba(200,255,0,0.22); border-radius: 6px;
  padding: 0.45rem 0.55rem; min-height: 2.4rem;
}
.tl-hex-dump { font-size: 0.72rem; }

.tl-multi-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.65rem; }
.tl-multi-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 36vh; overflow-y: auto; }
.tl-multi-item {
  display: grid; grid-template-columns: auto auto auto 1fr; gap: 0.45rem; align-items: center;
  text-align: left; border: 1px solid var(--border); border-radius: 6px; padding: 0.4rem 0.5rem;
  background: var(--surface); cursor: pointer; font-size: 0.72rem; color: var(--text2);
}
.tl-multi-item.bad { border-left: 3px solid var(--red); }
.tl-multi-flow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-multi-tags { color: var(--muted); font-size: 0.65rem; grid-column: 1 / -1; }

.tl-ctx-menu {
  position: fixed; z-index: 500;
  min-width: 210px; padding: 0.35rem;
  background: var(--bg3); border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.tl-ctx-menu button {
  display: block; width: 100%; text-align: left;
  border: none; background: none; color: var(--text2);
  font-size: 0.78rem; padding: 0.45rem 0.55rem; border-radius: 6px; cursor: pointer;
}
.tl-ctx-menu button:hover { background: var(--surface2); color: var(--text); }

.tl-popout-body { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.tl-popout-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  background: rgba(7,7,8,0.95); position: sticky; top: 0; z-index: 10;
}
.tl-popout-title { font-size: 1.2rem; }
.tl-popout-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.tl-popout-main { flex: 1; padding: 1rem 1.25rem 2rem; overflow-y: auto; }
.tl-popout-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
