:root {
  --navy: #16324f;
  --orange: #c8762a;
  --cream: #f8f3e6;
  --border: #ddd0ad;
  --text: #2a2a2a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}
.page { max-width: 860px; margin: 0 auto; padding: 32px 24px 64px; }
.page.wide { max-width: 1180px; }
h1 { color: var(--navy); font-size: 26px; margin-bottom: 4px; }
h2 { color: var(--navy); font-size: 18px; }
.subtitle { color: #555; font-size: 14px; margin-top: 0; }
.nav { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; margin-bottom: 24px; }
.nav span, .nav a {
  padding: 3px 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  color: #888;
  text-decoration: none;
}
.nav a { color: var(--navy); cursor: pointer; }
.nav a:hover { background: var(--cream); border-color: var(--navy); }
.nav span.active, .nav a.active { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 4px; color: var(--navy); }
input[type=text], input[type=password], textarea, select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fffdf8;
}
textarea { min-height: 220px; resize: vertical; }
textarea.tall { min-height: 420px; }
.hint { font-size: 12px; color: #777; margin-top: 2px; }
.actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
button, .btn {
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 5px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary, .btn.secondary { background: #fff; color: var(--navy); }
.error {
  background: #fbeaea;
  border: 1px solid #d98c8c;
  color: #7a1f1f;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.warn-note {
  background: #fdf3e3;
  border: 1px solid #eccb8f;
  color: #8a5a1f;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12px;
  margin: 6px 0 0;
}
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.checkbox-row input { width: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table th, table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table th { color: var(--navy); }
.manuscript { background: #fffdf8; padding: 24px 28px; border: 1px solid var(--border); border-radius: 8px; }
.manuscript h1, .manuscript h2, .manuscript h3 { color: var(--navy); }
.disclosure-entry { border-left: 3px solid var(--orange); padding-left: 12px; margin-bottom: 14px; }
.stat { font-size: 13px; margin: 2px 0; }
.stat strong { color: var(--navy); }
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.figure-card { margin-top: 16px; }
.figure-card img { max-width: 100%; border: 1px solid var(--border); border-radius: 6px; }
.figure-card p.caption { font-size: 13px; color: #555; margin-top: 6px; }
.progress-window {
  margin-top: 14px;
  max-height: 160px;
  overflow-y: auto;
  background: #fffdf8;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: #555;
  line-height: 1.6;
}
.progress-window .line { white-space: pre-wrap; }
.progress-window .line:last-child { color: var(--navy); font-weight: 600; }
.results-feed {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.result-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
}
.result-item .r-title { font-weight: 600; }
.result-item .r-title a { color: var(--navy); text-decoration: none; }
.result-item .r-title a:hover { text-decoration: underline; }
.result-item .r-meta { font-size: 11.5px; color: #777; margin-top: 2px; }
.result-item .r-note { margin-top: 6px; }

/* Two-column stage layout: main content + right-side transparency panel */
.layout-row { display: flex; gap: 24px; align-items: flex-start; }
.main-col { flex: 1; min-width: 0; }
.side-col { width: 280px; flex-shrink: 0; position: sticky; top: 24px; }
@media (max-width: 860px) {
  .layout-row { flex-direction: column; }
  .side-col { width: 100%; position: static; }
}

.side-h {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--orange); margin: 0 0 10px;
}
.side-col .card { padding: 14px 16px; margin-bottom: 14px; }

/* Stepper */
.stepper { list-style: none; margin: 0; padding: 0; }
.stepper-step {
  display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12.5px;
  position: relative;
}
.stepper-step:not(:last-child)::before {
  content: ""; position: absolute; left: 3px; top: 18px; width: 1px; height: 100%;
  background: var(--border);
}
.stepper-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--border); flex-shrink: 0;
  z-index: 1; position: relative;
}
.stepper-step.done .stepper-dot { background: var(--orange); }
.stepper-step.active .stepper-dot { background: var(--navy); box-shadow: 0 0 0 3px rgba(22,50,79,.15); }
.stepper-step.upcoming .stepper-label { color: #999; }
.stepper-step.done .stepper-label { color: #777; }
.stepper-step.active .stepper-label { color: var(--navy); font-weight: 700; }
.stepper-link { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.stepper-link:hover .stepper-label { text-decoration: underline; }

/* Execution trace */
.sidebar-trace { margin-top: 0; max-height: 220px; font-size: 11px; }

/* Prompt viewer */
.prompt-details { border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; margin-bottom: 8px; background: #fffdf8; }
.prompt-details + .prompt-details { margin-top: 8px; }
.prompt-details summary { font-size: 12.5px; font-weight: 600; color: var(--navy); cursor: pointer; }
.prompt-sub-h { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #888; margin: 10px 0 4px; }
.prompt-pre {
  white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; color: var(--text); background: #fff; border: 1px solid var(--border);
  border-radius: 4px; padding: 8px 10px; max-height: 240px; overflow-y: auto; margin: 0;
}

/* Landing-page plain-language onboarding cards */
.explainer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 32px;
}
.explainer-card {
  background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--orange);
  border-radius: 8px; padding: 14px 16px;
}
.explainer-card h4 { margin: 0 0 6px; font-size: 14px; color: var(--navy); }
.explainer-card p { font-size: 12.5px; color: #444; margin: 0 0 8px; }
.explainer-card a { font-size: 12px; font-weight: 600; color: var(--navy); }
@media (max-width: 760px) { .explainer-grid { grid-template-columns: 1fr 1fr; } }
