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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f4;
  color: #1c1917;
  line-height: 1.5;
}

header {
  padding: 2rem;
  border-bottom: 1px solid #e7e5e4;
  background: #fff;
}

header h1 { font-size: 1.5rem; font-weight: 600; }
header p  { color: #78716c; margin-top: 0.25rem; font-size: 0.9rem; }

main {
  max-width: 860px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Header ── */
.header-top {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

.tagline { color: #78716c; margin-top: 0.25rem; font-size: 0.9rem; }

.repo-link {
  font-size: 0.8rem;
  color: #78716c;
  text-decoration: none;
  border: 1px solid #e7e5e4;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.repo-link:hover { background: #f5f5f4; }

/* ── Motivation ── */
.motivation {
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: #44403c;
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

.motivation code {
  font-family: ui-monospace, monospace;
  background: #f5f5f4;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.85em;
}

/* ── Summary ── */
.summary {
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.summary-score {
  font-size: 1.05rem;
  font-weight: 600;
}

/* ── Filters ── */
.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.filter-btn {
  font-size: 0.8rem;
  font-weight: 500;
  color: #57534e;
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
}

.filter-btn:hover { background: #fafaf9; }

.filter-btn.active {
  background: #1c1917;
  color: #fff;
  border-color: #1c1917;
}

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a8a29e;
  margin-bottom: 0.25rem;
}

/* ── Location meta ── */
.location-meta {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f5f5f4;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meta-why {
  font-size: 0.84rem;
  color: #57534e;
  line-height: 1.6;
}

.meta-caveat {
  font-size: 0.82rem;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  line-height: 1.5;
}

/* ── Card ── */
.card {
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  overflow: hidden;
}

.card-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
}

.card-header:hover { background: #fafaf9; }

.card-header::after {
  content: '▸';
  margin-left: auto;
  color: #a8a29e;
  transition: transform 0.15s;
}

.card-header.open::after { transform: rotate(90deg); }

.location-name { font-weight: 600; flex: 1; }

/* ── Verdict badges ── */
.verdict {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.expected { background: #f5f5f4; color: #78716c; }
.pass     { background: #dcfce7; color: #15803d; }
.fail     { background: #fee2e2; color: #b91c1c; }

/* ── Trace ── */
.trace { border-top: 1px solid #e7e5e4; }

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Step ── */
.step {
  border-bottom: 1px solid #f5f5f4;
  padding: 1rem 1.25rem;
}

.step:last-child { border-bottom: none; }

.step-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.step[data-type="act"]     .step-label { color: #7c3aed; }
.step[data-type="observe"] .step-label { color: #0369a1; }
.step[data-type="reflect"] .step-label { color: #b45309; }
.step[data-type="output"]  .step-label { color: #15803d; }

.step-body {
  font-size: 0.85rem;
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  color: #44403c;
  line-height: 1.6;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 4px;
  padding: 0.75rem;
}

/* ── Output step ── */
.step-output {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.verdict-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.verdict-good     { background: #dcfce7; color: #15803d; }
.verdict-marginal { background: #fef9c3; color: #854d0e; }
.verdict-bad      { background: #fee2e2; color: #b91c1c; }

.output-reasoning {
  font-size: 0.85rem;
  color: #44403c;
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ── Prompt (collapsed) ── */
.step-prompt {
  margin-bottom: 0.5rem;
}

.step-prompt summary {
  font-size: 0.75rem;
  color: #a8a29e;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0.35rem;
}

.step-prompt summary:hover { color: #78716c; }

.step-prompt pre {
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #78716c;
  background: #f5f5f4;
  border: 1px solid #e7e5e4;
  border-radius: 4px;
  padding: 0.75rem;
  margin-top: 0.35rem;
}
