:root {
  --blue: #254898; --blue-dark: #1b3772; --pale: #e4eef6; --red: #c93a25; --ink: #1d2433; --muted: #566072;
  --paper: #fff; --green: #16794a; --amber: #8a5a00; --radius: 14px;
  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
.nb { white-space: nowrap; }
.line small, .dish__name { word-break: keep-all; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; -webkit-text-size-adjust: 100%; }
img { max-width: 100%; display: block; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #7aa2e8; outline-offset: 2px; }
.wrap { width: min(720px, 100% - 32px); margin-inline: auto; }
h1, h2, h3 { font-family: var(--serif); color: var(--blue); margin: 0; letter-spacing: .06em; }

.top { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--pale); }
.top__in { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 12px; }
.top h1 { font-size: 19px; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: none; padding: 5px 14px; border-radius: 99px; background: var(--pale); text-decoration: none; font-weight: 600; }

.note { padding: 12px 14px; border-radius: var(--radius); background: var(--pale); margin: 14px 0; }
.note--warn { background: #fff3d6; color: var(--amber); font-weight: 600; }
.note--bad { background: #fde8e4; color: var(--red); font-weight: 600; }

.cat { padding-top: 18px; scroll-margin-top: 104px; }
.cat h2 { font-size: 22px; margin-bottom: 6px; }
.dish { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--pale); background: none; padding: 12px 0; min-height: 64px; }
.dish img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; }
.dish__txt { flex: 1; min-width: 0; }
.dish__name { font-weight: 700; display: block; }
.dish__desc { color: var(--muted); font-size: 14px; display: block; line-height: 1.45; }
.dish__price { color: var(--muted); font-size: 15px; display: block; }
.dish__add { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 24px; line-height: 38px; text-align: center; }
.dish[disabled] { opacity: .5; cursor: not-allowed; }
.dish[disabled] .dish__add { background: none; color: var(--red); width: auto; font-size: 15px; font-weight: 700; }

.bar { position: fixed; inset: auto 0 0; background: #fff; border-top: 1px solid var(--pale); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); z-index: 6; }
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 20px; border-radius: 99px; border: 2px solid var(--blue); background: var(--blue); color: #fff; font-weight: 700; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: #fff; color: var(--blue); }
.btn--red { background: #fff; color: var(--red); border-color: var(--red); }
.btn--split { justify-content: space-between; }
.has-bar { padding-bottom: 110px; }

dialog { border: 0; padding: 0; width: min(560px, 100%); max-width: 100%; max-height: 92dvh; margin: auto auto 0; border-radius: 20px 20px 0 0; color: inherit; overflow: auto; }
dialog::backdrop { background: rgba(15, 25, 50, .5); }
@media (min-width: 640px) { dialog { margin: auto; border-radius: 20px; } }
.sheet { padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.sheet__photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.sheet h2 { font-size: 22px; }
.x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .25); font-size: 22px; line-height: 1; }
fieldset { border: 0; padding: 0; margin: 16px 0 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--pale); }
.opt input { width: 22px; height: 22px; accent-color: var(--blue); flex: none; }
.opt span:last-child { margin-left: auto; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two .opt span:last-child { margin-left: 0; color: inherit; }
.more { margin-top: 16px; }
.more summary { font-weight: 700; color: var(--blue); min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.more summary::before { content: '＋'; margin-right: 6px; }
.more[open] summary::before { content: '−'; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 99px; border: 2px solid var(--blue); background: #fff; color: var(--blue); font-weight: 700; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--blue); background: #fff; color: var(--blue); font-size: 22px; line-height: 1; }
.qty output { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.dish { font-size: 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.line { padding: 12px 0; border-bottom: 1px solid var(--pale); }
.line b { display: block; }
.line small { color: var(--muted); font-size: 15px; }
.field { display: block; margin-top: 14px; }
.field > span { display: block; font-weight: 700; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 10px 14px; border: 2px solid #c6d4e4; border-radius: 12px; background: #fff; font-size: 16px; }
.field textarea { min-height: 76px; resize: vertical; }
.total { font-size: 20px; font-weight: 700; padding: 14px 0; font-variant-numeric: tabular-nums; }
.err { color: var(--red); font-weight: 700; margin: 10px 0; }
.muted { color: var(--muted); font-size: 15px; }

.status { text-align: center; padding: 26px 0 10px; }
.status__no { font-size: 15px; color: var(--muted); }
.status__no b { display: block; font-family: var(--serif); font-size: 46px; line-height: 1.2; color: var(--blue); }
.status h1 { font-size: 26px; margin: 8px 0; }
.status--ok h1 { color: var(--green); }
.status--bad h1 { color: var(--red); }
.box { border: 2px solid var(--pale); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.stack { display: grid; gap: 10px; margin: 16px 0 40px; }
