* { box-sizing: border-box; }
body { margin: 0; background: #f2f4f6; color: #24323a; font: 14px/1.5 "Segoe UI", Arial, sans-serif; }
[hidden] { display: none !important; }
/* Keep mounted editors measurable while preserving their selection and undo history. */
#design-step[hidden], #document-step[hidden] { display: block !important; height: 0; overflow: hidden; visibility: hidden; }
button, input, textarea { font: inherit; }
button, a, input, textarea, summary { outline-offset: 4px; }
button { cursor: pointer; border: 1px solid #cdd3d6; border-radius: 6px; background: white; color: #24323a; padding: 9px 13px; min-height: 40px; }
button:hover { background: #f4f6f6; }
button:disabled { opacity: .5; cursor: default; }
main { max-width: 1600px; margin: auto; padding: 16px 24px 28px; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.steps button { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.steps span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #edf0f2; font-size: 12px; }
.steps button[aria-current] { background: #235548; border-color: #235548; color: white; }
.steps button[aria-current] span { background: #ffffff26; }
#status { font-size: 13px; color: #536b61; min-height: 20px; margin: 12px 0; }
#status[data-error=true] { color: #a53629; }
.step-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
h1 { font-size: 22px; line-height: 1.25; margin: 0 0 5px; letter-spacing: -.4px; }
h2 { font-size: 21px; line-height: 1.3; margin: 0; }
.step-heading p { margin: 0; color: #647179; font-size: 13px; }
.step-heading button { flex-shrink: 0; }
#data-step { max-width: 1100px; margin: 24px auto 0; }
#details { background: white; border: 1px solid #dce1e3; border-radius: 10px; padding: 24px; }
.data-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 16px; font-weight: 650; margin-bottom: 8px; padding: 0; }
label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; margin: 10px 0; }
input, textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #cbd3d7; border-radius: 5px; color: #263d45; background: #fff; font-size: 14px; }
textarea { resize: vertical; line-height: 1.5; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; margin-top: 16px; }
.check input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint, .privacy { font-size: 12px; color: #6c797f; }
.hint { margin: 0 0 10px; }
.item { padding: 0 0 12px; margin-bottom: 12px; border-bottom: 1px solid #edf0f1; }
.item-numbers { display: grid; grid-template-columns: 84px 1fr auto; align-items: end; gap: 10px; }
.item-numbers label { margin: 0; }
.remove { font-size: 12px; color: #86645d; }
.quiet { width: 100%; border-style: dashed; }
.total { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 13px; }
.total output { font-size: 24px; font-weight: 650; letter-spacing: -.5px; }
.primary { background: #235548; color: white; border-color: #235548; font-weight: 600; }
.primary:hover { background: #19473b; }
.data-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid #e4e7e9; margin-top: 24px; padding-top: 20px; }
.data-actions p { color: #647179; font-size: 13px; margin: 0; max-width: 620px; }
.data-actions button { flex-shrink: 0; }
.privacy { margin: 16px 0; }
.developer { font-size: 12px; color: #65777e; padding-top: 12px; }
.developer summary { cursor: pointer; color: #304b54; font-weight: 600; }
.text-button { color: #235548; padding: 0; border: 0; background: transparent; text-decoration: underline; min-height: auto; }
#document, #designer { border: 1px solid #dce1e3; border-radius: 8px; overflow: hidden; background: #e9edef; min-width: 0; }
#document { min-height: 650px; }
dialog { border: 1px solid #d1d9d7; border-radius: 10px; padding: 28px; width: min(460px, calc(100vw - 32px)); color: #24323a; box-shadow: 0 20px 80px #142a2930; }
dialog::backdrop { background: #172c3a66; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; }
@media (max-width: 720px) {
  main { padding: 12px; }
  .steps { gap: 6px; }
  .steps button { font-size: 12px; padding: 7px 9px; min-height: 42px; }
  .step-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  #data-step { margin-top: 18px; }
  #details { padding: 18px; }
  .data-columns { grid-template-columns: 1fr; gap: 26px; }
  .data-actions { align-items: stretch; flex-direction: column; gap: 14px; }
  .item-numbers { grid-template-columns: 70px 1fr auto; gap: 8px; }
  input, textarea { font-size: 16px; }
  h1 { font-size: 20px; }
}
