/* ==========================================================================
   Project Builder — layered on design-system.css
   ========================================================================== */

.pb-shell { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 5rem); }

/* ---------- Stepper ---------- */
.pb-steps {
  display: flex;
  align-items: center;
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 2.25rem;
  flex-wrap: wrap;
}

.pb-step {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  font-weight: 700;
  color: var(--ehs-ink-faint);
}

.pb-step-dot {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border-radius: var(--ehs-radius-pill);
  border: 1.5px solid var(--ehs-line);
  background: var(--ehs-cream);
  font-size: .8125rem;
}

.pb-step.is-active { color: var(--ehs-ink); }
.pb-step.is-active .pb-step-dot {
  border-color: var(--ehs-teal-deep);
  background: var(--ehs-teal-deep);
  color: #fff;
}

.pb-step.is-done { color: var(--ehs-ink-soft); }
.pb-step.is-done .pb-step-dot {
  border-color: var(--ehs-teal-deep);
  color: var(--ehs-teal-deep);
  background: var(--ehs-teal-wash);
}

.pb-step-sep { flex: 1 1 1.5rem; height: 1px; background: var(--ehs-line); min-width: 1rem; }

/* ---------- Category grid ---------- */
.pb-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}

.pb-cat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  text-align: left;
  padding: 1.4rem;
  background: var(--ehs-cream);
  border: 1.5px solid var(--ehs-line);
  border-radius: var(--ehs-radius-lg);
  cursor: pointer;
  transition: transform .18s var(--ehs-ease), border-color .18s var(--ehs-ease),
              box-shadow .18s var(--ehs-ease);
}

.pb-cat:hover { transform: translateY(-3px); box-shadow: var(--ehs-shadow); }

.pb-cat.is-selected {
  border-color: var(--ehs-teal-deep);
  box-shadow: 0 0 0 3px var(--ehs-teal-wash);
}

.pb-cat-icon { color: var(--ehs-teal-deep); margin-bottom: .5rem; }
.pb-cat-name { font-family: var(--ehs-display); font-size: 1.1875rem; font-weight: 600; }
.pb-cat-blurb { font-size: .9375rem; color: var(--ehs-ink-soft); margin: 0; }

.pb-cat-count {
  position: absolute;
  top: .85rem;
  right: .85rem;
  min-width: 1.6rem;
  height: 1.6rem;
  display: none;
  place-items: center;
  padding: 0 .45rem;
  border-radius: var(--ehs-radius-pill);
  background: var(--ehs-teal-deep);
  color: #fff;
  font-size: .8125rem;
  font-weight: 700;
}
.pb-cat.has-items .pb-cat-count { display: grid; }

.pb-badge {
  position: absolute;
  top: -.6rem;
  left: 1.1rem;
  padding: .2rem .6rem;
  border-radius: var(--ehs-radius-pill);
  background: var(--ehs-clay);
  color: #fff;
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- Item rows ---------- */
.pb-item {
  border: 1.5px solid var(--ehs-line);
  border-radius: var(--ehs-radius);
  background: var(--ehs-cream);
  padding: 1rem 1.15rem;
  margin-bottom: .75rem;
  transition: border-color .18s var(--ehs-ease), box-shadow .18s var(--ehs-ease);
}

.pb-item.is-on {
  border-color: var(--ehs-teal-deep);
  box-shadow: 0 0 0 3px var(--ehs-teal-wash);
}

.pb-item-head { display: flex; align-items: flex-start; gap: .8rem; cursor: pointer; }

.pb-check {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: .15rem;
  border-radius: 6px;
  border: 1.5px solid var(--ehs-ink-faint);
  display: grid;
  place-items: center;
  background: #fff;
  transition: background-color .16s var(--ehs-ease), border-color .16s var(--ehs-ease);
}
.pb-item.is-on .pb-check { background: var(--ehs-teal-deep); border-color: var(--ehs-teal-deep); }
.pb-check svg { opacity: 0; color: #fff; }
.pb-item.is-on .pb-check svg { opacity: 1; }

.pb-item-name { font-weight: 700; }
.pb-item-help { font-size: .875rem; color: var(--ehs-ink-soft); margin: .15rem 0 0; }

.pb-item-body { display: none; padding: .9rem 0 .2rem 2.2rem; }
.pb-item.is-on .pb-item-body { display: block; }

.pb-field { margin-bottom: .85rem; }
.pb-field label {
  display: block;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ehs-ink-soft);
  margin-bottom: .35rem;
}

.pb-input, .pb-select {
  width: 100%;
  max-width: 22rem;
  padding: .6rem .8rem;
  border: 1.5px solid var(--ehs-line);
  border-radius: var(--ehs-radius-sm);
  background: #fff;
  font-family: var(--ehs-body);
  font-size: 1rem;
  color: var(--ehs-ink);
}
.pb-input:focus, .pb-select:focus { outline: none; border-color: var(--ehs-teal-deep); }

.pb-stepper { display: flex; align-items: center; gap: .5rem; }
.pb-stepper button {
  width: 2.3rem; height: 2.3rem;
  border-radius: var(--ehs-radius-sm);
  border: 1.5px solid var(--ehs-line);
  background: #fff;
  font-size: 1.15rem; font-weight: 700; line-height: 1;
  color: var(--ehs-ink); cursor: pointer;
}
.pb-stepper button:hover { border-color: var(--ehs-teal-deep); color: var(--ehs-teal-deep); }
.pb-stepper .pb-input { width: 7rem; max-width: 7rem; text-align: center; }

.pb-range { width: 100%; max-width: 26rem; accent-color: var(--ehs-teal-deep); }

.pb-band {
  font-size: .875rem;
  color: var(--ehs-ink-soft);
  background: var(--ehs-sand);
  border-radius: var(--ehs-radius-sm);
  padding: .45rem .7rem;
  display: inline-block;
}
.pb-band strong { color: var(--ehs-ink); }

/* ---------- Measure / map ---------- */
.pb-measure {
  background: var(--ehs-cream);
  border: 1.5px solid var(--ehs-line);
  border-radius: var(--ehs-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.pb-map {
  width: 100%;
  height: 340px;
  border-radius: var(--ehs-radius);
  background: var(--ehs-sand-deep);
  border: 1px solid var(--ehs-line);
  display: grid;
  place-items: center;
  color: var(--ehs-ink-faint);
  font-size: .9375rem;
  overflow: hidden;
  margin-top: 1rem;
}

.pb-measure-result {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  background: var(--ehs-teal-wash);
  border-radius: var(--ehs-radius);
}
.pb-measure-result div span {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ehs-teal-deep);
}
.pb-measure-result div strong { font-family: var(--ehs-display); font-size: 1.5rem; }

.pb-note {
  font-size: .875rem;
  color: var(--ehs-ink-soft);
  background: var(--ehs-clay-wash);
  border-left: 3px solid var(--ehs-clay);
  border-radius: var(--ehs-radius-sm);
  padding: .7rem .9rem;
  margin-top: 1rem;
}

/* ---------- Summary rail ---------- */
.pb-summary {
  position: sticky;
  top: 5.5rem;
  background: var(--ehs-cream);
  border: 1.5px solid var(--ehs-line);
  border-radius: var(--ehs-radius-lg);
  padding: 1.35rem;
}

.pb-summary h3 { font-size: 1.15rem; margin-bottom: .25rem; }

.pb-summary-list { list-style: none; padding: 0; margin: 1rem 0; }
.pb-summary-list li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px dashed var(--ehs-line);
  font-size: .9375rem;
}
.pb-summary-list li:last-child { border-bottom: 0; }
.pb-summary-list .pb-sum-qty { color: var(--ehs-ink-soft); white-space: nowrap; }

.pb-summary-empty { color: var(--ehs-ink-faint); font-size: .9375rem; padding: 1rem 0; }

.pb-total {
  border-top: 2px solid var(--ehs-line);
  padding-top: .9rem;
  margin-top: .5rem;
}
.pb-total span {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ehs-ink-soft);
}
.pb-total strong { display: block; font-family: var(--ehs-display); font-size: 1.6rem; }
.pb-total small { color: var(--ehs-ink-faint); }

/* ---------- Panels ---------- */
.pb-panel { display: none; }
.pb-panel.is-active { display: block; animation: ehs-rise .45s var(--ehs-ease) both; }

.pb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ehs-line);
}

.pb-cat-section { margin-bottom: 2.25rem; }
.pb-cat-section h3 {
  font-size: 1.3rem;
  margin-bottom: .9rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--ehs-line);
}

@media (max-width: 991.98px) {
  .pb-summary { position: static; margin-top: 2rem; }
}
