:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #12313c;
  background: #f8f4e9;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, input:focus-visible { outline: 3px solid #ee8e18; outline-offset: 3px; }
.brand { background: var(--board-brand, #f9b627); }
.brand img, .admin-header img { display: block; width: 100%; max-height: 11vh; object-fit: contain; }
.brand-title { display: none; }
html[data-original-banner="false"] .brand { display: grid; place-items: center; min-height: clamp(4rem, 9vh, 7rem); padding: .35rem 1rem; border-bottom: .2rem solid var(--board-heading); }
html[data-original-banner="false"] .brand img { display: none; }
html[data-original-banner="false"] .brand-title { display: block; color: var(--board-bg); font-size: clamp(2rem, 4vw, 4.5rem); line-height: 1; letter-spacing: .04em; text-transform: uppercase; font-weight: 900; text-align: center; }
html[data-original-banner="true"] .brand { background: #f9b627; }
html[data-theme="christmas"] .brand-title { color: #fff9ec; }
.board { --board-brand: #f9b627; --board-bg: #101010; --board-text: #fff9de; --board-heading: #ffd343; --board-row: #232323; --board-quantity: #ffd343; --board-footer: #eee0ac; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: var(--board-bg); color: var(--board-text); }
html[data-theme="modern"] .board { --board-brand: #c59b42; --board-bg: #081d32; --board-text: #f6f3e9; --board-heading: #e3bd64; --board-row: #143451; --board-quantity: #ffdc8a; --board-footer: #c5d7df; }
html[data-theme="thanksgiving"] .board { --board-brand: #c47c30; --board-bg: #361b1b; --board-text: #fff5df; --board-heading: #f1bd70; --board-row: #62352c; --board-quantity: #ffd591; --board-footer: #f1d5b7; background-image: radial-gradient(circle at 95% 2%, #b2692533, transparent 34%); }
html[data-theme="christmas"] .board { --board-brand: #b32934; --board-bg: #092b27; --board-text: #fff9ec; --board-heading: #f6d891; --board-row: #184943; --board-quantity: #ffdf9b; --board-footer: #d3e2d7; background-image: radial-gradient(circle at 95% 2%, #b3293433, transparent 32%); }
html[data-theme="christmas"] .board-table tbody tr { border-left: .25rem solid #b32934; }
html[data-theme="thanksgiving"] .board-table tbody tr { border-left: .25rem solid #bc7632; }
.board-content { flex: 1; min-height: 0; overflow: hidden; padding: clamp(.4rem, 1vw, 1rem); }
.board-table { --columns: minmax(0, 43fr) minmax(0, 43fr) minmax(7.5rem, 14fr); width: 100%; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .3rem; }
.board-table thead, .board-table tbody { display: block; min-width: 0; }
.board-table thead tr, .board-table tbody tr { display: grid; grid-template-columns: var(--columns); min-width: 0; }
.board-table th { min-width: 0; text-align: left; color: var(--board-heading); font-size: clamp(1.05rem, 2vw, 2.2rem); padding: .25em .35em; white-space: nowrap; }
.board-table th:last-child { text-align: center; }
.board-table tbody { --row-gap: .22rem; display: grid; grid-auto-rows: var(--row-height, 3rem); align-content: start; gap: var(--row-gap); min-height: 0; }
.board-table tbody tr { min-height: 0; background: var(--board-row); border-radius: .35rem; }
.board-table td { min-width: 0; min-height: 0; display: flex; align-items: center; font-size: clamp(1rem, min(2vw, 2.4vh), 2.3rem); padding: .2em .35em; overflow-wrap: anywhere; line-height: 1.1; }
.board-table .quantity { justify-content: center; text-align: center; font-weight: 800; color: var(--board-quantity); }
.board-table tbody.is-empty { display: flex; align-items: center; justify-content: center; }
.board-table tbody.is-empty tr { width: 100%; display: block; background: transparent; }
.board-table .empty { justify-content: center; text-align: center; padding: 2rem; }
.person { display: flex; align-items: center; gap: .45em; min-width: 0; width: 100%; }
.person span { min-width: 0; overflow-wrap: anywhere; }
.person img { flex: 0 0 auto; width: min(5rem, 16%); height: min(5rem, calc(var(--row-height, 3rem) - 1.25rem)); object-fit: contain; border-radius: .3rem; }
.person.mbw { justify-content: flex-start; }
.person.mbw img { width: min(9rem, 46%); max-width: 100%; height: min(5rem, calc(var(--row-height, 3rem) - .6rem)); object-position: left center; }
.person.mbw.wide img { width: min(100%, 22rem); height: min(4rem, calc(var(--row-height, 3rem) - .6rem)); }
.board footer { flex: 0 0 auto; display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 1rem; font-size: clamp(.9rem, 1.2vw, 1.3rem); color: var(--board-footer); }
@media (orientation: portrait) {
  .brand img { max-height: 9vh; }
  .board-table { --columns: minmax(0, 42fr) minmax(0, 42fr) minmax(7.5rem, 16fr); }
  .board-table th { font-size: clamp(1.05rem, 2.3vw, 1.9rem); }
  .board-table td { font-size: clamp(1.15rem, 3.1vw, 2.45rem); padding: .34em .35em; }
  .person img { width: min(6rem, 20%); height: min(6rem, calc(var(--row-height, 3rem) - 1.5rem)); }
}
.admin { max-width: 1100px; margin: auto; padding-bottom: 3rem; }
.test-banner { background: #6b1b15; color: #fff; font-weight: 900; letter-spacing: .06em; text-align: center; padding: .8rem 1rem; font-size: clamp(1rem, 2.5vw, 1.35rem); }
.admin-header { background: #f9aa23; }
.admin-header img { max-height: 85px; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; padding: 1rem clamp(1rem, 3vw, 2rem); }
.admin-heading h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.admin-heading p { margin: .2rem 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 800; }
.admin-workspace { padding: 1rem clamp(1rem, 3vw, 2rem); }
.toolbar { display: grid; gap: 1rem; }
.staff-toolbar { position: sticky; top: 0; z-index: 2; grid-template-columns: minmax(0, 1fr) auto; align-items: end; padding: .45rem 0; background: #f8f4e9; }
.staff-toolbar #new { min-height: 3.25rem; padding: .6rem 1rem; border: 2px solid #07344a; border-radius: .55rem; background: #07344a; color: #fff; font-weight: 750; }
.search { display: grid; gap: .4rem; font-weight: 700; }
.search input, dialog input { width: 100%; min-height: 3.25rem; padding: .65rem .8rem; border: 2px solid #8aa2a6; border-radius: .55rem; background: #fff; color: #12313c; }
.actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.actions button, .dialog-actions button, #more, #logout button { min-height: 3.25rem; min-width: 8rem; padding: .6rem 1rem; border: 2px solid #12313c; border-radius: .55rem; background: #fff; color: #12313c; font-weight: 750; }
.actions .primary, .dialog-actions .primary { background: #07344a; color: #fff; }
.status { min-height: 1.5rem; margin: 1rem 0; color: #365862; }
.status.error, .form-error { color: #a12423; }
.record-list { display: grid; gap: .5rem; }
.record { width: 100%; min-height: 4.6rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: left; padding: .8rem 1rem; border: 2px solid #c5d3d0; border-radius: .65rem; color: #12313c; background: #fff; }
.record[aria-selected="true"] { border-color: #07344a; background: #e3f2ed; box-shadow: inset .4rem 0 #07344a; }
.record-names { display: grid; gap: .2rem; }
.record-names strong { font-size: 1.17rem; overflow-wrap: anywhere; }
.record-counts { font-weight: 700; color: #365862; text-align: right; }
.staff-workspace .record-list { gap: .4rem; }
.staff-workspace .record { min-height: 3.65rem; gap: .75rem; padding: .55rem .8rem; }
.staff-workspace .record[data-selected="true"] { border-color: #07344a; background: #e3f2ed; box-shadow: inset .4rem 0 #07344a; }
.staff-workspace .record-names { gap: .1rem; min-width: 0; }
.staff-workspace .record-names strong { font-size: 1.18rem; }
.staff-workspace .record-names span { font-size: .9rem; overflow-wrap: anywhere; }
.staff-workspace .record-counts { flex: 0 0 auto; font-weight: 800; font-size: 1.08rem; color: #07344a; }
.empty { padding: 2rem; text-align: center; }
dialog { width: min(92vw, 30rem); max-height: 90vh; overflow: auto; border: 0; border-radius: .8rem; padding: 1.4rem; color: #12313c; box-shadow: 0 1rem 3rem #0005; }
dialog::backdrop { background: #061e29b3; }
dialog form, dialog .confirm { display: grid; gap: 1rem; }
#detail, .staff-editor { width: min(92vw, 34rem); max-height: calc(var(--staff-viewport-height, 100dvh) - 1.5rem); padding: 1.25rem; }
dialog [hidden] { display: none !important; }
#detail-view, #redeem-view { display: grid; gap: 1rem; }
#detail-title { font-size: clamp(1.6rem, 5vw, 2.3rem); overflow-wrap: anywhere; }
.detail-from { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.detail-quantities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.detail-quantities div { display: grid; gap: .1rem; padding: .8rem; background: #e3f2ed; border-radius: .6rem; }
.detail-quantities strong { font-size: clamp(2rem, 8vw, 3rem); line-height: 1; color: #07344a; }
.detail-quantities span { font-weight: 700; }
.detail-status { min-height: 1.2rem; margin: 0; color: #17623f; font-weight: 750; }
#detail .dialog-actions { justify-content: stretch; }
#detail .dialog-actions button { flex: 1 1 8rem; }
.staff-editor { position: fixed; top: max(calc(var(--staff-viewport-top, 0px) + .75rem), env(safe-area-inset-top)); bottom: auto; left: 0; right: 0; margin: 0 auto; }
.staff-editor .dialog-actions { position: sticky; bottom: 0; padding: .7rem 0 .2rem; background: #fff; }
dialog h2 { margin: 0; }
dialog label { display: grid; gap: .3rem; font-weight: 700; }
.dialog-actions { justify-content: flex-end; }
.form-error { min-height: 1.2rem; margin: 0; }
.staff-login { width: min(100% - 2rem, 28rem); margin: 3rem auto; padding: 1.5rem; background: #fff; border-radius: .8rem; box-shadow: 0 .4rem 1.5rem #0002; }
.staff-login img { display: block; width: 100%; max-height: 6rem; object-fit: contain; background: #f9aa23; }
.staff-login form, .staff-login label { display: grid; gap: .7rem; }
.staff-login form { margin-top: 1.5rem; }
.staff-login input { min-height: 3.25rem; width: 100%; padding: .7rem; border: 2px solid #8aa2a6; border-radius: .5rem; }
.staff-login button, #more { min-height: 3.25rem; padding: .6rem 1rem; background: #07344a; color: #fff; border-radius: .5rem; }
.pin-login { max-width: 30rem; text-align: center; }
.pin-login #pin { font-size: 2rem; text-align: center; letter-spacing: .35em; }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin: 1rem 0; }
.pin-keypad button { min-height: 4.25rem; font-size: 1.5rem; touch-action: manipulation; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.staff-identity { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.staff-identity a { font-weight: 750; color: #07344a; }
.manage { padding: 1rem; }
.manage section { background: #fff; padding: 1rem; margin: 1rem 0; border-radius: .7rem; }
.manage form { display: grid; gap: .6rem; max-width: 30rem; margin: 1rem 0; padding: 1rem; border: 1px solid #c5d3d0; border-radius: .5rem; }
.manage label { display: grid; gap: .25rem; font-weight: 700; }
.manage input, .manage select { min-height: 3rem; padding: .5rem; }
.manage button { min-height: 3rem; }
.manage-notice { padding: .8rem; border-left: .25rem solid #956300; background: #fff4d8; }
.manage #manage-status.error { color: #a12423; font-weight: 750; }
#challenge { overflow-wrap: anywhere; font-weight: 700; }
#more { margin-top: 1rem; }
.record-names small { color: #365862; }
@media (max-width: 700px) {
  .admin-heading { display: block; }
  .staff-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .staff-toolbar #new { min-width: 6.5rem; }
  .actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .actions button { min-width: 0; padding: .5rem; }
  .record { align-items: start; flex-direction: column; gap: .4rem; }
  .record-counts { text-align: left; }
  .staff-workspace .record { align-items: center; flex-direction: row; }
  .staff-workspace .record-counts { max-width: 6rem; text-align: right; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
/* Brewery administration */
.manage { max-width: 1100px; margin: auto; padding: 1rem; }
.manage-header, .manage-section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.manage-header h1 { margin-bottom: .2rem; }
.manage-header p, .manage-section-head p { margin: .2rem 0; color: #365862; }
.manage-tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: .4rem; overflow-x: auto; padding: .7rem 0; background: #f3f6f4; }
.manage-tabs button { flex: 1 0 auto; min-height: 3.25rem; padding: .5rem .8rem; font-weight: 700; }
.manage-tabs button[aria-current="page"] { background: #07344a; color: white; }
.manage [data-panel] { margin: 0; min-height: 55vh; }
.manage [data-panel][hidden], .manage #challenge[hidden] { display: none; }
.manage-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1rem; margin-top: 1rem; }
.manage-list { display: grid; align-content: start; gap: .4rem; max-height: 60vh; overflow: auto; }
.manage-item { display: grid; gap: .2rem; width: 100%; padding: .75rem; text-align: left; border: 1px solid #b8cbc7; background: white; }
.manage-item span { font-size: .9rem; color: #365862; }
.manage-item[aria-pressed="true"] { border: 2px solid #07344a; background: #e6f2f1; }
.manage-detail { padding: 1rem; border: 1px solid #b8cbc7; border-radius: .6rem; background: #fbfdfc; overflow-wrap: anywhere; }
.manage-detail h3 { margin-top: 0; }
.manage-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.manage-actions button { flex: 1 1 10rem; }
.manage-status { min-height: 1.5rem; font-weight: 700; color: #176447; }
.manage-status.error, #action-error { color: #a12423; }
.manage dialog { width: min(92vw, 32rem); max-height: min(88vh, 800px); overflow: auto; border: 0; border-radius: .7rem; padding: 1rem; }
.manage dialog::backdrop { background: rgb(0 0 0 / .55); }
.manage dialog form { margin: 0; border: 0; padding: 0; max-width: none; }
.manage dialog .dialog-actions { display: flex; gap: .5rem; justify-content: flex-end; position: sticky; bottom: 0; background: white; padding: .5rem 0; }
.enrollment-code { padding: 1rem; margin: 1rem 0; background: #e6f2f1; border: 2px solid #176447; border-radius: .5rem; overflow-wrap: anywhere; }
.theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin: 1rem 0; }
.theme-options button { display: grid; gap: .5rem; text-align: left; min-height: 7rem; padding: 1rem; border: 2px solid #b8cbc7; }
.theme-options button[aria-pressed="true"] { border-color: #176447; box-shadow: inset 0 0 0 2px #176447; }
.theme-options [data-theme="classic"] { background: #f4dfb0; }
.theme-options [data-theme="modern"] { background: #e6f2f1; }
.theme-options [data-theme="thanksgiving"] { background: #f5dbbf; }
.theme-options [data-theme="christmas"] { background: #e2ede2; }
.theme-options .active-label { font-weight: 700; color: #176447; }
.activity-scroll { overflow-x: auto; }
.activity-table { width: 100%; border-collapse: collapse; }
.activity-table th, .activity-table td { padding: .7rem; text-align: left; border-bottom: 1px solid #b8cbc7; }
@media (max-width: 700px) { .manage-grid { grid-template-columns: 1fr; } .manage-list { max-height: 32vh; } .manage [data-panel] { min-height: auto; } .theme-options { grid-template-columns: 1fr 1fr; } }
/* Compact touch PIN sign-in */
.pin-login { width: min(100% - 1.5rem, 27rem); margin: max(.5rem, env(safe-area-inset-top)) auto max(.5rem, env(safe-area-inset-bottom)); padding: clamp(.65rem, 1.6vh, 1.2rem); }
.pin-login img { height: clamp(2.2rem, 8vh, 4rem); max-height: none; object-fit: contain; }
.pin-login h1 { font-size: clamp(1.1rem, 2.3vh, 1.55rem); margin: .3rem 0 0; }
.pin-login > p { margin: .2rem 0; }
.pin-login form { margin-top: .4rem; gap: .3rem; }
.pin-login form label { gap: .2rem; }
.pin-login #pin { min-height: clamp(2.5rem, 6vh, 3.2rem); padding: .2rem; font-size: 1.65rem; }
.pin-login .pin-keypad { gap: clamp(.25rem, 1vh, .5rem); margin: .3rem 0; }
.pin-login .pin-keypad button { min-height: clamp(2.7rem, 7.5vh, 3.8rem); padding: .15rem; font-size: 1.3rem; }
.pin-login button[type="submit"] { min-height: 3rem; }
.pin-login #pin-error { min-height: 1.2rem; margin: 0; }
.pin-login > p:last-child { margin: .3rem 0 0; }
@media (max-height: 620px) { .pin-login { width: min(100% - 1rem, 23rem); } .pin-login img { height: 2rem; } .pin-login .pin-keypad button { min-height: 2.6rem; } }
.manage .manage-confirm { display: flex; align-items: center; gap: .7rem; padding: .65rem; border-left: .25rem solid #a12423; background: #fff3ef; }
.manage .manage-confirm input[type="checkbox"] { min-height: 1.4rem; width: 1.4rem; flex: none; }
.banner-choice { display: flex !important; align-items: center; gap: .65rem !important; margin: .7rem 0; }
.manage .banner-choice input { min-height: 1.5rem; width: 1.5rem; flex: none; }
.theme-preview { display: grid; place-items: center; min-height: 5.5rem; margin: .7rem 0; border: 2px solid #b8cbc7; border-radius: .5rem; overflow: hidden; background: #f9b627; }
.theme-preview img { display: block; width: 100%; max-height: 7rem; object-fit: contain; }
.theme-preview span { display: none; }
.theme-preview[data-original-banner="false"] { padding: .5rem; background: #101010; }
.theme-preview[data-original-banner="false"] img { display: none; }
.theme-preview[data-original-banner="false"] span { display: block; color: #ffd343; font-size: clamp(1.4rem, 4vw, 2.3rem); font-weight: 900; text-transform: uppercase; text-align: center; }
.theme-preview[data-theme="modern"][data-original-banner="false"] { background: #081d32; }
.theme-preview[data-theme="modern"][data-original-banner="false"] span { color: #e3bd64; }
.theme-preview[data-theme="thanksgiving"][data-original-banner="false"] { background: #361b1b; }
.theme-preview[data-theme="thanksgiving"][data-original-banner="false"] span { color: #f1bd70; }
.theme-preview[data-theme="christmas"][data-original-banner="false"] { background: #092b27; }
.theme-preview[data-theme="christmas"][data-original-banner="false"] span { color: #fff9ec; }
.brewery-logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .5rem; margin: .7rem 0; }
.brewery-logos button { display: grid; gap: .3rem; align-content: center; min-height: 6rem; padding: .5rem; background: #183b4a; color: white; border: 2px solid transparent; }
.brewery-logos button[aria-pressed="true"] { border-color: #ec9b19; box-shadow: 0 0 0 2px #07344a; }
.brewery-logos img { width: 100%; height: 3.8rem; object-fit: contain; }
.brewery-logos span { font-size: .72rem; overflow-wrap: anywhere; }
.pending-request { padding: .65rem; border: 1px solid #b8cbc7; border-radius: .4rem; }
.pending-request p { margin: .25rem 0; font-size: .85rem; }
.pending-request .verification-number { font-size: 1.15rem; font-weight: 700; letter-spacing: .06em; }
.pending-request button, .enrollment-code button { margin: .3rem .3rem .2rem 0; }
.enrollment-page section { border-top: 1px solid #b8cbc7; padding-top: .5rem; margin-top: .7rem; }
.enrollment-page h2 { font-size: 1.1rem; margin: .3rem 0; }
.enrollment-page #request-status { overflow-wrap: anywhere; }
