:root {
  --green: #1F4D3A;
  --green-deep: #173B2C;
  --mist: #EEF3F0;
  --line: #D4DDD8;
  --ink: #1B1F1D;
  --muted: #5E6A64;
  --saffron: #D9951E;
  --saffron-tint: #FBF1DF;
  --tomato: #B42318;
  --tomato-tint: #FDECEA;
  --paper: #FFFFFF;
  --radius-s: 6px;
  --radius-l: 12px;
  --font: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5;
  color: var(--ink); background: var(--mist);
}
a { color: var(--green); }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.topbar {
  background: var(--green); color: #fff;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  padding: .7rem max(1rem, calc((100% - 1120px) / 2));
}
.topbar .brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; margin-right: auto; }
.topbar .brand span { font-weight: 400; opacity: .8; }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; }
.topbar nav a, .topbar nav button {
  color: #fff; text-decoration: none; padding: .35rem .65rem; border-radius: var(--radius-s);
  font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer;
}
.topbar nav a:hover, .topbar nav button:hover { background: rgba(255,255,255,.12); }
.topbar nav a[aria-current="page"] { background: rgba(255,255,255,.18); }
.topbar form { margin: 0; }

main { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
main.narrow { max-width: 760px; }

.flash {
  background: var(--paper); border-left: 4px solid var(--green); padding: .75rem 1rem;
  border-radius: var(--radius-s); margin-bottom: 1.25rem;
}
.banner {
  padding: .75rem 1rem; border-radius: var(--radius-s); margin-bottom: 1.25rem;
  background: var(--saffron-tint); border-left: 4px solid var(--saffron);
}
.banner.red { background: var(--tomato-tint); border-color: var(--tomato); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none;
  padding: .6rem 1rem; border-radius: var(--radius-s); border: 1.5px solid var(--green);
  background: var(--green); color: #fff; min-height: 44px;
}
.btn:hover { background: var(--green-deep); }
.btn.quiet { background: var(--paper); color: var(--green); }
.btn.quiet:hover { background: var(--mist); }
.btn.danger { background: var(--paper); color: var(--tomato); border-color: var(--tomato); }
.btn.small { min-height: 36px; padding: .35rem .7rem; font-size: .875rem; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

label { font-weight: 700; display: block; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time],
input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: .6rem .7rem; border: 1.5px solid var(--line);
  border-radius: var(--radius-s); background: var(--paper); color: var(--ink); min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(31,77,58,.15); }
.help { font-size: .85rem; color: var(--muted); margin: .25rem 0 0; }
.err { font-size: .875rem; color: var(--tomato); font-weight: 700; margin: .3rem 0 0; }
.has-err input, .has-err select, .has-err textarea { border-color: var(--tomato); }
.req { color: var(--tomato); font-weight: 400; }

/* ---------- request form ---------- */
.form-intro { margin-bottom: 1.5rem; }
.form-intro p { max-width: 62ch; }
fieldset {
  border: 0; margin: 0 0 1rem; padding: 1.25rem; background: var(--paper);
  border-radius: var(--radius-l);
}
legend { font-weight: 700; font-size: 1.1rem; color: var(--green); padding: 0; float: left; width: 100%; margin-bottom: .75rem; }
legend + * { clear: both; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid .wide { grid-column: 1 / -1; }
.grid.counts { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips label {
  font-weight: 400; margin: 0; display: inline-flex; align-items: center; gap: .45rem;
  border: 1.5px solid var(--line); border-radius: 999px; padding: .4rem .85rem; cursor: pointer;
  min-height: 40px; background: var(--paper);
}
.chips input { accent-color: var(--green); width: 1.05rem; height: 1.05rem; margin: 0; }
.chips label:has(input:checked) { border-color: var(--green); background: var(--mist); }
.check { display: flex; gap: .6rem; align-items: center; font-weight: 400; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--green); }
.lead-note { margin: .4rem 0 0; font-size: .9rem; color: var(--saffron); font-weight: 700; display: none; }
.lead-note.show { display: block; }
.hp { position: absolute; left: -5000px; }
.submit-bar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: 1.25rem; }

/* ---------- queue: ticket rail ---------- */
.q-head { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.q-head h1 { margin: 0; margin-right: auto; }
.stats { display: flex; gap: 2rem; flex-wrap: wrap; margin: 0 0 1.25rem; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 1.6rem; line-height: 1.1; }
.stats span { font-size: .85rem; color: var(--muted); }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1.5px solid var(--line); margin-bottom: 1.25rem; }
.tabs a {
  text-decoration: none; color: var(--muted); padding: .55rem .8rem; font-weight: 700;
  border-bottom: 3px solid transparent; margin-bottom: -1.5px;
}
.tabs a[aria-current="page"] { color: var(--green); border-color: var(--green); }
.tabs .count { background: var(--saffron); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .8rem; margin-left: .25rem; }
.search { display: flex; gap: .5rem; }
.search input { width: 220px; }

.day { display: grid; grid-template-columns: 92px 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.day-rail { text-align: left; padding-top: .35rem; }
.day-rail .dow { color: var(--muted); font-size: .9rem; }
.day-rail .dnum { font-size: 2.1rem; font-weight: 700; line-height: 1; }
.day-rail .mon { font-size: .9rem; color: var(--muted); }
.day-rail.today .dnum, .day-rail.today .dow { color: var(--green); }
.tickets { display: flex; flex-direction: column; gap: .5rem; }
.ticket {
  display: grid; grid-template-columns: 118px 1fr auto; gap: 1rem; align-items: center;
  background: var(--paper); border-radius: var(--radius-s); padding: .8rem 1rem;
  text-decoration: none; color: inherit; border-left: 5px solid var(--green);
}
.ticket:hover { background: #F7FAF8; }
.ticket.st-cancelled { border-left-color: var(--line); opacity: .7; }
.ticket.st-completed { border-left-color: var(--line); }
.ticket .time { font-size: 1.35rem; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.ticket .time small { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); }
.ticket .what b { font-size: 1.05rem; }
.ticket .meta { color: var(--muted); font-size: .9rem; }
.ticket .guests { text-align: right; }
.ticket .guests b { font-size: 1.6rem; line-height: 1; display: block; }
.ticket .guests span { font-size: .75rem; color: var(--muted); }
.tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .3rem; }
.tag {
  font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px;
  background: var(--mist); color: var(--green);
}
.tag.warn { background: var(--saffron-tint); color: #8A5A0B; }
.tag.red { background: var(--tomato-tint); color: var(--tomato); }
.empty { background: var(--paper); border-radius: var(--radius-l); padding: 2rem; text-align: center; }

/* ---------- detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem; align-items: start; }
.panel { background: var(--paper); border-radius: var(--radius-l); padding: 1.25rem; margin-bottom: 1.25rem; }
.panel h2 { font-size: 1.05rem; color: var(--green); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius-s); overflow: hidden; margin: 1rem 0; }
.facts div { background: var(--mist); padding: .7rem .8rem; }
.facts > div > span { display: block; font-size: .8rem; color: var(--muted); }
.facts .was { display: block; }
.facts b { font-size: 1.25rem; }
dl.kv { display: grid; grid-template-columns: 180px 1fr; gap: .45rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; white-space: pre-wrap; }
.changed { color: var(--tomato); font-weight: 700; }
.was { color: var(--tomato); font-size: .85rem; font-weight: 400; }
.allergy { border: 2px solid var(--tomato); border-radius: var(--radius-s); padding: .7rem .9rem; margin: 1rem 0; }
.allergy b { color: var(--tomato); }
.status-pill { display: inline-block; padding: .3rem .8rem; border-radius: 999px; font-weight: 700; font-size: .9rem; background: var(--green); color: #fff; }
.status-pill.st-completed { background: var(--paper); color: var(--muted); }
.status-pill.st-cancelled { background: var(--tomato-tint); color: var(--tomato); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .6rem 0; border-top: 1px solid var(--mist); }
.timeline li:first-child { border-top: 0; }
.timeline .who { font-weight: 700; }
.timeline .when { color: var(--muted); font-size: .8rem; }
.timeline .sys { color: var(--muted); font-size: .9rem; }
.timeline .body { white-space: pre-wrap; }
.side form + form { margin-top: .75rem; }
.side .stack > * + * { margin-top: .6rem; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.cal-head h1 { margin: 0; margin-right: auto; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius-l); overflow: hidden; }
.cal .dh { background: var(--paper); padding: .4rem .5rem; font-weight: 700; font-size: .85rem; color: var(--muted); }
.cal .cell { background: var(--paper); min-height: 110px; padding: .35rem .45rem; }
.cal .cell.out { background: #F6F8F7; color: var(--line); }
.cal .cell.today { background: var(--mist); }
.cal .num { font-weight: 700; font-size: .9rem; }
.cal a.ev { display: block; font-size: .8rem; text-decoration: none; color: var(--ink); padding: .15rem .3rem; border-radius: 4px; margin-top: .2rem; background: var(--mist); border-left: 3px solid var(--green); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal a.ev.st-cancelled { text-decoration: line-through; opacity: .6; }
.cal a.ev.chg { color: var(--tomato); }

/* ---------- tables (admin) ---------- */
.table-wrap { overflow-x: auto; background: var(--paper); border-radius: var(--radius-l); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--mist); vertical-align: top; }
table.data th { font-size: .82rem; color: var(--muted); }
table.data code { font-size: .78rem; }
.inline { display: inline-flex; gap: .35rem; align-items: center; margin: 0; }
.inline select, .inline input { min-height: 36px; padding: .3rem .5rem; width: auto; }

.login { max-width: 380px; margin: 8vh auto; background: var(--paper); border-radius: var(--radius-l); padding: 2rem; }
.login h1 { color: var(--green); }
.stack > * + * { margin-top: 1rem; }

/* ---------- requester status page ---------- */
.receipt-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  dl.kv { grid-template-columns: 1fr; gap: .1rem; }
  dl.kv dd { margin-bottom: .5rem; }
}
@media (max-width: 600px) {
  .day { grid-template-columns: 1fr; gap: .4rem; }
  .day-rail { display: flex; gap: .5rem; align-items: baseline; }
  .day-rail .dnum { font-size: 1.3rem; }
  .ticket { grid-template-columns: 94px 1fr auto; gap: .7rem; padding: .7rem; }
  .ticket .time { font-size: 1rem; }
  .ticket .time { font-size: 1.1rem; }
  .search input { width: 100%; }
  .search { width: 100%; }
  .cal .cell { min-height: 70px; }
  .cal a.ev { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Event ID card ---------- */
.event-id { background: var(--paper); border: 2px solid var(--green); border-radius: var(--radius-l); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.event-id span { display: block; font-size: .85rem; color: var(--muted); }
.event-id > b { display: block; font-size: clamp(1.35rem, 7vw, 2rem); letter-spacing: .04em; color: var(--green); line-height: 1.2; white-space: nowrap; }
.event-id small b { font-weight: 700; overflow-wrap: anywhere; }
.event-id small { display: block; margin-top: .3rem; color: var(--muted); }
.status-pill.st-scheduled { background: var(--green); color: #fff; }

/* conditional fields */
[hidden] { display: none !important; }
.dietary textarea { min-height: 160px; }
.grid > .wide[data-show-if] { border-left: 3px solid var(--green); padding-left: .85rem; }

/* settings: color swatches and wall-screen preview */
input.swatch { padding: .2rem; height: 44px; cursor: pointer; }
.board-preview { margin-top: 1rem; border-radius: var(--radius-l); padding: .9rem 1rem; max-width: 420px; }
.board-preview > b { display: block; opacity: .75; margin-bottom: .5rem; }
.bp-card { display: flex; justify-content: space-between; background: rgba(255,255,255,.72); border-radius: 6px; padding: .45rem .7rem; margin-top: .4rem; font-weight: 700; }
.bp-card.warn { background: #FFD966; color: #2B1B00; }
.bp-card.urgent { background: #D93A2B; color: #fff; }
.field-note { display: inline-block; margin-left: .4rem; font-size: .78rem; font-weight: 700; color: var(--saffron-ink, #8A5A0B); background: var(--saffron-tint); border-radius: 999px; padding: .05rem .55rem; vertical-align: middle; }
ul.people { list-style: none; padding: 0; margin: 0 0 .75rem; }
ul.people li { padding: .35rem 0; border-bottom: 1px solid var(--mist); }
