/* Matches her printed pricing menu: cream gingham, red Poppins lettering,
   a chunky retro script for titles, and thin red frames. */
:root {
  --red: #d23a2e;
  --red-deep: #a92a20;
  --red-soft: #c4685c;
  --red-line: #efc4ba;
  --cream: #fffaf1;
  --gingham: #fbf2e2;
  --check: rgba(231, 196, 142, .42);
  --tan: #f3e3c6;
  --warn-bg: #fde4dc;
  --display: "Shrikhand", "Cooper Black", Georgia, serif;
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--red-deep); font: 500 16px/1.45 var(--sans); }
body {
  min-height: 100vh;
  background-color: var(--gingham);
  background-image: linear-gradient(90deg, var(--check) 50%, transparent 50%), linear-gradient(var(--check) 50%, transparent 50%);
  background-size: 64px 64px;
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
.display { font-family: var(--display); font-weight: 400; color: var(--red); letter-spacing: .01em; }

/* Framed panels, like the boxes on the menu */
.panel { background: var(--cream); border: 2px solid var(--red); padding: 14px 16px; margin: 0 0 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 4px;
  border: 2px solid var(--red); background: var(--cream); color: var(--red);
  font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--red); color: var(--cream); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; }
.link { background: none; border: 0; padding: 12px 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: var(--red-soft); font-weight: 600; }
.err { color: var(--red); font-weight: 600; min-height: 1.4em; margin: 8px 0 0; }
.hint { color: var(--red-soft); font-size: 14px; margin: 10px 0 0; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login form { width: min(360px, 100%); display: grid; gap: 18px; padding: 26px 22px; outline: 2px solid var(--red); outline-offset: 7px; }
.login h1 { font-size: 38px; text-align: center; }

label { display: grid; gap: 6px; font-size: 15px; font-weight: 600; color: var(--red); }
label small { font-size: 13px; font-weight: 500; color: var(--red-soft); }
input[type=text], input[type=password], input:not([type]), input[inputmode] {
  min-height: 48px; padding: 0 14px; border: 2px solid var(--red-line); border-radius: 4px;
  background: #fff; color: var(--red-deep); font-size: 17px; font-weight: 500;
}
input:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: transparent; }
input::placeholder { color: #dba79d; }

/* App frame */
#app { min-height: 100vh; padding-bottom: calc(76px + var(--safe-b)); }
.top { padding: 18px 20px 6px; max-width: 640px; margin: 0 auto; text-align: center; }
.title-box {
  font-size: 30px; line-height: 1.2; padding: 8px 14px 10px; margin: 6px 6px 12px;
  background: var(--cream); border: 2px solid var(--red); outline: 2px solid var(--red); outline-offset: 5px;
  overflow-wrap: anywhere;
}
.today { font-size: 17px; font-weight: 700; color: var(--red); margin: 0; }
.sync { margin: 0; font-size: 13px; color: var(--red-soft); }
.sync.pending { color: var(--red); font-weight: 700; }
.view { padding: 12px 16px; max-width: 640px; margin: 0 auto; }
.section-title { font-family: var(--display); font-weight: 400; color: var(--red); font-size: 24px; margin: 26px 0 10px; text-align: center; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--cream); border-top: 2px solid var(--red); padding-bottom: var(--safe-b);
}
.tabs button { background: none; border: 0; min-height: 60px; font-size: 16px; font-weight: 600; color: var(--red-soft); cursor: pointer; }
.tabs button.on { color: var(--cream); background: var(--red); font-weight: 700; }

/* Scanner */
.scanner { position: relative; aspect-ratio: 3 / 2; background: #3a1814; border: 2px solid var(--red); overflow: hidden; display: grid; place-items: center; margin-bottom: 16px; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; height: 70%; aspect-ratio: 1; border: 3px solid var(--cream); border-radius: 6px; box-shadow: 0 0 0 999px rgba(58,24,20,.3); opacity: 0; transition: opacity .2s; }
.scanner.live .frame { opacity: 1; }
.scanner.hit .frame { border-color: #ffd36b; }
.scanner .start { position: relative; }
.scanner.live .start { display: none; }
.cam-msg { position: absolute; bottom: 8px; left: 12px; right: 12px; margin: 0; color: var(--cream); font-size: 14px; font-weight: 600; text-align: center; }
.has-basket .scanner { aspect-ratio: 2 / 1; }

/* Menu-style lists: a heading line per type, designs under it */
.menu-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 19px; font-weight: 700; color: var(--red); padding: 10px 0 6px; border-bottom: 2px solid var(--red); }
.menu-head:not(:first-child) { margin-top: 14px; }
.menu-price { font-size: 15px; font-weight: 700; color: var(--red); }
.menu-title { font-size: 34px; text-align: center; margin: 4px 0 10px; }
.price-list { list-style: none; margin: 0; padding: 0; text-align: center; }
.price-list button { background: none; border: 0; width: 100%; padding: 9px 4px; cursor: pointer; font-size: 21px; font-weight: 700; color: var(--red); border-bottom: 1px solid var(--red-line); }
.price-list li:last-child button { border-bottom: 0; }
.price-list button:active { background: var(--tan); }
.center { justify-content: center; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { border-bottom: 1px solid var(--red-line); }
.rows > li:last-child { border-bottom: 0; }
.row-btn {
  width: 100%; display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center;
  padding: 9px 0; background: none; border: 0; text-align: left; cursor: pointer;
}
.row-btn:active { background: var(--tan); }
.thumb { width: 52px; height: 52px; object-fit: cover; background: var(--tan); border: 1.5px solid var(--red); display: grid; place-items: center; font-size: 10px; line-height: 1.1; font-weight: 700; color: var(--red); text-align: center; padding: 2px; }
.row-title { display: block; font-weight: 700; color: var(--red-deep); }
.row-sub { display: block; font-size: 13px; color: var(--red-soft); }
.row-sub.low { color: var(--red); font-weight: 700; }
.row-add { font-size: 14px; font-weight: 700; color: var(--red); border: 2px solid var(--red); border-radius: 4px; padding: 4px 10px; min-width: 56px; text-align: center; }
.row-add b { font-weight: 700; }
.empty { color: var(--red-soft); padding: 8px 0; margin: 0; }

.settings li { padding: 4px 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 15px; min-height: 52px; }
.switch-row input { width: 26px; height: 26px; accent-color: var(--red); flex: none; }
.field-row { padding: 8px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 16px; }

/* This sale (basket), docked above the tabs while selling */
.basket {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(60px + var(--safe-b)); z-index: 7;
  width: min(640px, 100%); max-height: 56vh;
  background: var(--cream); border: 2px solid var(--red); border-bottom: 0;
  display: flex; flex-direction: column;
  box-shadow: 0 -6px 24px rgba(120, 40, 30, .18);
  animation: up .16s ease-out;
}
.basket-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px 2px; }
.basket-head h2 { font-size: 22px; }
.basket-head .link { padding: 6px 0; }
/* Items scroll; the total and the Paid button never leave the screen. */
.basket-body { flex: 1 1 auto; min-height: 56px; overflow-y: auto; padding: 0 16px 6px; display: grid; gap: 8px; align-content: start; }
.basket-foot { flex: none; border-top: 2px solid var(--red); padding: 8px 16px 12px; display: grid; gap: 6px; }
.total-line .link { font-size: 13px; padding: 4px 0 4px 10px; }
.basket-lines { list-style: none; margin: 0; padding: 0; }
.basket-lines li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--red-line); }
.qty { display: inline-flex; align-items: center; gap: 2px; }
.qty button { width: 36px; height: 36px; border: 2px solid var(--red); background: #fff; color: var(--red); font-size: 20px; font-weight: 700; line-height: 1; border-radius: 4px; cursor: pointer; }
.qty b { min-width: 26px; text-align: center; color: var(--red); }
.b-amt { font-weight: 700; color: var(--red); text-align: right; min-width: 52px; font-variant-numeric: tabular-nums; }
.b-amt s, .total-line s { display: block; font-size: 12px; font-weight: 500; color: var(--red-soft); }
.deal-line { margin: 0; font-weight: 700; color: var(--red); }
.nudge { margin: 0; font-size: 14px; color: var(--red-soft); }
.total-line { display: flex; justify-content: space-between; align-items: center; font-size: 18px; font-weight: 700; color: var(--red); }
.total-line > span:last-child { text-align: right; }
.total-line s { display: inline; font-size: 15px; }
.total-line strong { font-size: 30px; }

/* Ledger */
.range { display: flex; gap: 8px; margin-bottom: 14px; justify-content: center; }
.range button { border: 2px solid var(--red); background: var(--cream); color: var(--red); border-radius: 4px; min-height: 40px; padding: 0 12px; cursor: pointer; font-size: 14px; font-weight: 600; }
.range button.on { background: var(--red); color: var(--cream); }
.summary { font-size: 17px; font-weight: 700; color: var(--red); margin: 0 0 6px; }
.day-head { font-size: 13px; letter-spacing: .05em; text-transform: uppercase; font-weight: 700; color: var(--red); margin: 16px 0 0; padding-bottom: 4px; border-bottom: 2px solid var(--red); }
.sale-row { display: grid; grid-template-columns: 56px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--red-line); }
.sale-row .time { color: var(--red-soft); font-size: 13px; font-variant-numeric: tabular-nums; }
.sale-row .what { font-weight: 600; }
.sale-row .amt { font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; text-align: right; }
.sale-row .amt s { color: var(--red-soft); font-size: 12px; font-weight: 500; display: block; }
.sale-row.void .what, .sale-row.void .amt { text-decoration: line-through; color: var(--red-line); }
.sale-row .void-btn { background: none; border: 0; color: var(--red-soft); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 8px 0 8px 4px; }
.sale-row .tag { display: block; font-size: 12px; font-weight: 500; color: var(--red-soft); }

/* Sheets (editors) */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(90, 30, 22, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: min(560px, 100%); background: var(--cream); border: 2px solid var(--red); border-bottom: 0;
  padding: 20px 18px calc(14px + var(--safe-b)); display: grid; gap: 14px;
  max-height: 92vh; overflow-y: auto; animation: up .18s ease-out;
}
.sheet h2 { font-size: 26px; text-align: center; }
@keyframes up { from { transform: translate(var(--tx, 0), 40px); opacity: .4; } to { transform: translate(var(--tx, 0), 0); opacity: 1; } }
.basket { --tx: -50%; }
.warn { background: var(--warn-bg); color: var(--red); border: 2px solid var(--red); padding: 10px 12px; margin: 0; font-weight: 700; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 2px solid var(--red-line); background: #fff; color: var(--red); border-radius: 4px; min-height: 40px; padding: 0 12px; cursor: pointer; font-size: 14px; font-weight: 600; }
.sale-buttons { display: grid; gap: 10px; grid-auto-flow: column; grid-auto-columns: 1fr; }
.sale-buttons .btn { min-height: 58px; font-size: 20px; }
.cancel { justify-self: center; }
.preview { width: 100%; max-height: 220px; object-fit: contain; background: var(--tan); border: 2px solid var(--red); }

fieldset.type-pick { border: 0; padding: 0; margin: 0; }
.type-pick legend { font-size: 15px; font-weight: 600; color: var(--red); padding: 0; margin-bottom: 6px; }
.radio-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 2px solid var(--red-line); border-radius: 4px; margin-bottom: 6px; background: #fff; cursor: pointer; }
.radio-row:has(input:checked) { border-color: var(--red); background: var(--tan); }
.radio-row input { width: 20px; height: 20px; accent-color: var(--red); margin: 0; }
.deal-pick { display: grid; gap: 6px; font-size: 15px; font-weight: 600; color: var(--red); }
.deal-pick small { font-size: 13px; font-weight: 500; color: var(--red-soft); }
.deal-inputs { display: flex; align-items: center; gap: 8px; }
.deal-inputs input { width: 80px; text-align: center; }

/* Toast */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + var(--safe-b)); z-index: 15;
  width: min(520px, calc(100% - 24px)); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--red); color: var(--cream); border-radius: 4px; padding: 10px 10px 10px 16px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(120, 40, 30, .25);
}
.toast button { background: var(--cream); color: var(--red); border: 0; border-radius: 4px; min-height: 40px; padding: 0 18px; font-weight: 700; cursor: pointer; }

/* Google Sheet settings */
.gs-status { margin: 0 0 10px; }
.gs-status.ok { color: var(--red); font-weight: 700; }
.gsheet details { border-top: 1px solid var(--red-line); padding: 4px 0 0; }
.gsheet summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 700; color: var(--red); }
.steps { padding-left: 22px; margin: 6px 0 12px; display: grid; gap: 10px; }
.steps .btn { margin-right: 4px; }
.gs-script { width: 100%; height: 120px; font: 12px/1.4 ui-monospace, Consolas, monospace; border: 2px solid var(--red-line); border-radius: 4px; background: #fff; padding: 8px; }
