:root {
  color-scheme: light;
  --background: #f4f1ea;
  --surface: #fffdf8;
  --ink: #1f1c18;
  --muted: #625b52;
  --border: #d3cdc2;
  --accent: #8a3f17;
  --accent-dark: #6a2f10;
  --accent-soft: #f4e6dc;
  --ok: #1d5c3f;
  --ok-soft: #e3efe8;
  --danger: #9b2318;
  --danger-soft: #fbe9e6;
  --focus: #096bce;
  --radius: 10px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--background);
  line-height: 1.5;
}

button,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a,
select,
textarea,
input {
  outline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--focus);
}

a {
  color: var(--accent-dark);
  font-weight: 650;
  text-underline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.capacity {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: right;
}

.shell {
  width: min(100% - 2rem, 72rem);
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.intro {
  max-width: 44rem;
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 5vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
}

.lead {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.lead-small {
  max-width: 44rem;
  margin: 0;
  color: var(--muted);
}

.columns {
  display: grid;
  gap: 1rem;
}

.panel {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-wide {
  margin-top: 1rem;
}

.help-text,
.status-copy,
.optional {
  color: var(--muted);
}

.help-text {
  margin: 0;
  font-size: 0.875rem;
}

.status-copy {
  margin: 0 0 1rem;
}

.optional {
  font-weight: 400;
}

.choice-list {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.choice-list legend {
  margin-bottom: 0.5rem;
  padding: 0;
}

.choice {
  display: flex;
  min-height: 3rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.choice:hover {
  border-color: var(--accent);
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--accent);
}

.choice-name {
  font-weight: 650;
}

.choice-company {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.field label,
.field-label {
  font-weight: 700;
}

.field-pair {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 30rem) {
  .field-pair {
    grid-template-columns: 1fr 1fr;
  }
}

select,
textarea {
  width: 100%;
  border: 1px solid #a9a195;
  border-radius: 7px;
  background: #fff;
}

select {
  min-height: 2.75rem;
  padding: 0.5rem 0.6rem;
}

textarea {
  padding: 0.7rem;
  resize: vertical;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.field-meta span:last-child {
  flex: none;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.button {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease-out;
}

.button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.button:active:not(:disabled) {
  transform: scale(0.97);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-secondary {
  color: var(--accent-dark);
  background: transparent;
}

.button-secondary:hover:not(:disabled) {
  background: var(--accent-soft);
}

.notice {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.notice-error {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.steps {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.step-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.step-what {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.pill {
  flex: none;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
  white-space: nowrap;
}

.step[data-state="running"] {
  border-color: var(--accent);
}

.step[data-state="running"] .pill {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.step[data-state="done"] .pill {
  border-color: var(--ok);
  color: var(--ok);
  background: var(--ok-soft);
}

.step[data-state="failed"] {
  border-color: var(--danger);
}

.step[data-state="failed"] .pill {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.step-result {
  margin: 0.6rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.step-result p {
  margin: 0;
}

.step-result p + p {
  margin-top: 0.35rem;
}

.result-note {
  color: var(--muted);
  font-size: 0.875rem;
}

.prob-list {
  display: grid;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.prob-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr 3rem;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.prob-row progress {
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e4dfd5;
}

.prob-row progress::-webkit-progress-bar {
  background: #e4dfd5;
}

.prob-row progress::-webkit-progress-value {
  background: var(--accent);
}

.prob-row progress::-moz-progress-bar {
  background: var(--accent);
}

.prob-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.preview {
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #f8f6f0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.875rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.plain-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

footer {
  padding: 0 1rem 2rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

footer p {
  max-width: 44rem;
  margin: 0 auto 0.4rem;
}

@media (min-width: 60rem) {
  .site-header {
    padding: 1.25rem 2rem;
  }

  .shell {
    padding-top: 3rem;
  }

  .columns {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
    gap: 1.5rem;
  }

  .panel {
    padding: 1.5rem;
  }

  .panel-wide {
    margin-top: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
