:root {
  color-scheme: light;
  --bg: #f5f2ec;
  --paper: #fffdf8;
  --ink: #171717;
  --muted: #68706d;
  --line: #ddd5c6;
  --accent: #b3261e;
  --green: #26644d;
  --gold: #c39a35;
  --shadow: 0 14px 36px rgb(0 0 0 / 14%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.appShell {
  width: min(100%, 820px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(88px + env(safe-area-inset-bottom));
}

.topBar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

.topMeta {
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
  font-size: 13px;
}

.topMeta span {
  color: var(--green);
  font-weight: 900;
}

.topMeta strong {
  max-width: 152px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statusPanel {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
}

.statusDot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
}

.appView {
  display: none;
}

.appView.active {
  display: block;
}

.viewHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.secondaryButton,
.primaryButton,
.iconButton {
  border-radius: 8px;
  font-weight: 900;
}

.secondaryButton {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.primaryButton {
  width: 100%;
  min-height: 50px;
  border: 0;
  background: var(--accent);
  color: white;
}

.primaryButton:disabled {
  opacity: 0.5;
}

.iconButton {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.searchBox {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
}

.searchBox svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.searchBox input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.menuList,
.cartItems,
.historyList {
  display: grid;
  gap: 10px;
}

.menuItem,
.cartLine,
.historyCard,
.staffPanel,
#checkoutPanel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.menuItem {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.dishMark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #efe4d2;
  color: var(--accent);
  font-weight: 900;
}

.menuItem h3 {
  margin-bottom: 3px;
  font-size: 16px;
}

.menuItem p,
.staffPanel p,
.empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.menuItem strong {
  display: block;
  margin-top: 6px;
}

.stepper {
  display: grid;
  grid-template-columns: 34px 34px 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.stepper button {
  height: 34px;
  border: 0;
  background: transparent;
  font-weight: 900;
}

.stepper span {
  text-align: center;
  font-weight: 900;
}

.cartLine {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
}

.cartLine span,
.historyCard span {
  color: var(--muted);
  font-size: 13px;
}

.historyCard {
  padding: 12px;
}

.historyCard header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.historyCard ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.staffPanel,
#checkoutPanel {
  padding: 14px;
}

.staffPanel h2 {
  margin-bottom: 8px;
}

.staffPanel .primaryButton {
  margin-top: 18px;
}

.totals {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.totalLine {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.splitControl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-weight: 800;
}

.splitControl input {
  width: 76px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  text-align: center;
}

.splitResult {
  margin: 12px 0;
  color: var(--muted);
}

.checkoutBarcode {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: 120px;
  margin-top: 14px;
  padding: 18px 12px;
  border-radius: 8px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.barcodeBar {
  width: 3px;
  min-height: 82px;
  background: var(--ink);
}

.barcodeBar.thin {
  width: 1px;
}

.barcodeBar.wide {
  width: 5px;
}

.barcodeText {
  display: block;
  margin-top: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.drawerBackdrop {
  position: fixed;
  inset: 0;
  z-index: 7;
  background: rgb(0 0 0 / 32%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.drawerBackdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.categoryDrawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 8;
  width: min(82vw, 330px);
  padding: max(16px, env(safe-area-inset-top)) 14px 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: translateX(-110%);
  transition: transform 180ms ease;
}

.categoryDrawer.open {
  transform: translateX(0);
}

.drawerHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.categoryList {
  display: grid;
  gap: 8px;
}

.categoryButton {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  text-align: left;
  font-weight: 900;
}

.categoryButton.active {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.bottomNav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 820px;
  margin: 0 auto;
  padding: 7px 8px max(7px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  box-shadow: 0 -10px 30px rgb(0 0 0 / 10%);
  backdrop-filter: blur(14px);
}

.navItem {
  display: grid;
  min-width: 0;
  min-height: 56px;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}

.navItem svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.navItem.active {
  background: #efe4d2;
  color: var(--accent);
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 88px;
  left: 14px;
  z-index: 9;
  max-width: 792px;
  margin: 0 auto;
  padding: 12px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  text-align: center;
  pointer-events: none;
  transform: translateY(120px);
  transition: transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
}
