:root {
  --rp-bg: #f5f3ef;
  --rp-surface: #fffdf8;
  --rp-surface-strong: #ffffff;
  --rp-ink: #17201c;
  --rp-muted: #64706a;
  --rp-line: #d9ded6;
  --rp-primary: #1d5f43;
  --rp-primary-dark: #123d2b;
  --rp-accent: #b65432;
  --rp-accent-soft: #f2ddd4;
  --rp-warning: #8a5a10;
  --rp-warning-bg: #fff3cf;
  --rp-danger: #9c2f2f;
  --rp-danger-bg: #ffe1df;
  --rp-ok: #1b6b48;
  --rp-ok-bg: #ddf3e8;
  --shadow: 0 16px 40px rgba(25, 35, 30, 0.08);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--rp-bg);
}

body {
  margin: 0;
  color: var(--rp-ink);
  background:
    linear-gradient(180deg, rgba(29, 95, 67, 0.08), transparent 260px),
    var(--rp-bg);
}

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

button {
  cursor: pointer;
}

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

.side-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  border-right: 1px solid var(--rp-line);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  color: #fff;
  background: var(--rp-primary);
  font-weight: 900;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--rp-accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.28rem;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.12;
}

h3 {
  margin-bottom: 10px;
  font-size: clamp(1.55rem, 2.4vw, 2.4rem);
  line-height: 1.05;
}

h4 {
  margin-bottom: 4px;
  font-size: 1.05rem;
}

p {
  color: var(--rp-muted);
  line-height: 1.55;
}

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

.step-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--rp-muted);
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.step-link span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--rp-primary);
  background: rgba(29, 95, 67, 0.1);
  font-size: 0.84rem;
}

.step-link.is-active,
.step-link:hover {
  color: var(--rp-primary-dark);
  border-color: rgba(29, 95, 67, 0.18);
  background: rgba(29, 95, 67, 0.08);
}

.pricing-summary {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  background: var(--rp-surface-strong);
  box-shadow: var(--shadow);
}

.summary-head,
.summary-row,
.capacity-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.summary-head strong {
  color: var(--rp-primary);
  font-size: 1.75rem;
  line-height: 1;
}

.summary-row {
  color: var(--rp-muted);
  font-size: 0.94rem;
}

.summary-row strong {
  color: var(--rp-ink);
}

.capacity-box {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--rp-line);
}

.capacity-label {
  font-size: 0.88rem;
  font-weight: 800;
}

.meter {
  overflow: hidden;
  height: 9px;
  border-radius: 99px;
  background: #edf0eb;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--rp-primary);
  transition: width 160ms ease, background-color 160ms ease;
}

.capacity-box p {
  margin: 0;
  font-size: 0.82rem;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
}

.topbar,
.workspace-footer {
  position: sticky;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid var(--rp-line);
  background: rgba(245, 243, 239, 0.9);
  backdrop-filter: blur(16px);
}

.topbar {
  top: 0;
}

.topbar-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.workspace-footer {
  bottom: 0;
  border-top: 1px solid var(--rp-line);
  border-bottom: 0;
}

.workspace-footer #status-message {
  color: var(--rp-muted);
  font-weight: 700;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 900;
  white-space: nowrap;
}

.primary-button {
  color: #fff;
  background: var(--rp-accent);
}

.primary-button:hover {
  background: #934326;
}

.ghost-button {
  color: var(--rp-primary);
  border-color: rgba(29, 95, 67, 0.34);
  background: var(--rp-surface-strong);
}

.ghost-button:hover {
  border-color: var(--rp-primary);
}

.step-panel {
  display: none;
  padding: clamp(22px, 4vw, 42px);
}

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

.section-intro {
  max-width: 840px;
  margin-bottom: 24px;
}

.section-intro p:last-child {
  margin-bottom: 0;
  font-size: 1.02rem;
}

.form-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wide {
  grid-column: 1 / -1;
}

label,
.field-label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--rp-ink);
  font-size: 0.91rem;
  font-weight: 850;
}

.stacked {
  margin-top: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  color: var(--rp-ink);
  background: var(--rp-surface-strong);
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: auto;
  accent-color: var(--rp-primary);
}

input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
}

input[type="file"] {
  padding: 10px;
  min-height: 48px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(29, 95, 67, 0.22);
  outline-offset: 2px;
}

.panel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel,
.package-section {
  padding: 20px;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  background: var(--rp-surface);
}

.panel-heading,
.package-heading {
  margin-bottom: 16px;
}

.panel-heading p,
.package-heading p {
  margin-bottom: 0;
  font-size: 0.93rem;
}

.check-list {
  display: grid;
  gap: 10px;
}

.check-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 750;
  line-height: 1.35;
}

.check-list.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mini-preview {
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  background: #fff;
}

.mini-preview-nav {
  display: flex;
  gap: 18px;
  padding: 12px 14px;
  color: var(--preview-primary, var(--rp-primary));
  border-bottom: 1px solid var(--rp-line);
  font-weight: 900;
}

.mini-preview-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.mini-preview-body strong {
  font-size: 1.12rem;
}

.mini-preview-body p {
  margin-bottom: 0;
}

.mini-preview-body button {
  justify-self: start;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--preview-accent, var(--rp-accent));
  font-weight: 900;
}

.package-section {
  margin-bottom: 18px;
}

.package-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.package-heading .eyebrow {
  margin-bottom: 6px;
}

.heading-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(29, 95, 67, 0.26);
  border-radius: 8px;
  color: var(--rp-primary);
  background: var(--rp-surface-strong);
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.heading-link:hover {
  border-color: var(--rp-primary);
}

.trajectory-preview {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 2px 0 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--rp-line);
  border-bottom: 1px solid var(--rp-line);
  background: rgba(29, 95, 67, 0.04);
}

.trajectory-preview-copy {
  display: grid;
  gap: 3px;
}

.trajectory-preview-copy strong {
  color: var(--rp-primary-dark);
  font-size: 0.98rem;
}

.trajectory-preview-copy span {
  color: var(--rp-muted);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
}

.trajectory-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trajectory-rail li {
  position: relative;
  display: grid;
  gap: 7px;
  justify-items: start;
  padding: 0 12px;
}

.trajectory-rail li::before {
  content: "";
  position: absolute;
  top: 13px;
  right: 0;
  left: 76px;
  height: 1px;
  background: rgba(29, 95, 67, 0.22);
}

.trajectory-rail li:last-child::before {
  display: none;
}

.trajectory-rail strong {
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 70px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--rp-primary);
  font-size: 0.8rem;
}

.trajectory-rail span {
  max-width: 128px;
  color: var(--rp-ink);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.25;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.option-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 208px;
  padding: 16px;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  background: var(--rp-surface-strong);
  text-align: left;
}

.option-card:hover {
  border-color: rgba(29, 95, 67, 0.42);
}

.option-card.is-selected {
  border-color: var(--rp-primary);
  box-shadow: inset 0 0 0 2px rgba(29, 95, 67, 0.14);
}

.option-card h5 {
  margin: 0;
  font-size: 1rem;
}

.option-card .price {
  color: var(--rp-primary);
  font-size: 1.45rem;
  font-weight: 950;
}

.option-card .price span {
  font-size: 0.82rem;
}

.package-volume,
.output-badge {
  justify-self: start;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--rp-primary-dark);
  background: rgba(29, 95, 67, 0.1);
  font-size: 0.78rem;
  font-weight: 950;
}

.option-card p {
  margin: 0;
  font-size: 0.9rem;
}

.option-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--rp-muted);
  font-size: 0.86rem;
}

.badge {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--rp-primary);
  background: rgba(29, 95, 67, 0.1);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.addon-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.addon-card,
.chip-button {
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  background: var(--rp-surface-strong);
}

.addon-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.addon-card label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
}

.addon-card strong {
  color: var(--rp-primary);
}

.addon-card.is-conditional {
  border-color: rgba(29, 95, 67, 0.28);
  background: rgba(29, 95, 67, 0.04);
}

.condition-note {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--rp-accent);
  background: var(--rp-accent-soft);
  font-size: 0.76rem;
  font-weight: 950;
}

.mix-list {
  display: grid;
  gap: 12px;
}

.mix-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  background: var(--rp-surface-strong);
}

.mix-row h5 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.mix-row p {
  margin: 0;
  font-size: 0.84rem;
}

.output-badge {
  white-space: nowrap;
}

.stepper {
  display: grid;
  grid-template-columns: 38px 48px 38px;
  align-items: center;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.stepper button {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--rp-primary);
  font-size: 1.1rem;
  font-weight: 950;
}

.stepper output {
  display: grid;
  place-items: center;
  height: 38px;
  border-left: 1px solid var(--rp-line);
  border-right: 1px solid var(--rp-line);
  font-weight: 950;
}

.insight-box,
.alert {
  padding: 14px;
  border-radius: 8px;
  line-height: 1.45;
}

.insight-box {
  margin-top: 16px;
  color: var(--rp-primary-dark);
  background: rgba(29, 95, 67, 0.08);
  font-weight: 750;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.timeline-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  background: var(--rp-surface-strong);
}

.timeline-card strong {
  color: var(--rp-primary);
}

.timeline-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--rp-muted);
  line-height: 1.4;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--rp-muted);
  font-weight: 850;
}

.chip-button.is-selected {
  color: var(--rp-primary-dark);
  border-color: var(--rp-primary);
  background: rgba(29, 95, 67, 0.09);
}

.proposal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.proposal-card {
  background: #fff;
}

.proposal-summary {
  display: grid;
  gap: 14px;
}

.price-table {
  display: grid;
  border: 1px solid var(--rp-line);
  border-radius: 8px;
  overflow: hidden;
}

.price-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rp-line);
}

.price-line:last-child {
  border-bottom: 0;
}

.price-line.total {
  color: #fff;
  background: var(--rp-primary);
  font-weight: 950;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--rp-primary-dark);
  background: rgba(29, 95, 67, 0.1);
  font-weight: 850;
  font-size: 0.86rem;
}

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

.readiness-item {
  padding: 12px;
  border-radius: 8px;
  background: var(--rp-ok-bg);
  color: var(--rp-ok);
  font-weight: 850;
}

.readiness-item.warn {
  color: var(--rp-warning);
  background: var(--rp-warning-bg);
}

.readiness-item.danger {
  color: var(--rp-danger);
  background: var(--rp-danger-bg);
}

#handoff-output {
  min-height: 520px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    height: auto;
  }

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

  .step-link {
    justify-content: center;
    font-size: 0.88rem;
  }

  .pricing-summary {
    margin-top: 0;
  }

  .option-grid,
  .addon-grid,
  .timeline,
  .proposal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .side-panel,
  .topbar,
  .workspace-footer,
  .step-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar,
  .workspace-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .button-row {
    width: 100%;
  }

  .primary-button,
  .ghost-button {
    flex: 1;
  }

  .step-nav {
    grid-template-columns: 1fr;
  }

  .step-link {
    justify-content: flex-start;
  }

  .form-grid.two,
  .form-grid.three,
  .panel-row,
  .package-heading,
  .trajectory-preview,
  .theme-controls,
  .check-list.compact,
  .readiness-grid {
    grid-template-columns: 1fr;
  }

  .package-heading {
    display: grid;
  }

  .trajectory-rail {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .trajectory-rail li {
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    padding: 0;
  }

  .trajectory-rail li::before {
    top: 28px;
    bottom: -10px;
    left: 35px;
    width: 1px;
    height: auto;
  }

  .trajectory-rail span {
    max-width: none;
  }

  .mini-preview-nav {
    flex-wrap: wrap;
  }

  .mix-row {
    grid-template-columns: 1fr;
  }

  .stepper {
    justify-self: start;
  }
}
