#order,
#editor {
  width: min(670px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  padding: clamp(18px, 4vw, 30px);
  overflow: auto;
  border: 1px solid var(--outline);
  border-radius: 16px;
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 0 14px 48px #30251940;
}

#editor { width: min(440px, calc(100% - 28px)); }
#order::backdrop, #editor::backdrop { background: #241a15a6; }
#order [hidden], #editor [hidden] { display: none; }

.order-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.order-heading h2 { margin: 0; font-size: clamp(25px, 4vw, 33px); line-height: 1.13; }

.order-close {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--outline);
  border-radius: 10px;
  background: var(--page);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.order-banner, .order-error:not(:empty) {
  margin: 12px 0 0;
  padding: 11px 13px;
  border-radius: 8px;
  background: var(--warm);
}

.order-error { margin: 0; color: var(--accent-hover); }
.order-section { margin-top: 22px; }
.order-section h3 { margin: 0 0 12px; font-size: 1.2rem; }

.order-fields {
  display: grid;
  grid-template-columns: 1fr 1fr .75fr;
  gap: 12px;
}

.order-contacts, .order-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.order-fields label, .order-upload { display: grid; min-width: 0; gap: 6px; font-weight: 700; }

.order-fields input, .order-fields select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid #cab6a9;
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px 16px;
  margin-top: 12px;
}

.order-link { color: var(--accent-hover); }
.order-actions .site-button, [data-checkout] { min-height: 44px; }
#order button:disabled { opacity: .58; cursor: default; }
#order button:disabled:hover { background: revert-layer; }

.order-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--warm);
  overflow-wrap: anywhere;
}

.order-total strong { font-size: 1.25rem; }
.order-upload input { width: 100%; max-width: 275px; font: inherit; }
.order-meta { margin: 8px 0; color: var(--muted-ink); overflow-wrap: anywhere; }
.order-meta:empty { display: none; }
.order-check { margin: 8px 0; overflow-wrap: anywhere; }
ul.order-check { padding-inline-start: 20px; }
label.order-check { display: flex; align-items: start; gap: 8px; }
label.order-check input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.order-check a { color: var(--accent-hover); }
.order-contacts legend { margin-bottom: 9px; font-size: 1.2rem; font-weight: 700; }
[data-checkout] { margin-top: 8px; }

@media (max-width: 560px) {
  .order-fields { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  #order .site-button { transition: none; }
}
