:root {
  --bg: #f3f1ea; --card: #fff; --ink: #1b1f1c; --muted: #6a6f68; --line: #e2dfd5;
  --brand: #1f3d2b; --brand-ink: #fff; --accent: #d99a1e;
  --ok-bg: #e6f3ea; --ok: #1d6b3a; --warn-bg: #fdf1d8; --warn: #8a5a00; --bad-bg: #fbe3e1; --bad: #9b2a1f;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: baseline; gap: 8px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--brand); color: var(--brand-ink); }
.logo { font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.sub { opacity: .7; font-size: 13px; }
.who { margin-left: auto; display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.who .link { color: #cfe3d4; }
main { max-width: 520px; margin: 0 auto; padding: 12px 16px 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 12px 0; }
h1 { font-size: 22px; margin: 2px 0 4px; line-height: 1.2; }
h2 { font-size: 18px; margin: 2px 0 10px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; color: var(--muted); margin: 0; font-weight: 600; }
.facts { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 10px; margin: 12px 0 8px; }
.facts dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: 2px 0 0; font-size: 14px; }
.facts a { color: var(--brand); }
.alert { border-radius: 10px; padding: 10px 12px; font-size: 14px; background: #eee; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 0; }
input[type=text], input[type=number], input[type=password], input[type=date], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px; font: inherit; font-weight: 400;
  border: 1px solid #cfcbbf; border-radius: 10px; background: #fff; color: var(--ink); }
input[type=file] { display: block; margin-top: 6px; font-weight: 400; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#weight { font-size: 24px; font-weight: 600; }
button { font: inherit; cursor: pointer; }
.primary { display: block; width: 100%; margin-top: 18px; padding: 15px; border: 0; border-radius: 12px;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 17px; }
.primary:disabled { opacity: .5; }
.link { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; font-size: 14px; }
.back { display: block; margin: 14px auto 0; }
.stepper { display: flex; gap: 8px; margin-top: 6px; }
.stepper input { margin: 0; text-align: center; font-size: 20px; }
.stepper button { width: 56px; flex: none; border: 1px solid #cfcbbf; border-radius: 10px; background: #fff; font-size: 24px; }
fieldset { border: 0; padding: 0; margin: 14px 0 0; }
legend { font-weight: 600; font-size: 14px; padding: 0; }
.chips { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.chip { margin: 0; font-weight: 500; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 10px 14px; border: 1px solid #cfcbbf; border-radius: 999px; background: #fff; }
.chip input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); }
.total { display: grid; grid-template-columns: 1fr auto; align-items: baseline; margin-top: 16px;
  padding: 12px; border-radius: 10px; background: #f7f5ef; }
.total b { font-size: 24px; }
.total small { grid-column: 1 / -1; color: var(--muted); }
.summary { background: #f7f5ef; border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.sigwrap { margin-top: 14px; }
.sighead { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; }
#sig { display: block; width: 100%; height: 190px; margin-top: 6px; border: 1.5px dashed #b8b3a5;
  border-radius: 10px; background: #fff; touch-action: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; }
.done-mark { width: 56px; height: 56px; margin: 4px 0 8px; border-radius: 50%; background: var(--ok-bg); color: var(--ok);
  display: grid; place-items: center; font-size: 30px; font-weight: 700; }
.receipt { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; font-weight: 600; }
.links { padding-left: 18px; }
.links li { margin: 6px 0; }
.links a { color: var(--brand); font-weight: 600; }

/* ---- admin (desktop-first, still usable on a phone) */
.admin .bar a { color: inherit; text-decoration: none; }
.admin .who { gap: 16px; flex-wrap: wrap; }
.admin .who a { color: #cfe3d4; }
.admin .who form { display: inline; }
main.wide { max-width: 1180px; }
.narrow { max-width: 520px; }
.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head h1, .head h2 { margin: 0; flex: 1; }
.head input[type=search] { width: 240px; margin: 0; padding: 8px 10px; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 10px; background: var(--brand); color: #fff;
  text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.scroll { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #faf9f5; }
tr.off td { color: var(--muted); }
td a { color: var(--brand); font-weight: 600; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #eee; color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--warn-bg); color: var(--warn); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 16px; }
.grid .span2 { grid-column: 1 / -1; }
h3 { margin: 22px 0 0; font-size: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.qr { width: 96px; height: 96px; }
.card .primary { max-width: 320px; }
.admin main > p > a { color: var(--brand); font-weight: 600; }
