:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5f6b7a;
  --quiet: #8a96a8;
  --line: #d8dee8;
  --surface: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #eef4f2;
  --green: #26705a;
  --green-soft: #e3f3ed;
  --blue: #245d7a;
  --blue-soft: #e5f0f6;
  --amber: #8a5f12;
  --amber-soft: #fff1d6;
  --red: #a43f3f;
  --red-soft: #f8e4e4;
  --shadow: 0 18px 40px rgba(20, 32, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  min-height: 100vh;
}

.left-rail,
.right-rail {
  background: #fbfcfd;
  border-color: var(--line);
  border-style: solid;
  padding: 18px;
}

.left-rail {
  border-width: 0 1px 0 0;
}

.right-rail {
  border-width: 0 0 0 1px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 750;
}

.brand-subtitle,
.eyebrow,
.field-help,
.small-note {
  color: var(--muted);
  font-size: 13px;
}

.step-nav {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.step-button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.step-button:hover,
.step-button.active {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.step-number {
  display: grid;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 750;
}

.step-button.complete .step-number {
  border-color: rgba(38, 112, 90, 0.25);
  background: var(--green-soft);
  color: var(--green);
}

.step-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--line);
}

.step-button.active .step-status-dot {
  background: var(--blue);
}

.step-button.complete .step-status-dot {
  background: var(--green);
}

.workspace {
  min-width: 0;
  background: linear-gradient(180deg, #ffffff 0, var(--surface) 310px);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.progress-strip {
  padding: 16px 28px 0;
}

.progress-meter {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #e9eef4;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 0.2s ease;
}

.progress-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.screen-panel {
  padding: 22px 28px 40px;
}

.screen-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.55fr);
  gap: 18px;
  align-items: start;
}

.card,
.rail-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card {
  padding: 20px;
}

.rail-card {
  margin-bottom: 14px;
  padding: 16px;
}

.rail-card h2,
.card h2,
.card h3 {
  margin: 0 0 10px;
  letter-spacing: 0;
}

.rail-card h2 {
  font-size: 14px;
}

.rail-card p,
.card p {
  margin: 0;
  color: var(--muted);
}

.participant-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.participant-id,
.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.pill.good {
  border-color: rgba(38, 112, 90, 0.25);
  background: var(--green-soft);
  color: var(--green);
}

.pill.warn {
  border-color: rgba(138, 95, 18, 0.25);
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.info {
  border-color: rgba(36, 93, 122, 0.25);
  background: var(--blue-soft);
  color: var(--blue);
}

.button {
  min-height: 40px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 750;
}

.button.secondary {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 13px;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 14px;
}

.checkbox-row input {
  margin-top: 3px;
}

.stack {
  display: grid;
  gap: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-item,
.finding,
.section-card,
.evidence-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
  padding: 12px;
}

.summary-item dt,
.state-list dt {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.summary-item dd,
.state-list dd {
  margin: 2px 0 0;
}

.state-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.check-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
}

.check-list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
}

.check-list li::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 99px;
  background: var(--green);
}

.warning-list li::before {
  background: var(--amber);
}

.section-card h3,
.finding h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.section-card p,
.finding p {
  margin: 0;
  color: var(--muted);
}

.code-box,
.export-box {
  width: 100%;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111820;
  color: #edf3f7;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.export-box {
  min-height: 380px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  transform: translateY(18px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  padding: 12px 14px;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .right-rail {
    display: none;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .left-rail {
    border-width: 0 0 1px;
  }

  .step-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .screen-grid,
  .form-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .screen-panel,
  .topbar,
  .progress-strip {
    padding-left: 16px;
    padding-right: 16px;
  }
}
