:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --text: #16212a;
  --muted: #66727c;
  --line: #dfe5e8;
  --accent: #1f6f5c;
  --accent-soft: #e9f4f1;
  --warning-soft: #fff5df;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(22, 33, 42, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { overflow: hidden; }
button, input, select, textarea { font: inherit; }

.app-shell {
  height: 100vh;
  min-height: 620px;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand-block { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand-kicker { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.project-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.save-dot { width: 8px; height: 8px; border-radius: 50%; background: #c9a044; }

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 230px minmax(480px, 1fr) 280px;
  gap: 16px;
  padding: 16px;
}

.step-nav, .summary-panel, .main-panel {
  min-height: 0;
}

.step-nav {
  overflow: auto;
  padding-right: 4px;
}

.progress-card, .summary-card, .form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.progress-card { padding: 14px; margin-bottom: 12px; }
.progress-copy { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.progress-copy strong { color: var(--text); }
.progress-track { height: 6px; border-radius: 999px; overflow: hidden; background: #edf1f3; margin-top: 10px; }
.progress-track span { display: block; height: 100%; width: 11%; background: var(--accent); transition: width .2s ease; }

#stepNav { display: grid; gap: 6px; }
.step-link {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  color: var(--muted);
  cursor: pointer;
}
.step-link:hover { background: rgba(255,255,255,.65); color: var(--text); }
.step-link.active { background: var(--surface); color: var(--text); box-shadow: 0 3px 12px rgba(22,33,42,.06); }
.step-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #e9edef; font-size: 12px; font-weight: 700; }
.step-link.active .step-index { background: var(--accent); color: #fff; }
.step-name { font-size: 13px; font-weight: 650; line-height: 1.2; }
.step-state { font-size: 11px; }

.main-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 64px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.content-scroll { min-height: 0; overflow: auto; padding: 24px; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 18px; }
.section-heading h1 { margin: 3px 0 6px; font-size: clamp(24px, 3vw, 34px); line-height: 1.1; }
.section-heading p { margin: 0; color: var(--muted); max-width: 680px; }
.eyebrow { font-size: 11px; color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.completion-pill { flex: 0 0 auto; background: var(--warning-soft); border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 700; }
.form-stack { display: grid; gap: 14px; }
.form-card { padding: 18px; box-shadow: none; }
.form-card h2 { font-size: 16px; margin: 0 0 4px; }
.form-card > p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 6px; grid-column: span 6; }
.field.small { grid-column: span 3; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 700; }
.field .hint { font-size: 11px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid #ccd5da;
  border-radius: 9px;
  padding: 10px 11px;
  color: var(--text);
  background: #fff;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 88px; resize: vertical; }
.money-wrap { position: relative; }
.money-wrap input { padding-right: 34px; }
.money-wrap span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }

.action-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.action-hint { color: var(--muted); font-size: 12px; text-align: center; }
.button { min-height: 40px; border-radius: 9px; border: 1px solid transparent; padding: 0 14px; cursor: pointer; font-weight: 750; }
.button.ghost { background: #fff; border-color: var(--line); color: var(--text); }
.button.primary { background: var(--accent); color: #fff; }
.button:disabled { opacity: .45; cursor: default; }

.summary-panel { display: grid; align-content: start; gap: 12px; overflow: auto; }
.summary-card { padding: 16px; box-shadow: none; }
.summary-card h2 { margin: 4px 0 12px; font-size: 18px; }
.summary-list { display: grid; gap: 10px; }
.summary-item { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid #edf0f2; font-size: 12px; }
.summary-item span { color: var(--muted); }
.summary-item strong { text-align: right; }
.help-card { background: var(--accent-soft); border-color: transparent; }
.help-card p { margin: 8px 0 0; color: #3e6259; font-size: 12px; line-height: 1.5; }

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 200px minmax(0, 1fr); }
  .summary-panel { display: none; }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .app-shell { min-height: 100vh; height: auto; display: block; }
  .topbar { min-height: 58px; padding: 10px 14px; position: sticky; top: 0; z-index: 20; }
  .brand-block { display: grid; gap: 2px; }
  .brand-kicker { font-size: 10px; }
  .save-status { font-size: 11px; }
  .workspace { display: block; padding: 10px; }
  .step-nav { overflow: visible; padding: 0; }
  .progress-card { margin-bottom: 8px; }
  #stepNav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
  #stepNav::-webkit-scrollbar { display: none; }
  .step-link { min-width: max-content; grid-template-columns: 26px auto; padding: 7px 9px; background: #fff; border: 1px solid var(--line); }
  .step-state { display: none; }
  .step-index { width: 26px; height: 26px; }
  .main-panel { display: block; overflow: visible; }
  .content-scroll { overflow: visible; padding: 16px; }
  .section-heading { display: grid; gap: 10px; }
  .completion-pill { justify-self: start; }
  .field, .field.small { grid-column: 1 / -1; }
  .action-bar { position: sticky; bottom: 0; grid-template-columns: auto 1fr; z-index: 15; }
  .action-hint { display: none; }
  .button.primary { justify-self: stretch; }
}
