:root {
  color-scheme: light;
  --bg: #f6f8f3;
  --surface: #ffffff;
  --surface-soft: #eef3ec;
  --ink: #18211b;
  --muted: #5d6b61;
  --line: #dce4dd;
  --line-strong: #c6d2c9;
  --green: #138a4d;
  --green-soft: #dff3e7;
  --blue: #2257a5;
  --blue-soft: #e2ebfa;
  --amber: #a05e00;
  --amber-soft: #fff1d2;
  --red: #b3261e;
  --red-soft: #fde7e4;
  --violet: #6b4bb8;
  --violet-soft: #ece6fb;
  --shadow: 0 18px 50px rgba(24, 33, 27, 0.08);
  --shadow-sm: 0 8px 24px rgba(24, 33, 27, 0.07);
  --radius: 8px;
  --max: 1480px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, #f7faf5 0, var(--bg) 32rem),
    var(--bg);
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 1rem;
}

.topbar {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  min-height: 4.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(220, 228, 221, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  color: #fff;
  font-weight: 900;
  background: var(--ink);
  border-radius: 7px;
}

.brand__mark--image {
  overflow: hidden;
  background: transparent;
}

.brand__mark--image img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  justify-content: center;
}

.topnav a,
.topbar__cta,
.button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0 0.9rem;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: var(--radius);
}

.topnav a {
  color: var(--muted);
}

.topnav a:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.topbar__cta,
.button--primary {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 10px 24px rgba(24, 33, 27, 0.16);
}

.button--quiet,
.ghost-button {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.ghost-button {
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.65fr);
  gap: 1rem;
  align-items: stretch;
  padding: 1rem 0;
}

.hero__copy,
.hero-panel,
.module,
.slice-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.hero__copy {
  min-height: 30rem;
  padding: 2rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 241, 0.9)),
    var(--surface);
}

.eyebrow,
.module__head span,
.section-title span,
.panel-head span,
.hero-panel__signal span,
.mail-meta,
.micro-label {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 12ch;
  margin: 1rem 0;
  font-size: 4.1rem;
  line-height: 0.98;
}

.origin-chip {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.75rem;
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 850;
  text-decoration: none;
}

.origin-chip:hover {
  text-decoration: underline;
}

.hero p {
  max-width: 46rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 1.5rem 0 0;
  padding: 0;
  color: var(--muted);
  font-weight: 800;
  list-style: none;
}

.trust-strip li::before {
  color: var(--green);
  content: "• ";
}

.hero-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: 1rem;
}

.panel-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel-head strong {
  font-size: 0.92rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.kpi {
  min-height: 8rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.kpi strong {
  display: block;
  font-size: 2.1rem;
  line-height: 1;
}

.kpi span {
  display: block;
  margin-top: 0.65rem;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.35;
}

.hero-panel__signal {
  padding: 1rem;
  color: #fff;
  background: #1d271f;
  border-radius: var(--radius);
}

.hero-panel__signal span {
  color: #b9e7c8;
}

.hero-panel__signal strong {
  display: block;
  margin: 0.45rem 0 0.9rem;
  font-size: 2.6rem;
  line-height: 1;
}

.meter {
  overflow: hidden;
  height: 0.55rem;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #5fc985, #ffd166, #ef6351);
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding-bottom: 3rem;
}

.slice-panel {
  position: sticky;
  top: 6.2rem;
  padding: 1rem;
}

.section-title h2,
.module__head h2 {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.slice-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.slice-button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: start;
  width: 100%;
  min-height: 5.2rem;
  padding: 0.8rem;
  text-align: left;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.slice-button:hover,
.slice-button.is-active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.slice-button strong {
  display: block;
  margin-bottom: 0.2rem;
}

.slice-button small {
  color: var(--muted);
  line-height: 1.35;
}

.slice-button b {
  display: inline-grid;
  place-items: center;
  min-width: 2.2rem;
  height: 2.2rem;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
}

.board {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 1rem;
}

.module {
  min-width: 0;
  padding: 1rem;
}

.module--wide {
  grid-column: 1 / -1;
}

.module--graph {
  padding: 1rem;
}

.module__head {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0 0.65rem;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  background: var(--green-soft);
  border-radius: 999px;
}

.status-pill--warm,
.badge--amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.badge--red {
  color: var(--red);
  background: var(--red-soft);
}

.badge--blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge--violet {
  color: var(--violet);
  background: var(--violet-soft);
}

.campaign-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.campaign-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.campaign-card.is-active,
.campaign-card:hover {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.campaign-card__top,
.campaign-card__stats,
.mail-row__top,
.detail-pair {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.campaign-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.campaign-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.campaign-card__stats {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.stat {
  display: grid;
  gap: 0.15rem;
  min-width: 6.6rem;
  padding: 0.7rem;
  background: var(--surface-soft);
  border-radius: var(--radius);
}

.stat span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.stat strong {
  font-size: 1.15rem;
}

.mail-list {
  display: grid;
  gap: 0.55rem;
}

.mail-row {
  width: 100%;
  padding: 0.82rem;
  text-align: left;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mail-row.is-active,
.mail-row:hover {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.mail-row h3 {
  overflow-wrap: anywhere;
  margin: 0.45rem 0 0.35rem;
  font-size: 1rem;
  line-height: 1.25;
}

.mail-row p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.9rem;
}

.risk-dot {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  background: var(--green);
  border-radius: 999px;
}

.risk-dot--critical {
  background: var(--red);
}

.risk-dot--high {
  background: var(--amber);
}

.risk-dot--review {
  color: var(--ink);
  background: #ffd166;
}

.graph {
  min-height: 35rem;
  overflow: hidden;
  background:
    linear-gradient(rgba(24, 33, 27, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 27, 0.04) 1px, transparent 1px),
    var(--surface-soft);
  background-size: 28px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: -0.3rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.graph-legend span {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  min-height: 1.7rem;
  padding: 0 0.55rem;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.legend-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
}

.legend-dot--mail {
  background: #d45d2f;
}

.legend-dot--domain {
  background: var(--blue);
}

.legend-dot--ip {
  background: var(--violet);
}

.legend-line {
  display: inline-block;
  width: 1.25rem;
  border-top: 2px solid rgba(24, 33, 27, 0.54);
}

.legend-line--dashed {
  border-top-style: dashed;
}

.graph svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 35rem;
}

.graph text {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.graph .node-type {
  fill: #fff;
  font-size: 11px;
  font-weight: 950;
}

.graph .edge {
  fill: none;
  stroke: rgba(24, 33, 27, 0.52);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.graph .edge--observed_link,
.graph .edge--entry_domain,
.graph .edge--landing_domain {
  stroke: rgba(160, 94, 0, 0.72);
  stroke-dasharray: 9 7;
}

.graph .edge--redirect_domain {
  stroke: rgba(179, 38, 30, 0.72);
  stroke-dasharray: 5 8;
}

.graph .edge--resolved_on {
  stroke: rgba(107, 75, 184, 0.7);
  stroke-dasharray: 2 7;
}

.graph .edge--mail_attachment {
  stroke: rgba(179, 38, 30, 0.78);
}

.graph .node {
  stroke: #fff;
  stroke-width: 4;
  filter: drop-shadow(0 8px 14px rgba(24, 33, 27, 0.18));
}

.graph .node-label-bg {
  fill: rgba(255, 255, 255, 0.92);
  stroke: rgba(198, 210, 201, 0.88);
  stroke-width: 1.2;
}

.graph .lane-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.evidence-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.65fr);
  gap: 1rem;
}

.mail-detail,
.preview-card {
  min-width: 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mail-detail h3,
.preview-card h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.detail-pair {
  align-items: flex-start;
  padding: 0.75rem;
  background: var(--surface-soft);
  border-radius: var(--radius);
}

.detail-pair span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.detail-pair strong {
  overflow-wrap: anywhere;
  text-align: right;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.reason-list,
.redirect-list,
.infra-grid,
.timeline {
  display: grid;
  gap: 0.65rem;
}

.reason-list {
  margin-top: 1rem;
}

.reason {
  padding: 0.8rem;
  background: var(--surface-soft);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
}

.reason strong,
.reason span {
  display: block;
}

.reason span {
  margin-top: 0.25rem;
  color: var(--muted);
  line-height: 1.45;
}

.preview-window {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  color: #dce7d8;
  background: #1d271f;
  border-radius: var(--radius);
}

.preview-window__bar {
  display: flex;
  gap: 0.35rem;
}

.preview-window__bar span {
  width: 0.7rem;
  height: 0.7rem;
  background: #dce7d8;
  border-radius: 999px;
  opacity: 0.58;
}

.preview-window__screen {
  min-height: 10rem;
  padding: 1rem;
  background: #26352a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.preview-window__screen strong {
  display: block;
  color: #fff;
  font-size: 1.05rem;
}

.preview-window__screen p {
  margin: 0.6rem 0 0;
  color: #c6d5c8;
  line-height: 1.5;
}

.redirect-list {
  margin-top: 1rem;
}

.redirect-hop {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.7rem;
  background: var(--surface-soft);
  border-radius: var(--radius);
}

.redirect-hop b {
  color: var(--blue);
}

.redirect-hop span {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.infra-card,
.time-item {
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.infra-card h3,
.time-item h3 {
  margin: 0;
  font-size: 1rem;
}

.infra-card p,
.time-item p {
  margin: 0.4rem 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  line-height: 1.45;
}

.time-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
}

.time-item time {
  display: inline-flex;
  min-width: 5.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.empty-state {
  padding: 1rem;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: var(--radius);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1rem;
  padding: 1rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer strong {
  color: var(--ink);
}

.site-footer span {
  margin-top: 0.18rem;
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: 0 0.65rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.site-footer a:hover {
  border-color: var(--green);
}

@media (max-width: 1120px) {
  .topbar,
  .hero,
  .workspace,
  .board,
  .evidence-layout {
    grid-template-columns: 1fr;
  }

  .topnav {
    justify-content: flex-start;
    order: 3;
    grid-column: 1 / -1;
  }

  .slice-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0.5rem;
  }

  .topbar {
    top: 0.5rem;
  }

  .brand small {
    display: none;
  }

  .topbar__cta {
    padding-inline: 0.7rem;
  }

  .hero__copy {
    min-height: auto;
    padding: 1.25rem;
  }

  .hero h1 {
    max-width: 100%;
    font-size: 2.55rem;
    line-height: 1.02;
  }

  .hero p {
    font-size: 1rem;
  }

  .kpi-grid,
  .campaign-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .module__head,
  .campaign-card__top,
  .mail-row__top {
    align-items: flex-start;
    flex-direction: column;
  }

  .button,
  .topbar__cta,
  .ghost-button {
    width: 100%;
  }

  .hero__actions {
    align-items: stretch;
    flex-direction: column;
  }
}
