:root {
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #111111;
  --muted: #555555;
  --accent: #000000;
  --accent-ink: #ffffff;
  --line: #cccccc;
  --line-strong: #000000;
  --shade: #f4f4f4;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.entry { min-width: 0; }

.entry__header h1 { margin: 0 0 8px; color: var(--accent); }

.muted { color: var(--muted); font-size: 0.9rem; }
.req { color: var(--ink); font-weight: 700; }

fieldset {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 0 18px;
}

/* Float the legend so it sits as a normal block at the top of the fieldset instead of
   straddling the top border. */
legend {
  float: left;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  font-weight: 700;
}
legend + * { clear: both; }

fieldset.subgroup {
  background: var(--shade);
  margin: 14px 0 0;
}

label {
  display: block;
  margin: 12px 0;
  font-weight: 600;
}
label .muted { font-weight: 400; display: inline; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 11px;
  font: inherit;
  font-weight: 400;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.options { display: grid; gap: 8px; }
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 400;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}
.option input { width: auto; margin: 0; }
.option:hover { border-color: var(--line-strong); }

/* Honeypot: visually and assistively hidden, still in the DOM for bots. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button[type="submit"] {
  font: inherit;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 13px 22px;
  cursor: pointer;
  width: 100%;
}
button[type="submit"]:disabled { opacity: 0.5; cursor: progress; }

.form-error {
  color: var(--ink);
  font-weight: 600;
  background: var(--shade);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.banner {
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 0 18px;
  background: var(--shade);
  border: 1px solid var(--line-strong);
}
.banner h2 { margin: 0 0 6px; }

.cf-turnstile { margin: 6px 0 16px; }

/* Sticky running total */
.total {
  position: sticky;
  top: 24px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
}
.total h2 { margin: 0 0 12px; color: var(--accent); font-size: 1.1rem; }
.total__lines {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 50vh;
  overflow: auto;
}
.total__lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}
.total__grand {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.2rem;
  border-top: 2px solid var(--line-strong);
  padding-top: 12px;
}

@media (max-width: 820px) {
  body { grid-template-columns: 1fr; }
  .total { position: static; order: 2; }
}
