:root {
  --bg: #f5f3ee;
  --card: #fffdf8;
  --ink: #1f2933;
  --muted: #5d6b78;
  --accent: #b91c1c;
  --accent-dark: #7f1d1d;
  --line: #ded8cc;
  --ok: #166534;
  --warn: #92400e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(180deg, #fff8ed 0%, var(--bg) 45%);
  color: var(--ink);
}

header, main, aside, footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

header { padding: 42px 0 24px; }

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .82rem;
}

h1 { font-size: clamp(2rem, 4vw, 4rem); margin: 0 0 10px; line-height: 1; }
h2 { margin-top: 0; }
.lead { max-width: 820px; color: var(--muted); font-size: 1.13rem; line-height: 1.55; }

main {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 18px;
  align-items: start;
}

.panel, .note {
  background: rgba(255, 253, 248, .92);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(47, 34, 20, .08);
  padding: 22px;
}

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1fr 1fr; }

label, fieldset { display: block; margin: 0 0 14px; }
label { font-weight: 700; }
fieldset {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 4px;
}
legend { font-weight: 800; color: var(--accent-dark); padding: 0 6px; }
fieldset label { font-weight: 600; margin-bottom: 10px; color: #374151; }

input[type="text"], select, textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid #c9c1b4;
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(185, 28, 28, .18); border-color: var(--accent); }

.actions, .output-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(185, 28, 28, .2);
}
button:hover { background: var(--accent-dark); }
button.secondary {
  background: #efe7dc;
  color: var(--accent-dark);
  box-shadow: none;
}
button.secondary:hover { background: #e2d5c5; }

#output {
  min-height: 540px;
  font-size: 1rem;
}

.checklist {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  color: var(--muted);
  border: 1px dashed #cbd5e1;
}
.checklist strong { color: var(--ink); }
.checklist .ok { color: var(--ok); font-weight: 800; }
.checklist .warn { color: var(--warn); font-weight: 800; }

.note { margin-top: 18px; }
.note li { margin: 8px 0; }
footer { padding: 24px 0 40px; color: var(--muted); }

@media (max-width: 880px) {
  main, .grid.two { grid-template-columns: 1fr; }
}
