:root {
  --brown: #543728;
  --brown-dark: #3d281d;
  --gold: #d1a84f;
  --tan: #e9cd9d;
  --cream: #faf6ee;
  --line: #e4d9c6;
  --text: #2b1d15;
  --muted: #7a6656;
  --danger: #a33a2a;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--text); }
body {
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-bottom: 3px solid var(--gold);
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
}
.topbar .logo { height: 40px; width: auto; }
.topbar .title { font-weight: 700; color: var(--brown); margin-left: auto; text-align: right; font-size: 15px; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { font-size: 34px; line-height: 1; border: 0; background: none; color: var(--brown); padding: 0 6px 4px; min-width: 44px; min-height: 44px; }
main { max-width: 720px; margin: 0 auto; padding: 16px 16px 120px; }
h1 { font-size: 22px; margin: 4px 0 12px; color: var(--brown); }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 8px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row > .grow { flex: 1; min-width: 0; }
.list-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 8px; font: inherit; color: inherit; min-height: 56px; }
.list-item .sub { color: var(--muted); font-size: 14px; }
.list-item .qty { font-weight: 700; color: var(--brown); min-width: 34px; text-align: center; background: var(--tan); border-radius: 8px; padding: 4px 8px; }
.door-no { display: flex; align-items: center; gap: 12px; background: var(--gold); color: var(--brown-dark); font-weight: 800; font-size: 34px; line-height: 1; padding: 10px 14px; border-radius: 12px; }
.door-no small { font-size: 14px; font-weight: 700; }
.topbar .title.door { font-size: 20px; background: var(--gold); color: var(--brown-dark); padding: 6px 10px; border-radius: 8px; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--tan); color: var(--brown); }
.badge.sent { background: #d7ead2; color: #2f5b27; }
label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
input[type=text], input[type=number], input[type=email], select, textarea {
  width: 100%; font: inherit; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); min-height: 48px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--tan); border-color: var(--gold); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; border: 0; border-radius: var(--radius); padding: 14px 18px; min-height: 52px; background: var(--brown); color: #fff; cursor: pointer; }
.btn.gold { background: var(--gold); color: var(--brown-dark); }
.btn.light { background: #fff; color: var(--brown); border: 2px solid var(--brown); }
.btn.danger { background: #fff; color: var(--danger); border: 2px solid var(--danger); }
.btn.block { width: 100%; }
.btn:active { transform: translateY(1px); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-weight: 600; border: 2px solid var(--line); background: #fff; color: var(--text); border-radius: 10px; padding: 10px 12px; min-height: 48px; min-width: 64px; }
.chip[aria-pressed=true] { border-color: var(--brown); background: var(--brown); color: #fff; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 52px; height: 52px; font-size: 26px; font-weight: 700; border-radius: 10px; border: 2px solid var(--brown); background: #fff; color: var(--brown); }
.stepper input { width: 80px; text-align: center; font-weight: 700; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); margin: 10px 0; min-height: 44px; }
.check input { width: 26px; height: 26px; accent-color: var(--brown); }
.muted { color: var(--muted); font-size: 14px; }
.sticky-actions { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); z-index: 4; }
.sticky-actions .inner { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sticky-actions .inner.one { grid-template-columns: 1fr; }
.sticky-actions .inner.three { grid-template-columns: 1fr 1fr 1fr; }
.sticky-actions .inner.five { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sticky-actions .inner.five .btn { padding: 10px 2px; font-size: 13px; min-height: 52px; white-space: nowrap; letter-spacing: -.01em; }
.sheet-title { font-weight: 800; color: #fff; background: var(--brown); margin: -14px -14px 6px; padding: 10px 14px; border-radius: var(--radius) var(--radius) 0 0; }
.sheet h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 4px; }
table.order td.tag { width: 48px; text-align: right; font-weight: 700; color: var(--brown); white-space: nowrap; }
table.order td.tag.head { font-size: 12px; color: var(--muted); }
table.order { width: 100%; border-collapse: collapse; font-size: 15px; }
table.order td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.order td.q { width: 56px; font-weight: 700; text-align: right; padding-right: 10px; color: var(--brown); white-space: nowrap; }
.email-box { display: flex; gap: 8px; align-items: center; background: var(--tan); border-radius: 10px; padding: 10px 12px; font-weight: 700; color: var(--brown-dark); }
.email-box span { flex: 1; overflow-wrap: anywhere; }
.email-box button { font: inherit; font-weight: 700; border: 0; background: var(--brown); color: #fff; border-radius: 8px; padding: 8px 12px; min-height: 40px; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--brown-dark); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 10; max-width: calc(100% - 32px); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.danger-link { background: none; border: 0; color: var(--danger); font: inherit; font-weight: 600; padding: 12px 0; }
