:root {
  --brand-black: #000000;
  --brand-white: #fafaff;
  --brand-gold: #c19232;
  --brand-ink: #1d1f29;
  --brand-soft: #f8f4f2;
  --text-main: #171717;
  --text-muted: #5b5b5b;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --border: rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.12);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.08);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --layout-max: 1320px;
  --layout-gutter: clamp(1rem, 3.2vw, 2.6rem);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text-main);
  font-family: "Mulish", "Segoe UI", sans-serif;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 10%, rgba(193, 146, 50, 0.22), transparent 32%),
    radial-gradient(circle at 88% 22%, rgba(29, 31, 41, 0.14), transparent 24%),
    linear-gradient(140deg, #ffffff 0%, var(--brand-soft) 50%, #ffffff 100%);
}

/* ── Auth gate ── */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #0e0e10);
  transition: opacity .4s ease;
}
.auth-gate[hidden] { display: none; }
.auth-card {
  max-width: 380px;
  width: 90%;
  text-align: center;
  padding: 3rem 2rem;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.auth-card h1 {
  font-family: var(--ff-display, 'Cormorant Garamond', serif);
  font-size: 1.8rem;
  letter-spacing: .04em;
  margin: 0 0 .25rem;
  color: var(--gold, #c9a96e);
}
.auth-card > p {
  font-size: .9rem;
  color: var(--muted, rgba(255,255,255,.5));
  margin: 0 0 2rem;
}
.auth-card form { display: flex; flex-direction: column; gap: .75rem; }
.auth-card label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted, rgba(255,255,255,.5));
}
.auth-card input[type="password"] {
  padding: .75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 1rem;
  text-align: center;
  letter-spacing: .15em;
  outline: none;
  transition: border-color .2s;
}
.auth-card input[type="password"]:focus {
  border-color: var(--gold, #c9a96e);
}
.auth-error {
  color: #e74c3c;
  font-size: .85rem;
  margin: .25rem 0 0;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(55px);
  pointer-events: none;
}

.ambient-a {
  width: 420px;
  height: 420px;
  top: -140px;
  right: -90px;
  background: rgba(193, 146, 50, 0.24);
}

.ambient-b {
  width: 380px;
  height: 380px;
  bottom: -180px;
  left: -130px;
  background: rgba(29, 31, 41, 0.12);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  width: min(var(--layout-max), calc(100% - (var(--layout-gutter) * 2)));
  margin: 0 auto;
  padding: 2.2rem 0 1.2rem;
}

.brand-block h1 {
  margin: 0.25rem 0 0.4rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.8rem, 2.8vw, 2.65rem);
  line-height: 1;
  letter-spacing: 0.01em;
}

.brand-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--brand-gold);
  font-weight: 700;
}

.brand-subtitle {
  margin: 0;
  color: var(--text-muted);
  max-width: 42ch;
}

.header-meta {
  text-align: right;
  color: var(--brand-ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  max-width: 28ch;
}

.header-meta p {
  margin: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 1rem;
  width: min(var(--layout-max), calc(100% - (var(--layout-gutter) * 2)));
  margin: 0 auto;
  padding: 0 0 2rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px);
}

.config-panel,
.summary-panel {
  min-width: 0;
}

.progress-wrap {
  --progress-ratio: 0;
  --meter-inset: 0.78rem;
  margin-bottom: 0.95rem;
  padding: 0.72rem;
  border: 1px solid rgba(193, 146, 50, 0.25);
  border-radius: calc(var(--radius-lg) + 2px);
  background:
    radial-gradient(circle at top right, rgba(193, 146, 50, 0.15), transparent 56%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 242, 0.96));
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  position: relative;
  overflow: hidden;
}

.progress-wrap::before {
  content: "";
  position: absolute;
  left: var(--meter-inset);
  right: var(--meter-inset);
  top: 0.56rem;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.1);
}

.progress-wrap::after {
  content: "";
  position: absolute;
  left: var(--meter-inset);
  top: 0.56rem;
  height: 4px;
  width: calc((100% - (var(--meter-inset) * 2)) * var(--progress-ratio));
  border-radius: 999px;
  background: linear-gradient(90deg, #a67b2e, #d7b06a 60%, #f1d39c);
  box-shadow: 0 0 0 1px rgba(193, 146, 50, 0.2), 0 3px 8px rgba(193, 146, 50, 0.25);
  transition: width 340ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.progress-wrap.is-animating::after {
  animation: progressFillPulse 420ms ease;
}

@keyframes progressFillPulse {
  0% {
    filter: saturate(1);
  }
  40% {
    filter: saturate(1.25) brightness(1.08);
  }
  100% {
    filter: saturate(1);
  }
}

.progress-list {
  margin: 0;
  padding: 0.56rem 0.1rem 0.1rem;
  list-style: none;
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 1;
}

.progress-item {
  flex: 0 0 auto;
  width: min(230px, 58vw);
  position: relative;
}

.progress-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -0.42rem;
  width: 0.28rem;
  height: 2px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.14);
  transform: translateY(-50%);
}

.progress-button {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(0, 0, 0, 0.11);
  border-radius: 13px;
  background: #fff;
  color: inherit;
  text-align: left;
  padding: 0.5rem 0.58rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.52rem;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.progress-button:hover:not(.is-locked) {
  transform: translateY(-1px);
  border-color: rgba(193, 146, 50, 0.64);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
}

.progress-button.is-current {
  border-color: rgba(193, 146, 50, 0.9);
  background: linear-gradient(130deg, rgba(193, 146, 50, 0.2), rgba(255, 255, 255, 1));
  box-shadow: 0 12px 20px rgba(193, 146, 50, 0.2);
  transform: translateY(-1px);
}

.progress-button.is-visited {
  border-color: rgba(193, 146, 50, 0.48);
}

.progress-button.is-locked {
  opacity: 0.58;
  cursor: not-allowed;
}

.progress-index {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(245, 245, 245, 0.9);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #1f1f1f;
  flex: 0 0 auto;
}

.progress-button.is-current .progress-index {
  border-color: rgba(193, 146, 50, 0.85);
  background: var(--brand-gold);
  color: #121212;
}

.progress-button.is-visited .progress-index {
  border-color: rgba(193, 146, 50, 0.7);
  background: rgba(193, 146, 50, 0.2);
}

.progress-copy {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.progress-stage {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.progress-section {
  display: -webkit-box;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.2;
  max-height: 2.4em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow: hidden;
  text-overflow: unset;
}

.config-panel {
  padding: 1.2rem;
}

.stage-head {
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
}

.stage-tag {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-gold);
}

.stage-head h2 {
  margin: 0.18rem 0 0.3rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.5rem, 2.2vw, 2.15rem);
  line-height: 1.08;
}

.stage-head p {
  margin: 0;
  color: var(--text-muted);
  max-width: 72ch;
}

.section-container {
  display: grid;
  gap: 0.95rem;
  justify-items: center;
}

.section-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  width: min(100%, 980px);
}

.step-enter {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.2, 0.75, 0.2, 1);
  animation-fill-mode: both;
}

.step-enter-forward {
  animation-name: stepSlideInForward;
}

.step-enter-backward {
  animation-name: stepSlideInBackward;
}

@keyframes stepSlideInForward {
  from {
    opacity: 0;
    transform: translate3d(28px, 0, 0) scale(0.992);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes stepSlideInBackward {
  from {
    opacity: 0;
    transform: translate3d(-28px, 0, 0) scale(0.992);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

.section-card > header {
  padding: 0.95rem 1rem 0.7rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
  background:
    linear-gradient(120deg, rgba(193, 146, 50, 0.1), rgba(255, 255, 255, 0.92)),
    #fff;
}

.section-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.section-description {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.section-standards {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  display: inline-block;
  text-align: left;
}

.scope-showcase {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.7rem;
  max-width: 840px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.scope-visual {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.95), rgba(248, 244, 242, 0.95));
  padding: 0.35rem;
}

.scope-visual svg {
  width: 100%;
  height: auto;
  display: block;
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.scope-card {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0.6rem;
}

.scope-card h4 {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-ink);
}

.scope-item {
  margin: 0.32rem 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 7px;
  background: rgba(248, 244, 242, 0.55);
  font-size: 0.84rem;
  color: #2b2b2b;
}

.scope-card-exclusion {
  border-color: rgba(142, 53, 40, 0.35);
  background: rgba(255, 246, 243, 0.8);
}

.scope-card-exclusion h4 {
  color: #7a2d2d;
}

.section-controls {
  padding: 0.95rem 1rem 1rem;
  display: grid;
  gap: 0.92rem;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

.section-generated-sketch {
  margin: 0.65rem auto 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 242, 0.9));
  padding: 0.3rem;
  width: min(100%, 620px);
}

.section-generated-sketch img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: calc(var(--radius-md) - 3px);
}

.section-figure-notes {
  margin: 0.55rem 0.45rem 0.15rem;
  text-align: left;
}

.section-figure-notes p {
  margin: 0.28rem 0;
  font-size: 0.82rem;
  color: #3a3a3a;
}

.section-sketch {
  margin: 0.65rem auto 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 242, 0.9));
  padding: 0.38rem;
  width: min(100%, 620px);
}

.section-sketch svg {
  width: 100%;
  height: auto;
  display: block;
}

.section-mini-sketch {
  margin: 0.65rem auto 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 242, 0.9));
  padding: 0.3rem;
  width: min(100%, 620px);
}

.section-mini-sketch svg {
  width: 100%;
  height: auto;
  display: block;
}

.section-sketch svg text,
.section-mini-sketch svg text,
.scope-visual svg text {
  paint-order: stroke fill;
  stroke: rgba(251, 250, 247, 0.96);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.field {
  display: grid;
  gap: 0.42rem;
}

.field > label,
.field .field-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.field .field-help {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.52rem 0.62rem;
  font: inherit;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(193, 146, 50, 0.35);
  border-color: rgba(193, 146, 50, 0.65);
}

.money-input {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.money-symbol {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  font-weight: 700;
  background: rgba(193, 146, 50, 0.14);
  border-right: 1px solid rgba(0, 0, 0, 0.15);
  color: #222;
}

.money-input input {
  border: 0;
  border-radius: 0;
}

.money-input input:focus {
  outline: 0;
}

.money-input:focus-within {
  outline: 2px solid rgba(193, 146, 50, 0.35);
  border-color: rgba(193, 146, 50, 0.65);
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--brand-gold);
}

.choice-list {
  display: grid;
  gap: 0.4rem;
}

.choice-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.52rem 0.6rem;
  background: #fff;
}

.choice-item-selectable {
  cursor: pointer;
}

.choice-item-selectable:hover {
  border-color: rgba(193, 146, 50, 0.65);
}

.choice-item-selectable.is-active {
  border-color: rgba(193, 146, 50, 0.82);
  box-shadow: inset 0 0 0 1px rgba(193, 146, 50, 0.22);
}

.choice-content {
  flex: 1;
}

.choice-item input[type="radio"],
.choice-item input[type="checkbox"] {
  margin-top: 0.2rem;
}

.choice-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.65rem;
}

.choice-note {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.price-chip {
  font-size: 0.76rem;
  padding: 0.2rem 0.42rem;
  border-radius: 999px;
  color: #fff;
  background: var(--brand-ink);
  white-space: nowrap;
}

.price-chip.included {
  background: rgba(0, 0, 0, 0.16);
  color: #191919;
}

.swatch-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 0.5rem;
}

.swatch-option {
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-sm);
  min-height: 64px;
  padding: 0.5rem 0.55rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.swatch-option:hover {
  transform: translateY(-1px);
  border-color: rgba(193, 146, 50, 0.8);
}

.swatch-option.is-active {
  border-color: rgba(193, 146, 50, 0.95);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42);
}

.swatch-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.swatch-price {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.16rem 0.4rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.section-comment-field textarea {
  min-height: 86px;
}

.split-input {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 0.6rem;
}

.triple-input {
  display: grid;
  grid-template-columns: 1fr 120px 120px;
  gap: 0.52rem;
}

.calc-preview {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pill-note {
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-muted);
  font-size: 0.84rem;
}

.dynamic-rows {
  display: grid;
  gap: 0.48rem;
}

.door-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 0.56rem;
  overflow-x: auto;
  padding-bottom: 0.24rem;
}

.door-option {
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0.38rem;
  display: grid;
  gap: 0.4rem;
  cursor: pointer;
  text-align: left;
}

.door-option:hover {
  border-color: rgba(193, 146, 50, 0.74);
}

.door-option.is-active {
  border-color: rgba(193, 146, 50, 0.92);
  box-shadow: inset 0 0 0 1px rgba(193, 146, 50, 0.24);
}

.door-option img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: #f8f8f8;
}

.door-option-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #222;
  text-align: center;
}

.dynamic-row {
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 0.48rem;
}

.row-remove {
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: #fff;
  color: #7a2d2d;
  border-radius: var(--radius-sm);
  padding: 0 0.62rem;
  cursor: pointer;
}

.row-remove:hover {
  border-color: #7a2d2d;
}

.panel-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.panel-actions .btn {
  min-height: 44px;
}

.panel-actions.review-actions {
  justify-content: flex-start;
}

.review-step {
  margin-top: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-sm);
  padding: 0.95rem;
  display: grid;
  gap: 0.8rem;
}

.review-step[hidden] {
  display: none !important;
}

.review-callout h3 {
  margin: 0;
  font-size: 1.12rem;
  font-family: "Cormorant Garamond", Georgia, serif;
}

.review-callout p {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.review-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.review-meta p {
  margin: 0;
  padding: 0.56rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  background: #fff;
  display: grid;
  gap: 0.3rem;
}

.review-meta span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.review-meta strong {
  font-size: 1.02rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.62rem 0.95rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease, border-color 0.16s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand-black);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  border-color: rgba(0, 0, 0, 0.2);
  background: #fff;
  color: #161616;
}

.btn-ghost:hover {
  border-color: rgba(193, 146, 50, 0.8);
}

.btn-danger {
  border-color: rgba(142, 53, 40, 0.35);
  color: #7a2d2d;
}

.btn-danger:hover {
  border-color: rgba(142, 53, 40, 0.7);
  background: rgba(255, 246, 243, 0.82);
}

.summary-panel {
  padding: 1rem;
  position: sticky;
  top: 1rem;
  height: fit-content;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.summary-header h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
}

.summary-header p {
  margin: 0.28rem 0 0.8rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.field-row {
  margin-bottom: 0.8rem;
}

.field-row label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.discount-input-group {
  display: flex;
  gap: 0.4rem;
}

.discount-input-group select {
  flex: 0 0 5.2rem;
  padding: 0.42rem 0.4rem;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  background: #fff;
}

.discount-input-group input {
  flex: 1 1 auto;
  min-width: 0;
}

.discount-display {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.discount-summary-block {
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0.52rem;
}

.meta-value.discount {
  color: #b5451b;
}

.summary-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.72rem;
}

.summary-meta > div:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.summary-meta > div {
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0.52rem;
}

.meta-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.meta-value {
  margin: 0.3rem 0 0;
  font-weight: 700;
}

.meta-value.grand {
  color: var(--brand-ink);
}

.summary-items {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.summary-stage {
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: var(--radius-sm);
  background: #fff;
}

.summary-stage header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0.58rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.summary-stage h4 {
  margin: 0;
  font-size: 0.91rem;
}

.summary-stage-total {
  margin: 0;
  font-size: 0.84rem;
  color: var(--brand-ink);
}

.summary-lines {
  margin: 0;
  padding: 0.5rem 0.58rem;
  list-style: none;
  display: grid;
  gap: 0.38rem;
}

.summary-lines li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.42rem;
  font-size: 0.84rem;
}

.summary-lines .line-label {
  color: #222;
  min-width: 0;
  overflow-wrap: anywhere;
}

.summary-lines .line-value {
  font-weight: 700;
}

.summary-lines .credit {
  color: #0f6f0f;
}

.summary-empty {
  margin: 0;
  font-size: 0.87rem;
  color: var(--text-muted);
}

.summary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.summary-actions .btn {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 44px;
}

.action-status {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.83rem;
  color: #1c5f1c;
}

.lead-form {
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
  display: grid;
  gap: 0.46rem;
}

.lead-form h3 {
  margin: 0;
  font-size: 1.02rem;
}

.lead-form p {
  margin: 0 0 0.35rem;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.lead-form label {
  font-size: 0.83rem;
  font-weight: 700;
}

.lead-status {
  margin: 0.2rem 0 0;
  font-size: 0.83rem;
  color: #1c5f1c;
}

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

@media (max-width: 1040px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .header-meta {
    text-align: left;
    max-width: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .progress-wrap {
    padding: 0.5rem;
  }

  .progress-list {
    padding-bottom: 0.2rem;
  }

  .progress-item {
    width: min(200px, 70vw);
  }

  .summary-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 720px) {
  :root {
    --layout-gutter: 1rem;
  }

  .site-header {
    padding: 1.4rem 0 0.9rem;
  }

  .app-shell {
    padding: 0 0 1.1rem;
    gap: 0.75rem;
  }

  .section-card > header,
  .section-controls {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  .review-step {
    padding: 0.8rem;
  }

  .split-input,
  .dynamic-row {
    grid-template-columns: 1fr;
  }

  .triple-input {
    grid-template-columns: 1fr;
  }

  .summary-actions {
    grid-template-columns: 1fr;
  }

  .scope-grid {
    grid-template-columns: 1fr;
  }

  .review-meta {
    grid-template-columns: 1fr;
  }

  .panel-actions {
    flex-direction: column;
  }

  .panel-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .step-enter {
    animation: none !important;
  }

  .progress-wrap::after {
    transition: none !important;
    animation: none !important;
  }

  .progress-button,
  .btn {
    transition: none !important;
  }
}
