:root {
  --bg: #fafafa;
  --card: #fff;
  --text: #222;
  --subtle: #666;
  --border: #d0d0d0;
  --accent: #0057d9;
  --accent-bg: #eef3fc;
  --pass: #0a7d0a;
  --warn: #b77700;
  --fail: #b00020;
  --skip: #777;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

body {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

header { margin-bottom: 2rem; }
header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.625rem;
  letter-spacing: -0.01em;
}

.pitch {
  margin: 0.25rem 0 0;
  color: var(--subtle);
  font-size: 0.95rem;
}
.pitch strong { color: var(--text); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.drop-zone {
  display: block;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 3.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  background: var(--card);
}
.drop-zone:hover { border-color: var(--accent); }
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.drop-zone.disabled {
  opacity: 0.55;
  pointer-events: none;
}
.drop-zone-title { margin: 0; font-size: 1.05rem; font-weight: 500; }
.drop-zone-title code {
  background: #eee; padding: 0.1em 0.35em; border-radius: 4px;
  font-size: 0.95em;
}
.drop-zone-hint {
  margin: 0.5rem 0 0; color: var(--subtle); font-size: 0.9rem;
}

.status {
  min-height: 1.5rem;
  margin: 1rem 0 0;
  color: var(--subtle);
  font-size: 0.95rem;
}
.status.error { color: var(--fail); }

.tips {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--subtle);
}
.tips summary { cursor: pointer; }
.tips ul { margin: 0.5rem 0 0 1rem; padding: 0; }

.report {
  margin-top: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}
.report.hidden { display: none; }
.report-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.5rem;
}
.report-header h2 { margin: 0; font-size: 1.15rem; }
#copy-report {
  font: inherit;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
}
#copy-report:hover { border-color: var(--accent); color: var(--accent); }
#copy-report.copied { color: var(--pass); border-color: var(--pass); }

.summary {
  margin: 0.5rem 0 1rem;
  font-size: 0.95rem;
  color: var(--subtle);
}
.summary.pass { color: var(--pass); }
.summary.warn { color: var(--warn); }
.summary.fail { color: var(--fail); }

.stages { list-style: none; margin: 0; padding: 0; }

.stage {
  border-top: 1px solid #eee;
  padding: 0.65rem 0;
}
.stage:first-child { border-top: none; }

.stage-summary {
  display: flex; align-items: center; gap: 0.75rem;
  cursor: pointer; list-style: none;
}
.stage-summary::-webkit-details-marker { display: none; }
.stage-summary::before {
  content: "▸";
  color: var(--subtle);
  font-size: 0.8rem;
  width: 1rem;
  transition: transform 120ms ease;
}
.stage[open] .stage-summary::before { content: "▾"; }

.dot {
  flex: 0 0 auto;
  width: 0.75rem; height: 0.75rem; border-radius: 50%;
  background: var(--subtle);
}
.stage.pass .dot { background: var(--pass); }
.stage.warn .dot { background: var(--warn); }
.stage.fail .dot { background: var(--fail); }

.stage-title { flex: 1; font-weight: 500; }
.stage-meta  { color: var(--subtle); font-size: 0.875rem; }

.stage-details {
  margin: 0.5rem 0 0 1.75rem;
  padding: 0.5rem 0.75rem;
  background: #f5f5f7;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  overflow-x: auto;
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--subtle);
  font-size: 0.85rem;
}
footer a { color: var(--subtle); }
footer a:hover { color: var(--accent); }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --card: #1b1b1d;
    --text: #e8e8ea;
    --subtle: #a0a0a8;
    --border: #333338;
    --accent: #5b9cff;
    --accent-bg: #1c2a44;
  }
  .drop-zone-title code { background: #2a2a2d; }
  .stage-details { background: #232327; }
}
