:root {
  --ink: #141414;
  --muted: #595959;
  --line: #e4e4e4;
  --soft: #f4f4f4;
  --yellow: #ffd400;
  --orange: #c2410c;
  --orange-dark: #9a3412;
  --danger: #b42318;
  --radius: 14px;
  --sab: env(safe-area-inset-bottom, 0px);
  --sat: env(safe-area-inset-top, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: #fff;
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}
body.lock { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: #fff; padding: 10px 14px; z-index: 100; border: 2px solid var(--ink); }
.skip:focus { top: 8px; }

/* header */
.top { background: #fff; border-bottom: 1px solid var(--line); padding: calc(var(--sat) + 8px) calc(var(--sar) + 12px) 8px calc(var(--sal) + 12px); }
.brand-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; }
.wordmark { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; background: #111; color: var(--yellow); font-weight: 900; letter-spacing: .06em; text-decoration: none; border-radius: 10px; font-size: 17px; }
.wordmark span { background: var(--yellow); color: #111; padding: 2px 6px; border-radius: 6px; }
.badge-demo { background: var(--yellow); color: #111; font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px; margin-right: auto; }
.btn-ghost, .btn-link { min-height: 44px; min-width: 44px; padding: 0 10px; background: none; border: 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; justify-content: center; }
.notice { max-width: 1200px; margin: 4px auto 0; font-size: 13px; color: var(--muted); }

main { max-width: 1200px; margin: 0 auto; padding: 0 calc(var(--sar) + 12px) 0 calc(var(--sal) + 12px); outline: none; }
.band { display: flex; gap: 8px; padding: 10px 0; align-items: center; }
.table-chip { display: flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 12px; padding: 2px 8px 2px 12px; min-height: 44px; flex: none; }
.table-label { font-weight: 700; }
#table-select { min-height: 44px; border: 0; background: transparent; font-weight: 800; padding: 0 4px; }
.search { flex: 1; min-width: 0; }
.search input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: #fff; }
.tabs-wrap { position: sticky; top: 0; background: #fff; z-index: 5; margin: 0 -12px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; }
.tab[aria-pressed="true"] { background: #111; color: var(--yellow); border-color: #111; }

/* menu list */
.menu-list { list-style: none; margin: 0; padding: 12px 0 calc(100px + var(--sab)); display: grid; gap: 12px; grid-template-columns: 1fr; }
.item { display: flex; gap: 12px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 44px; align-items: stretch; }
.item .thumb { flex: none; width: 128px; height: 128px; border-radius: 12px; overflow: hidden; background: var(--soft); position: relative; }
.thumb img, .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb svg, .photo svg { width: 100%; height: 100%; display: block; }
.ill-tag { position: absolute; left: 6px; bottom: 6px; background: #fff; color: var(--ink); border: 1px solid var(--line); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.item .info { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 4px; }
.item h3 { font-size: 17px; line-height: 1.25; }
.item .desc { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item .price { margin-top: auto; font-weight: 800; font-size: 17px; }
.empty { text-align: center; padding: 32px 12px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.foot { border-top: 1px solid var(--line); padding: 16px 0 calc(110px + var(--sab)); font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.foot p { flex-basis: 100%; }
.foot .btn-link { color: var(--ink); }

/* cart bar */
.cartbar-wrap { position: fixed; left: 0; right: 0; bottom: 0; padding: 8px calc(var(--sar) + 12px) calc(var(--sab) + 10px) calc(var(--sal) + 12px); z-index: 20; pointer-events: none; }
.cartbar { pointer-events: auto; display: flex; width: 100%; max-width: 600px; margin: 0 auto; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; background: var(--orange); color: #fff; border: 0; border-radius: 14px; font-weight: 800; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.cartbar-count { background: #fff; color: var(--orange-dark); min-width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; font-size: 14px; padding: 0 6px; }
.cartbar-label { flex: 1; text-align: left; }

/* dialogs */
dialog { border: 0; padding: 0; margin: 0; background: #fff; color: var(--ink); width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; inset: 0; overflow: hidden; }
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog[open] { display: block; }
.sheet { display: flex; flex-direction: column; height: 100%; max-height: 100dvh; }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(var(--sat) + 8px) calc(var(--sar) + 12px) 8px calc(var(--sal) + 56px); border-bottom: 1px solid var(--line); min-height: 60px; }
.sheet-head h2 { flex: 1; text-align: center; font-size: 20px; line-height: 1.25; }
.sheet-head:not(:has(.icon-btn)) { padding-right: 56px; }
.icon-btn { flex: none; width: 44px; height: 44px; border: 0; background: none; border-radius: 999px; display: grid; place-items: center; }
.icon-btn svg { width: 26px; height: 26px; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 0 12px; }
.sheet-body > * { margin-left: calc(var(--sal) + 16px); margin-right: calc(var(--sar) + 16px); }
.sheet-body > .photo, .sheet-body > .group { margin-left: 0; margin-right: 0; }
.sheet-body.prose p, .sheet-body.prose ul { margin-top: 12px; line-height: 1.5; }
.sheet-body.prose ul { padding-left: 20px; overflow-wrap: anywhere; }
.sheet-foot { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px calc(var(--sar) + 16px) calc(var(--sab) + 12px) calc(var(--sal) + 16px); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
.sheet-foot.col { flex-direction: column; align-items: stretch; }
.sheet-foot .row, .row { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-foot .row > * { flex: 1; }
.photo { width: 100%; max-width: 420px; aspect-ratio: 4 / 3; margin: 12px auto 0; position: relative; border-radius: 12px; overflow: hidden; background: var(--soft); }
.p-price { font-size: 22px; font-weight: 800; margin-top: 14px; }
.p-desc { color: var(--muted); margin-top: 4px; }
.group { margin-top: 14px; padding: 12px calc(var(--sar) + 16px) 12px calc(var(--sal) + 16px); border-top: 8px solid var(--soft); }
.group-head { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.group-head h3, .group-title { font-size: 17px; font-weight: 600; display: block; }
.tag { background: var(--soft); border-radius: 6px; font-size: 13px; padding: 2px 8px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 14px; min-height: 52px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 44px; height: 44px; margin: 0; }
.check .box { flex: none; width: 28px; height: 28px; border: 2px solid #8a8a8a; border-radius: 999px; background: #fff; display: grid; place-items: center; }
.check input:checked + .box { background: var(--orange); border-color: var(--orange); }
.check input:checked + .box::after { content: ""; width: 7px; height: 13px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check input:focus-visible + .box { outline: 3px solid #1d4ed8; outline-offset: 2px; }
textarea { display: block; width: 100%; margin-top: 8px; min-height: 110px; border: 1px solid #bdbdbd; border-radius: 14px; padding: 12px; resize: vertical; }
.hint { font-size: 13px; color: var(--muted); text-align: right; }
.sheet-foot.col .hint { text-align: left; }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper output { min-width: 32px; text-align: center; font-weight: 800; font-size: 20px; }
.step { width: 44px; height: 44px; border: 0; background: none; border-radius: 999px; display: grid; place-items: center; }
.step svg { width: 24px; height: 24px; }
.step:disabled { opacity: .35; cursor: default; }
.cta { flex: 1; min-height: 52px; border: 0; border-radius: 14px; background: var(--orange); color: #fff; font-weight: 800; font-size: 17px; padding: 0 12px; }
.cta:hover { background: var(--orange-dark); }
.cta:disabled { opacity: .6; cursor: default; }
.btn-secondary { min-height: 48px; min-width: 44px; padding: 0 16px; border: 1px solid #8a8a8a; border-radius: 12px; background: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); }
.btn-danger { min-height: 48px; min-width: 44px; padding: 0 16px; border: 1px solid var(--danger); border-radius: 12px; background: #fff; color: var(--danger); font-weight: 700; }
.btn-small { min-height: 44px; min-width: 44px; padding: 0 14px; border: 1px solid #8a8a8a; border-radius: 10px; background: #fff; font-weight: 600; }

/* product options, demo notes */
.sheet-body > #p-options, .sheet-body > .cart-full { margin-left: 0; margin-right: 0; }
.demo-note { margin-top: 10px; padding: 8px 10px; background: #fff8cc; border: 1px solid #111; border-radius: 10px; font-size: 14px; }
.opt-group { margin-inline: 0; min-width: 0; border-width: 8px 0 0; border-style: solid; border-color: var(--soft); }
.opt-group legend { float: left; width: 100%; display: flex; align-items: center; gap: 10px; padding: 0 0 4px; }
.opt-group legend + * { clear: both; }
.check { position: relative; }
.check.opt { min-height: 48px; }
.opt-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt-price { font-weight: 700; }
.item .tag { align-self: flex-start; font-size: 12px; }

/* cart (reference layout) */
.cart-full { padding: 0 calc(var(--sar) + 16px) 8px calc(var(--sal) + 16px); }
.cart-context { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 calc(-1 * (var(--sar) + 16px)) 0 calc(-1 * (var(--sal) + 16px)); padding: 12px calc(var(--sar) + 16px) 12px calc(var(--sal) + 16px); background: var(--soft); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cart-row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; flex-wrap: wrap; }
.cart-row-head h3 { font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.count-pill { background: var(--soft); border-radius: 8px; padding: 2px 8px; color: var(--ink); }
.cart-add { min-height: 44px; min-width: 44px; padding: 0 4px; background: none; border: 0; font-weight: 800; font-size: 16px; text-decoration: underline; text-underline-offset: 3px; }
.cart-actions, #c-add-more, #c-promo, .cart-row { min-height: 44px; }
.cart-row { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-top: 12px; padding: 0 4px; background: none; border: 0; border-top: 8px solid var(--soft); border-bottom: 8px solid var(--soft); font-size: 17px; text-align: left; min-height: 56px; }
.cart-section { padding: 14px 0 6px; display: grid; gap: 6px; }
.cart-section h3 { font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pay-row { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 17px; }
.pay-dot { flex: none; width: 28px; height: 28px; border-radius: 999px; border: 8px solid var(--orange); background: #fff; }
.cart-section .hint, .cart-totals .hint { text-align: left; }
.cart-totals { border-top: 8px solid var(--soft); padding-top: 10px; display: grid; gap: 8px; }
.muted-row { color: var(--muted); font-size: 16px; }
.cart-thumb { position: relative; flex: none; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--soft); }
.cart-thumb img, .cart-thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-thumb .ill-tag { display: none; }
.cl-main { min-width: 0; display: grid; gap: 6px; flex: 1; }
.cl-edit { margin-left: auto; border: 0; background: none; color: var(--orange-dark); font-weight: 800; }
.cart-line .step, .cart-line .btn-small { min-width: 44px; min-height: 44px; }
.sheet-foot.col .total-row { font-size: 20px; }

/* cart lines */
.cart-line { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.cl-top { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; }
.cl-note { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.cl-opts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.total-row { display: flex; justify-content: space-between; font-size: 18px; }
.cart-table-note { margin-top: 12px; }
.counter-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-cart { text-align: center; padding: 40px 0; color: var(--muted); display: grid; gap: 14px; justify-items: center; }
.edit-box { display: grid; gap: 8px; padding: 8px; background: var(--soft); border-radius: 12px; }
.edit-box textarea { min-height: 80px; margin: 0; }

/* receipt & counter */
.receipt-ok { margin-top: 14px; padding: 12px; background: #fff8cc; border: 1px solid #111; border-radius: 12px; font-weight: 600; }
.receipt-meta { margin-top: 12px; display: grid; gap: 2px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.status-pill { display: inline-block; margin-top: 8px; padding: 2px 10px; border-radius: 999px; background: var(--soft); font-weight: 700; font-size: 14px; }
.order-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-top: 12px; display: grid; gap: 6px; }
.counter-head { padding: 16px 0; display: grid; gap: 10px; }
.warn { background: #fff8cc; border: 1px solid #111; border-radius: 12px; padding: 10px 12px; font-weight: 600; }
.counter-list { list-style: none; margin: 0; padding: 0 0 40px; display: grid; gap: 12px; grid-template-columns: 1fr; }
.counter-list .order-card { margin: 0; }
.status-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.status-btns button[aria-pressed="true"] { background: #111; color: var(--yellow); border-color: #111; }
.total-line { display: flex; justify-content: space-between; font-weight: 800; padding-top: 8px; }
.r-line { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.r-line > div { display: flex; justify-content: space-between; gap: 12px; }

@media (min-width: 601px) {
  dialog { inset: 0; margin: auto; width: min(560px, calc(100vw - 32px)); height: auto; max-height: min(92dvh, 860px); border-radius: 18px; }
  .sheet { height: auto; max-height: min(92dvh, 860px); }
  .sheet.small { max-height: none; }
}
@media (min-width: 700px) {
  .menu-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counter-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item .thumb { width: 150px; height: 150px; }
}
@media (min-width: 1100px) {
  .item .thumb { width: 176px; height: 176px; }
}
@media (max-width: 380px) {
  .item .thumb { width: 104px; height: 104px; }
  .item h3 { font-size: 16px; }
  .wordmark { font-size: 15px; padding: 0 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .item, .cta, .cartbar { transition: transform .12s ease, background-color .12s ease; }
  .item:active, .cta:active { transform: scale(.985); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
