.esg-container {
  max-width: 1180px;
}

.esg-mainarea {
  padding: 28px;
}

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

.esg-form-col,
.esg-preview-col {
  min-width: 0;
}

.esg-form-col {
  background: linear-gradient(180deg, #ffffff 0%, #faf8ff 100%);
  border: 1px solid #e6dcff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(76, 29, 149, 0.08);
}

.esg-preview-col {
  position: sticky;
  top: 100px;
}

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

  .esg-preview-col {
    position: static;
  }
}

.esg-section-label {
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7c3aed;
  margin: 18px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #efe8ff;
}

.esg-section-label:first-child {
  margin-top: 0;
}

.esg-field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 13px;
}

.esg-field-row label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #2d1659;
}

.esg-req {
  color: #dc2626;
}

.esg-field-row input[type="text"],
.esg-field-row input[type="email"],
.esg-field-row input[type="url"],
.esg-field-row select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d8caf9;
  border-radius: 12px;
  background: #ffffff;
  font-size: 0.96rem;
  color: #27165b;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.esg-field-row input:focus,
.esg-field-row select:focus,
.esg-html-output:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.esg-color-row {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.esg-color-row label {
  min-width: 100px;
}

input[type="color"] {
  width: 48px;
  height: 40px;
  border: 1px solid #d8caf9;
  border-radius: 10px;
  padding: 2px;
  cursor: pointer;
  background: #fff;
}

.esg-color-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.esg-preset {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(17, 24, 39, 0.12);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.esg-preset:hover {
  transform: translateY(-1px) scale(1.1);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.esg-preview-label {
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7c3aed;
  margin-bottom: 10px;
}

.esg-preview-frame {
  border: 1px solid #ddd0fb;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.08), transparent 36%),
    linear-gradient(180deg, #fbf9ff 0%, #f4f1fb 100%);
  padding: 26px;
  min-height: 180px;
  box-shadow: 0 14px 34px rgba(59, 31, 125, 0.11);
  overflow: auto;
}

#esg-preview {
  display: inline-block;
  min-width: max-content;
}

#esg-preview > * {
  max-width: 100%;
}

.esg-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.esg-secondary-btn,
.esg-rich-btn {
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.esg-rich-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(109, 40, 217, 0.24);
}

.esg-rich-btn:hover,
.esg-secondary-btn:hover {
  transform: translateY(-1px);
}

.esg-secondary-btn {
  background: #ffffff;
  color: #40216f;
  border: 1px solid #ddd0fb;
}

.esg-plain-btn {
  color: #5b4b84;
}

.esg-copy-msg {
  margin-top: 10px;
  font-weight: 700;
  color: #0f8a5f;
  font-size: 0.92rem;
}

.esg-html-output {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid #d8caf9;
  border-radius: 16px;
  padding: 14px;
  font: 12px/1.6 Consolas, Monaco, monospace;
  color: #27165b;
  background: #fdfcff;
}

@media (max-width: 640px) {
  .esg-mainarea {
    padding: 18px;
  }

  .esg-form-col {
    padding: 18px;
  }

  .esg-preview-frame {
    padding: 18px;
    border-radius: 18px;
  }

  .esg-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .esg-secondary-btn,
  .esg-rich-btn {
    width: 100%;
  }
}
