:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #201f1b;
  background: #e9e5dc;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }

.shell { max-width: 1180px; margin: 0 auto; padding: 58px 28px 72px; }
header { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 48px; align-items: end; margin-bottom: 42px; }
.eyebrow { grid-column: 1 / -1; color: #665f53; font: 700 11px/1 monospace; letter-spacing: .2em; }
h1 { margin: 0; font: 500 clamp(44px, 7vw, 82px)/.92 Georgia, serif; letter-spacing: -.055em; }
h1 em { color: #d55231; font-weight: 400; }
.intro { margin: 0 0 4px; max-width: 420px; color: #625e56; font-size: 15px; line-height: 1.7; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 430px; background: #f7f4ec; border: 1px solid #d0cabd; box-shadow: 0 28px 80px rgba(57, 49, 35, .12); }
form { padding: 34px; border-right: 1px solid #d0cabd; }
.field { display: grid; gap: 9px; margin-bottom: 24px; }
.field > span, .controls span { font-size: 12px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.field i { color: #8c867b; font-style: normal; font-weight: 500; text-transform: none; }
.field small { color: #8c867b; font-size: 11px; }
.field-row { display: flex; gap: 16px; }
.grow { flex: 1; }.compact { width: 130px; }
input, textarea, select { width: 100%; border: 1px solid #c7c0b3; border-radius: 0; background: #fffefa; color: #201f1b; outline: none; }
input, select { height: 46px; padding: 0 13px; }
textarea { min-height: 254px; padding: 14px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: #d55231; box-shadow: 0 0 0 2px rgba(213, 82, 49, .12); }
.counter { margin-top: -5px; text-align: right; color: #8c867b; font: 11px/1 monospace; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 20px 0; border-top: 1px solid #ded8cc; }
.controls label { display: grid; gap: 10px; }
input[type="range"] { accent-color: #d55231; height: auto; padding: 0; border: 0; background: transparent; }
.actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; margin-top: 16px; }
button { min-height: 50px; padding: 0 18px; border: 1px solid #201f1b; cursor: pointer; font-weight: 750; }
button:disabled { cursor: wait; opacity: .55; }
.primary { background: #201f1b; color: #fff; }
.primary:hover { background: #d55231; border-color: #d55231; }
.secondary { background: transparent; color: #201f1b; }
#status { min-height: 22px; margin: 15px 0 0; color: #625e56; font-size: 13px; }
#status.error { color: #a82e18; }
#status.success { color: #23704a; }

.preview-panel { padding: 28px; background: #ddd7ca; }
.preview-heading { display: flex; justify-content: space-between; margin-bottom: 18px; font: 700 10px/1 monospace; letter-spacing: .12em; color: #655f54; }
.paper-wrap { position: relative; display: flex; justify-content: center; align-items: flex-start; min-height: 510px; padding: 22px; overflow: auto; background: #cbc4b7; box-shadow: inset 0 0 26px rgba(67, 58, 45, .08); }
canvas { display: none; width: min(100%, 384px); height: auto; image-rendering: pixelated; background: #fffef9; box-shadow: 0 8px 26px rgba(45, 39, 29, .17); }
#empty-preview { margin: auto; color: #777064; font: 12px/1.4 monospace; }
.preview-panel > p { color: #716a5f; font-size: 11px; line-height: 1.5; }

@media (max-width: 860px) {
  .shell { padding: 34px 16px; }
  header { grid-template-columns: 1fr; gap: 22px; }
  .workspace { grid-template-columns: 1fr; }
  form { border-right: 0; border-bottom: 1px solid #d0cabd; }
  .paper-wrap { min-height: 420px; }
}

@media (max-width: 520px) {
  form, .preview-panel { padding: 22px; }
  .field-row, .controls { display: grid; grid-template-columns: 1fr; }
  .compact { width: auto; }
}
