.custom-rack-page { background: #f4f7fc; }
.rack-builder { padding-block: 7.5rem 4.5rem; }
.rack-back { color: #0033b6; font-weight: 500; }
.rack-back:hover { text-decoration: underline; }
.rack-builder h1 { margin-top: .8rem; font-size: clamp(2.5rem, 5.8vw, 4.7rem); line-height: 1.1; }
.rack-lead { margin: .7rem 0 1.8rem; color: #43506a; max-width: 62ch; }
.rack-builder__layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1rem, 3vw, 2.4rem); align-items: start; }
.rack-preview, .rack-form {
  min-width: 0;
  border-radius: clamp(16px, 2.5vw, 28px);
  padding: clamp(1rem, 2.8vw, 2rem);
  border: 1px solid #dde5f3;
}
.rack-preview { position: sticky; top: 6rem; background: #e8effc; text-align: center; }
.rack-preview h2 { text-align: left; font-size: 1.3rem; }
.rack-preview canvas { display: block; width: 100%; height: auto; }
.rack-size { font-weight: 600; color: #15356a; font-variant-numeric: tabular-nums; }
.rack-note { color: #43506a; font-size: .93rem; }
.rack-form { display: grid; gap: 1.4rem; background: #fff; }
.rack-form fieldset { display: grid; gap: .8rem; border: 0; min-width: 0; }
.rack-form legend { font-size: 1.28rem; font-weight: 600; margin-bottom: .45rem; }
.rack-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.rack-fields--size { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rack-form label { display: grid; gap: .2rem; align-content: start; min-width: 0; font-weight: 500; }
.rack-form :is(input, select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .55rem .65rem;
  font: inherit;
  color: #15223a;
  background: #fff;
  border: 1px solid #bac8de;
  border-radius: 9px;
}
.rack-form textarea { resize: vertical; }
.rack-form :focus-visible { outline: 2px solid #0033b6; outline-offset: 2px; }
.rack-form > .btn { width: 100%; min-height: 46px; border-radius: 10px; cursor: pointer; }
.rack-form button:disabled { opacity: .65; cursor: wait; }
#rack-logo-clear { justify-self: start; color: #0033b6; background: none; border: 0; text-decoration: underline; cursor: pointer; }
.rack-error, #rack-status[data-error] { color: #a31d3c; }
.rack-error:empty, #rack-status:empty { display: none; }
#rack-status { font-weight: 600; }
@media (max-width: 820px) {
  .rack-builder { padding-top: 6.25rem; }
  .rack-builder__layout { grid-template-columns: minmax(0, 1fr); }
  .rack-preview { top: 4.65rem; z-index: 2; padding-block: .65rem; }
  .rack-preview canvas { max-height: min(25svh, 160px); object-fit: contain; }
  .rack-preview h2 { font-size: 1rem; }
  .rack-preview .rack-note { font-size: .8rem; }
}
@media (max-height: 520px) {
  .rack-preview { position: static; }
}


.rack-preview canvas.rack-preview__3d {
  height: clamp(230px, 34vw, 420px);
  cursor: grab;
  touch-action: pan-y pinch-zoom;
}
.rack-preview canvas.rack-preview__3d:active { cursor: grabbing; }
.rack-preview canvas.rack-preview__3d:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
@media (max-width: 820px) {
  .rack-preview canvas.rack-preview__3d { height: min(29svh, 210px); max-height: none; }
}

.rack-unit {
  margin-top: clamp(2rem, 5vw, 4rem);
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #dde5f3;
  border-radius: clamp(16px, 2.5vw, 28px);
  background: #fff;
}
.rack-unit p { margin: .55rem 0; max-width: 75ch; }
.rack-unit__inputs, .rack-unit__results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr));
  gap: .7rem;
  margin: 1rem 0;
}
.rack-unit__inputs { max-width: 480px; }
.rack-unit__inputs label { display: grid; gap: .25rem; font-weight: 600; }
.rack-unit__inputs :is(input, select) {
  width: 100%;
  min-height: 44px;
  padding: .45rem .65rem;
  border: 1px solid #bac8de;
  border-radius: 9px;
  font: inherit;
  background: #fff;
}
.rack-unit__results > div { border-radius: 10px; background: #edf3fc; padding: .65rem .85rem; }
.rack-unit__results dd { margin: 0; color: #15356a; font-weight: 700; overflow-wrap: anywhere; }

