:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --ink: #1c2b2a;
  --muted: #60706d;
  --card: #fffdf8;
  --accent: #0f766e;
  --accent-dark: #0b5d56;
  --soft: #dff4ed;
  --line: #ded8cb;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(24, 42, 40, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #dff4ed 0, transparent 32rem), var(--bg);
  line-height: 1.5;
}

.hero, main, .history, footer { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 42px 0 22px;
}
.eyebrow { text-transform: uppercase; letter-spacing: .08em; color: var(--accent-dark); font-weight: 800; font-size: .78rem; }
h1 { font-size: clamp(2rem, 5vw, 4.4rem); line-height: .95; margin: .1em 0; }
h2 { margin-top: 0; }
.lead { font-size: 1.15rem; max-width: 720px; color: var(--muted); }
.badge { background: var(--ink); color: white; border-radius: 999px; padding: 12px 18px; white-space: nowrap; font-weight: 700; }

.layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; align-items: start; }
.card {
  background: rgba(255,253,248,.93);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label, legend { font-weight: 750; color: var(--ink); }
label { display: grid; gap: 6px; }
input, textarea, select {
  width: 100%;
  border: 1px solid #cfc8b9;
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  background: white;
  color: var(--ink);
}
textarea { resize: vertical; }
form { display: grid; gap: 16px; }
fieldset { border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin: 0; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.checks label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.checks input { width: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.stack button { flex: 1 1 180px; }
button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 850;
  cursor: pointer;
  background: var(--accent);
  color: white;
  box-shadow: 0 7px 18px rgba(15,118,110,.22);
}
button:hover { background: var(--accent-dark); }
button.secondary { background: var(--soft); color: var(--accent-dark); box-shadow: none; }
button.secondary:hover { background: #c7eadf; }
button.danger { background: #fee4df; color: var(--danger); box-shadow: none; }
.hint, .status, footer { color: var(--muted); }
.output-card { position: sticky; top: 12px; }
#output { min-height: 390px; background: #fbfaf7; }
.status { min-height: 1.5em; font-weight: 700; }
.history { margin-top: 20px; }
.history-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.history-list { display: grid; gap: 12px; }
.item { border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 14px; }
.item h3 { margin: 0 0 6px; font-size: 1rem; }
.item pre { white-space: pre-wrap; margin: 0; color: #33413f; }
footer { padding: 24px 0 40px; }

@media (max-width: 900px) {
  .hero, .layout { display: block; }
  .badge { display: inline-block; margin-top: 12px; }
  .output-card { position: static; margin-top: 20px; }
}
@media (max-width: 640px) {
  .grid.two, .checks { grid-template-columns: 1fr; }
  .card { padding: 18px; border-radius: 18px; }
}
