:root {
  /* "Troop patch" theme (2026-12): olive, khaki, red stripe, orange accent */
  --bg: #eee7d6; --surface: #f7f3e8; --text: #22281c; --muted: #5a5c45; --border: #cfc4a8; --border-strong: #8b7d5a;
  --accent: #2f3b24; --accent-text: #fff; --red: #a8322d; --orange: #f28a1e; --on-olive: #cfd6bf;
  --warn-bg: #fbeec4; --err-bg: #f8e0dc; --err: #8f241f;
  --head: "Oswald", "Arial Narrow", Impact, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--red); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header.site { background: var(--accent); border-bottom: 6px solid var(--red); }
header.site a.brand { display: flex; align-items: center; gap: 14px; padding: 12px 0; color: #eee7d6; text-decoration: none; }
header.site .patch { width: 72px; height: 72px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title { font: 700 26px/1.05 var(--head); text-transform: uppercase; letter-spacing: .01em; }
.brand-sub { font-size: 14px; color: var(--on-olive); }
footer.site { margin-top: 48px; padding: 20px 0; background: var(--accent); color: var(--on-olive); font-size: 14px; }
footer.site a { color: #fff; }
main.wrap { padding-top: 28px; }
h1 { font: 700 30px/1.1 var(--head); text-transform: uppercase; letter-spacing: .01em; color: var(--accent); margin: 0 0 12px; }
h2 { font: 700 21px/1.2 var(--head); text-transform: uppercase; letter-spacing: .01em; color: var(--accent); margin: 32px 0 12px; }
.step-h { display: flex; align-items: center; gap: 10px; }
.step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; font-size: 16px; flex: none; }
h3 { font-size: 16px; margin: 0 0 8px; }
.lead { font-size: 18px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.info, .notice { background: var(--surface); border: 2px solid var(--accent); border-radius: 6px; padding: 12px 16px; margin: 16px 0; }
.info p { margin: 4px 0; }
.info strong { font-family: var(--head); text-transform: uppercase; letter-spacing: .02em; color: var(--red); font-weight: 700; }
.notice { background: var(--warn-bg); }
.error { background: var(--err-bg); color: var(--err); border-radius: 8px; padding: 12px 16px; }
table.items { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
table.items th, table.items td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.items thead th { font: 600 14px var(--head); text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.items tfoot th { border-bottom: 0; border-top: 3px double var(--accent); font: 700 20px var(--head); }
.num { text-align: right !important; white-space: nowrap; }
input.qty { width: 72px; text-align: right; }
.stepper { display: inline-flex; align-items: center; background: var(--accent); border-radius: 6px; }
.stepper button { min-height: 40px; width: 36px; padding: 0; border: 0; background: transparent; color: #eee7d6; font-size: 20px; line-height: 1; }
.stepper input.qty { width: 44px; min-height: 40px; padding: 4px; border: 0; border-radius: 0; text-align: center; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.stepper input.qty::-webkit-inner-spin-button, .stepper input.qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.scroll { overflow-x: auto; }
.field { margin: 0 0 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
input, textarea { font: inherit; padding: 10px 12px; border: 2px solid var(--border-strong); border-radius: 6px; width: 100%; background: var(--surface); color: var(--text); }
input[type=checkbox] { width: auto; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: inline-flex; gap: 8px; align-items: center; margin: 0 16px 16px 0; }
button { font: inherit; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 6px; padding: 8px 12px; min-height: 44px; }
button.primary { background: var(--red); color: #fff; border-color: var(--red); padding: 12px 22px; font: 700 18px var(--head); text-transform: uppercase; letter-spacing: .03em; }
button.primary:hover { background: #8f241f; }
button.small { padding: 6px 10px; font-size: 14px; }
.narrow { max-width: 420px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 16px; border-bottom: 1px solid var(--border); margin-bottom: 24px; padding-bottom: 8px; }
.tabs a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.tabs a[aria-current] { color: var(--text); font-weight: 600; border-bottom: 3px solid var(--red); }
.tabs .right { margin-left: auto; }
.item-row { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: 2fr 1.5fr 1fr 0.7fr; gap: 0 12px; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr 1fr; } h1 { font-size: 26px; } .brand-title { font-size: 22px; } header.site .patch { width: 56px; height: 56px; } table.items th, table.items td { padding: 10px 8px; } }
.error-text { color: var(--err); }
.mode { margin: -12px 0 20px; font-size: 14px; padding: 6px 12px; border-radius: 6px; display: inline-block; }
.mode-test { background: var(--warn-bg); }
.mode-live { background: #dfe6cf; color: var(--accent); }
.test-banner { background: var(--warn-bg); border-bottom: 1px solid var(--border); text-align: center; padding: 8px 16px; font-size: 14px; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 600; margin-bottom: 4px; padding: 0; }

/* Docs rendered from docs/*.md (admin Release notes / Tech / Help) */
.doc { overflow-wrap: break-word; }
.doc th:first-child, .doc td:first-child { min-width: 90px; }
.doc h2 { font-size: 22px; } .doc h3 { font-size: 18px; margin: 24px 0 8px; } .doc h4 { font-size: 16px; margin: 20px 0 8px; }
.doc ul, .doc ol { padding-left: 24px; } .doc li { margin: 4px 0; }
.doc code { font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 4px; }
.doc pre { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; }
.doc pre code { border: 0; padding: 0; }
.doc table.items { margin: 12px 0; font-size: 14px; }
.doc blockquote { margin: 12px 0; padding: 4px 16px; border-left: 3px solid var(--border); color: var(--muted); }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
select { font: inherit; padding: 10px 12px; border: 2px solid var(--border-strong); border-radius: 6px; width: 100%; background: var(--surface); color: var(--text); }
[hidden] { display: none !important; }
details.item-row summary { cursor: pointer; font-weight: 600; }
details.item-row form { margin-top: 16px; }
input[type=radio] { width: auto; }
.field label.check { display: inline-flex; font-weight: 400; margin-bottom: 8px; }

/* Stand and troop money pages (scout bucks release) */
a.button { display: inline-block; text-decoration: none; text-align: center; border-radius: 6px; padding: 12px 22px; margin: 4px 0; min-height: 44px; }
a.button.primary { background: var(--red); color: #fff; font: 700 18px var(--head); text-transform: uppercase; letter-spacing: .03em; }
a.button.primary:hover { background: #8f241f; }
form.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 8px 0 16px; }
form.inline .field { margin: 0; }
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; min-width: 140px; }
.stat strong { display: block; font: 700 22px var(--head); }
.amount-neg { color: var(--red); }
