:root {
  --ink: #10241a;
  --muted: #5f6f66;
  --navy: #043520;      /* Sound Coffee dark green */
  --navy-2: #0f6b3a;
  --cream: #FCF1E9;     /* light tint of brand peach */
  --peach: #F8DECC;
  --paper: #ffffff;
  --line: #ecd9cb;
  --accent: #2DB455;    /* Sound Coffee light green */
  --accent-ink: #043520;
  --ok: #2DB455;
  --err: #b3261e;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(4, 53, 32, .16);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; }
input { font: inherit; }
[hidden] { display: none !important; }

.test-banner { background: #fff4c2; color: #5a4600; font-size: 13px; padding: 8px 16px; text-align: center; }

.hero { background: var(--navy); color: var(--peach); padding: calc(20px + env(safe-area-inset-top)) 16px 20px; }
.hero-inner { max-width: 760px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 56px; height: auto; }
.hero h1 { margin: 0; font-size: 24px; letter-spacing: .2px; }
.hero .sub { margin: 0; opacity: .8; font-size: 14px; }
.status { margin: 14px 0 0; font-size: 15px; opacity: .95; }
.status.closed { color: #fff; font-weight: 600; }

.tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 16px; background: var(--cream); border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font-size: 14px; white-space: nowrap;
}
.tabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.menu { max-width: 760px; margin: 0 auto; padding: 8px 16px 24px; }
.menu h2 { font-size: 19px; margin: 22px 0 10px; scroll-margin-top: 64px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 620px) { .grid { grid-template-columns: 1fr 1fr; } }
.card {
  display: flex; gap: 12px; align-items: stretch; text-align: left; width: 100%;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
}
.card:active { transform: scale(.99); }
.card img, .card .ph { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; flex: none; background: var(--peach); }
.card .ph { display: grid; place-items: center; color: var(--navy-2); font-size: 28px; }
.card .meta { min-width: 0; display: flex; flex-direction: column; }
.card .name { font-weight: 600; }
.card .desc { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .price { margin-top: auto; font-size: 14px; color: var(--navy-2); font-weight: 600; }
.loading, .muted { color: var(--muted); }

.cart-bar {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 10;
  max-width: 728px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px;
  padding: 14px 20px; font-weight: 600; box-shadow: var(--shadow);
}
.cart-count { background: rgba(4,53,32,.15); border-radius: 999px; min-width: 28px; padding: 2px 8px; }

.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 25, 32, .45); }
.sheet-panel {
  position: relative; width: 100%; max-width: 600px; max-height: 92vh; overflow-y: auto;
  background: var(--paper); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up .2s ease-out;
}
@media (min-width: 620px) { .sheet { align-items: center; } .sheet-panel { border-radius: 20px; } }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
.sheet-close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--peach); color: var(--navy); font-size: 22px; line-height: 1; z-index: 2; }
.sheet h2 { margin: 0 0 4px; font-size: 22px; padding-right: 40px; }
.sheet h3 { font-size: 15px; margin: 20px 0 8px; }
.item-photo { width: calc(100% + 32px); margin: -20px -16px 14px; height: 220px; object-fit: cover; display: block; border-radius: 20px 20px 0 0; }
.group { margin-top: 18px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; }
.group-head h3 { margin: 0 0 8px; }
.req { font-size: 12px; color: var(--navy-2); font-weight: 600; }
.opt { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid #f0ebe3; }
.opt input { width: 20px; height: 20px; accent-color: var(--navy); }
.opt .on { flex: 1; }
.opt .op { color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 14px; }
.chips button.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chips button small { display: block; font-size: 12px; opacity: .75; }
textarea, input[type=text], input:not([type]), input[type=tel], input[type=email] {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff; color: var(--ink);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
@media (max-width: 380px) { .row2 { grid-template-columns: 1fr; } }

.sheet-footer { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); background: var(--paper); display: flex; gap: 12px; align-items: center; padding: 14px 0 4px; margin-top: 12px; border-top: 1px solid var(--line); }
.qty { display: flex; align-items: center; gap: 10px; }
.qty button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 20px; }
.qty span { min-width: 18px; text-align: center; font-weight: 600; }
.primary { flex: 1; background: var(--navy); color: #fff; border: 0; border-radius: 12px; padding: 14px 16px; font-weight: 600; }
.primary:disabled { opacity: .5; cursor: default; }
.primary.wide { width: 100%; margin-top: 14px; }

.cart-list { list-style: none; padding: 0; margin: 12px 0 0; }
.cart-list li { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f0ebe3; }
.cart-list .ci { flex: 1; }
.cart-list .cn { font-weight: 600; }
.cart-list .cm { color: var(--muted); font-size: 13px; }
.cart-list .remove { border: 0; background: none; color: var(--err); font-size: 13px; padding: 0; margin-top: 4px; }
.totals { margin: 18px 0 6px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals dt, .totals dd { margin: 0; }
.totals .grand { font-weight: 700; font-size: 18px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px; }
.wallets { display: grid; gap: 10px; margin-top: 12px; }
.apple-pay { height: 48px; border-radius: 10px; -webkit-appearance: -apple-pay-button; -apple-pay-button-type: plain; -apple-pay-button-style: black; cursor: pointer; }
.or { text-align: center; color: var(--muted); font-size: 13px; margin: 12px 0 4px; }
#cardContainer { min-height: 90px; margin-top: 8px; }
.error { color: var(--err); font-size: 14px; margin: 8px 0 0; }

.done { text-align: center; padding-top: 32px; }
.check { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: var(--ok); color: var(--navy); font-size: 34px; display: grid; place-items: center; }
.link { display: inline-block; margin-top: 4px; color: var(--navy-2); }

.install-tip {
  position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 9; max-width: 728px; margin: 0 auto;
  background: var(--navy); color: var(--peach); border-radius: 12px; padding: 12px 44px 12px 14px; font-size: 14px; box-shadow: var(--shadow);
}
.install-tip button { position: absolute; right: 8px; top: 8px; background: none; border: 0; color: #fff; font-size: 20px; }

/* Sound Rewards */
.rewards { margin-top: 16px; background: var(--peach); border-radius: var(--radius); padding: 14px; }
.rw-head { display: flex; justify-content: space-between; align-items: baseline; }
.rw-title { font-weight: 700; color: var(--navy); }
.rw-points { font-weight: 700; color: var(--navy-2); }
.rw-msg { margin: 6px 0 0; font-size: 14px; color: var(--ink); }
.rw-tiers { display: grid; gap: 8px; margin-top: 10px; }
.rw-tiers:empty { display: none; }
.rw-tiers button { border: 0; border-radius: 10px; padding: 12px; font-weight: 600; background: var(--accent); color: var(--accent-ink); }
.rw-tiers button.applied { background: var(--navy); color: var(--peach); }
.rw-row { display: flex; gap: 8px; margin-top: 8px; }
.rw-row input { flex: 1; letter-spacing: 4px; text-align: center; }
.rw-row .primary { flex: none; }
.rw-test { font-size: 13px; color: #5a4600; background: #fff4c2; border-radius: 8px; padding: 6px 10px; margin: 8px 0 0; }
.totals .disc dd { color: var(--navy-2); font-weight: 600; }
.rw-done { background: var(--peach); border-radius: 10px; padding: 10px; font-weight: 600; color: var(--navy); }

/* Order again (returning customers) */
.usual { max-width: 760px; margin: 0 auto; padding: 14px 16px 0; }
.usual-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.usual-head h2 { font-size: 19px; margin: 0 0 8px; }
.usual-list { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.usual-list::-webkit-scrollbar { display: none; }
.usual-card {
  flex: 0 0 min(78%, 260px); scroll-snap-align: start; display: flex; flex-direction: column; gap: 3px; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.usual-card:active { transform: scale(.99); }
.usual-card .un { font-weight: 600; }
.usual-card .ud { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.usual-card .up { margin-top: auto; padding-top: 6px; display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--navy-2); }
.usual-card .go { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 2px 10px; }
.signed-out { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--peach); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; color: var(--navy); }
.usual .empty { margin: 0; font-size: 14px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--navy-2); font-size: 13px; text-decoration: underline; }
.small-btn { flex: none; border: 0; border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; background: var(--navy); color: #fff; }

/* Checkout: verify prompt, saved cards, consent */
.acct-prompt { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; background: var(--peach); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--navy); }
.saved-list .opt { gap: 10px; }
.saved-list .remove { border: 0; background: none; color: var(--err); font-size: 13px; padding: 4px; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 13px; color: var(--muted); }
.consent input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--navy); }
.consent b { color: var(--ink); }
#siStep1 .primary.wide { margin-top: 10px; }
#siStep2 .link-btn { margin-top: 12px; }
