.builder-body {
  min-height: 100vh;
  background: #f4f8f9;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1500px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 12px 17px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  box-shadow: 0 9px 30px rgba(75, 103, 119, 0.07);
  backdrop-filter: blur(16px);
}

.builder-header > a {
  color: var(--subtext);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.builder-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.builder-header > div p {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.builder-header > div span {
  padding: 3px 9px;
  color: #3c7863;
  background: var(--green-light);
  border-radius: 99px;
  font-size: 9px;
  font-weight: 750;
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(390px, 0.78fr) minmax(560px, 1.22fr);
  gap: 18px;
  width: min(1500px, calc(100% - 32px));
  margin: 18px auto 0;
  padding-bottom: 30px;
}

.control-panel,
.preview-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  box-shadow: 0 18px 55px rgba(75, 104, 120, 0.09);
}

.control-panel {
  height: calc(100vh - 101px);
  overflow-y: auto;
  padding: 28px;
  scrollbar-color: rgba(113, 128, 145, 0.3) transparent;
  scrollbar-width: thin;
}

.control-intro h1 {
  margin-top: 4px;
  font-size: clamp(30px, 3vw, 42px);
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.control-intro > p:last-child {
  margin-top: 8px;
  color: var(--subtext);
  font-size: 12px;
}

#site-form {
  display: grid;
  gap: 13px;
  margin-top: 25px;
}

fieldset {
  display: grid;
  gap: 13px;
  padding: 20px;
  background: #fbfcfc;
  border: 1px solid var(--border);
  border-radius: 19px;
}

legend {
  padding: 0 7px;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 850;
}

label {
  display: grid;
  gap: 5px;
}

label > span {
  color: var(--subtext);
  font-size: 10px;
  font-weight: 750;
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 11px;
  font: inherit;
  font-size: 12px;
}

textarea {
  min-height: 76px;
  line-height: 1.6;
  resize: vertical;
}

input[type="text"]:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(57, 127, 150, 0.25);
  outline-offset: 2px;
}

.field-pair {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.color-grid label {
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

input[type="color"] {
  width: 100%;
  height: 35px;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
}

.check-list input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue-dark);
}

.check-list label span {
  color: var(--text);
  font-size: 11px;
}

.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 19px;
}

.outline-button,
.text-button {
  min-height: 43px;
  padding: 10px 15px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.text-button {
  color: var(--subtext);
  background: transparent;
  border-color: transparent;
}

.action-status {
  min-height: 19px;
  margin-top: 9px;
  color: #3c7863;
  font-size: 10px;
  font-weight: 750;
}

.preview-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: calc(100vh - 101px);
  min-height: 600px;
  padding: 19px;
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 3px 15px;
}

.preview-toolbar h2 {
  margin-top: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.device-switch {
  display: flex;
  padding: 3px;
  background: #edf2f3;
  border-radius: 99px;
}

.device-switch button {
  padding: 6px 11px;
  color: var(--subtext);
  background: transparent;
  border: 0;
  border-radius: 99px;
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
}

.device-switch button.active {
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(52, 65, 85, 0.08);
}

.preview-shell {
  justify-self: center;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 12px 35px rgba(52, 65, 85, 0.08);
  transition: width 0.2s ease;
}

.preview-shell.mobile {
  width: min(390px, 100%);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 0 11px;
  background: #eef2f3;
  border-bottom: 1px solid var(--border);
}

.browser-bar span {
  width: 7px;
  height: 7px;
  background: var(--orange);
  border-radius: 50%;
}

.browser-bar span:nth-child(2) {
  background: var(--blue);
}

.browser-bar span:nth-child(3) {
  background: var(--purple);
}

.browser-bar p {
  margin-left: auto;
  color: var(--subtext);
  font-size: 8px;
}

#site-preview {
  display: block;
  width: 100%;
  height: calc(100% - 31px);
  min-height: 500px;
  background: #ffffff;
  border: 0;
}

.preview-note {
  padding: 12px 3px 0;
  color: var(--subtext);
  font-size: 9px;
}

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

  .control-panel,
  .preview-panel {
    height: auto;
    overflow: visible;
  }

  .preview-panel {
    min-height: 760px;
  }

  #site-preview {
    min-height: 650px;
  }
}

@media (max-width: 600px) {
  .builder-header > div span {
    display: none;
  }

  .builder-layout {
    width: min(100% - 20px, 1500px);
  }

  .control-panel {
    padding: 20px;
  }

  .field-pair {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-shell {
    transition: none;
  }
}
