:root {
  color-scheme: light;
  --ink: #20242a;
  --muted: #64707d;
  --line: #d8dee5;
  --paper: #fbfbf8;
  --panel: #ffffff;
  --nav: #111820;
  --nav-soft: #263445;
  --green: #238267;
  --red: #b33a3a;
  --amber: #a76d16;
  --blue: #2b68a8;
  --shadow: 0 16px 40px rgba(20, 24, 31, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #ece8df;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

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

.app-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 28px 32px 24px;
  background: var(--nav);
  color: #fff;
}

.eyebrow {
  margin: 0 0 6px;
  color: #6f8b79;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-header .eyebrow { color: #9bd7bf; }

h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: 0; }

h1 { font-size: clamp(2rem, 5vw, 4.4rem); }

h2 { font-size: 1.55rem; }

h3 { font-size: 1rem; }

.promise {
  max-width: 780px;
  margin: 10px 0 0;
  color: #d7e4dc;
  font-size: 1.05rem;
}

.status-strip {
  min-width: 260px;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}

.status-strip span { color: #c8d3dc; font-size: 0.9rem; }
.status-strip strong { font-size: 1rem; }

.workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 330px;
  min-height: calc(100vh - 166px);
}

.rail-nav {
  position: sticky;
  top: 0;
  height: calc(100vh - 72px);
  overflow: auto;
  padding: 18px;
  background: #f6f3ec;
  border-right: 1px solid var(--line);
}

.nav-step {
  width: 100%;
  min-height: 42px;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid #cbd3db;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.nav-step.is-active {
  border-color: var(--green);
  background: #e8f5ef;
  box-shadow: inset 4px 0 0 var(--green);
}

.editor-pane {
  padding: 28px;
  min-width: 0;
}

.step-panel {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.step-panel.is-active { display: block; }

.step-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}


.subhead {
  margin: 20px 0 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #2f3a45;
}

label, fieldset {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #394350;
  font-weight: 700;
}

legend { font-weight: 800; }

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

textarea { min-height: 92px; resize: vertical; }

input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 3px solid rgba(43, 104, 168, 0.24);
  border-color: var(--blue);
}

.field-grid, .folder-grid {
  display: grid;
  gap: 14px;
}

.field-grid.two, .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.test-table {
  display: grid;
  gap: 10px;
}

.test-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 190px minmax(160px, 1.4fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfcfa;
}

.test-row span { font-weight: 800; }

.release-options {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.release-options label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.release-options input { width: auto; }

.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

button {
  border: 1px solid #9ca8b4;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

button:hover { border-color: var(--blue); color: var(--blue); }

#build-receipt, #sample-data {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.receipt-output {
  min-height: 430px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.5;
}

.proof-pane {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 28px 22px;
  background: #fff;
  border-left: 1px solid var(--line);
}

.proof-pane section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.proof-pane p { color: var(--muted); }

.loop-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.loop-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f4f6f8;
  color: var(--muted);
  font-size: 0.9rem;
}

.loop-list li.touched { color: var(--green); background: #e9f5ef; }

.wall-line {
  padding: 12px;
  border-left: 4px solid var(--amber);
  background: #fff7e7;
  color: #503912 !important;
  font-weight: 800;
}

.app-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #faf9f5;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 210px minmax(0, 1fr); }
  .proof-pane { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 780px) {
  .app-header { grid-template-columns: 1fr; padding: 22px 18px; }
  .status-strip { min-width: 0; }
  .workspace { display: block; }
  .rail-nav {
    position: static;
    height: auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-step { min-width: 145px; }
  .editor-pane, .proof-pane { padding: 18px; }
  .field-grid.two, .folder-grid, .test-row { grid-template-columns: 1fr; }
  .app-footer { align-items: stretch; flex-direction: column; }
}


.home-panel .lead {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.12rem;
}

.primary-start {
  margin: 8px 0 14px;
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.small-proof {
  color: var(--muted);
  font-size: 0.92rem;
}

.receipt-status {
  margin: 0;
  color: #5f6470;
  font-size: 0.92rem;
}

.download-link {
  align-self: center;
  color: #143f8f;
  font-weight: 700;
  text-decoration: underline;
}

.is-hidden {
  display: none;
}
