:root {
  --bg: #ffffff; --ink: #111111; --muted: #666666; --rule: #e4e4e4; --accent: #1740c7;
  --serif: Charter, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

::selection { color: var(--bg); background: var(--ink); }

.page { max-width: 680px; margin: 0 auto; padding: 0 20px 96px; }

h1 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}

h2 { font-size: 21px; line-height: 1.3; margin: 0 0 14px; }
h3 { font-size: 17px; line-height: 1.4; margin: 22px 0 8px; }

p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--ink); }

button, input { font: inherit; }

.label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
[hidden] { display: none !important; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 28px 0 20px;
}

.brand {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.top a:last-child {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
}

.hero { padding: 34px 0 44px; border-top: 1px solid var(--rule); }
.lede { margin-bottom: 24px; }

section { padding: 40px 0; border-top: 1px solid var(--rule); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  align-items: end;
}

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}

.field input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--serif);
  outline: none;
}

.field input:focus { border-color: var(--ink); }

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.cta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: var(--bg);
  text-decoration: none;
  cursor: pointer;
  border-radius: 0;
}

.cta:hover { background: var(--ink); color: var(--bg); }
.cta:disabled { cursor: wait; color: var(--muted); border-color: var(--rule); }
.cta:disabled:hover { color: var(--muted); background: var(--bg); }

.form-message,
.status-message {
  font-size: 15px;
  border-left: 2px solid var(--accent);
  padding-left: 12px;
  margin-top: 16px;
}

.wait-note,
.footnote {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.wait-note { margin-top: 14px; }

.facts { width: 100%; border-collapse: collapse; margin: 24px 0 0; }

.facts td {
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  vertical-align: top;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.facts td:first-child {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  width: 120px;
  padding-right: 16px;
  white-space: nowrap;
}

.gallery-entry {
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}

.gallery-entry:first-child { border-top: 0; padding-top: 4px; }
.gallery-entry .facts { margin-top: 16px; }

.key-finding {
  border-left: 2px solid var(--accent);
  padding: 10px 0 10px 14px;
  margin: 18px 0;
}

.gallery-actions { margin-top: 18px; }

.stage-trail { margin-top: 24px; }

details { border-top: 1px solid var(--rule); padding: 12px 0; }
details:last-child { border-bottom: 1px solid var(--rule); }

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; font-family: var(--mono); color: var(--muted); }
details[open] summary::before { content: "\2013"; }

.details-body { padding: 14px 0 8px 24px; font-size: 15.5px; }
.details-body ul { margin: 8px 0 18px; padding-left: 20px; }
.details-body li { margin-bottom: 8px; }

.score-list { margin: 16px 0; }

.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
}

.score-row span:last-child {
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.artifact-content,
.email-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.artifact-content {
  border: 1px solid var(--rule);
  padding: 16px;
  margin: 16px 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  background: var(--bg);
}

.email-block {
  border: 1px solid var(--rule);
  padding: 16px;
  margin: 14px 0 20px;
}

.email-block.compact { font-size: 14px; }

.email-subject {
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}

.email-subject strong,
.field-name {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.quality-item {
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}

.quality-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.quality-state {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.structured {
  display: grid;
  grid-template-columns: minmax(110px, 0.35fr) minmax(0, 1fr);
  margin: 10px 0 18px;
}

.structured dt,
.structured dd {
  padding: 7px 0;
  border-top: 1px solid var(--rule);
}

.structured dt {
  padding-right: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.structured dd { margin: 0; overflow-wrap: anywhere; }
.structured ul { margin: 0; }

.result-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

footer {
  border-top: 1px solid var(--rule);
  padding-top: 24px;
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  h1 { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-actions { grid-column: auto; }
  .facts td:first-child { width: 96px; }
  .details-body { padding-left: 18px; }
  .structured { grid-template-columns: 1fr; }
  .structured dt { padding-bottom: 2px; }
  .structured dd { border-top: 0; padding-top: 0; }
}

/* Lead-example fold strip (ISC-D2) */
#lead-fold {
  border: 1px solid var(--rule);
  padding: 14px 16px;
  margin-top: 20px;
}
#lead-fold .label { margin-bottom: 8px; }
.lead-fold-head { font-weight: 600; margin: 0 0 6px; }
.lead-fold-finding { margin: 0 0 8px; font-size: 15px; }
.lead-fold-email {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* The Line — station belt for full runs */
.belt {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  border-bottom: 1px solid var(--rule);
}
.belt-chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  padding: 5px 10px;
  white-space: nowrap;
  cursor: pointer;
}
.belt-chip:hover { border-color: var(--ink); }
.belt-chip.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  font-weight: 600;
}
.belt-chip.stopped { color: #8a1c1c; border-color: #b08585; }
.belt-chip.stopped.active { background: #8a1c1c; color: var(--bg); border-color: #8a1c1c; }
.belt-chip.unreached { opacity: 0.45; }
.belt-panel { padding-top: 16px; }
