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

:root {
  --bg: #f4f9ff;
  --surface: #ffffff;
  --surface2: #e8f1ff;
  --border: #bfd4f2;
  --text: #0f2a52;
  --muted: #4f6f9a;
  --accent: #2f6fda;
  --accent2: #1b4fa8;
  --warn: #3a5f9b;
  --mono: 'JetBrains Mono', monospace;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

/* Layout */
.container { max-width: 860px; margin: 0 auto; padding: 0 24px; }

section { padding: 72px 0; }
section + section { border-top: 1px solid var(--border); }

h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 24px; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; }
p { color: #355a8f; margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* Nav */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244,249,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
nav .inner { max-width: 860px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
nav .logo { font-size: 0.85rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
nav .links { display: flex; gap: 8px; flex-wrap: wrap; }
nav a {
  font-size: 0.8rem; font-weight: 500; padding: 5px 12px;
  border-radius: 6px; border: 1px solid var(--border);
  color: var(--text); text-decoration: none; transition: all 0.15s;
}
nav a:hover { background: var(--surface2); border-color: var(--accent); }

/* Hero */
#hero { padding: 80px 0 64px; }
.venue-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(47,111,218,0.12); border: 1px solid rgba(47,111,218,0.28);
  color: #2f6fda; font-size: 0.8rem; font-weight: 500;
  padding: 4px 10px; border-radius: 20px; margin-bottom: 20px;
}
.venue-tag::before { content: "★"; font-size: 0.65rem; }

.author-affiliations { margin: 20px 0 8px; }
.author-affiliations .row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 6px;
  font-size: 0.88rem;
}
.author-affiliations .name { font-weight: 600; color: var(--text); }
.author-affiliations .affil { color: var(--muted); font-size: 0.82rem; }
.with-apart { margin-top: 14px; font-size: 0.88rem; color: var(--muted); }

.llm-statement { font-size: 0.82rem; color: var(--muted); margin-top: 8px; line-height: 1.55; }

.paper-footnote { font-size: 0.82rem; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.paper-footnote sup { font-size: 0.75em; }

.abstract {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  margin-top: 32px;
}
.abstract h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 12px; }
.abstract p:not(.paper-footnote) { margin: 0; text-align: justify; text-wrap: pretty; hyphens: auto; -webkit-hyphens: auto; }
.abstract .paper-footnote { text-align: left; hyphens: manual; }

/* TL;DR */
.tldr {
  background: linear-gradient(135deg, rgba(47,111,218,0.14), rgba(27,79,168,0.1));
  border: 1px solid rgba(47,111,218,0.25);
  border-radius: 12px;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
}
.tldr-icon { font-size: 2.2rem; line-height: 1; }
.tldr-text { font-size: 1.05rem; color: var(--text); line-height: 1.65; }
.tldr-text strong { color: #0f2a52; }

/* Setting diagram */
.pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 0;
  margin: 32px 0;
}
.pipeline-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 14px;
  text-align: center;
}
.pipeline-step .icon { font-size: 1.5rem; margin-bottom: 6px; }
.pipeline-step .label { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.pipeline-step .sub { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }
.arrow { font-size: 1.2rem; color: var(--muted); text-align: center; padding: 0 4px; }

/* Home overview pipeline (attacker → monitor → system) */
.pipeline-home {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 4px 0;
  align-items: stretch;
}
.pipeline-callout {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.45;
  text-align: center;
  max-width: 14rem;
  margin-left: auto;
  margin-right: auto;
}
.pipeline-callout strong { color: var(--text); }
.pipeline-step-highlight {
  border-color: rgba(47, 111, 218, 0.45);
  background: linear-gradient(180deg, #fff 0%, var(--surface2) 100%);
}
.arrow-with-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
  min-width: 76px;
}
.arrow-with-score .arrow { padding: 0; }
.score-pill {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent2);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  white-space: nowrap;
}
.score-note {
  font-size: 0.62rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
  max-width: 5.5rem;
}
.pipeline-intro {
  font-size: 0.92rem;
  color: #355a8f;
  margin-bottom: 20px;
}
@media (max-width: 760px) {
  .pipeline-panel-inner {
    grid-template-columns: 1fr;
  }
  .pipeline-panel-inner .pipeline-mascot {
    order: -1;
    max-width: 180px;
    margin: 0 auto 8px;
  }
  .pipeline-home {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
  }
  .pipeline-home > .arrow:first-of-type {
    align-self: center;
    transform: rotate(90deg);
    padding: 4px 0;
  }
  .pipeline-home .arrow-with-score {
    flex-direction: row;
    gap: 12px;
    min-width: unset;
  }
  .pipeline-home .arrow-with-score .arrow { transform: none; }
}

.pipeline-section-title { font-size: 1.15rem; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.pipeline-panel { margin-bottom: 48px; }
.pipeline-panel:last-of-type { margin-bottom: 8px; }
.pipeline-panel-inner {
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
  gap: 20px 24px;
  align-items: center;
  margin-top: 16px;
}
.pipeline-mascot {
  margin: 0;
  text-align: center;
}
.pipeline-mascot img {
  width: 100%;
  max-width: 140px;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: block;
  margin: 0 auto;
}
.pipeline-mascot figcaption {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.35;
}
.pipeline-panel-inner .pipeline-home { margin: 0; }
.pipeline-foot {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 16px;
  line-height: 1.55;
}
.pipeline-foot strong { color: var(--text); }

/* Charts */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}
@media (max-width: 700px) { .chart-grid { grid-template-columns: 1fr; } }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.chart-card h3 { font-size: 0.9rem; color: var(--text); margin-bottom: 4px; }
.chart-card h4 { font-size: 0.85rem; color: var(--text); margin-bottom: 4px; }
.chart-card .caption { font-size: 0.78rem; color: var(--muted); margin-bottom: 16px; }

/* Citation */
.citation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: pre;
  overflow-x: auto;
}

/* Footer */
footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Misc */
.section-tag {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 8px;
}

.doc-prose p { margin-bottom: 1em; color: #355a8f; }
.doc-prose p:last-child { margin-bottom: 0; }
.doc-prose ol, .doc-prose ul { margin: 0.75em 0 1em 1.25rem; color: #355a8f; }
.doc-prose li { margin-bottom: 0.4em; }
.doc-prose ol.contributions { margin: 0.75em 0 1em 1.5rem; padding-left: 0.25rem; list-style: decimal; }
.doc-prose strong { color: var(--text); }
.figure-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 16px;
  padding: 14px 18px;
  background: rgba(232, 241, 255, 0.65);
  border: 1px solid var(--border);
  border-radius: 10px;
  line-height: 1.5;
}
.figure-note em { font-style: italic; color: #4f6f9a; }

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