:root {
  color-scheme: light;
  --ink: #211a17;
  --muted: #655953;
  --page: #f7f5f2;
  --paper: #fffdf9;
  --line: #e8e0d9;
  --orange: #f1762e;
  --accent: #9b3912;
  --wash: #fff0e6;
  --good: #176140;
  --good-bg: #e6f6ed;
  --wait: #734709;
  --wait-bg: #fff1d7;
  --bad: #8b2439;
  --bad-bg: #fce9ee;
  --radius: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: var(--page); color: var(--ink); font: 16px/1.45 system-ui, sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, a.button { min-height: 44px; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
:where(button, a, input, select, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(1.55rem, 4.8vw, 2.4rem); line-height: 1.13; letter-spacing: -.04em; }
h2 { font-size: 1.125rem; line-height: 1.3; letter-spacing: -.015em; }
h3 { font-size: 1rem; line-height: 1.3; }
small, .muted { color: var(--muted); }
small { font-size: .82rem; }
.frame { width: min(100% - 32px, 960px); margin-inline: auto; }
.top { padding-top: env(safe-area-inset-top, 0px); background: var(--paper); border-bottom: 1px solid var(--line); }
.top-row { min-height: 58px; display: flex; align-items: center; gap: 12px; }
.wordmark { flex: none; display: inline-flex; align-items: center; }
.wordmark img { display: block; width: 81px; height: 34px; object-fit: contain; object-position: left center; }
.top-label { color: var(--muted); font-size: .8rem; }
.quiet { flex: none; margin-left: auto; border: 0; border-radius: 10px; padding: 0 10px; background: transparent; color: var(--ink); font-size: .88rem; font-weight: 700; }
.quiet:hover { background: var(--wash); }
main.frame { min-height: 65dvh; padding-block: 20px; }
.footer { padding-block: 14px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.stack, .stack-tight, .form, .page-heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.stack-tight { gap: 10px; }
.page-heading { gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.panel, .hero { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.eyebrow { color: var(--accent); font-size: .72rem; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.balance-block { min-width: 0; }
.balance-block p { font-size: .85rem; }
.balance { font-size: clamp(1.85rem, 8vw, 3rem); font-weight: 820; line-height: 1.15; letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.overview-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.overview-totals > div { min-width: 0; }
.overview-totals dt { color: var(--muted); font-size: .79rem; }
.overview-totals dd { font-size: clamp(.96rem, 4vw, 1.22rem); font-weight: 760; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.admin-totals .credit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.next-action { display: grid; gap: 7px; }
.nav {
  position: fixed; z-index: 3; inset: auto 0 0; display: flex; gap: 0;
  padding: 4px max(8px, env(safe-area-inset-right, 0px)) max(5px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--line); background: var(--paper);
}
.nav button {
  flex: 1 1 0; min-width: 0; min-height: 53px; display: grid; justify-items: center; align-content: center;
  gap: 2px; border: 0; border-radius: 10px; padding: 4px 1px; background: transparent; color: var(--muted);
  font-size: .68rem; font-weight: 720; line-height: 1.15; white-space: normal; text-align: center;
}
.nav button svg { width: 20px; height: 20px; }
.nav [aria-current=page] { background: var(--wash); color: var(--accent); }
.app-view { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
.button {
  display: inline-flex; align-items: center; justify-content: center; max-width: 100%; min-width: 0;
  border: 1px solid transparent; border-radius: 10px; padding: 9px 13px; background: var(--orange); color: var(--ink);
  text-decoration: none; font-size: .9rem; font-weight: 740; line-height: 1.22; text-align: center; overflow-wrap: anywhere;
}
.button:hover:not(:disabled) { filter: brightness(.95); }
.button.alt { background: var(--wash); color: var(--accent); }
.button.subtle { background: transparent; color: var(--accent); padding-inline: 0; justify-content: flex-start; }
.button.light { background: var(--orange); }
.button.danger { background: var(--bad-bg); color: var(--bad); }
.actions, .spread { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.spread { justify-content: space-between; gap: 8px 12px; }
.spread > *, .actions > * { min-width: 0; max-width: 100%; }
.section-heading { padding-bottom: 2px; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px 12px;
  padding-block: 9px; border-top: 1px solid var(--line); overflow-wrap: anywhere;
}
.row:last-child { padding-bottom: 0; }
.row-meta { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.row-meta strong { font-size: .91rem; }
.row > .button { max-width: 115px; }
.row > .actions { grid-column: 1 / -1; }
.receipt-list .row { grid-template-columns: minmax(0, 1fr); }
.receipt-list .row > .button { max-width: none; justify-self: start; }
.tag {
  display: inline-flex; width: fit-content; max-width: 100%; border-radius: 99px; padding: 2px 8px;
  font-size: .72rem; font-weight: 750; background: var(--wash); color: var(--accent);
}
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.wait { background: var(--wait-bg); color: var(--wait); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.message { padding: 10px 12px; border-radius: 10px; background: var(--wash); overflow-wrap: anywhere; }
.message.error { background: var(--bad-bg); color: var(--bad); }
.preline { white-space: pre-wrap; overflow-wrap: anywhere; }
.access-layout { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 840px; margin: 14px auto 0; }
.access-layout .signin { padding: 20px; }
.identity-art { display: none; }
.login-links { display: grid; gap: 2px; padding-top: 2px; }
.login-links .button { justify-self: start; }
.form { gap: 11px; }
.form label { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: .88rem; font-weight: 700; }
.form input, .form select, .form textarea {
  width: 100%; min-width: 0; min-height: 46px; border: 1px solid #c8bbb2; border-radius: 9px;
  background: #fff; color: var(--ink); padding: 8px 10px; font-size: 16px;
}
.form textarea { resize: vertical; min-height: 94px; }
.form .check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.form .check input { width: 18px; min-height: auto; }
.form fieldset { border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.form legend { padding: 0 5px; font-weight: 690; }
.form .check span { flex: 1; min-width: 0; }
.empty { padding: 8px 0; color: var(--muted); font-size: .88rem; }
dialog {
  position: fixed; inset: auto 0 0; margin: auto 0 0; width: 100%; max-width: 100%;
  max-height: calc(100dvh - 18px); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line);
  border-radius: 18px 18px 0 0; padding: 18px 16px max(18px, env(safe-area-inset-bottom, 0px));
  background: var(--paper); color: var(--ink); overflow-wrap: anywhere;
}
dialog::backdrop { background: #211a176f; }
dialog .form > button[type=submit] { width: 100%; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip:focus { position: absolute; z-index: 5; padding: 10px; background: #fff; }
.money { font-variant-numeric: tabular-nums; }
.access-code { font-size: 1.6rem; letter-spacing: .12em; }

@media (max-width: 359px) {
  .frame { width: calc(100% - 24px); }
  .top-label { display: none; }
  .panel, .hero { padding: 13px; }
  .access-layout .signin { padding: 16px; }
}
@media (min-width: 680px) {
  main.frame { padding-block: 26px; }
  .panel, .hero { padding: 22px; }
  .access-layout {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); margin-block: 28px;
    border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  }
  .access-layout .signin { padding: 32px; border: 0; border-radius: 0; align-content: center; }
  .identity-art {
    display: grid; align-content: center; justify-items: start; gap: 13px;
    padding: 28px; background: var(--wash);
  }
  .identity-art img { display: block; }
  .identity-title { max-width: 13ch; font-weight: 780; font-size: 1.8rem; line-height: 1.1; letter-spacing: -.04em; }
  .nav { position: static; justify-self: start; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; }
  .nav button { flex: 0 0 auto; min-height: 44px; display: flex; align-items: center; gap: 7px; padding: 6px 12px; font-size: .85rem; }
  .app-view { padding-bottom: 0; }
  .admin-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-totals .credit { grid-column: auto; display: block; }
  .next-action { grid-template-columns: auto auto; justify-content: space-between; align-items: center; }
  .row > .button { max-width: 190px; }
  .row > .actions { grid-column: auto; }
  .receipt-list .row { grid-template-columns: minmax(0, 1fr) auto; }
  dialog { inset: 0; width: min(100% - 32px, 550px); max-height: 90dvh; margin: auto; border-radius: 18px; padding: 22px; }
}
