body.builder-page{
  background:linear-gradient(180deg, #fcfafc 0%, #fbf7fa 100%);
}

.builder-navbar{
  min-height:56px;
  justify-content:space-between;
  gap:0;
}

.builder-back{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 10px;
  border-radius:999px;
  border:none;
  background:transparent;
  color:#5d5160;
  font-size:13px;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
}

.builder-back:hover{
  background:#f8f1f5;
  color:#3e2f3f;
}

.builder-lk-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 10px;
  border-radius:999px;
  background:#f7eff4;
  border:1px solid rgba(132,67,105,.16);
  color:#6d3b58;
  font-size:12px;
  font-weight:700;
  line-height:1;
}

.builder-stage{
  padding:18px 0 28px;
}

.builder-layout{
  display:grid;
  grid-template-columns:minmax(320px, 410px) minmax(0, 1fr);
  gap:22px;
  align-items:start;
}

.builder-preview{
  position:sticky;
  top:72px;
}

.builder-preview,
.builder-controls{
  display:grid;
  gap:12px;
}

.builder-controls{
  max-height:calc(100vh - 96px);
  overflow:auto;
  padding-right:4px;
}

.preview-switch,
.price-box,
.settings-card,
.pro-contact-card{
  padding:16px;
  border-radius:16px;
  background:#fff;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.settings-card,
.pro-contact-card,
.builder-business-card,
.form-grid,
.field{
  min-width:0;
  max-width:100%;
}

.preview-switch{
  display:inline-flex;
  align-items:center;
  gap:4px;
  width:max-content;
  margin:0 auto;
  justify-self:center;
  padding:6px;
  border-radius:14px;
  background:#f0ebf2;
  border:1px solid var(--line);
  box-shadow:none;
}

.preview-btn{
  min-height:40px;
  min-width:112px;
  padding:0 18px;
  border:1px solid transparent;
  border-radius:12px;
  background:transparent;
  color:#616b80;
  font-size:14px;
  font-weight:700;
  white-space:nowrap;
  cursor:pointer;
  transition:background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.preview-btn.active{
  background:#fff;
  border-color:#ddd2db;
  color:#232b3d;
  box-shadow:0 4px 12px rgba(35, 28, 39, .08);
}

.card-wrapper{
  padding:0;
  border-radius:0;
  background:transparent;
  border:none;
  box-shadow:none;
  perspective:1400px;
}

.nfc-card{
  position:relative;
  width:100%;
  margin:0 auto;
  aspect-ratio:1.58 / 1;
  transform-style:preserve-3d;
  transition:transform .6s ease;
  border-radius:24px;
  background:#111;
  color:#fff;
  box-shadow:0 30px 50px rgba(41, 19, 34, .18);
}

.nfc-card.is-back{
  transform:rotateY(180deg);
}

.card-side{
  position:absolute;
  inset:0;
  padding:16px;
  border-radius:24px;
  backface-visibility:hidden;
  overflow:hidden;
}

.card-front{
  display:block;
}

.card-back{
  transform:rotateY(180deg);
}

.nfc-icon{
  position:absolute;
  top:18px;
  right:18px;
  opacity:.95;
}

.logo-placeholder{
  width:44%;
  min-width:120px;
  max-width:180px;
  height:86px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:absolute;
  top:42%;
  left:50%;
  transform:translate(-50%, -50%);
  border-radius:20px;
  border:2px dashed rgba(255,255,255,.25);
  color:inherit;
  font-weight:800;
  letter-spacing:.05em;
  cursor:pointer;
  overflow:hidden;
}

.logo-placeholder img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}

.back-logo{
  display:none;
}

.back-logo.is-visible{
  display:flex;
}

.card-text{
  position:absolute;
  left:22px;
  bottom:22px;
  display:grid;
  gap:6px;
  max-width:56%;
  z-index:2;
}

#previewName{
  font-size:clamp(1.1rem, 2.2vw, 1.42rem);
  font-weight:800;
  letter-spacing:-.05em;
  line-height:1.02;
}

#previewPosition,
#previewPhone,
.card-copy{
  font-weight:600;
  opacity:.92;
}

#previewPosition,
#previewPhone{
  font-size:clamp(.82rem, 1.55vw, .98rem);
  line-height:1.1;
}

.card-copy{
  position:absolute;
  top:22px;
  left:22px;
  padding:0;
  border-radius:0;
  background:none;
  font-size:.78rem;
}

.card-qr{
  position:absolute;
  right:20px;
  bottom:20px;
  width:78px;
  height:78px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:#fff;
  box-shadow:0 14px 28px rgba(0,0,0,.18);
}

.card-qr img{
  width:100%;
  height:100%;
  object-fit:contain;
  border-radius:14px;
}

.price-title{
  font-size:1.18rem;
  font-weight:800;
  letter-spacing:-.03em;
}

.price-breakdown{
  display:grid;
  gap:8px;
  margin-top:12px;
}

.price-row,
.price-total{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.price-row{
  color:#5c5160;
  font-weight:600;
}

.price-total{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid var(--line);
  font-size:1.08rem;
  font-weight:800;
}

.primary-btn{
  width:100%;
  min-height:40px;
  margin-top:10px;
  font-size:1rem;
  border-radius:10px;
  padding:0 14px;
  box-shadow:none;
}

.form-error{
  margin-top:12px;
  padding:12px 14px;
  border-radius:14px;
  background:#fff0f0;
  border:1px solid rgba(199, 64, 64, .24);
  color:#b53838;
  font-size:.92rem;
  font-weight:600;
}

.plans-compact{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

.plan-inline{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
  align-items:center;
}

.plan-pill{
  min-height:46px;
  padding:8px 12px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  width:100%;
  min-width:0;
}

.plan-pill span{
  font-size:.86rem;
  font-weight:800;
  white-space:nowrap;
}

.plan-pill strong{
  font-size:.8rem;
  font-weight:800;
  white-space:nowrap;
}

.plan-pill-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:26px;
  padding:0 9px;
  border-radius:999px;
  background:linear-gradient(180deg, #fff6fa 0%, #fdf0f7 100%);
  border:1px solid rgba(132,67,105,.18);
  color:#8a456f;
  font-size:.72rem !important;
  letter-spacing:-.01em;
}

.plan-card{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  box-shadow:none;
  text-align:left;
  cursor:pointer;
  width:100%;
  box-sizing:border-box;
  appearance:none;
  -webkit-appearance:none;
  margin:0;
  outline:none;
  transform:translateZ(0);
  transition:border-color .18s ease, background .18s ease, color .18s ease;
}

.plan-card.active{
  border-color:rgba(132,67,105,.38);
  background:linear-gradient(180deg, #fff 0%, #fcf8fb 100%);
  box-shadow:none;
}

.plan-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:6px;
  font-weight:800;
  font-size:1.05rem;
  letter-spacing:-.03em;
}

.plan-card ul{
  margin:0;
  padding-left:16px;
  display:grid;
  gap:3px;
  color:#5d5160;
  line-height:1.45;
  font-size:.95rem;
}

.plan-card li{
  margin:0;
}

.plan-muted{
  color:#8d8090;
}

.plan-plus{
  color:#4e2d44;
  font-weight:700;
}

.sidebar-panel{
  padding:14px;
  border-radius:16px;
  background:#fff;
  border:1px solid var(--line);
  box-shadow:none;
}

.colors-panel .settings-title{
  margin-bottom:8px;
}

.colors-panel .colors-flex{
  gap:12px;
}

.builder-preview .settings-group{
  margin-top:0;
  padding-top:0;
  border-top:none;
}

.settings-head h2{
  margin:0 0 4px;
  font-size:clamp(1.3rem, 2.2vw, 1.7rem);
  line-height:1;
  letter-spacing:-.05em;
}

.settings-head p{
  color:var(--muted);
  line-height:1.45;
  font-size:.95rem;
}

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

.field{
  display:grid;
  gap:8px;
  min-width:0;
}

.field span{
  font-weight:700;
  color:#3a2e3b;
}

.field input,
.field textarea{
  width:100%;
  min-height:46px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid rgba(132,67,105,.16);
  background:#fff;
  color:var(--text);
  outline:none;
  transition:border-color .2s ease, box-shadow .2s ease;
  min-width:0;
}

.field textarea{
  min-height:106px;
  padding-top:10px;
  resize:vertical;
}

.field input:focus,
.field textarea:focus{
  border-color:rgba(132,67,105,.34);
  box-shadow:0 0 0 4px rgba(132,67,105,.08);
}

.field input.error,
.field textarea.error{
  border-color:#d55a5a;
  box-shadow:0 0 0 4px rgba(213, 90, 90, .08);
}

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

.section-block,
.settings-group{
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

.section-headline h3,
.settings-title{
  margin:0 0 6px;
  font-size:1.02rem;
  font-weight:800;
  letter-spacing:-.03em;
}

.logo-upload-inline{
  margin-top:4px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:36px;
}

.logo-section .section-headline{
  text-align:center;
}

.logo-upload-btn,
.logo-remove-btn{
  min-height:36px;
  padding:0 14px;
  border:none;
  border-radius:999px;
  font-weight:700;
  font-size:.9rem;
  cursor:pointer;
}

.logo-upload-btn{
  display:inline-flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  min-height:44px;
  min-width:220px;
  padding:6px 12px;
  background:var(--brand);
  color:#fff;
  text-align:center;
}

.logo-remove-btn{
  min-width:36px;
  padding:0;
  background:#f6edf3;
  color:#6b5166;
  border:1px solid var(--line);
  font-size:1.2rem;
  line-height:1;
}

.logo-upload-main{
  font-size:.9rem;
  font-weight:800;
  line-height:1.05;
}

.logo-upload-sub{
  margin-top:2px;
  font-size:.7rem;
  font-weight:700;
  opacity:.9;
}

.colors-flex{
  display:flex;
  align-items:flex-start;
  gap:20px;
  flex-wrap:wrap;
  margin-top:8px;
}

.color-block{
  min-width:130px;
}

.color-label{
  margin-bottom:6px;
  font-weight:700;
  font-size:.95rem;
}

.color-row{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.color-dot{
  position:relative;
  width:28px;
  height:28px;
  border-radius:50%;
  border:none;
  background:var(--dot-color, #111111);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);
  cursor:pointer;
}

.color-dot--light{
  border:1px solid #ccc;
}

.color-dot.active{
  box-shadow:0 0 0 2px #fff, 0 0 0 4px var(--brand);
}

.color-dot.custom{
  display:grid;
  place-items:center;
  background:#fff;
  border:1px dashed rgba(132,67,105,.3);
  color:var(--brand);
  font-weight:800;
  font-size:.9rem;
}

.color-dot.custom input{
  position:absolute;
  inset:0;
  opacity:0;
  pointer-events:none;
}

.toggle-grid{
  display:grid;
  gap:8px;
  margin-top:10px;
}

.toggle{
  padding:10px 12px;
  border-radius:12px;
  background:linear-gradient(180deg, #fcf7fa 0%, #f8f1f5 100%);
  border:1px solid rgba(132,67,105,.08);
}

.toggle-row,
.qr-move{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.toggle-row span,
.qr-move span{
  font-weight:700;
  color:#413542;
}

.switch{
  position:relative;
  display:inline-flex;
  width:52px;
  height:32px;
}

.switch input{
  opacity:0;
  width:0;
  height:0;
}

.slider{
  position:absolute;
  inset:0;
  border-radius:999px;
  background:#e7dde4;
  transition:background .2s ease;
}

.slider::before{
  content:"";
  position:absolute;
  top:4px;
  left:4px;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 4px 10px rgba(0,0,0,.10);
  transition:transform .2s ease;
}

.switch input:checked + .slider{
  background:var(--brand);
}

.switch input:checked + .slider::before{
  transform:translateX(20px);
}

.qr-advanced{
  margin-top:8px;
  padding-top:8px;
  border-top:1px solid rgba(132,67,105,.10);
}

.qr-note{
  margin-bottom:12px;
  color:#6f6270;
  line-height:1.7;
  font-size:.94rem;
}

.order-modal-card{
  min-height:unset;
}

.order-points{
  display:grid;
  gap:10px;
}

.order-result-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
}

.order-result-card{
  width:100%;
  padding:24px;
  border-radius:24px;
  background:#fff;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.order-result-card h4{
  margin:0 0 10px;
  font-size:1.3rem;
  letter-spacing:-.03em;
}

.order-result-card p{
  margin:0;
  color:var(--muted);
  line-height:1.75;
}

.order-result-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:20px;
}

@media (max-width:1100px){
  .builder-layout{
    grid-template-columns:1fr;
  }

  .builder-preview{
    position:static;
  }

  .builder-controls{
    max-height:none;
    overflow:visible;
    padding-right:0;
  }

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

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

@media (max-width:760px){
  .builder-navbar{
    min-height:52px;
    gap:10px;
  }

  .builder-back{
    min-height:32px;
    padding:0 8px;
    font-size:12px;
  }

  .plans-compact,
  .form-grid,
  .colors-flex{
    grid-template-columns:1fr;
  }

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

  .colors-flex{
    display:grid;
    gap:10px;
  }

  .preview-switch,
  .price-box,
  .settings-card,
  .pro-contact-card,
  .builder-business-card{
    padding:20px;
  }

  .preview-switch{
    width:100%;
    padding:6px;
  }

  .logo-upload-inline{
    flex-wrap:wrap;
    gap:8px;
  }

  .logo-section .section-headline{
    text-align:left;
  }

  .card-wrapper{
    padding:0;
  }

  .preview-btn{
    min-width:0;
    flex:1;
  }

  .card-side{
    padding:18px;
  }

  .logo-placeholder{
    width:44%;
    min-width:110px;
    height:74px;
    top:40%;
    border-radius:22px;
  }

  .card-text{
    left:18px;
    right:18px;
    bottom:18px;
    max-width:60%;
  }

  .card-copy{
    top:18px;
    left:18px;
  }
}
