:root {
  --paper: #f7f4ed;
  --card: #fffdf8;
  --ink: #26392e;
  --muted: #626e65;
  --line: #d7dcd5;
  --green: #315d40;
  --soft: #edf2e8;
  --red: #a13e31;
  --redsoft: #fff1e9;
  --gold: #b18441;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { overflow-y: scroll; }
@supports (scrollbar-gutter: stable) {
  html { overflow-y: auto; scrollbar-gutter: stable; }
}
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--green); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
a, button, input, select, textarea, summary { touch-action: manipulation; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.2; letter-spacing: -.7px; overflow-wrap: anywhere; }
h2 { font-size: 22px; line-height: 1.3; }
h3 { font-size: 17px; line-height: 1.4; }
p + p { margin-top: 10px; }
[hidden] { display: none !important; }
.admin-header { background: #294d35; color: #fffdf4; border-bottom: 4px solid #c6b68d; }
.admin-header-inner { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: center; gap: 22px; max-width: 1280px; margin: auto; padding: 15px 28px; }
.admin-brand { color: inherit; text-decoration: none; line-height: 1.3; }
.admin-brand strong, .admin-brand span { display: block; }
.admin-brand strong { font-size: 21px; }
.admin-brand span { font-size: 15px; color: #e0e8db; }
.admin-session { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; max-width: 240px; }
.admin-session .session-name { min-width: 0; max-width: 120px; color: #e0e8db; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-session form { flex-shrink: 0; margin: 0; }
.admin-back { grid-column: 3; justify-self: end; color: inherit; font-size: 14px; }
.admin-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.admin-nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 9px 12px; border: 1px solid transparent; border-radius: var(--radius); color: #fffdf4; font-size: 15px; font-weight: 650; text-align: center; text-decoration: none; }
.admin-nav a:hover { background: #ffffff12; border-color: #9db299; }
.admin-nav a[aria-current="page"] { color: #24432d; background: #fffdf4; border-color: #fffdf4; }
.wrap { max-width: 1280px; margin: auto; padding: 30px 28px 44px; }
.intro { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.intro p:not(.eyebrow) { color: var(--muted); max-width: 760px; margin-top: 10px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 750; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; }
.panel { min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.panel > h2 { margin-bottom: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; max-width: 100%; padding: 10px 17px; border: 1px solid var(--green); border-radius: var(--radius); background: var(--green); color: #fff; font-size: 16px; font-weight: 650; line-height: 1.4; text-align: center; text-decoration: none; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.btn.secondary { background: #fffdf8; border-color: #879f8b; color: var(--green); }
.btn.danger { background: #fffdf8; border-color: #c68e82; color: var(--red); }
.btn.small { min-height: 44px; padding: 8px 13px; font-size: 14px; }
.btn.header-button { min-height: 44px; padding: 8px 13px; border-color: #a4b69e; background: transparent; color: inherit; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: default; }
.full { width: 100%; margin-top: 18px; }
.actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.field { display: block; min-width: 0; margin-top: 16px; font-weight: 400; }
.field > span { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 650; }
.field small, .help { display: block; margin-top: 7px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.control, input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 46px; border: 1px solid #94a299; border-radius: var(--radius); padding: 10px 12px; background: #fff; color: var(--ink); font-weight: 400; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 18px; flex-shrink: 0; accent-color: var(--green); }
input:disabled, select:disabled, textarea:disabled { opacity: 1; color: var(--ink); background: #efefea; cursor: default; }
textarea { min-height: 100px; resize: vertical; }
input[type="file"]::file-selector-button { min-height: 44px; margin-right: 12px; padding: 8px 12px; border: 1px solid #879f8b; border-radius: 9px; background: var(--soft); color: var(--green); font: inherit; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.form-grid .field { margin-top: 0; }
.form-grid .wide { grid-column: 1 / -1; }
.section-heading, .list-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.section-title { margin-bottom: 16px; }
.muted, .subtle { color: var(--muted); }
.small-text, .subtle { font-size: 14px; }
.pill, .badge { display: inline-block; padding: 4px 10px; border-radius: 20px; background: var(--soft); color: #365b3b; font-size: 12px; font-weight: 650; line-height: 1.5; }
.pill.off, .badge.off { background: #eeeae3; color: #726d62; }
.pill.lost { background: #f2eadb; color: #7a5b29; }
.pill.warning, .pill.waiting { background: #fff0d4; color: #7a5825; }
.pill.danger, .badge.rejected { background: var(--redsoft); color: var(--red); }
.notice, .flash { padding: 16px 18px; margin-bottom: 20px; border: 1px solid #b7c9af; border-radius: var(--radius); background: var(--soft); color: #345337; overflow-wrap: anywhere; font-size: 15px; }
.notice strong { font-size: 18px; }
.notice p { margin-top: 8px; }
.notice.error, .flash.error { background: var(--redsoft); border-color: #d9b3a8; color: #7c2e23; }
.notice.warning { border-color: #dbc48d; background: #fff6df; color: #745521; }
.notice a { color: inherit; }
.empty { padding: 28px 20px; border: 1px dashed #c7cfbf; border-radius: var(--radius); background: var(--card); color: var(--muted); text-align: center; }
.login { max-width: 480px; margin: 18px auto 50px; }
.login h1 { margin-bottom: 20px; }
.login .intro { display: block; margin-bottom: 20px; }
.login .field:first-of-type { margin-top: 0; }
.login-note { padding-top: 16px; margin-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 12px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 16px; border: 1px solid #879f8b; border-radius: var(--radius); background: #fffdf8; color: var(--green); font-size: 15px; font-weight: 650; cursor: pointer; }
.tab[aria-current="page"] { border-color: var(--green); background: var(--green); color: #fff; }
.tab span { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 20px; background: #e5ebdf; color: #365b3b; font-size: 12px; }
.tab[aria-current="page"] span { background: #ffffff24; color: #fff; }
summary { cursor: pointer; }
.admin-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; max-width: 1280px; margin: auto; padding: 0 28px 28px; color: var(--muted); font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (max-width: 1080px) {
  .admin-header-inner { grid-template-columns: minmax(0, 1fr) max-content; gap: 14px 20px; }
  .admin-brand { grid-column: 1; grid-row: 1; }
  .admin-session, .admin-back { grid-column: 2; grid-row: 1; }
  .admin-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}
@media (max-width: 620px) {
  .admin-header-inner { padding: 14px 16px; gap: 14px 12px; }
  .admin-brand strong { font-size: 19px; }
  .admin-brand span { font-size: 14px; }
  .admin-session { max-width: 165px; flex-wrap: wrap; gap: 6px 10px; }
  .admin-session .session-name { max-width: 165px; font-size: 13px; text-align: right; }
  .admin-nav { display: flex; flex-wrap: wrap; gap: 8px; }
  .admin-nav a { flex: 1 1 auto; padding: 9px 10px; font-size: 15px; }
  .wrap { padding: 24px 16px 34px; }
  .intro { gap: 12px; margin-bottom: 20px; align-items: flex-start; }
  .panel { padding: 18px; }
  .actions > .btn, .form-actions > .btn { flex: 1 1 180px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .wide { grid-column: auto; }
  .tabs { gap: 10px; }
  .tab { flex: 1 1 120px; padding: 10px 12px; }
  .admin-footer { padding: 0 16px 24px; }
}
