:root {
  --purrch-bg: #f7f6f2;
  --purrch-card: #ffffff;
  --purrch-text: #111111;
  --purrch-muted: #66615b;
  --purrch-border: #e7e2da;
  --purrch-accent: #9a7652;
}

.purrch-brief,
.purrch-panel,
.purrch-configurator {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 20px;
  color: var(--purrch-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.purrch-card {
  background: var(--purrch-card);
  border: 1px solid var(--purrch-border);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 24px 70px rgba(17, 17, 17, 0.06);
}

.purrch-hero-card {
  margin-bottom: 28px;
}

.purrch-eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--purrch-accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.purrch-card h2,
.purrch-card h3 {
  margin: 0 0 14px;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.purrch-card h2 { font-size: clamp(40px, 8vw, 84px); }
.purrch-card h3 { font-size: clamp(28px, 5vw, 48px); }
.purrch-card p { color: var(--purrch-muted); font-size: 18px; line-height: 1.55; }

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

.purrch-full { grid-column: 1 / -1; }

.purrch-brief label,
.purrch-configurator label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

.purrch-brief input,
.purrch-brief select,
.purrch-brief textarea,
.purrch-configurator input,
.purrch-configurator select,
.purrch-configurator textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--purrch-border);
  border-radius: 18px;
  padding: 16px 18px;
  font: inherit;
  background: #fff;
}

.purrch-check {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
  color: var(--purrch-muted);
}

.purrch-check input {
  width: auto !important;
  margin-top: 5px;
}

.purrch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  border-radius: 999px;
  background: #111;
  color: #fff !important;
  text-decoration: none;
  font-weight: 900;
  border: 2px solid #111;
  cursor: pointer;
}

.purrch-button-secondary {
  background: #fff;
  color: #111 !important;
}

.purrch-orders-list {
  display: grid;
  gap: 20px;
}

.purrch-order-card {
  display: grid;
  gap: 24px;
}

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

.purrch-payment-grid div {
  border: 1px solid var(--purrch-border);
  border-radius: 20px;
  padding: 18px;
  background: #fbfaf7;
}

.purrch-payment-grid span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--purrch-muted);
  text-transform: uppercase;
}

.purrch-payment-grid strong {
  font-size: 24px;
  letter-spacing: -0.04em;
}

.purrch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.purrch-config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
}

.purrch-viewport {
  min-height: 560px;
  border: 1px solid var(--purrch-border);
  border-radius: 32px;
  background: linear-gradient(180deg, #fff, #f4f1ea);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.purrch-cube-preview {
  width: min(56vw, 380px);
  height: 420px;
  border-radius: 24px;
  border: 3px solid #111;
  background:
    linear-gradient(90deg, transparent 45%, #111 45% 49%, transparent 49%),
    linear-gradient(180deg, transparent 20%, #c8b292 20% 23%, transparent 23% 52%, #c8b292 52% 55%, transparent 55%);
  display: grid;
  place-items: end center;
  padding: 24px;
  text-align: center;
  color: var(--purrch-muted);
  font-weight: 800;
}

.purrch-config-fields {
  display: grid;
  gap: 12px;
}

@media (max-width: 760px) {
  .purrch-brief,
  .purrch-panel,
  .purrch-configurator {
    padding: 24px 14px;
  }

  .purrch-card {
    padding: 26px 20px;
    border-radius: 24px;
  }

  .purrch-grid,
  .purrch-payment-grid,
  .purrch-config-layout {
    grid-template-columns: 1fr;
  }

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

  .purrch-card h2 {
    font-size: clamp(42px, 13vw, 64px);
    overflow-wrap: normal;
    word-break: normal;
  }

  .purrch-viewport {
    min-height: 360px;
  }
}

.purrch-section-card {
  margin-bottom: 22px;
}

.purrch-section-card .purrch-eyebrow {
  margin-bottom: 18px;
}

.purrch-notice {
  margin: 0 0 20px;
  border-radius: 20px;
  padding: 16px 18px;
  font-weight: 800;
  border: 1px solid var(--purrch-border);
  background: #fff;
}

.purrch-notice-success {
  background: #f4fbf5;
  border-color: #cbe8cf;
  color: #1f6b2a;
}

.purrch-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.purrch-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--purrch-border);
}

.purrch-badge.is-unlocked {
  background: #111;
  color: #fff;
  border-color: #111;
}

.purrch-badge.is-locked {
  background: #fbfaf7;
  color: var(--purrch-muted);
}

.purrch-button-disabled {
  background: #eee9e1;
  border-color: #eee9e1;
  color: #6f675d !important;
  cursor: not-allowed;
}

.purrch-brief .purrch-card + .purrch-card {
  margin-top: 22px;
}

@media (max-width: 760px) {
  .purrch-order-head {
    flex-direction: column;
  }

  .purrch-badge {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .purrch-section-card {
    margin-bottom: 18px;
  }

  .purrch-payment-grid strong {
    font-size: 20px;
  }
}

.purrch-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.purrch-section-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.purrch-section-headline h3 {
  margin-bottom: 0;
}

.purrch-file-list,
.purrch-approval-list {
  display: grid;
  gap: 12px;
}

.purrch-file-row,
.purrch-approval-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--purrch-border);
  border-radius: 20px;
  padding: 18px;
  background: #fbfaf7;
}

.purrch-file-row strong,
.purrch-approval-row strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.purrch-file-row span,
.purrch-approval-row span,
.purrch-timeline small {
  display: block;
  margin-top: 4px;
  color: var(--purrch-muted);
  font-size: 13px;
  font-weight: 800;
}

.purrch-approval-row p,
.purrch-timeline p {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.45;
}

.purrch-mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: #111;
  color: #fff !important;
  text-decoration: none;
  border: 1px solid #111;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.purrch-mini-button-light {
  background: #fff;
  color: #111 !important;
}

.purrch-mini-button.is-disabled {
  background: #eee9e1;
  border-color: #eee9e1;
  color: #6f675d !important;
}

.purrch-mini-button.is-success {
  background: #e8f5ea;
  border-color: #cbe8cf;
  color: #1f6b2a !important;
}

.purrch-approval-form {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.purrch-approval-form-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 4px;
}

.purrch-approval-form textarea {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--purrch-border);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  box-sizing: border-box;
}

.purrch-timeline {
  position: relative;
  display: grid;
  gap: 16px;
}

.purrch-timeline-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 14px;
}

.purrch-timeline-item > span {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 999px;
  background: #111;
  box-shadow: 0 0 0 6px #eee9e1;
}

.purrch-payment-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 1020px) {
  .purrch-detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .purrch-section-headline,
  .purrch-file-row,
  .purrch-approval-row,
  .purrch-approval-form-wide {
    grid-template-columns: 1fr;
  }

  .purrch-section-headline {
    align-items: stretch;
  }

  .purrch-mini-button,
  .purrch-approval-form,
  .purrch-approval-form button {
    width: 100%;
  }
}

/* Purrch configurator v5 */
.purrch-config-layout-v5 {
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: start;
}

.purrch-viewport-v5 {
  position: sticky;
  top: 24px;
  min-height: 720px;
  padding: 22px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 18px;
  background: radial-gradient(circle at 50% 18%, #ffffff 0, #f6f3ed 46%, #ece7dd 100%);
}

.purrch-model-stage {
  position: relative;
  width: 100%;
  min-height: 560px;
  display: grid;
  place-items: center;
  perspective: 900px;
}

.purrch-model-room {
  position: relative;
  width: 320px;
  height: 430px;
  max-width: 92%;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.05) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(180deg, rgba(17, 17, 17, 0.04) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.22));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7), 0 40px 90px rgba(17, 17, 17, 0.08);
  transition: width .25s ease, height .25s ease;
  overflow: hidden;
}

.purrch-model-label {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 5;
  font-size: 11px;
  font-weight: 900;
  color: var(--purrch-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.purrch-model-base,
.purrch-model-cubby,
.purrch-model-column,
.purrch-model-steps i,
.purrch-model-shelves i,
.purrch-model-hammock,
.purrch-model-perch {
  position: absolute;
  display: block;
  box-shadow: 0 16px 30px rgba(17, 17, 17, 0.16);
}

.purrch-model-base {
  left: 8%;
  right: 8%;
  bottom: 26px;
  height: 42px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6f5138, #b38a61 48%, #6f5138);
}

.purrch-model-column {
  bottom: 58px;
  width: 24px;
  border-radius: 999px;
  background: repeating-linear-gradient(0deg, #b89870 0 8px, #d7c1a3 8px 13px);
}

.purrch-model-column-a { left: 28%; height: 72%; }
.purrch-model-column-b { right: 25%; height: 82%; }
.purrch-model-column-c { left: 53%; height: 58%; opacity: .92; }

.purrch-model-cubby {
  left: 17%;
  bottom: 86px;
  width: 48%;
  height: 108px;
  border-radius: 28px;
  background: linear-gradient(135deg, #eee4d5, #cdb793);
}

.purrch-model-cubby::after {
  content: "";
  position: absolute;
  inset: 23px 34px 20px 34px;
  border-radius: 22px;
  background: #6a513b;
  box-shadow: inset 0 0 0 10px rgba(255,255,255,0.28);
}

.purrch-model-steps i,
.purrch-model-shelves i {
  width: 88px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7a5638, #c99c6f);
}

.purrch-model-shelves i {
  width: 118px;
  height: 30px;
  background: linear-gradient(90deg, #8a6544, #d8b184);
}

.purrch-model-hammock {
  left: 30%;
  bottom: 62px;
  width: 34%;
  height: 38px;
  border-radius: 0 0 50% 50%;
  background: #e8dfd3;
  transform: skewX(-8deg);
}

.purrch-model-perch {
  right: 12%;
  top: 56px;
  width: 140px;
  height: 90px;
  border-radius: 52px 52px 40px 40px;
  background: linear-gradient(135deg, #fff7ee, #d7c6ad);
}

.purrch-model-perch::before {
  content: "";
  position: absolute;
  inset: 20px 18px;
  border-radius: 999px;
  border: 10px solid rgba(122,86,56,.32);
}

.purrch-model-led {
  position: absolute;
  left: 26%;
  bottom: 176px;
  width: 28%;
  height: 4px;
  border-radius: 999px;
  background: #fff2c4;
  box-shadow: 0 0 20px #ffd978;
  z-index: 4;
}

.purrch-price-card {
  border: 1px solid var(--purrch-border);
  border-radius: 24px;
  padding: 22px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(16px);
}

.purrch-price-card span,
.purrch-price-card small {
  display: block;
  color: var(--purrch-muted);
  font-weight: 800;
}

.purrch-price-card strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -.05em;
}

.purrch-config-fields-v5 {
  gap: 18px;
}

.purrch-config-group {
  padding: 24px;
  box-shadow: none;
}

.purrch-grid-tight {
  gap: 12px;
}

.purrch-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 12px;
}

.purrch-option-grid .purrch-check {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--purrch-border);
  border-radius: 16px;
  background: #fbfaf7;
  font-size: 14px;
  font-weight: 800;
}

.purrch-render-card pre {
  max-height: 260px;
  overflow: auto;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--purrch-border);
  border-radius: 18px;
  background: #111;
  color: #f7f6f2;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .purrch-viewport-v5 {
    position: static;
    min-height: 560px;
  }

  .purrch-model-stage {
    min-height: 410px;
  }

  .purrch-model-room {
    transform: scale(.78);
  }

  .purrch-option-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .purrch-viewport-v5 {
    padding: 14px;
    min-height: 500px;
  }

  .purrch-model-room {
    transform: scale(.68);
  }

  .purrch-price-card {
    padding: 18px;
  }
}

.purrch-message-card {
  overflow: hidden;
}

.purrch-message-thread {
  display: grid;
  gap: 12px;
  margin: 18px 0 20px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.purrch-message,
.purrch-message-empty {
  max-width: 78%;
  border: 1px solid var(--purrch-border);
  border-radius: 22px;
  padding: 16px 18px;
  background: #fbfaf7;
}

.purrch-message.is-client {
  justify-self: end;
  background: #111;
  color: #fff;
  border-color: #111;
}

.purrch-message.is-support {
  justify-self: start;
}

.purrch-message div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.purrch-message span {
  color: inherit;
  opacity: .65;
  font-size: 12px;
}

.purrch-message p,
.purrch-message-empty p {
  margin: 0;
  color: inherit;
  font-size: 15px;
  line-height: 1.55;
}

.purrch-message-form {
  display: grid;
  gap: 12px;
}

.purrch-message-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--purrch-border);
  border-radius: 20px;
  padding: 16px 18px;
  font: inherit;
  resize: vertical;
}

.purrch-section-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

@media (max-width: 760px) {
  .purrch-section-headline {
    align-items: stretch;
    flex-direction: column;
  }

  .purrch-message,
  .purrch-message-empty {
    max-width: 100%;
  }
}

/* v7 approvals/files polish */
.purrch-progress-wrap{margin-top:18px;max-width:520px}.purrch-progress-meta{display:flex;justify-content:space-between;gap:16px;font-size:13px;color:#6b6259;margin-bottom:8px}.purrch-progress-bar{height:8px;background:#eee9e2;border-radius:999px;overflow:hidden}.purrch-progress-bar span{display:block;height:100%;background:#17120f;border-radius:999px}.purrch-file-row small,.purrch-approval-row small{display:block;margin-top:4px;color:#7b7268;font-size:12px}.purrch-file-row p,.purrch-approval-row p{margin:8px 0 0;color:#5f564e}.purrch-approval-row.is-approved{border-color:#cfe8d5}.purrch-approval-row.is-changes_requested{border-color:#e8d6bf}.purrch-approval-row.is-locked{opacity:.76}

.purrch-payment-plan {
    display: grid;
    gap: 12px;
}

.purrch-payment-step {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.purrch-payment-step strong,
.purrch-payment-step span {
    display: block;
}

.purrch-payment-step span {
    color: rgba(17, 17, 17, 0.56);
    font-size: 0.88rem;
    margin-top: 4px;
}

.purrch-payment-step.is-paid {
    opacity: 0.72;
}

.purrch-payment-summary-line {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(17, 17, 17, 0.08);
}

@media (max-width: 720px) {
    .purrch-payment-step,
    .purrch-payment-summary-line {
        flex-direction: column;
    }
}

/* v14 Three.js preview foundation */
.purrch-three-inline-wrap {
    margin-top: 18px;
}

.purrch-three-preview-card {
    overflow: hidden;
}

.purrch-three-preview {
    position: relative;
    min-height: 420px;
    margin-top: 22px;
    border: 1px solid var(--purrch-border, rgba(17,17,17,.1));
    border-radius: 28px;
    background:
        radial-gradient(circle at 22% 18%, rgba(215, 200, 180, .20), transparent 32%),
        linear-gradient(135deg, #fbfaf7 0%, #f5f1eb 100%);
    overflow: hidden;
}

.purrch-three-canvas,
.purrch-three-canvas canvas {
    display: block;
    width: 100%;
    height: 420px;
}

.purrch-three-preview.is-fallback .purrch-three-canvas {
    display: none;
}

.purrch-three-fallback {
    position: relative;
    height: 420px;
    transform-style: preserve-3d;
}

.purrch-three-fallback [class*="purrch-three-fallback-"] {
    position: absolute;
    border-radius: 999px;
    background: #d8c4a2;
    box-shadow: 0 18px 50px rgba(25, 20, 15, .12);
}

.purrch-three-fallback-base {
    left: 18%;
    right: 18%;
    bottom: 42px;
    height: 34px;
    background: #a77a52 !important;
}

.purrch-three-fallback-column {
    width: 28px;
    height: 280px;
    left: 50%;
    bottom: 66px;
    transform: translateX(-50%);
    background: repeating-linear-gradient(0deg, #b79768 0 7px, #d0b180 7px 14px) !important;
}

.purrch-three-fallback-cubby {
    width: 160px;
    height: 100px;
    left: 22%;
    bottom: 80px;
    border-radius: 28px !important;
    background: #eee3d4 !important;
}

.purrch-three-fallback-step {
    width: 92px;
    height: 22px;
    right: 22%;
    background: #b8895a !important;
}

.purrch-three-fallback-step.s1 { bottom: 108px; }
.purrch-three-fallback-step.s2 { bottom: 176px; right: 29%; }
.purrch-three-fallback-step.s3 { bottom: 244px; right: 23%; }

.purrch-three-fallback-perch {
    width: 170px;
    height: 78px;
    left: 50%;
    top: 52px;
    transform: translateX(-50%);
    border-radius: 40px 40px 32px 32px !important;
    background: #efe3d4 !important;
}

.purrch-three-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.purrch-three-meta div {
    border: 1px solid var(--purrch-border, rgba(17,17,17,.1));
    border-radius: 20px;
    padding: 14px 16px;
    background: #fff;
}

.purrch-three-meta strong,
.purrch-three-meta span {
    display: block;
}

.purrch-three-meta strong {
    font-size: 13px;
    margin-bottom: 4px;
}

.purrch-three-meta span {
    color: rgba(17,17,17,.6);
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 860px) {
    .purrch-three-preview {
        min-height: 340px;
        border-radius: 22px;
    }

    .purrch-three-canvas,
    .purrch-three-canvas canvas,
    .purrch-three-fallback {
        height: 340px;
    }

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