:root {
  --paper: #e9e7df;
  --ink: #16191c;
  --muted: #666964;
  --line: #b8b7b0;
  --focus: #225fd1;
  --failure: #d64a30;
  --success: #1d7852;
  --panel: #f4f2eb;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}
html {
  color-scheme: light;
  background: var(--paper);
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  z-index: 20;
  left: 12px;
  top: 12px;
  transform: translateY(-180%);
  background: var(--ink);
  color: white;
  padding: 10px 14px;
}
.skip-link:focus {
  transform: none;
}
.masthead {
  height: 64px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.masthead p,
.privacy {
  margin: 0;
  font: 11px/1.2 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.privacy {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}
.privacy span {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 3px #1d785222;
}
.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  font-size: 13px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font: 13px var(--mono);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  min-height: calc(100vh - 119px);
}
.stage {
  padding: 30px 28px 26px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.stage-head,
.tape-head,
.export-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}
.eyebrow {
  font: 10px/1.2 var(--mono);
  letter-spacing: 0.1em;
  color: var(--muted);
}
h1,
h2 {
  margin: 6px 0 0;
  letter-spacing: -0.035em;
}
h1 {
  font-size: clamp(30px, 4vw, 58px);
  line-height: 0.96;
  max-width: 680px;
  font-weight: 650;
}
h2 {
  font-size: 24px;
  line-height: 1;
}
.mode-switch {
  display: flex;
  border: 1px solid var(--line);
}
.mode-button {
  border: 0;
  background: transparent;
  padding: 9px 14px;
  font: 11px var(--mono);
}
.mode-button + .mode-button {
  border-left: 1px solid var(--line);
}
.mode-button.is-active[data-mode="broken"] {
  background: var(--failure);
  color: white;
}
.mode-button.is-active[data-mode="fixed"] {
  background: var(--success);
  color: white;
}
.browser-frame {
  margin-top: 26px;
  height: min(62vh, 640px);
  min-height: 410px;
  border: 1px solid #8d8e88;
  background: white;
  position: relative;
  box-shadow: 10px 12px 0 #cbc9c0;
}
.browser-bar {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: #deddd7;
  border-bottom: 1px solid #aaa9a4;
}
.browser-bar > span {
  width: 8px;
  height: 8px;
  border: 1px solid #777;
  border-radius: 50%;
}
.browser-bar div {
  margin-left: 8px;
  color: #62635f;
  font: 10px var(--mono);
}
iframe {
  display: block;
  width: 100%;
  height: calc(100% - 36px);
  border: 0;
}
.focus-wire {
  position: absolute;
  inset: 36px -1px -1px 0;
  width: calc(100% + 1px);
  height: calc(100% - 35px);
  pointer-events: none;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.2s;
}
.focus-wire.is-visible {
  opacity: 1;
}
.focus-wire path {
  fill: none;
  stroke: var(--failure);
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 4 5;
  animation: dash 1s linear infinite;
}
@keyframes dash {
  to {
    stroke-dashoffset: -9;
  }
}
.controls {
  min-height: 58px;
  margin-top: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}
.controls p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.record-button,
.mark-button,
.export-actions button,
.assertion-actions button,
footer button {
  min-height: 42px;
  border: 1px solid var(--ink);
  background: transparent;
  padding: 0 16px;
  font-weight: 650;
}
.record-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: white;
}
.record-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--failure);
}
.record-button.is-recording .record-dot {
  animation: pulse 1s steps(2, end) infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
.mark-button:not(:disabled) {
  border-color: var(--failure);
  color: var(--failure);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}
kbd {
  font: 10px var(--mono);
  margin-left: 8px;
  border: 1px solid currentColor;
  padding: 2px 4px;
}
.tape {
  background: var(--panel);
  min-width: 0;
}
.tape-head {
  padding: 30px 22px 20px;
  border-bottom: 1px solid var(--line);
}
#event-count {
  font: 34px var(--mono);
  color: var(--line);
}
.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: calc(100vh - 184px);
  overflow: auto;
}
.event-list li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #d2d0c8;
  position: relative;
}
.event-list li::before {
  content: "";
  position: absolute;
  left: 34px;
  top: 0;
  bottom: 0;
  border-left: 1px solid #c3c1b8;
}
.event-list li.is-evidence {
  background: #d64a3011;
  box-shadow: inset 3px 0 var(--failure);
}
.event-list li > span:first-child,
.event-time {
  font: 10px var(--mono);
  color: var(--muted);
}
.event-list p {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.event-list strong {
  font-weight: 700;
}
.event-kind {
  display: block;
  margin-bottom: 3px;
  font: 9px var(--mono);
  color: var(--muted);
  letter-spacing: 0.08em;
}
.proof-panel,
.export-panel {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  display: grid;
}
.proof-panel[hidden],
.export-panel[hidden] {
  display: none;
}
.proof-panel {
  grid-template-columns: 1fr 1fr;
}
.proof-summary,
.assertion-builder {
  padding: 28px;
}
.proof-summary {
  background: var(--failure);
  color: white;
}
.proof-summary .eyebrow {
  color: #ffffffb8;
}
.proof-summary p {
  max-width: 620px;
}
.evidence-cites {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.evidence-cites span {
  font: 10px var(--mono);
  border: 1px solid #ffffff88;
  padding: 5px 7px;
}
.assertion-builder {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.assertion-builder label {
  font: 10px var(--mono);
  color: var(--muted);
  text-transform: uppercase;
}
.assertion-builder input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  padding: 12px 0;
  font-size: 18px;
}
.assertion-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.assertion-actions button {
  background: var(--ink);
  color: white;
}
.assertion-actions span {
  font: 10px var(--mono);
  color: var(--muted);
}
.export-panel {
  padding: 28px;
  background: #1a1d20;
  color: #f2f0e8;
}
.export-panel .eyebrow {
  color: #a8acae;
}
.export-actions {
  display: flex;
  gap: 8px;
}
.export-actions button {
  border-color: #777;
  color: inherit;
}
.export-actions button:last-child {
  background: var(--focus);
  border-color: var(--focus);
}
.run-result {
  margin: 22px 0 0;
  padding: 12px 14px;
  border-left: 3px solid #777;
  background: #ffffff08;
  font: 12px var(--mono);
}
.run-result.is-fail {
  border-color: var(--failure);
  color: #ff9b88;
}
.run-result.is-pass {
  border-color: #51bd8e;
  color: #70d6a9;
}
pre {
  overflow: auto;
  margin: 14px 0 0;
  padding: 20px;
  border: 1px solid #383d42;
  background: #111315;
  color: #d9e3dc;
  font: 12px/1.7 var(--mono);
}
footer {
  min-height: 55px;
  padding: 0 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
}
footer p {
  margin: 0;
  color: var(--muted);
  font: 10px var(--mono);
}
footer button {
  min-height: 32px;
  font: 10px var(--mono);
  border-color: var(--line);
}

@media (max-width: 900px) {
  .masthead {
    grid-template-columns: 1fr auto;
  }
  .masthead > p {
    display: none;
  }
  .workspace {
    display: block;
  }
  .stage {
    border-right: 0;
  }
  .tape {
    border-top: 1px solid var(--line);
  }
  .event-list {
    max-height: 360px;
  }
  .proof-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .masthead {
    padding: 0 14px;
  }
  .privacy {
    font-size: 8px;
  }
  .stage {
    padding: 22px 14px;
  }
  .stage-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .browser-frame {
    margin-top: 18px;
    height: 520px;
    min-height: 0;
    box-shadow: 6px 7px 0 #cbc9c0;
  }
  .controls {
    grid-template-columns: 1fr 1fr;
  }
  .controls p {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .record-button,
  .mark-button {
    width: 100%;
    justify-content: center;
  }
  .proof-summary,
  .assertion-builder,
  .export-panel {
    padding: 22px 14px;
  }
  .export-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .export-actions {
    width: 100%;
  }
  .export-actions button {
    flex: 1;
  }
  footer {
    gap: 12px;
    padding: 12px 14px;
  }
  footer p {
    max-width: 70%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
