.custom-builder {
  display: grid;
  gap: clamp(32px, 4vw, 72px);
  grid-template-columns: minmax(430px, 1.08fr) minmax(500px, .92fr);
  height: 100%;
  padding: 104px clamp(48px, 6vw, 112px) 34px;
}

.custom-preview-column {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.custom-preview-heading { padding-left: 2px; }
.custom-preview-heading .kicker { margin-bottom: 8px; }
.custom-preview-heading h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 2.5vw, 44px);
  font-weight: 500;
  letter-spacing: -.025em;
  margin: 0;
}
.custom-preview-heading > p:last-child { color: var(--ink-muted); font-size: 13px; margin: 8px 0 0; }

.custom-preview-stage {
  align-items: center;
  align-self: center;
  border: 1px solid rgba(255,240,184,.24);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(0,0,0,.26), inset 0 1px rgba(255,255,255,.08);
  display: flex;
  height: min(65vh, 620px);
  justify-content: center;
  margin-top: 18px;
  min-height: 480px;
  overflow: hidden;
  position: relative;
  transition: background-color var(--motion-base), border-color var(--motion-base);
}
.custom-preview-stage::before {
  border: 1px solid rgba(255,255,255,.14);
  content: "";
  inset: 20px;
  pointer-events: none;
  position: absolute;
}
.custom-preview-stage[data-canvas="green"] { background: #00a84f; }
.custom-preview-stage[data-canvas="black"] { background: #000; }
.custom-preview-stage[data-canvas="white"] { background: #fff; border-color: rgba(8,17,15,.24); }

.custom-card-preview {
  aspect-ratio: 1;
  filter: drop-shadow(0 24px 28px rgba(0,0,0,.42));
  position: relative;
  width: clamp(390px, 31vw, 520px);
}
.custom-card-frame { height: 100%; inset: 0; object-fit: contain; pointer-events: none; position: absolute; width: 100%; }
.custom-card-content {
  align-items: center;
  color: #fff6d8;
  display: flex;
  flex-direction: column;
  inset: 14% 21% 17%;
  pointer-events: none;
  position: absolute;
  text-align: center;
  text-shadow: 0 2px 5px rgba(0,0,0,.86);
}
.custom-icon-cluster { height: 30%; margin-top: 3%; position: relative; width: 76%; }
.custom-icon-cluster img {
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.72));
  height: 64%;
  left: 50%;
  object-fit: contain;
  position: absolute;
  top: 50%;
  transform: translate(-50%,-50%);
  width: 64%;
}
.custom-icon-cluster img:nth-child(1) { transform: translate(-86%,-48%) rotate(-9deg) scale(.72); }
.custom-icon-cluster img:nth-child(2) { z-index: 2; }
.custom-icon-cluster img:nth-child(3) { transform: translate(-14%,-48%) rotate(9deg) scale(.72); }
.custom-icon-cluster img:only-child { height: 82%; transform: translate(-50%,-50%); width: 82%; }
.custom-card-content h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 1.8vw, 30px);
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.15;
  margin: 8% 0 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.custom-preview-effect { font-size: clamp(11px,.82vw,14px); line-height: 1.55; margin: 7% 0 0; max-width: 95%; }
.custom-preview-rule { background: linear-gradient(90deg,transparent,rgba(255,240,184,.78),transparent); height: 1px; margin: 7% 0 5%; width: 82%; }
.custom-preview-detail { color: rgba(255,248,220,.78); font-size: clamp(9px,.68vw,12px); line-height: 1.55; margin: 0; max-width: 94%; }

.custom-control-panel {
  align-self: center;
  backdrop-filter: blur(18px) saturate(112%);
  background: linear-gradient(145deg,rgba(11,27,23,.94),rgba(18,35,29,.84));
  border: 1px solid rgba(238,225,170,.27);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.07);
  max-height: calc(100vh - 136px);
  overflow: auto;
  padding: clamp(22px, 2vw, 32px);
}
.custom-panel-heading { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 24px; }
.custom-panel-heading span { color: var(--gold); font-size: 10px; letter-spacing: .18em; }
.custom-panel-heading h2 { font-family: var(--font-display); font-size: 28px; font-weight: 500; margin: 5px 0 0; }

.custom-fieldset { border: 0; margin: 0 0 22px; padding: 0; }
.custom-fieldset legend, .custom-copy-fields > label {
  color: rgba(243,240,221,.78);
  display: block;
  font-size: 12px;
  letter-spacing: .08em;
  margin-bottom: 10px;
}
.canvas-options { display: grid; gap: 9px; grid-template-columns: repeat(3,1fr); }
.canvas-option {
  align-items: center;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  gap: 9px;
  min-height: 46px;
  padding: 8px 10px;
  transition: background-color var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
}
.canvas-option input { clip: rect(0,0,0,0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; width: 1px; }
.canvas-option:has(input:checked) { background: rgba(216,187,114,.11); border-color: rgba(255,240,184,.62); color: var(--gold-pale); }
.canvas-option:has(input:focus-visible) { outline: 2px solid var(--gold-pale); outline-offset: 3px; }
.canvas-swatch { border: 1px solid rgba(255,255,255,.28); border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.2); height: 18px; width: 18px; }
.canvas-swatch--green { background: #00a84f; }
.canvas-swatch--black { background: #000; }
.canvas-swatch--white { background: #fff; }
.canvas-option span { font-size: 12px; }

.custom-style-grid { display: grid; gap: 7px; grid-template-columns: repeat(9,minmax(42px,1fr)); }
.custom-style-button {
  aspect-ratio: 1;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 48px;
  overflow: hidden;
  padding: 2px;
  position: relative;
  transition: background-color var(--motion-fast), border-color var(--motion-fast), transform 80ms;
}
.custom-style-button img { height: 100%; object-fit: contain; width: 100%; }
.custom-style-button:hover, .custom-style-button[aria-pressed="true"] { background: rgba(216,187,114,.12); border-color: rgba(255,240,184,.7); }
.custom-style-button:active { transform: scale(.96); }
.custom-style-button[aria-pressed="true"]::after { background: var(--gold-pale); border-radius: 50%; box-shadow: 0 0 9px var(--gold); content: ""; height: 5px; position: absolute; right: 5px; top: 5px; width: 5px; }

.custom-copy-fields { display: grid; grid-template-columns: 64px minmax(0,1fr); }
.custom-copy-fields > label { align-self: start; margin: 13px 12px 0 0; }
.custom-copy-fields input, .custom-copy-fields textarea {
  background: rgba(255,255,255,.045);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 10px;
  min-height: 46px;
  outline: 0;
  padding: 11px 13px;
  resize: none;
  transition: background-color var(--motion-fast), border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.custom-copy-fields input::placeholder, .custom-copy-fields textarea::placeholder { color: rgba(234,235,214,.34); }
.custom-copy-fields input:focus, .custom-copy-fields textarea:focus { background: rgba(255,255,255,.07); border-color: var(--gold-pale); box-shadow: 0 0 0 3px rgba(216,187,114,.12); }
.custom-static-note { border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 11px; margin: 10px 0 0; padding-top: 16px; }
.custom-static-note span { color: var(--gold); margin-right: 7px; }

@media (max-width: 1260px) {
  .custom-builder { gap: 28px; grid-template-columns: minmax(360px,.9fr) minmax(470px,1.1fr); padding-left: 52px; padding-right: 52px; }
  .custom-preview-stage { min-height: 430px; }
  .custom-card-preview { width: clamp(340px,32vw,420px); }
  .custom-control-panel { padding: 20px; }
  .custom-panel-heading { margin-bottom: 18px; }
  .custom-fieldset { margin-bottom: 17px; }
  .custom-style-grid { gap: 5px; }
}
