:root {
  --ink: #241c14;
  --muted: #6d5c4b;
  --paper: #f3eadb;
  --card: #fffaf2;
  --line: #e2d3bc;
  --copper: #b4532a;
  --copper-deep: #8a3b1c;
  --good: #1e6b45;
  --bad: #9d2c2c;
  --wait: #8a5a12;
  --shadow: 0 18px 40px rgba(60, 36, 14, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", "Palatino Linotype", serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(180, 83, 42, 0.16), transparent 28%),
    linear-gradient(180deg, #efe2cc 0%, #e7d7bd 100%);
  min-height: 100vh;
}
h1, h2 { font-family: Fraunces, "Iowan Old Style", serif; font-weight: 560; letter-spacing: -0.03em; }
h1 { font-size: 46px; margin: 0; line-height: 0.95; }
h2 { margin: 0 0 8px; font-size: 28px; }
.eyebrow { margin: 0 0 6px; color: var(--copper-deep); letter-spacing: 0.18em; text-transform: uppercase; font-size: 12px; }
.lead, .hint { color: var(--muted); line-height: 1.45; }
.sheet, .desk { width: min(1180px, calc(100% - 28px)); margin: 28px auto 48px; }
.sheet, .card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
}
.sheet { margin-top: 10vh; max-width: 520px; }
header { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.meters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.meter, .card { border-radius: 18px; }
.meter {
  background: var(--ink);
  color: #f6efe4;
  padding: 14px 16px;
}
.meter b { display: block; font-family: Fraunces, serif; font-size: 28px; font-variant-numeric: tabular-nums; }
.meter span { color: #d9c7b0; font-size: 13px; }
.card { margin-top: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.steps { margin: 8px 0 14px; padding-left: 22px; }
.steps li { margin: 4px 0; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}
input, textarea {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  width: 100%;
}
button {
  border: 0;
  background: var(--copper);
  color: white;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
}
button:hover { background: var(--copper-deep); }
button.ghost, a.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  text-decoration: none;
  display: inline-block;
}
button.danger { background: var(--bad); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.wide { grid-column: 1 / -1; }
.pair, .row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin: 8px 0; }
.pair label { flex: 1; min-width: 240px; }
.warn { color: var(--bad); min-height: 1.2em; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 8px 6px; vertical-align: top; }
th { color: var(--muted); font-weight: 400; }
.ok { color: var(--good); }
.bad { color: var(--bad); }
.wait { color: var(--wait); }
.ops { display: flex; flex-wrap: wrap; gap: 6px; }
.ops button, .ops input { font-size: 13px; }
.edit { display: grid; gap: 6px; min-width: 220px; }
pre {
  white-space: pre-wrap;
  background: #241c14;
  color: #f6efe4;
  border-radius: 14px;
  padding: 14px;
  min-height: 72px;
}
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.toc a {
  color: var(--copper-deep);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
}
code { font-family: "Atkinson Hyperlegible", serif; background: #efe4d2; padding: 0 4px; border-radius: 4px; }
.calc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.calc output { font-family: Fraunces, serif; font-size: 28px; }
@media (max-width: 900px) {
  .meters, .grid, .calc { grid-template-columns: 1fr; }
  h1 { font-size: 36px; }
}
