:root {
  color-scheme: light;
  --canvas: #f4f7fd;
  --panel: #ffffffb8;
  --panel-raised: #f3f5ff;
  --ink: #17233e;
  --muted: #4b5875;
  --line: #5f719c32;
  --accent: #4c60b6;
  --teal: #277068;
  --danger: #a83c61;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  background: var(--canvas);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
body {
  min-width: 280px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 79% 4%, #e9def8 0, transparent 36rem),
    radial-gradient(ellipse at 14% 25%, #dce8ff 0, transparent 46rem),
    radial-gradient(ellipse at 97% 55%, #fae6e9 0, transparent 36rem),
    var(--canvas);
}
button { font: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  z-index: 1;
  left: 1rem;
  top: .65rem;
  padding: .7rem .9rem;
  border-radius: 7px;
  color: var(--canvas);
  background: var(--accent);
  transform: translateY(-150%);
}
.skip:focus { transform: translateY(0); }

.masthead { border-bottom: 1px solid #7b8aaf25; background: #f8faff9c; backdrop-filter: blur(22px); }
.masthead-inner, .shell {
  width: min(100% - clamp(2rem, 10vw, 9rem), 1280px);
  margin-inline: auto;
}
.masthead-inner {
  display: flex;
  min-height: 76px;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .68rem;
  font-size: 1.12rem;
  font-weight: 670;
  text-decoration: none;
  letter-spacing: -.04em;
}
.mark {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  width: 33px;
  height: 33px;
  padding-bottom: 8px;
  border: 1px solid #a3b2df9c;
  border-radius: 11px;
  background: linear-gradient(150deg, #f4edff, #dce8ff);
}
.mark i { width: 4px; height: 8px; background: #40549d; border-radius: 3px; }
.mark i:nth-child(2) { height: 16px; }
.mark i:nth-child(3) { height: 12px; }
.site-nav { display: flex; align-items: center; gap: clamp(.7rem, 4vw, 2.55rem); }
.site-nav a {
  padding-block: .55rem;
  color: var(--muted);
  font-size: .9rem;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover, .site-nav [aria-current="page"] { color: var(--ink); }
.site-nav [aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .44rem; }

.shell { padding: clamp(2rem, 5.5vw, 4.5rem) 0 2rem; }
.muted, .run-footer { color: var(--muted); }
.notice {
  max-width: 43rem;
  padding: clamp(1.5rem, 5vw, 3.4rem);
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--panel);
  box-shadow: 0 22px 55px #54669c13;
}
.notice h1 { font-size: clamp(1.7rem, 5vw, 3rem); letter-spacing: -.06em; line-height: 1.08; }
.notice p { color: var(--muted); margin-top: .8rem; line-height: 1.55; }
.notice-actions { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: .8rem 1.2rem; margin-top: 1.3rem; }
.button {
  padding: .67rem .93rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--canvas);
  font-weight: 650;
  cursor: pointer;
}
.button:hover { background: #3d50a4; }
.text-link { color: var(--teal); text-underline-offset: .22rem; font-size: .86rem; }
.text-link:hover { color: var(--ink); }

.run-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, .48fr);
  gap: clamp(1.25rem, 5vw, 4rem);
  align-items: end;
  padding: clamp(1.3rem, 4.2vw, 3.4rem);
  border: 1px solid var(--line);
  border-radius: clamp(22px, 3.5vw, 34px);
  background:
    radial-gradient(ellipse at 95% 0, #eedff9ae, transparent 64%),
    radial-gradient(ellipse at 0 105%, #dbe7ffcb, transparent 63%),
    var(--panel);
  box-shadow: inset 0 1px 0 white, 0 16px 42px #54669c14;
}
.kicker {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .72rem;
  color: var(--muted);
  font: .76rem / 1.4 var(--mono);
  letter-spacing: .055em;
}
.kicker span { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.run-header h1 {
  font-size: clamp(2.9rem, 7.5vw, 6.8rem);
  font-weight: 690;
  line-height: .96;
  letter-spacing: -.064em;
  word-spacing: .04em;
}
.goal-panel { margin-top: clamp(1rem, 3vw, 1.6rem); max-width: 64ch; }
.goal-panel summary { color: var(--accent); cursor: pointer; width: fit-content; font-weight: 650; font-size: .86rem; }
.goal-panel p {
  margin-top: .6rem;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.run-meta {
  min-width: 0;
  display: grid;
  gap: .55rem;
  border-left: 1px solid var(--line);
  padding: .3rem 0 .3rem 1.15rem;
  font-size: .84rem;
}
.run-meta > div { display: grid; grid-template-columns: 4.15rem minmax(0, 1fr); gap: .65rem; align-items: baseline; }
.run-meta dt { color: var(--muted); }
.run-meta dd { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem clamp(.85rem, 3vw, 1.8rem);
  margin: .6rem 0 1rem;
  padding: .55rem .1rem .63rem;
  border-bottom: 1px solid var(--line);
}
.section-nav a {
  padding: .28rem .1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .87rem;
  font-weight: 600;
}
.section-nav a:hover, .section-nav a:focus-visible { color: var(--accent); }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}
.records { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.records:has(.artifact-panel[hidden]) { grid-template-columns: minmax(0, 1fr); }
.panel {
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 white, 0 12px 30px #54669c0e;
}
#result-panel, #agents, #evidence-panel, #artifact-panel { scroll-margin-top: 1rem; }
.result-panel { border-left: 2px solid var(--teal); }
.panel-header {
  min-height: 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .78rem clamp(.9rem, 2.4vw, 1.45rem);
  border-bottom: 1px solid var(--line);
}
.panel-header h2 { font-size: 1rem; letter-spacing: -.02em; font-weight: 650; }
.count { color: var(--muted); font: .75rem / 1.4 var(--mono); white-space: nowrap; }
.panel-content { min-width: 0; padding: 1.15rem clamp(.9rem, 2.4vw, 1.45rem); overflow-wrap: anywhere; }
.panel-content > * + * { margin-top: .8rem; }
.panel-content h3 { font-size: 1.45rem; letter-spacing: -.04em; }
.panel-content p { white-space: pre-wrap; line-height: 1.64; font-size: .91rem; }
.panel-content h4 { margin: 1rem 0 .35rem; font-size: .77rem; color: var(--muted); }
.result-panel p { max-width: 82ch; font-size: 1rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: .36rem;
  padding: .26rem .48rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--accent);
  background: #e6ecfe;
  font-size: .7rem;
  line-height: 1.23;
  font-weight: 650;
  white-space: nowrap;
}
.status::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; flex: none; }
.status.success { color: var(--teal); background: #e5f6f0; }
.status.danger { color: var(--danger); background: #fbe8f1; }
.status.quiet { color: var(--muted); background: #eef2fb; }

#tree { padding: .65rem .7rem; overflow-x: auto; }
#tree > p { padding: .4rem .5rem; }
.tree-list { list-style: none; padding: 0; margin: 0; }
.tree-list .tree-list { border-left: 1px solid #a8b9e9; margin-left: .79rem; padding-left: .4rem; }
.node-row { min-height: 44px; display: flex; align-items: center; gap: .1rem; }
.tree-toggle, .tree-indent { width: 27px; height: 34px; flex: none; }
.tree-toggle {
  padding: 0;
  line-height: 1;
  background: transparent;
  color: var(--muted);
  border: 0;
  cursor: pointer;
  border-radius: 5px;
}
.tree-toggle::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translate(0, -2px) rotate(45deg);
}
.tree-toggle[aria-expanded="false"]::before { transform: translate(-2px, 0) rotate(-45deg); }
.tree-toggle:hover { background: var(--panel-raised); }
.node-button {
  width: 100%;
  min-width: 0;
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .46rem;
  text-align: left;
  padding: .53rem .58rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 610;
  cursor: pointer;
}
.node-button:hover { background: var(--panel-raised); }
.node-button[aria-pressed="true"] { background: #e7edfe; border-color: #a9b6e9; color: var(--accent); }
.node-button span:first-child { overflow-wrap: anywhere; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .86rem clamp(.9rem, 2.4vw, 1.45rem) 0;
}
.filters button, .download {
  padding: .43rem .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .76rem;
  font-weight: 650;
}
.filters button:hover, .download:hover { color: var(--ink); border-color: var(--muted); }
.filters [aria-pressed="true"] { border-color: #a4b5e0; color: var(--accent); background: #edf1ff; }
.download { color: var(--teal); }

.payload {
  margin: .7rem 0 0;
  padding: .82rem .84rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 25rem;
  overflow: auto;
  color: #2d3959;
  background: #f1f5ff;
  border: 1px solid var(--line);
  border-radius: 14px;
  font: .8rem / 1.62 var(--mono);
  scrollbar-color: #afbcdc #f1f5ff;
}
.record-list { list-style: none; margin: 0; padding: 0; }
.record-list > li + li { border-top: 1px solid var(--line); }
.record-list details { padding: .78rem 0; }
.record-list > li:first-child details { padding-top: 0; }
.record-list > li:last-child details { padding-bottom: 0; }
.record-list summary { cursor: pointer; font-size: .86rem; color: var(--ink); font-weight: 610; line-height: 1.6; }
.record-list summary:hover, .record-list details[open] summary { color: var(--teal); }
.filename { font-family: var(--mono); }
.record-size, .event-meta { color: var(--muted); font-size: .74rem; font-weight: 460; }
.record-size { display: inline-block; margin-inline-start: .55rem; }
.event-meta { display: block; margin: .2rem 0 0 .85rem; }
.record-list details p { margin-top: .58rem; }
.record-list .text-link { display: inline-block; margin-top: .7rem; }
.record-list .download { display: inline-block; margin-top: .7rem; }
.run-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 1rem .1rem;
  gap: .5rem 1rem;
  font-size: .75rem;
}
.run-footer code { overflow-wrap: anywhere; font-family: var(--mono); }

.site-nav a, .text-link, .section-nav a, .node-button, .filters button, .download {
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

@media (max-width: 680px) {
  .masthead-inner { min-height: 65px; }
  .site-nav a { font-size: .79rem; }
  .wordmark { font-size: 1rem; gap: .5rem; }
  .run-header, .workspace, .records { grid-template-columns: minmax(0, 1fr); }
  .run-meta { border-left: 0; border-top: 1px solid var(--line); padding: .85rem 0 0; }
  .run-header h1 { font-size: clamp(2.8rem, 11vw, 5rem); }
}
@media (max-width: 350px) {
  .mark { width: 28px; height: 28px; padding-bottom: 6px; }
  .node-button .status { font-size: .62rem; padding: .17rem .29rem; }
  .tree-list .tree-list { margin-left: .5rem; padding-left: .2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
