/* ==========================================================================
   TraceLab Showcase — 视觉基线
   纯白纸底、衬线标题、发丝线分隔。结构性强调用中性蓝（--accent），
   暖色（--signal）只留给"命中敏感信号"这一种语义，不做装饰用途。
   ========================================================================== */

:root {
  --paper: #ffffff;
  --paper-deep: #f5f5f4;
  --surface: #ffffff;
  --ink: #17171a;
  --ink-soft: #54545c;
  --ink-faint: #87878f;
  --line: #e5e5e3;
  --line-strong: #cdcdc9;

  /* Structural accent: navigation, IDs, section rules. */
  --accent: #1e4d6b;
  --accent-soft: #ebf1f5;
  --accent-ink: #17415a;

  /* Semantic warm tone, reserved for sensitive-signal hits. */
  --signal: #b0621f;
  --signal-soft: #fbf1e7;
  --signal-ink: #8a4a16;

  --pass-ink: #2f5d46;
  --pass-bg: #e8efe9;
  --fail-ink: #9c3320;
  --fail-bg: #f7e6e0;
  --warn-ink: #7e6015;
  --warn-bg: #f6efdc;
  --idle-ink: #6a6a70;
  --idle-bg: #eeeeed;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC",
    "Source Han Serif SC", "Noto Serif CJK SC", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas,
    "Sarasa Mono SC", "Noto Sans Mono CJK SC", monospace;

  --shell: 1180px;
  --radius: 10px;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.012em;
  margin: 0;
  line-height: 1.22;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 32px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  z-index: 100;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  gap: 28px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.site-nav a {
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ----------------------------------------------------------- typography */

.eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}

.lede {
  font-size: 18px;
  line-height: 1.72;
  color: var(--ink-soft);
  max-width: 62ch;
}

.section-rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ----------------------------------------------------------------- hero */

.hero {
  padding: 96px 0 72px;
}

.hero h1 {
  font-size: clamp(38px, 5.6vw, 64px);
  max-width: 20ch;
  margin: 18px 0 26px;
}

.hero .lede {
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 14.5px;
  transition: opacity 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.button:hover {
  opacity: 0.86;
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button.ghost:hover {
  background: var(--paper-deep);
  opacity: 1;
}

/* ---------------------------------------------------------------- stats */

.stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  padding: 28px 28px 30px;
  border-left: 1px solid var(--line);
}

.stat:first-child {
  border-left: 0;
  padding-left: 0;
}

.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat span {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-faint);
}

/* -------------------------------------------------------------- section */

.section {
  padding: 76px 0;
}

.section-head {
  max-width: 66ch;
  margin-bottom: 40px;
}

.section-head h2 {
  font-size: clamp(26px, 3vw, 34px);
  margin: 12px 0 14px;
}

/* ---------------------------------------------------------- risk cards */

.risk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.risk-card {
  background: var(--surface);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.18s ease;
}

a.risk-card:hover {
  background: var(--paper-deep);
}

.risk-card .tag {
  align-self: flex-start;
}

.risk-card h3 {
  font-size: 21px;
}

.risk-card p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.risk-card .risk-count {
  margin-top: auto;
  padding-top: 12px;
  font-size: 13px;
  color: var(--ink-faint);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: var(--paper);
  white-space: nowrap;
}

.tag.accent {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-ink);
  text-transform: uppercase;
}

/* ------------------------------------------------------------ case list */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.search-field {
  position: relative;
  flex: 1 1 260px;
  max-width: 380px;
}

.search-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
}

.search-field input::placeholder {
  color: var(--ink-faint);
}

.chip {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-size: 13.5px;
  color: var(--ink-soft);
  transition: all 0.16s ease;
}

.chip:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.case-list {
  border-top: 1px solid var(--line);
}

.case-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 24px 8px 24px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.16s ease, padding 0.16s ease;
}

.case-row:hover {
  background: var(--paper-deep);
  padding-left: 10px;
}

.case-row .case-id {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.case-row h3 {
  font-size: 20px;
  margin-bottom: 7px;
}

.case-row p {
  font-size: 14.5px;
  color: var(--ink-soft);
  max-width: 74ch;
}

.case-row .case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.outcome-strip {
  display: flex;
  gap: 4px;
  align-items: center;
}

.outcome-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.outcome-dot.pass {
  background: #7ba58c;
}
.outcome-dot.fail {
  background: #c0563d;
}
.outcome-dot.warning {
  background: #c9a94e;
}
.outcome-dot.not_evaluated,
.outcome-dot.inconclusive {
  background: #cbc9c0;
}

/* ------------------------------------------------------------- outreach */

/* Sits between the stat band and the risk taxonomy. No panel, no tint: the page
   is a white sheet with hairline rules, and a floating tinted box reads as an
   advertisement rather than as part of the argument. It carries the same
   measure as every other section head, so it lines up with them. */

.outreach-section {
  padding: 56px 0 0;
}

.outreach {
  max-width: 66ch;
}

.outreach h2 {
  font-size: clamp(20px, 2.2vw, 25px);
  margin: 10px 0 12px;
}

.outreach p {
  color: var(--ink-soft);
  line-height: 1.75;
}

.outreach-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  margin-top: 20px;
  font-size: 14px;
}

.outreach-contact span {
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}

.outreach-contact a {
  color: var(--accent-ink);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
  transition: border-color 0.16s ease;
}

.outreach-contact a:hover {
  border-bottom-color: var(--accent);
}

/* --------------------------------------------------------- case detail */

.detail-head {
  padding: 60px 0 44px;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 22px;
}

.breadcrumb a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-head h1 {
  font-size: clamp(30px, 4vw, 44px);
  max-width: 24ch;
  margin-bottom: 8px;
}

.detail-head .title-en {
  font-size: 15px;
  color: var(--ink-faint);
  font-style: italic;
  margin-bottom: 20px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 56px;
  align-items: start;
  padding: 52px 0 90px;
}

.side-nav {
  position: sticky;
  top: 92px;
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--line);
}

.side-nav a {
  padding: 6px 0 6px 16px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--ink-faint);
  transition: color 0.16s ease, border-color 0.16s ease;
}

.side-nav a:hover {
  color: var(--ink);
}

.side-nav a.active {
  color: var(--ink);
  border-left-color: var(--accent);
}

.panel {
  scroll-margin-top: 88px;
  padding-bottom: 52px;
  margin-bottom: 52px;
  border-bottom: 1px solid var(--line);
}

.panel:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.panel > h2 {
  font-size: 25px;
  margin: 10px 0 18px;
}

.panel .panel-note {
  font-size: 13.5px;
  color: var(--ink-faint);
  margin-bottom: 20px;
}

.prose {
  font-size: 16px;
  line-height: 1.78;
  color: var(--ink-soft);
  max-width: 76ch;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose p + p {
  margin-top: 14px;
}

.prose ul {
  margin: 12px 0;
  padding-left: 20px;
}

.prose li {
  margin: 5px 0;
}

.prose h3 {
  font-size: 17px;
  color: var(--ink);
  margin: 22px 0 8px;
}

.prose code {
  background: var(--paper-deep);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink);
}

.callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  font-size: 16px;
  line-height: 1.78;
}

.callout.plain {
  border-left-color: var(--line-strong);
}

pre.block {
  margin: 0;
  padding: 22px 24px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.72;
  white-space: pre;
  color: var(--ink);
  tab-size: 2;
}

pre.block.wrap {
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
  font-size: 16.5px;
  line-height: 1.82;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}

.prompt-block::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--accent);
  border-radius: 2px 0 0 2px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* --------------------------------------------------------- content tree */

.tree-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--ink-faint);
}

.tree-legend {
  display: flex;
  gap: 16px;
  align-items: center;
}

.tree-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: 1px;
}

.tree-legend i.inducement {
  background: var(--signal);
}
.tree-legend i.protected {
  background: #9c3320;
}
.tree-legend i.supporting {
  background: var(--line-strong);
}

.tree-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
}

.tree-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  background: var(--paper-deep);
  border-bottom: 1px solid transparent;
}

.tree-group[open] > summary {
  border-bottom-color: var(--line);
}

.tree-group > summary::-webkit-details-marker {
  display: none;
}

.tree-group > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid var(--ink-faint);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.16s ease;
  flex: none;
}

.tree-group[open] > summary::before {
  transform: rotate(90deg);
}

.tree-group > summary strong {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.tree-group > summary .count {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 12.5px;
}

.tree-node {
  border-top: 1px solid var(--line);
  padding: 16px 20px;
}

.tree-node:first-child {
  border-top: 0;
}

.tree-node-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.tree-node-head .node-path {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
}

.tree-node.inducement {
  border-left: 2px solid var(--accent);
}
.tree-node.protected_asset {
  border-left: 2px solid #9c3320;
}

.tree-node .node-summary {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.tree-node .node-risk {
  font-size: 13.5px;
  color: var(--signal-ink);
  background: var(--signal-soft);
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 10px;
  line-height: 1.65;
}

.reveal {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.reveal > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  user-select: none;
}

.reveal > summary::-webkit-details-marker {
  display: none;
}

.reveal[open] > summary {
  border-bottom: 1px solid var(--line);
}

.reveal pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 520px;
  overflow-y: auto;
  background: var(--surface);
}

/* ------------------------------------------------------------ run cards */

.run-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.run-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.run-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.run-card .agent-line {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15.5px;
}

.agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.run-card .run-stats {
  font-size: 12.5px;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.verdict {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.verdict.pass {
  background: var(--pass-bg);
  color: var(--pass-ink);
}
.verdict.fail {
  background: var(--fail-bg);
  color: var(--fail-ink);
}
.verdict.warning {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.verdict.not_evaluated,
.verdict.inconclusive {
  background: var(--idle-bg);
  color: var(--idle-ink);
}

/* ----------------------------------------------------------- run matrix */

.matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table.matrix {
  border-collapse: collapse;
  width: 100%;
  min-width: 780px;
  font-size: 14px;
}

table.matrix th,
table.matrix td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0;
  text-align: center;
}

table.matrix th:last-child,
table.matrix td:last-child {
  border-right: 0;
}

table.matrix thead th {
  position: sticky;
  top: 0;
  background: var(--paper-deep);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 12px 10px;
  z-index: 2;
}

table.matrix tbody th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 400;
  background: var(--surface);
  min-width: 260px;
}

table.matrix tbody th .case-id {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  margin-right: 8px;
}

table.matrix tbody tr:hover th,
table.matrix tbody tr:hover td {
  background: var(--paper-deep);
}

.cell-link {
  display: block;
  padding: 12px 8px;
  font-size: 12px;
  transition: background 0.14s ease;
}

.cell-link:hover {
  background: var(--paper-deep);
}

.cell-link .cell-mark {
  display: inline-block;
  min-width: 46px;
  padding: 2px 8px;
  border-radius: 999px;
}

.cell-empty {
  padding: 12px 8px;
  color: var(--line-strong);
  font-size: 12px;
}

.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------ trace view */

.trace-head {
  padding: 52px 0 36px;
  border-bottom: 1px solid var(--line);
}

.trace-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 28px;
}

.trace-facts div {
  background: var(--surface);
  padding: 16px 20px;
}

.trace-facts dt {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.trace-facts dd {
  margin: 0;
  font-size: 15px;
  word-break: break-word;
}

.message {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px 28px;
  margin-bottom: 16px;
}

.message .message-label {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
}

.message .message-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.8;
}

.message.user {
  background: var(--paper-deep);
}

.message.final {
  border-left: 2px solid var(--accent);
}

/* timeline */

.timeline {
  position: relative;
  margin-top: 8px;
  padding-left: 34px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--line);
}

.step {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 10px;
  overflow: hidden;
}

.step::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 21px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
}

.step.has-signal::before {
  background: var(--signal);
  border-color: var(--signal);
}

.step.has-signal {
  border-color: #e2cbb4;
}

.step > summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 20px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.step > summary::-webkit-details-marker {
  display: none;
}

.step[open] > summary {
  border-bottom: 1px solid var(--line);
}

.step .step-order {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  text-align: right;
}

.step .step-title {
  min-width: 0;
}

.step .step-title strong {
  font-weight: 500;
  font-size: 15px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step .step-title small {
  display: block;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step .step-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.badge {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  white-space: nowrap;
}

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

.badge.failed {
  background: var(--fail-bg);
  color: var(--fail-ink);
}

.badge.success {
  background: var(--pass-bg);
  color: var(--pass-ink);
}

.step-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-label {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 7px;
}

.field-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.field-body.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  max-height: 420px;
  overflow: auto;
  color: var(--ink);
}

.signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.signal-pill {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--signal-soft);
  color: var(--signal-ink);
}

.signal-pill.medium {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.snapshot {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--paper-deep);
  font-size: 13px;
}

.snapshot header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.snapshot header strong {
  font-weight: 500;
}

.snapshot header span {
  color: var(--ink-faint);
  font-size: 12px;
}

.change-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.change-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
}

.change-list em {
  font-style: normal;
  flex: none;
  min-width: 34px;
  text-align: center;
  border-radius: 4px;
  padding: 0 5px;
  font-size: 11px;
}

.change-list li.create em {
  background: var(--pass-bg);
  color: var(--pass-ink);
}
.change-list li.modify em {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.change-list li.delete em {
  background: var(--fail-bg);
  color: var(--fail-ink);
}

/* ------------------------------------------------------------- feedback */

.state {
  padding: 120px 0;
  text-align: center;
  color: var(--ink-faint);
}

.state h2 {
  font-size: 24px;
  color: var(--ink);
  margin-bottom: 10px;
}

.spinner {
  width: 22px;
  height: 22px;
  margin: 0 auto 20px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-note {
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-faint);
  font-size: 14px;
  text-align: center;
}

/* --------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 56px;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-title {
  font-family: var(--font-display);
  font-size: 17px;
  margin-bottom: 8px;
}

.footer-note {
  font-size: 13px;
  color: var(--ink-faint);
  max-width: 56ch;
  line-height: 1.7;
}

.footer-meta {
  font-size: 12px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

.noscript-note {
  padding: 40px 32px;
  color: var(--ink-soft);
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .side-nav {
    display: none;
  }
  .hero {
    padding: 62px 0 48px;
  }
  .section {
    padding: 56px 0;
  }
  .stat {
    padding: 22px 18px;
  }
  .stat:first-child {
    padding-left: 0;
  }
}

@media (max-width: 620px) {
  .shell {
    padding: 0 20px;
  }
  .site-nav {
    gap: 18px;
    font-size: 14px;
  }
  .case-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .timeline {
    padding-left: 0;
  }
  .timeline::before,
  .step::before {
    display: none;
  }
  .step > summary {
    grid-template-columns: 26px minmax(0, 1fr);
    grid-template-areas: "order title" ". badges";
  }
  .step .step-order {
    grid-area: order;
  }
  .step .step-title {
    grid-area: title;
  }
  .step .step-badges {
    grid-area: badges;
    margin-top: 6px;
  }
  .stat-band {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat {
    border-left: 0;
    padding-left: 0;
  }
}

@media print {
  .site-header,
  .site-footer,
  .side-nav,
  .toolbar {
    display: none;
  }
  .step {
    break-inside: avoid;
  }
}
