.mh-build-worksheet-page .mh-single-article,
.mh-build-worksheet-page .entry-content {
  width: min(100%, var(--gsf-wide-content-width));
}

.mh-build-worksheet {
  --mh-workbook-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  margin-top: 10px;
}

.mh-build-worksheet__intro {
  max-width: 820px;
  margin-bottom: 30px;
}

.mh-build-worksheet__eyebrow {
  width: fit-content;
  margin: 0 0 12px;
  padding: 5px 10px;
  border: 1px solid rgba(215, 154, 59, 0.45);
  border-radius: 999px;
  color: #f2c47d;
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
}

.mh-build-worksheet__intro h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: pretty;
}

.mh-build-worksheet__intro > p:not(.mh-build-worksheet__eyebrow, .mh-build-worksheet__privacy) {
  max-width: 70ch;
  margin: 16px 0 0;
  font-size: 17px;
}

.mh-build-worksheet__privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 0;
  color: var(--muted-color);
  font-size: 14px;
}

.mh-build-worksheet__privacy span {
  width: 8px;
  height: 8px;
  margin-top: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mh-accent-3);
}

.mh-build-worksheet__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
  align-items: start;
  gap: 24px;
}

.mh-build-worksheet__form {
  display: grid;
  gap: 18px;
}

.mh-build-worksheet__panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--surface-bg);
}

.mh-build-worksheet__panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.mh-build-worksheet__panel-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.mh-build-worksheet__panel-head p {
  max-width: 54ch;
  margin: 7px 0 0;
  color: var(--muted-color);
  font-size: 14px;
  line-height: 1.6;
}

.mh-build-worksheet__step {
  min-width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 50%;
  color: var(--link-color);
  background: rgba(125, 211, 252, 0.08);
  font-size: 13px;
  font-weight: 800;
}

.mh-build-worksheet__field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mh-build-worksheet__field--wide {
  grid-column: 1 / -1;
}

.mh-build-worksheet__field label {
  display: block;
  margin-bottom: 6px;
  color: var(--heading-color);
  font-size: 14px;
  font-weight: 750;
}

.mh-build-worksheet__field label span {
  color: #f2c47d;
}

.mh-build-worksheet__field input,
.mh-build-worksheet__field select,
.mh-build-worksheet__field textarea {
  width: 100%;
}

.mh-build-worksheet__field textarea {
  resize: vertical;
}

.mh-build-worksheet__field :where(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 1px var(--danger-color);
}

.mh-build-worksheet__hint,
.mh-build-worksheet__error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}

.mh-build-worksheet__hint {
  color: var(--muted-color);
}

.mh-build-worksheet__error {
  color: var(--danger-color);
}

.mh-build-worksheet__report {
  position: sticky;
  top: 100px;
  box-shadow: var(--mh-workbook-shadow);
}

.admin-bar .mh-build-worksheet__report {
  top: 132px;
}

.mh-build-worksheet__completion {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--muted-color);
  background: var(--surface-raised);
  font-size: 12px;
  font-weight: 800;
}

.mh-build-worksheet__completion.is-complete {
  border-color: rgba(134, 239, 172, 0.5);
  color: var(--mh-accent-3);
  background: rgba(134, 239, 172, 0.08);
}

.mh-build-worksheet__preview {
  min-height: 370px;
  max-height: 58vh;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px dashed var(--control-border-color);
  border-radius: 12px;
  color: var(--body-color);
  background: #091522;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.mh-build-worksheet__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.mh-build-worksheet__button {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.mh-build-worksheet__button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.mh-build-worksheet__button:active:not(:disabled) {
  transform: translateY(0);
}

.mh-build-worksheet__button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.mh-build-worksheet__button--primary {
  border-color: var(--accent-color);
  color: var(--button-text-color);
  background: var(--accent-color);
}

.mh-build-worksheet__button--primary:hover:not(:disabled) {
  border-color: #e4ae58;
  background: #e4ae58;
}

.mh-build-worksheet__button--secondary {
  border-color: var(--border-color);
  color: var(--link-color);
  background: var(--surface-raised);
}

.mh-build-worksheet__button--secondary:hover:not(:disabled) {
  border-color: var(--link-color);
  color: var(--link-hover-color);
}

.mh-build-worksheet__button--wide {
  grid-column: 1 / -1;
}

.mh-build-worksheet__status {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--link-color);
  font-size: 13px;
  font-weight: 700;
}

.mh-build-worksheet__storage-note {
  margin: 4px 0 0;
  color: var(--muted-color);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .mh-build-worksheet__workspace {
    grid-template-columns: 1fr;
  }

  .mh-build-worksheet__report,
  .admin-bar .mh-build-worksheet__report {
    position: static;
  }

  .mh-build-worksheet__preview {
    max-height: none;
  }
}

@media (max-width: 600px) {
  .mh-build-worksheet__field-grid {
    grid-template-columns: 1fr;
  }

  .mh-build-worksheet__field--wide {
    grid-column: auto;
  }

  .mh-build-worksheet__panel {
    padding: 18px;
  }

  .mh-build-worksheet__actions {
    grid-template-columns: 1fr;
  }

  .mh-build-worksheet__button--wide {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mh-build-worksheet__button {
    transition: none;
  }
}
