:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #607069;
  --line: #d8dfda;
  --paper: #fbfbf8;
  --band: #eef4f1;
  --accent: #1b6b5a;
  --accent-2: #9b4b32;
  --gold: #b5892f;
  --good: #2f7357;
  --warn: #a15f27;
  --bad: #8b3535;
  --shadow: 0 24px 70px rgba(23, 33, 29, 0.12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 88% 10%, rgba(181, 137, 47, 0.12), transparent 26rem),
    linear-gradient(180deg, #fbfbf8 0%, #f4f7f2 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 251, 248, 0.9);
  backdrop-filter: blur(16px);
}
.brand {
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
}
.subbrand, .eyebrow, .section-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
nav { display: flex; flex-wrap: wrap; gap: 8px; }
nav a, button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 9px 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
nav a.active, button {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.secondary { background: var(--accent-2); border-color: var(--accent-2); }
button.ghost { background: white; color: var(--ink); }
button:hover, nav a:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(23, 33, 29, 0.1); }
.masthead {
  min-height: 590px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: end;
  gap: 50px;
  padding: 78px 36px 42px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(238, 244, 241, 0.88), rgba(251, 251, 248, 0.96)),
    repeating-linear-gradient(90deg, rgba(27, 107, 90, 0.1) 0, rgba(27, 107, 90, 0.1) 1px, transparent 1px, transparent 38px);
  overflow: hidden;
}
.masthead::after {
  content: "";
  position: absolute;
  inset: 70px 28px auto auto;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(27, 107, 90, 0.18);
  transform: rotate(12deg);
  animation: drift 12s ease-in-out infinite alternate;
}
.hero-copy { position: relative; z-index: 1; }
.masthead h1 {
  max-width: 980px;
  margin: 8px 0 12px;
  font-family: Georgia, serif;
  font-size: clamp(44px, 7vw, 90px);
  line-height: 0.96;
  letter-spacing: 0;
}
.dek { max-width: 780px; color: var(--muted); font-size: 20px; }
.hero-actions, .chips, .citation-row { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-actions { margin: 24px 0 8px; }
.chips { margin-top: 14px; }
.chips span, .citation {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9faf7;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.citation { color: var(--accent); }
.chip-accent { color: var(--accent-2) !important; border-color: rgba(155, 75, 50, 0.32) !important; background: #fff7f2 !important; }
.status-panel, .panel, .section-card, .progress-card, .note-form, .admin-form, .evidence-note, .tool-log {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 45px rgba(23, 33, 29, 0.07);
}
.status-panel { display: grid; gap: 14px; padding: 18px; position: relative; z-index: 1; }
.metric-grid, .obs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric, .obs-grid .panel {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9faf7;
}
.metric strong, .obs-grid strong { display: block; font-family: Georgia, serif; font-size: 30px; line-height: 1; }
.metric span, .obs-grid span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.band, .run-desk, .evidence-hunt, .retry-lab, .memory-section, .trace-history, .evidence-section, .notes-section, .observability, .admin-section, .about-section {
  padding: 36px;
  border-bottom: 1px solid var(--line);
}
.two-col, .notes-section, .admin-section {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
}
.top-three { margin: 0; padding-left: 22px; font-size: 18px; }
.top-three li { margin-bottom: 12px; padding-left: 6px; }
.panel { padding: 20px; }
.panel h2, .section-card h2, .run-desk h2, .section-heading h2, .notes-section h2, .admin-section h2, .about-section h2 {
  margin: 6px 0 12px;
  font-family: Georgia, serif;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}
.compact p { margin-bottom: 0; }
.briefing-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  padding: 24px 36px 40px;
}
.section-card {
  grid-column: span 6;
  padding: 20px;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.section-card:first-child { grid-column: span 12; }
.section-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.section-card p { color: #2b3833; }
.confidence-low { border-top: 4px solid var(--warn); }
.confidence-medium { border-top: 4px solid var(--gold); }
.confidence-high { border-top: 4px solid var(--good); }
.run-header, .section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.run-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px; width: min(620px, 100%); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: white;
  color: var(--ink);
}
.progress-card { padding: 16px; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; font-weight: 800; }
.progress-track { height: 10px; margin: 10px 0 14px; border-radius: 999px; background: #e4ebe6; overflow: hidden; }
.progress-track div { width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width 450ms ease; }
.live-events { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.live-events li {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  animation: slideIn 280ms ease both;
}
.live-events time, .live-events span { color: var(--muted); font-size: 12px; }
.agent-loop {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.agent-loop article {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  transition: transform 250ms ease, border-color 250ms ease;
}
.agent-loop article.active { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--shadow); }
.agent-loop span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--band); color: var(--accent); font-weight: 900; }
.agent-loop strong, .agent-loop em { display: block; margin-top: 10px; }
.agent-loop em { color: var(--muted); font-size: 13px; font-style: normal; }
.hunt-grid, .retry-grid, .memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.hunt-board, .retry-card, .memory-card {
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 45px rgba(23, 33, 29, 0.07);
}
.hunt-board h3, .retry-card h3, .memory-card h3, .tool-log h3 {
  margin: 0 0 12px;
  font-family: Georgia, serif;
  font-size: 24px;
  line-height: 1.1;
}
.hunt-board ol, .memory-card ul, .retry-card ul {
  margin: 0;
  padding-left: 20px;
}
.hunt-board li, .memory-card li, .retry-card li {
  margin-bottom: 10px;
}
.ledger-item, .hypothesis-item, .gate-item {
  position: relative;
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9faf7;
  animation: slideIn 260ms ease both;
}
.ledger-item::before, .hypothesis-item::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: var(--accent);
}
.ledger-item strong, .hypothesis-item strong, .gate-item strong {
  font-size: 14px;
}
.ledger-item span, .hypothesis-item span, .gate-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.hypothesis-item.rejected::before, .retry-card.failed { border-color: rgba(139, 53, 53, 0.42); }
.hypothesis-item.held::before, .retry-card.review { border-color: rgba(181, 137, 47, 0.5); }
.hypothesis-item.promoted::before, .retry-card.passed { border-color: rgba(47, 115, 87, 0.45); }
.hypothesis-item.rejected::before { background: var(--bad); }
.hypothesis-item.held::before { background: var(--gold); }
.hypothesis-item.promoted::before { background: var(--good); }
.retry-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.retry-card pre {
  white-space: pre-wrap;
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #17211d;
  color: #eef4f1;
  font-size: 12px;
}
.gate-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.gate-item {
  min-height: 112px;
  background: white;
}
.gate-item.passed { border-top: 4px solid var(--good); }
.gate-item.retry { border-top: 4px solid var(--gold); }
.score-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.score-row strong {
  font-family: Georgia, serif;
  color: var(--accent);
}
.trace-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}
.trace-index {
  display: grid;
  align-content: start;
  gap: 8px;
}
.trace-index button {
  width: 100%;
  text-align: left;
  background: white;
  color: var(--ink);
}
.trace-index button.active {
  background: var(--accent);
  color: white;
}
.trace-panels {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 45px rgba(23, 33, 29, 0.07);
}
.trace-panel {
  display: none;
  padding: 18px;
}
.trace-panel.active { display: block; }
.trace-panel h3 {
  margin: 0 0 14px;
  font-family: Georgia, serif;
  font-size: 26px;
}
.trace-panel details {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9faf7;
}
.trace-panel summary {
  cursor: pointer;
  font-weight: 900;
}
.trace-panel pre {
  white-space: pre-wrap;
  padding: 12px;
  border-radius: 8px;
  background: #17211d;
  color: #eef4f1;
}
.trace-stream {
  display: grid;
  gap: 10px;
}
.trace-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9faf7;
  animation: slideIn 260ms ease both;
}
.trace-item strong { color: var(--accent); }
.trace-item code {
  margin-top: 4px;
  background: #f4f0e7;
}
.evidence-stack { display: grid; gap: 12px; }
.evidence-note { padding: 0; overflow: hidden; }
.evidence-note summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 900;
}
.evidence-note summary em { color: var(--muted); font-size: 12px; font-style: normal; text-transform: uppercase; }
.evidence-body {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  gap: 22px;
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
}
code {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border-radius: 6px;
  background: #f4f0e7;
  color: #5b4122;
  white-space: normal;
}
.support-figure { margin: 14px 0 0; }
.support-figure figcaption { font-weight: 900; margin-bottom: 6px; }
.d3-chart { min-height: 230px; }
.d3-chart svg { width: 100%; height: auto; overflow: visible; }
.axis path, .axis line, .grid line { stroke: #cbd5ce; }
.chart-line { fill: none; stroke-width: 3; stroke-linecap: round; }
.chart-area { opacity: 0.13; }
.dot { stroke: white; stroke-width: 2; }
.annotation { fill: var(--accent-2); font-size: 12px; font-weight: 800; }
.note-form, .admin-form { display: grid; gap: 10px; padding: 18px; align-content: start; }
.note-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.note-card { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f9faf7; animation: slideIn 260ms ease both; }
.note-card strong, .note-card span { display: block; }
.note-card span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.observability .obs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.timeline {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.timeline-row {
  display: grid;
  grid-template-columns: 170px 1fr 80px;
  gap: 12px;
  align-items: center;
}
.timeline-bar { height: 12px; border-radius: 999px; background: #e4ebe6; overflow: hidden; }
.timeline-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold)); transform-origin: left; animation: grow 900ms ease both; }
.tool-log { margin-top: 16px; padding: 18px; }
.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle-row input { width: auto; }
.about-section { max-width: none; }
.about-section p { max-width: 860px; font-size: 18px; }
.selection-ask {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: min(440px, calc(100vw - 36px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}
.selection-ask[hidden] { display: none; }
.ask-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.selection-ask blockquote { margin: 0; padding: 10px; border-left: 4px solid var(--accent); background: var(--band); color: var(--muted); font-size: 13px; }
.selection-ask form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ask-answer { margin: 0; color: #2b3833; font-size: 13px; }
.reveal { opacity: 0; transform: translateY(18px); animation: reveal 650ms ease forwards; }
.reveal:nth-of-type(2) { animation-delay: 100ms; }
.reveal:nth-of-type(3) { animation-delay: 170ms; }
@keyframes reveal { to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes drift { from { transform: rotate(12deg) translateY(0); } to { transform: rotate(18deg) translateY(20px); } }
@media (max-width: 1050px) {
  .agent-loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .observability .obs-grid, .note-list, .hunt-grid, .retry-grid, .memory-grid, .gate-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trace-layout { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 14px 18px; }
  .masthead, .two-col, .notes-section, .admin-section, .evidence-body { grid-template-columns: 1fr; }
  .masthead { min-height: auto; padding: 46px 20px 28px; }
  .masthead h1 { font-size: clamp(40px, 14vw, 64px); }
  .band, .run-desk, .evidence-hunt, .retry-lab, .memory-section, .trace-history, .evidence-section, .notes-section, .observability, .admin-section, .about-section, .briefing-grid { padding-left: 20px; padding-right: 20px; }
  .section-card, .section-card:first-child { grid-column: span 12; }
  .run-header { align-items: stretch; flex-direction: column; }
  .run-form, .live-events li, .timeline-row { grid-template-columns: 1fr; }
  .observability .obs-grid, .note-list, .metric-grid, .hunt-grid, .retry-grid, .memory-grid, .gate-list { grid-template-columns: 1fr; }
  .trace-item { grid-template-columns: 1fr; }
}

/* Edition redesign layer */
:root {
  --ink: #111111;
  --muted: #6b7280;
  --line: rgba(17, 17, 17, 0.12);
  --paper: #fffdfb;
  --band: #f8f4f2;
  --accent: #c62828;
  --accent-2: #8e1b1b;
  --gold: #a16207;
  --good: #0f766e;
  --warn: #a16207;
  --bad: #8e1b1b;
  --shadow: 0 22px 48px rgba(17, 17, 17, 0.08);
  --edition-gutter: clamp(30px, 5vw, 76px);
}
body {
  background: var(--band);
  font-family: "Public Sans", "Segoe UI", sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(17, 17, 17, 0.025) 1px, transparent 1px);
  background-size: 100% 24px;
  opacity: 0.45;
}
.topbar {
  max-width: 1180px;
  margin: 26px auto 0;
  position: sticky;
  border-top: 4px double var(--ink);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 251, 0.94);
  padding: 16px var(--edition-gutter);
}
.brand {
  font-family: "Newsreader", Georgia, serif;
  font-size: 34px;
  font-style: italic;
  line-height: 1;
}
.subbrand {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
nav a, button {
  border-radius: 999px;
  border-color: rgba(17, 17, 17, 0.12);
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
nav a.active, button {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
main {
  max-width: 1180px;
  margin: 0 auto 48px;
  background: var(--paper);
}
.masthead {
  position: relative;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: start;
  gap: 30px;
  padding: 18px var(--edition-gutter) 42px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.masthead::after { display: none; }
.edition-rule {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.edition-rule strong {
  color: var(--accent);
  font-size: 11px;
}
.edition-rule span:last-child { text-align: right; }
.hero-copy { padding-left: 0; }
.eyebrow, .section-label {
  color: var(--accent);
  letter-spacing: 0.18em;
}
.masthead h1 {
  margin: 10px 0 14px;
  max-width: 900px;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(48px, 6.8vw, 82px);
  font-weight: 800;
  line-height: 0.92;
}
.dek {
  max-width: 720px;
  color: #3f3f46;
  font-family: "Newsreader", Georgia, serif;
  font-size: 22px;
  font-style: italic;
  line-height: 1.32;
}
.byline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 20px 0 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.byline-row strong { color: var(--ink); }
.status-pill {
  margin-left: auto;
  border-radius: 999px;
  background: rgba(198, 40, 40, 0.08);
  color: var(--accent-2);
  padding: 5px 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-panel {
  margin-top: 160px;
  box-shadow: none;
  border: 0;
  border-top: 3px solid var(--ink);
  border-radius: 0;
  background: transparent;
  padding: 12px 0 0;
}
.metric-grid {
  grid-template-columns: 1fr;
  gap: 0;
}
.metric {
  min-height: auto;
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 8px 0;
}
.metric strong {
  color: var(--ink);
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 800;
}
.metric span {
  color: var(--muted);
  font-size: 12px;
}
.hero-actions { margin-top: 18px; }
.chips span, .citation {
  border-color: rgba(198, 40, 40, 0.18);
  background: rgba(198, 40, 40, 0.06);
  color: var(--accent-2);
}
.band, .run-desk, .evidence-hunt, .retry-lab, .memory-section, .trace-history, .evidence-section, .notes-section, .observability, .admin-section, .about-section, .archive-section, .briefing-grid {
  padding-left: var(--edition-gutter);
  padding-right: var(--edition-gutter);
}
.band {
  background: var(--paper);
  border-top: 1px solid var(--ink);
}
.top-three {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 44px;
  padding: 0;
  list-style: none;
}
.top-three li {
  position: relative;
  margin: 0;
  padding-left: 56px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 17px;
  line-height: 1.45;
}
.top-three li::before {
  content: counter(list-item, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: -6px;
  color: var(--accent);
  font-family: "Newsreader", Georgia, serif;
  font-size: 38px;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
}
.panel, .section-card, .progress-card, .hunt-board, .retry-card, .memory-card, .trace-panels, .note-form, .admin-form, .evidence-note, .tool-log {
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.panel h2, .section-card h2, .run-desk h2, .section-heading h2, .notes-section h2, .admin-section h2, .about-section h2 {
  font-family: "Newsreader", Georgia, serif;
  font-size: 32px;
  font-style: italic;
}
.briefing-grid {
  border-top: 1px solid var(--ink);
}
.section-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  grid-column: span 12;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.section-card:first-child { grid-column: span 12; }
.section-card h2 {
  margin-top: 0;
  font-size: 26px;
}
.section-card p {
  font-family: "Newsreader", Georgia, serif;
  color: #3f3f46;
  font-size: 18px;
  line-height: 1.55;
}
.confidence-low, .confidence-medium, .confidence-high {
  border-top: 0;
}
.section-card .section-label {
  grid-row: span 3;
  color: var(--muted);
}
.citation-row {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.run-desk, .evidence-hunt, .retry-lab, .memory-section, .trace-history, .evidence-section, .notes-section, .observability, .admin-section, .about-section, .archive-section {
  border-top: 1px solid var(--ink);
  background: var(--paper);
}
.run-header, .section-heading {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 12px;
}
.live-events li, .timeline-row {
  border-top-color: var(--line);
}
.agent-loop article {
  border-radius: 0;
  background: #fcfaf8;
}
.d3-chart svg .chart-line {
  stroke-width: 2.5;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.about-grid article {
  border-top: 3px solid var(--accent);
  padding-top: 12px;
}
.about-grid h3 {
  margin: 0 0 8px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 24px;
  font-style: italic;
}
.about-section p, .about-grid p {
  max-width: none;
  font-size: 15px;
  line-height: 1.6;
}
@media (max-width: 1100px) {
  .topbar, main { margin-left: 22px; margin-right: 22px; }
}
@media (max-width: 820px) {
  .topbar { margin: 0; padding: 14px 18px; }
  main { margin: 0; }
  .masthead { grid-template-columns: 1fr; padding: 20px; }
  .edition-rule { grid-template-columns: 1fr; gap: 8px; }
  .edition-rule span:last-child { text-align: left; }
  .masthead h1 { font-size: clamp(42px, 13vw, 64px); }
  .status-panel { margin-top: 12px; }
  .top-three, .about-grid { grid-template-columns: 1fr; }
  .section-card { grid-template-columns: 1fr; }
  .band, .run-desk, .evidence-hunt, .retry-lab, .memory-section, .trace-history, .evidence-section, .notes-section, .observability, .admin-section, .about-section, .briefing-grid {
    padding-left: 20px;
    padding-right: 20px;
  }
  .status-pill { margin-left: 0; }
}

/* Point commentary and SQL superscript evidence */
.commentary-section {
  border-top: 1px solid var(--ink);
  background: var(--paper);
  padding-left: var(--edition-gutter);
  padding-right: var(--edition-gutter);
}
.commentary-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
}
.comment-form {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  background: transparent;
}
.comment-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.comment-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  padding: 14px;
  background: #fcfaf8;
  animation: slideIn 260ms ease both;
}
.comment-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.comment-card strong {
  display: block;
  margin-top: 7px;
}
.comment-card p {
  margin-bottom: 0;
  font-family: "Newsreader", Georgia, serif;
  color: #3f3f46;
}
.edition-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding: 5px;
  border: 1px solid var(--line);
  background: rgba(248, 244, 242, 0.78);
}
.edition-switch button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 10px;
}
.edition-switch button.active {
  background: var(--ink);
  color: var(--paper);
}
.inline-comment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.inline-comment-toggle input {
  width: auto;
  accent-color: var(--accent);
}
.weekly-edition-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 34px;
  padding: 34px var(--edition-gutter);
  border-top: 1px solid var(--ink);
  background:
    linear-gradient(180deg, rgba(198, 40, 40, 0.04), transparent 64%),
    var(--paper);
}
.weekly-edition-panel[hidden] {
  display: none;
}
.weekly-edition-panel h2 {
  margin: 8px 0 12px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 34px;
  font-style: italic;
  line-height: 1.05;
}
.weekly-edition-panel button {
  margin-top: 8px;
}
.weekly-edition-panel p {
  color: #3f3f46;
  font-family: "Newsreader", Georgia, serif;
  font-size: 17px;
  line-height: 1.55;
}
.weekly-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.weekly-grid article {
  padding: 16px;
  border-right: 1px solid var(--line);
}
.weekly-grid article:last-child {
  border-right: 0;
}
.weekly-grid span {
  color: var(--accent);
  font-family: "Newsreader", Georgia, serif;
  font-size: 30px;
  font-style: italic;
  font-weight: 800;
}
.weekly-grid strong {
  display: block;
  margin: 8px 0;
}
.weekly-grid p {
  margin: 0;
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: 13px;
}
.weekly-draft-card {
  grid-column: 1 / -1;
  border-top: 1px solid var(--ink);
  padding-top: 18px;
}
.weekly-draft-card h3 {
  margin: 8px 0 10px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 30px;
  font-style: italic;
  line-height: 1.05;
}
.weekly-draft-card p {
  max-width: 780px;
}
.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.archive-card {
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  background: transparent;
}
.archive-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.archive-card h3 {
  margin: 8px 0 10px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 28px;
  font-style: italic;
  line-height: 1.08;
}
.archive-card p {
  color: #3f3f46;
}
.archive-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 14px 0 0;
}
.archive-card div {
  min-width: 0;
}
.archive-card dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.archive-card dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.embedded-comments-section {
  padding: 32px var(--edition-gutter);
  border-top: 1px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(198, 40, 40, 0.04), transparent 44%),
    var(--paper);
}
.embedded-comments-section[hidden] {
  display: none;
}
.embedded-comment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.embedded-comment-card {
  position: relative;
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--line);
  padding: 13px 0 14px;
  background: transparent;
}
.embedded-comment-card::before {
  content: "comment";
  position: absolute;
  top: -11px;
  right: 0;
  background: var(--paper);
  color: var(--accent);
  padding-left: 6px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.embedded-comment-card span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.embedded-comment-card strong {
  display: block;
  margin-top: 7px;
}
.embedded-comment-card p {
  margin: 7px 0 10px;
  color: #3f3f46;
  font-family: "Newsreader", Georgia, serif;
  font-size: 15px;
  line-height: 1.45;
}
.embedded-comment-card button {
  padding: 6px 9px;
  font-size: 10px;
}
.sql-sup {
  display: inline;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  padding: 0 1px;
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-transform: uppercase;
}
.sql-sup:hover {
  box-shadow: none;
  transform: none;
}
.about-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.briefing-narrative {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  padding: 34px var(--edition-gutter);
  border-top: 1px solid var(--ink);
}
.story-column {
  column-count: 2;
  column-gap: 34px;
}
.story-column p {
  margin-top: 0;
  break-inside: avoid;
  font-family: "Newsreader", Georgia, serif;
  color: #2b2b2b;
  font-size: 20px;
  line-height: 1.58;
}
.story-column .eyebrow {
  column-span: all;
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: 12px;
}
.lede span {
  color: var(--ink);
  font-weight: 800;
}
.editorial-note {
  align-self: start;
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.editorial-note h2 {
  margin: 8px 0 10px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 31px;
  font-style: italic;
  line-height: 1.05;
}
.editorial-note p:last-child {
  margin-bottom: 0;
  color: #3f3f46;
}
.proof-table {
  padding: 32px var(--edition-gutter) 36px;
  border-top: 1px solid var(--ink);
}
.proof-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.proof-head h2 {
  max-width: 620px;
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 36px;
  font-style: italic;
  line-height: 1.05;
}
.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.proof-grid article {
  position: relative;
  padding: 18px 18px 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(198, 40, 40, 0.035), transparent 58%),
    transparent;
}
.proof-grid article:last-child {
  border-right: 0;
}
.proof-grid span {
  color: var(--accent);
  font-family: "Newsreader", Georgia, serif;
  font-size: 38px;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
}
.proof-grid h3 {
  margin: 8px 0 12px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 27px;
  font-style: italic;
}
.proof-grid p {
  margin: 10px 0 0;
  color: #3f3f46;
  font-size: 14px;
  line-height: 1.5;
}
@media (max-width: 1050px) {
  .about-grid, .comment-list, .archive-grid, .embedded-comment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .commentary-layout {
    grid-template-columns: 1fr;
  }
  .briefing-narrative {
    grid-template-columns: 1fr;
  }
  .story-column {
    column-count: 1;
  }
  .proof-grid, .weekly-grid {
    grid-template-columns: 1fr;
  }
  .proof-grid article, .weekly-grid article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .proof-grid article:last-child, .weekly-grid article:last-child {
    border-bottom: 0;
  }
}
@media (max-width: 820px) {
  .commentary-section {
    padding-left: 20px;
    padding-right: 20px;
  }
  .about-grid, .comment-list, .archive-grid, .embedded-comment-grid {
    grid-template-columns: 1fr;
  }
  .briefing-narrative, .proof-table, .weekly-edition-panel, .embedded-comments-section {
    padding-left: 20px;
    padding-right: 20px;
  }
  .story-column p {
    font-size: 18px;
  }
  .proof-head {
    display: block;
  }
}

/* Edition page system and marginal conversation layer */
.edition-shell {
  position: relative;
  min-height: calc(100vh - 122px);
  padding-top: 42px;
  perspective: 1400px;
}
.page-folio {
  position: sticky;
  top: 76px;
  z-index: 22;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  padding: 10px var(--edition-gutter);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 251, 0.94);
  backdrop-filter: blur(12px);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.page-folio strong {
  color: var(--accent);
  font-family: "Newsreader", Georgia, serif;
  font-size: 18px;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  transition: transform 360ms ease, opacity 360ms ease;
}
.page-folio span:last-child { text-align: right; }
.paper-transition {
  position: fixed;
  inset: -8vh -10vw;
  z-index: 35;
  pointer-events: none;
  background:
    linear-gradient(105deg, rgba(255, 253, 251, 0.98), rgba(248, 244, 242, 0.92) 62%, rgba(238, 229, 224, 0.78)),
    repeating-linear-gradient(0deg, rgba(17, 17, 17, 0.025) 0, rgba(17, 17, 17, 0.025) 1px, transparent 1px, transparent 9px);
  box-shadow: -34px 10px 92px rgba(17, 17, 17, 0.14), inset 1px 0 rgba(17, 17, 17, 0.07);
  transform: translateX(-112%) rotate(-2.4deg);
  transform-origin: 42% 50%;
}
.edition-shell.turning .paper-transition {
  animation: paperWipe 1450ms cubic-bezier(.12,.62,.18,1) both;
}
.edition-shell.turning .page-folio strong {
  opacity: 0.4;
  transform: translateY(-4px);
}
.page-sheet {
  display: none;
  transform-origin: 50% 0;
}
.page-sheet.active {
  display: block;
  animation: pageRise 1120ms cubic-bezier(.12,.62,.18,1) both;
}
.page-sheet.active .reveal {
  animation: editorialReveal 660ms ease both;
}
.page-sheet.active .reveal:nth-child(2) { animation-delay: 90ms; }
.page-sheet.active .reveal:nth-child(3) { animation-delay: 150ms; }
.page-sheet.active .reveal:nth-child(4) { animation-delay: 210ms; }
.page-sheet .section-heading h2,
.page-sheet .masthead h1,
.page-sheet .section-card h2 {
  text-wrap: balance;
}
.evidence-note {
  overflow: hidden;
  transition: border-color 220ms ease, background 220ms ease;
}
.evidence-note[open] {
  background: linear-gradient(180deg, rgba(255, 253, 251, 0.92), rgba(248, 244, 242, 0.68));
  border-color: rgba(198, 40, 40, 0.24);
}
.evidence-note[open] .evidence-body {
  animation: evidenceUnfold 420ms ease both;
}
.agent-loop article.active {
  animation: deskPulse 900ms ease both;
}
.selection-ask {
  right: 24px;
  bottom: 24px;
  width: min(500px, calc(100vw - 48px));
  gap: 12px;
  border-radius: 0;
  border-top: 4px solid var(--accent);
  background: rgba(255, 253, 251, 0.98);
  box-shadow: 0 24px 80px rgba(17, 17, 17, 0.18);
  animation: marginNoteIn 260ms ease both;
}
.ask-head strong {
  font-family: "Newsreader", Georgia, serif;
  font-size: 24px;
  font-style: italic;
}
.ask-head button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border-radius: 999px;
}
.ask-subtitle {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.selection-ask blockquote {
  border-left-color: var(--accent);
  background:
    linear-gradient(90deg, rgba(198, 40, 40, 0.07), transparent),
    var(--band);
  color: #3f3f46;
  font-family: "Newsreader", Georgia, serif;
  font-size: 15px;
  line-height: 1.45;
}
.ask-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ask-context span {
  border: 1px solid rgba(198, 40, 40, 0.18);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ask-answer {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: #2b2b2b;
  font-family: "Newsreader", Georgia, serif;
  font-size: 16px;
  line-height: 1.45;
}
.ask-history {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.ask-history article {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 10px;
}
.ask-history span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ask-history strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}
.ask-history p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
@keyframes paperWipe {
  0% {
    opacity: 0;
    transform: translateX(-118%) translateY(18px) rotate(-3.2deg);
  }
  18% {
    opacity: 1;
  }
  54% {
    opacity: 1;
    transform: translateX(1%) translateY(2px) rotate(-0.75deg);
  }
  72% {
    opacity: 1;
    transform: translateX(34%) translateY(-2px) rotate(0.35deg);
  }
  100% {
    opacity: 0;
    transform: translateX(118%) translateY(-12px) rotate(2.2deg);
  }
}
@keyframes pageRise {
  from {
    opacity: 0;
    transform: translateY(30px) rotateX(2.8deg) rotateZ(-0.7deg);
    filter: blur(2.5px);
  }
  68% {
    opacity: 1;
    transform: translateY(7px) rotateX(0.55deg) rotateZ(0.12deg);
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
@keyframes editorialReveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes evidenceUnfold {
  from { opacity: 0; transform: translateY(-8px); clip-path: inset(0 0 100% 0); }
  to { opacity: 1; transform: none; clip-path: inset(0); }
}
@keyframes deskPulse {
  0% { box-shadow: none; }
  45% { box-shadow: 0 18px 45px rgba(198, 40, 40, 0.16); }
  100% { box-shadow: var(--shadow); }
}
@keyframes marginNoteIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 820px) {
  .edition-shell {
    padding-top: 0;
  }
  .page-folio {
    position: static;
    grid-template-columns: 1fr;
    gap: 4px;
    margin: 0 20px 14px;
  }
  .page-folio span:last-child {
    text-align: left;
  }
  .selection-ask {
    right: 14px;
    bottom: 14px;
    width: calc(100vw - 28px);
    max-height: calc(100vh - 28px);
    overflow: auto;
  }
}
