:root {
  --bg: #f5f2ea;
  --panel: #fffdf8;
  --text: #22201c;
  --muted: #686155;
  --brand: #9a3412;
  --brand-dark: #7c2d12;
  --line: #e7dccb;
  --ok: #166534;
  --shadow: 0 14px 40px rgba(59, 38, 20, .12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(circle at top left, #fff7ed, var(--bg) 42%);
  color: var(--text);
}
.hero {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-start;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.eyebrow { text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 700; font-size: .8rem; }
h1 { margin: .2rem 0; max-width: 920px; font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1; }
.lead { max-width: 780px; color: var(--muted); font-size: 1.1rem; }
.badge { background: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; padding: .7rem 1rem; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.layout { display: grid; grid-template-columns: minmax(320px, 520px) 1fr; gap: 1.2rem; padding: 1.2rem clamp(1rem, 4vw, 3rem); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 1.2rem; }
h2 { margin: .4rem 0 1rem; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
label { display: grid; gap: .35rem; font-weight: 700; margin-bottom: .85rem; }
input, textarea, select { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 12px; padding: .75rem; background: white; color: var(--text); }
textarea { min-height: 105px; resize: vertical; }
.checks { border: 1px solid var(--line); border-radius: 14px; padding: .75rem; margin: 0 0 1rem; }
.checks legend { font-weight: 800; }
.checks label { display: flex; align-items: center; gap: .45rem; font-weight: 600; margin: .45rem 0; }
.checks input { width: auto; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; position: sticky; bottom: .8rem; background: rgba(255,253,248,.9); backdrop-filter: blur(8px); padding-top: .7rem; }
button { border: 0; border-radius: 999px; padding: .75rem 1rem; font-weight: 800; cursor: pointer; background: var(--brand); color: white; }
button:hover { background: var(--brand-dark); }
button.secondary { background: #e7dccb; color: #3b3025; }
.output-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
#saved { color: var(--ok); font-weight: 700; }
.preview { line-height: 1.55; }
.preview h1, .preview h2, .preview h3 { line-height: 1.15; }
.preview h1 { font-size: 2rem; border-bottom: 3px solid var(--brand); padding-bottom: .4rem; }
.preview table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .95rem; }
.preview th, .preview td { border: 1px solid var(--line); padding: .65rem; vertical-align: top; }
.preview th { background: #ffedd5; }
.preview code { background: #f3eee5; padding: .1rem .3rem; border-radius: .3rem; }
footer { padding: 1rem clamp(1rem, 4vw, 3rem) 2rem; color: var(--muted); }
@media (max-width: 950px) { .layout { grid-template-columns: 1fr; } .hero { flex-direction: column; } }
@media (max-width: 620px) { .grid.two { grid-template-columns: 1fr; } }
@media print { body { background: white; } .form-panel, .hero, footer, .actions { display:none; } .layout { display:block; padding:0; } .panel { box-shadow:none; border:0; } }
