:root {
  --bg: #1a1210;
  --card: #2a1c18;
  --ink: #f6efe8;
  --muted: #cbb8ad;
  --chili: #e23d2d;
  --chili-dark: #b4221c;
  --ok: #3d9b6a;
  --line: #3d2b26;
  --tap: 44px;
  --tabbar-h: 64px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.35 system-ui, -apple-system, Segoe UI, sans-serif;
}
.screen {
  height: 100dvh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#app.screen {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.eyebrow {
  margin: 0;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--chili);
  font-weight: 700;
}
h1 { margin: 2px 0 0; font-size: 22px; }
h2 { margin: 12px 0 6px; font-size: 14px; color: var(--muted); font-weight: 700; }
.sub, .hint, em { color: var(--muted); font-style: normal; font-weight: 400; }
.login-card {
  margin: auto 0;
  padding: 24px 20px;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 6px;
  flex-shrink: 0;
  background: var(--bg);
}
.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 16px calc(12px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.view::-webkit-scrollbar { width: 0; height: 0; display: none; }
.field { display: block; margin: 8px 0; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, textarea {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
}
textarea { min-height: 64px; resize: none; }
.cards { display: grid; gap: 8px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
}
.card h3 { margin: 0 0 4px; font-size: 15px; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: var(--tap);
}
.row .label { color: var(--muted); font-size: 13px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 12px;
  background: var(--chili);
  color: white;
  font-size: 22px;
  font-weight: 700;
}
.stepper button:active { background: var(--chili-dark); }
.stepper .qty {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 18px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  margin: 8px 0;
}
.check input { width: 22px; height: 22px; min-height: 22px; }
.total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  padding: 12px 14px;
  background: #3a1f1a;
  border-radius: 14px;
  font-size: 18px;
}
.btn {
  min-height: var(--tap);
  width: 100%;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  padding: 12px;
}
.btn.primary { background: var(--chili); color: #fff; }
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  width: auto;
  padding: 8px 14px;
}
.btn.small { width: auto; min-height: 40px; padding: 8px 12px; font-size: 14px; }
.err { color: #ff8a7a; font-size: 14px; }
.tabbar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 4px 12px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.btn.danger { background: #7a1f1a; color: #fff; }
.prep-list { display: grid; gap: 8px; }
.prep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}
.prep-info { flex: 1; min-width: 0; }
.prep-who {
  font-size: 13px;
  color: var(--ink);
  text-align: right;
  max-width: 46%;
  line-height: 1.35;
  font-weight: 700;
}
.prep-qty {
  min-width: 64px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--chili);
  text-align: right;
}
.prep-name { font-size: 18px; font-weight: 700; }
.prep-size { color: var(--muted); font-size: 14px; }
.tab {
  min-height: var(--tap);
  border: 0;
  border-radius: 14px;
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
}
.tab.on { background: var(--chili); color: #fff; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 12px;
}
.chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
.chip.on { background: var(--chili); border-color: var(--chili); }
.order-list { display: grid; gap: 8px; }
.order {
  text-align: left;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  color: inherit;
  font: inherit;
}
.order .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #3d2b26;
  font-size: 12px;
  text-transform: capitalize;
}
.badge.paid { background: var(--ok); color: #fff; }
.sheet {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 5;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}
.sheet-card {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sheet-card::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sheet-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
[hidden] { display: none !important; }

.suggest {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  margin-top: -4px;
  margin-bottom: 8px;
  overflow: hidden;
}
.suggest button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  padding: 12px;
  min-height: var(--tap);
}
.suggest button:active { background: #3a1f1a; }
.picked {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  background: #3a1f1a;
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.picked-actions { display: flex; flex-direction: column; gap: 6px; }
.person-card { display: grid; gap: 8px; }
.person-rename { display: flex; gap: 8px; align-items: center; }
.person-rename input { flex: 1; min-width: 0; }
.person-rename .btn { width: auto; flex: 0 0 auto; }

@media (hover: hover) and (pointer: fine) {
  .view,
  .sheet-card {
    scrollbar-width: thin;
    scrollbar-color: #7a5348 var(--card);
    -ms-overflow-style: auto;
  }
  .view::-webkit-scrollbar,
  .sheet-card::-webkit-scrollbar {
    width: 12px;
    height: 12px;
    display: block;
  }
  .view::-webkit-scrollbar-track,
  .sheet-card::-webkit-scrollbar-track {
    background: var(--card);
  }
  .view::-webkit-scrollbar-thumb,
  .sheet-card::-webkit-scrollbar-thumb {
    background: #7a5348;
    border-radius: 8px;
    border: 2px solid var(--card);
  }
}
