:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --ink: #1C2430;
  --muted: #5F6875;
  --line: #E4E1D8;
  --accent: #2B4C7E;
  --accent-soft: #E8EDF5;
  --warn-bg: #FFF4E0;
  --warn-ink: #7A4B00;
  --radius: 14px;
  --tap: 44px;
  /* Phone built-in fonts only (no web-font download). Japanese text always uses
     --font-ja so kanji get Japanese glyph shapes even on a Korean/Chinese screen. */
  --font-ja: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --font: var(--font-ja);
}
html[lang="ko"] { --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", system-ui, sans-serif; }
html[lang="zh"] { --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif; }
html[lang="zh-Hant"] { --font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", system-ui, sans-serif; }
html[lang="en"] { --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
/* touch-action stops double-tap zoom when + is tapped quickly */
button {
  font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0;
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button:active { opacity: .82; }
.icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.loading {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; color: var(--muted); padding: 16px; text-align: center;
}
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.retry { min-height: var(--tap); padding: 0 22px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10; background: rgba(247,246,242,.94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 8px; min-height: 60px; }
.top .title { flex: 1; min-width: 0; }
.top h1 { font-size: 17px; margin: 0; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-chip { display: inline-block; font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 9px; margin-top: 2px; }
.seat-chip.waiting { color: var(--warn-ink); background: var(--warn-bg); }
.icon-btn {
  min-width: var(--tap); height: var(--tap); border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  gap: 4px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 700; flex: none;
}
.icon-btn.plain { border-color: transparent; background: transparent; padding: 0; }
.icon-btn .icon { width: 20px; height: 20px; }

/* Notices */
.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius); padding: 12px 14px; margin-top: 14px; font-size: 15px; }
.banner .icon { margin-top: 1px; width: 20px; height: 20px; }
.banner.allergy { background: var(--warn-bg); color: var(--warn-ink); font-weight: 700; }
.banner.waiting { background: var(--surface); border: 1px dashed var(--line); color: var(--muted); }
.notices { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; font-size: 15px; }
.notices h2 { font-size: 13px; color: var(--muted); margin: 0 0 6px; font-weight: 400; }
.notices ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.notices li { display: flex; gap: 8px; }
.notices li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 10px; flex: none; }

/* Sections */
.section-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; font-size: 19px; margin: 26px 0 10px; }
.section-title small { font-size: 13px; color: var(--muted); font-weight: 400; }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: left;
  display: flex; flex-direction: column; gap: 4px; min-height: 100px; position: relative; min-width: 0;
}
.pick .rank { font-size: 13px; font-weight: 700; color: var(--accent); }
.pick .nm { font-size: 14px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pick .pr { margin-top: auto; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pick [data-badge] { position: absolute; top: 8px; right: 8px; }

.tabs { position: sticky; top: 60px; z-index: 9; background: var(--bg); margin: 18px -16px 0; padding: 8px 16px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: var(--tap); padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 15px; white-space: nowrap; }
.cat { scroll-margin-top: 124px; }

/* Cards */
.cards { display: grid; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; gap: 12px; padding: 12px; cursor: pointer; }
.card:active { background: #FBFAF7; }
.card .thumb { width: 88px; height: 88px; border-radius: 10px; object-fit: cover; flex: none; background: var(--line); }
.card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.jname { margin: 1px 0 0; font-size: 14px; color: var(--muted); font-family: var(--font-ja); }
.card .desc { margin: 6px 0 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; gap: 8px; }
.price { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.ctl { display: inline-flex; align-items: center; gap: 8px; }

.add-btn { height: var(--tap); min-width: var(--tap); padding: 0 16px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.add-btn .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.stepper button { width: var(--tap); height: var(--tap); display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.stepper button .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.stepper .n { min-width: 26px; text-align: center; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.qbadge { min-width: 24px; height: 24px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }

/* Bottom bar */
.spacer { height: 110px; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, rgba(247,246,242,0)); }
.bottom .inner { max-width: 528px; margin: 0 auto; }
.primary {
  width: 100%; min-height: 56px; border-radius: 16px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; box-shadow: 0 6px 18px rgba(28,36,48,.18);
}
.primary.ghost { background: var(--surface); color: var(--accent); border: 1px solid var(--accent); font-size: 15px; }
.primary[disabled] { opacity: .4; box-shadow: none; cursor: default; }
.primary .grow { flex: 1; text-align: left; }
.secondary { width: 100%; min-height: 56px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.25; padding: 4px 12px; }
.sub-ja { font-size: 12px; font-weight: 400; opacity: .8; font-family: var(--font-ja); }

/* Cart */
.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 14px; overflow: hidden; }
.block h2 { font-size: 16px; margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.block.muted h2 { color: var(--muted); }
.line { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.line .info { flex: 1; min-width: 0; }
.line .nm { font-weight: 700; line-height: 1.35; }
.line .lp { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.line .q { font-weight: 700; font-variant-numeric: tabular-nums; }
.sum { display: flex; justify-content: space-between; padding: 14px; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.empty { padding: 20px 14px; text-align: center; color: var(--muted); font-size: 15px; }
.link-btn { display: block; margin: 22px auto 0; min-height: var(--tap); padding: 0 12px; color: var(--muted); font-size: 14px; text-decoration: underline; }

/* Staff screen: read by staff at arm's length from the guest's phone */
.staff { background: #fff; min-height: 100vh; min-height: 100dvh; font-family: var(--font-ja); }
.staff-head { background: var(--accent); color: #fff; padding: 14px 16px 12px; }
.staff-head .wrap { padding: 0; }
.staff-head h1 { margin: 0; font-size: 22px; line-height: 1.3; }
.staff-head .seat { font-size: 34px; font-weight: 700; line-height: 1.25; }
.staff-head .gl { font-size: 15px; opacity: .92; margin-top: 2px; }
.s-line { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.s-line .info { flex: 1; min-width: 0; }
.s-line .ja { font-size: 27px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.s-line .gn { font-size: 14px; color: var(--muted); margin-top: 2px; font-family: var(--font); }
.s-line .q { font-size: 32px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.s-total { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 16px 0; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.s-total small { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.s-total .cnt { font-size: 18px; font-weight: 700; color: var(--ink); }
.s-note { font-family: var(--font); background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 12px; text-align: center; font-weight: 700; margin: 6px 0 16px; }
.s-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); font-family: var(--font); }
.s-actions .primary { flex-direction: column; gap: 0; line-height: 1.25; box-shadow: none; }
.s-hint { font-family: var(--font); font-size: 13px; color: var(--muted); text-align: center; margin: -6px 0 10px; }

/* Call */
.calls { display: grid; gap: 10px; margin-top: 14px; }
.call-btn { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 10px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-align: left; }
.call-btn .icon { width: 26px; height: 26px; color: var(--accent); }
.call-btn .nm { font-weight: 700; font-size: 18px; }
.call-btn .sub-ja { display: block; font-size: 13px; }
.hint { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.call-show { position: fixed; inset: 0; z-index: 50; background: #fff; display: flex; flex-direction: column; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.call-show .msg { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 18px; font-family: var(--font-ja); }
.call-show .seat { font-size: 34px; font-weight: 700; color: var(--accent); }
.call-show .ja { font-size: clamp(30px, 9.4vw, 60px); font-weight: 700; line-height: 1.3; word-break: auto-phrase; }
.call-show .gl { font-size: 16px; color: var(--muted); font-family: var(--font); }

/* Language select */
.lang-screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 16px; max-width: 420px; margin: 0 auto; }
.brand { font-size: 13px; letter-spacing: .14em; color: var(--muted); text-align: center; }
.lang-screen h1 { text-align: center; font-size: 20px; margin: 8px 0 4px; }
.lang-screen .shop { text-align: center; color: var(--muted); margin: 0 0 22px; font-family: var(--font-ja); }
.lang-list { display: grid; gap: 10px; }
.lang-btn { min-height: 60px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 19px; font-weight: 700; }
.lang-btn.on { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Sheet */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(28,36,48,.45); animation: fade .18s ease-out; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; max-height: 92dvh; overflow-y: auto; background: var(--surface);
  border-radius: 20px 20px 0 0; padding: 0 0 calc(16px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto;
  animation: up .22s ease-out; overscroll-behavior: contain;
}
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 8px auto 0; }
.sheet .close { position: absolute; top: 10px; right: 10px; width: var(--tap); height: var(--tap); border-radius: 50%; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; }
.sheet .big { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--line); margin-top: 8px; }
.sheet .content { padding: 14px 16px 0; }
.sheet h2 { margin: 0; font-size: 22px; line-height: 1.35; padding-right: 44px; }
.sheet .jname { font-size: 16px; }
.sheet .desc { color: var(--muted); margin: 10px 0 0; font-size: 16px; }
.sheet .price { display: block; margin-top: 10px; font-size: 20px; }
.opt { margin-top: 16px; }
.opt h3 { font-size: 15px; margin: 0 0 8px; }
.opt h3 span { font-weight: 400; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 52px; min-width: 84px; padding: 4px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; line-height: 1.25; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .sub-ja { display: block; }
.sheet-actions { display: flex; gap: 10px; align-items: center; padding: 18px 16px 0; }
.sheet-actions .stepper button { height: 54px; }
.sheet-actions .primary { box-shadow: none; }

@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sheet, .backdrop { animation: none; } .spinner { animation-duration: 2s; } }

/* How-to-order guide: shown until the first order is placed */
.howto { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; }
.howto h2 { font-size: 15px; margin: 0 0 8px; color: var(--accent); }
.howto ol { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 6px; }
.howto li { counter-increment: step; display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.howto li::before { content: counter(step); flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.howto p { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
