:root {
  --bg: #f7f8fb;
  --panel-bg: #ffffff;
  --stroke: #dee2e9;
  --muted: #666d7c;
  --text: #242631;
  --label: #303542;
  --placeholder: #8f95a3;
  --primary: #5855d6;
  --primary-soft: #f2f1ff;
  --primary-border: #d8d6fa;
  --danger: #d9485f;
  --shadow: rgba(20, 22, 36, 0.06);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
}

.app-shell {
  width: 100%;
  max-width: 800px;
  background: var(--panel-bg);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  box-shadow: 0 8px 24px var(--shadow);
  padding: 28px 50px 18px;
}

.header {
  margin-bottom: 8px;
}

.header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.divider {
  height: 1px;
  width: 100%;
  background: #e1e4ea;
  margin: 18px 0 20px;
}

.field-block,
.optional-field {
  margin-bottom: 18px;
}

.field-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.field-header label,
.checkbox-label span:last-child {
  font-size: 17px;
  font-weight: 700;
}

.field-header span {
  font-size: 13px;
  color: #717887;
}

textarea {
  width: 100%;
  border: 2px solid #c9ced8;
  border-radius: 10px;
  resize: vertical;
  background: #fff;
  color: var(--label);
  font-size: 16px;
  line-height: 1.5;
  padding: 16px 18px;
  min-height: 78px;
  font-family: inherit;
}

textarea::placeholder {
  color: var(--placeholder);
}

textarea:focus,
textarea:focus-visible {
  outline: 2px solid rgba(88, 85, 214, 0.18);
  border-color: var(--primary);
}

.required-block textarea {
  min-height: 92px;
}

.toggle-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  min-height: 22px;
}

.checkbox-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary);
  position: relative;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.checkbox-box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.checkbox-label input:checked + .checkbox-box::after {
  opacity: 1;
}

.optional-field textarea {
  min-height: 78px;
}

.show-mix-button {
  width: 100%;
  margin-top: 8px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  height: 48px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.show-mix-button:hover,
.show-mix-button:focus-visible {
  filter: brightness(1.05);
}

.show-mix-button:active {
  transform: translateY(1px);
}

.output-section {
  margin-top: 28px;
  position: relative;
}

.output-section h2 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
}

.output-box {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 9px;
  min-height: 48px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
}

#output-text {
  margin: 0;
  color: #46439a;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-button {
  position: absolute;
  right: 16px;
  top: 54px;
  border: 1px solid rgba(88, 85, 214, 0.35);
  background: rgba(255, 255, 255, 0.7);
  color: var(--primary);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.copy-button:hover,
.copy-button:focus-visible {
  background: #fff;
}

.copy-button.is-copied {
  background: #e9f9ef;
  border-color: #8bd0a6;
  color: #1d7c4d;
}

@media (max-width: 640px) {
  body {
    padding: 16px;
  }

  .app-shell {
    padding: 22px 18px 16px;
  }

  .field-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .output-section {
    margin-top: 24px;
  }

  .copy-button {
    position: static;
    margin-top: 10px;
  }
}
