/* CAPELLA 五車二 — 版面照 FMU 版面規格基準(深空黑階、Noto Serif TC + Space Grotesk、820px 起電腦版側欄) */
:root {
  --bg: #08090B; --bg2: #111317; --bg3: #1B1E24; --bg4: #22262D;
  --fg: #F7F8FA; --fg2: #ABB1BF; --line: rgba(255,255,255,.08);
  --accent: #FF7B70; --accent2: #5AD7E0; --accent3: #B497FF; --ok: #6ED39B; --warn: #FF7B70;
  --serif: 'Noto Serif TC', serif; --mono: 'Space Grotesk', system-ui, sans-serif;
  --r-card: 16px; --r-in: 12px; --r-tag: 6px;
  --nav-h: 62px;
  /* 品牌色:五車二金(圖示 C 環同一組漸層) */
  --gold: #FFD98A; --gold2: #FFB454; --brand-grad: linear-gradient(135deg, #FFE3A3 0%, #FFB454 50%, #FF7B70 100%);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--serif); font-size: 14px; -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--accent2); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hint { color: var(--fg2); font-size: 12px; line-height: 1.5; margin: 6px 0; }
.err { color: var(--warn); font-size: 12px; }
.empty { color: var(--fg2); font-size: 12.5px; padding: 28px 12px; text-align: center; }
h1 { font-size: 24px; font-weight: 900; margin: 6px 0 10px; }
h2 { font-size: 17px; font-weight: 700; margin: 16px 0 8px; }
.money { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; }
.tag { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 2px 7px; border-radius: var(--r-tag); background: var(--bg4); color: var(--fg2); }
.tag.ok { background: rgba(110,211,155,.16); color: var(--ok); } .tag.warn { background: rgba(255,123,112,.16); color: var(--warn); } .tag.info { background: rgba(90,215,224,.16); color: var(--accent2); } .tag.pur { background: rgba(180,151,255,.16); color: var(--accent3); }

/* 頂列/導覽 */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: rgba(8,9,11,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand b { font-family: var(--mono); font-weight: 700; letter-spacing: .14em; font-size: 15px; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand i { font-style: normal; color: var(--fg2); font-size: 13px; }
.brand .sub { color: var(--fg2); font-size: 11.5px; margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live { width: 8px; height: 8px; border-radius: 999px; background: var(--fg2); opacity: .4; }
.live.on { background: var(--ok); opacity: 1; box-shadow: 0 0 8px var(--ok); }
#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; background: rgba(8,9,11,.92); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 6px; color: var(--fg2); text-decoration: none; font-size: 11px; transition: color .15s, background .15s; -webkit-tap-highlight-color: transparent; }
#nav a svg { width: 48px; height: 28px; padding: 4px 13px; border-radius: 999px; transition: background .2s var(--ease); }
#nav a.on { color: var(--fg); font-weight: 700; }
#nav a.on svg { background: rgba(255,123,112,.18); color: var(--accent); }
#view { padding: 12px 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); animation: viewIn .22s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 按鈕/表單 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg3); color: var(--fg); font-size: 13px; font-weight: 500; white-space: nowrap; transition: transform .08s, background .15s, opacity .15s; -webkit-tap-highlight-color: transparent; }
.btn:active:not(:disabled), .chip:active, .icon:active, .prod:active, .tbl:active { transform: scale(.96); }
.btn.primary { box-shadow: 0 6px 18px rgba(255,123,112,.22); }
.btn:hover { background: var(--bg4); }
.btn.primary { background: var(--accent); color: #2A0A07; border-color: transparent; font-weight: 700; }
.btn.cyan { background: var(--accent2); color: #062126; border-color: transparent; font-weight: 700; }
.btn.ok { background: var(--ok); color: #06210F; border-color: transparent; font-weight: 700; }
.btn.danger { color: var(--warn); border-color: rgba(255,123,112,.4); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 12px; }
.btn.tiny { padding: 4px 9px; font-size: 11.5px; }
.btn.big { padding: 14px 18px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.icon { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg3); display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--fg); }
.icon:hover { background: var(--bg4); }
.icon.sm { width: 30px; height: 30px; } .icon.sm svg { width: 15px; height: 15px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0; }
.row.between { justify-content: space-between; }
.row label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--fg2); }
.field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.field > span { font-size: 12px; color: var(--fg2); }
select, textarea, input:not([type=color]):not([type=range]):not([type=checkbox]):not([type=radio]):not([type=file]) { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-in); padding: 9px 11px; color: var(--fg); width: 100%; min-width: 0; }
select:focus, input:focus, textarea:focus { outline: none; border-color: rgba(255,123,112,.5); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.switch small { display: block; color: var(--fg2); font-size: 11.5px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); color: var(--fg2); font-size: 13px; transition: transform .08s, background .15s; }
.chip.on { background: var(--fg); color: var(--bg); border-color: transparent; font-weight: 700; }

/* 卡片 */
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; margin: 10px 0; }
.card.pad0 { padding: 0; overflow: hidden; }
.card h3 { margin: 0 0 8px; font-size: 15px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.kpi span { display: block; font-size: 11px; color: var(--fg2); }
.kpi b { display: block; font-family: var(--mono); font-size: 22px; font-weight: 700; margin-top: 2px; }
.kpi b small { font-size: 12px; color: var(--fg2); font-weight: 400; margin-left: 4px; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li span.sub { display: block; font-size: 11.5px; color: var(--fg2); }
table.t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.t th { text-align: left; color: var(--fg2); font-weight: 500; font-size: 11px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.t td { padding: 8px; border-bottom: 1px solid var(--line); }
table.t td.n, table.t th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--bg4); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent3), var(--accent)); }

/* 首頁功能格 */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tile { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 16px; text-decoration: none; color: var(--fg); display: flex; flex-direction: column; gap: 8px; }
.tile:hover { border-color: rgba(255,123,112,.4); }
.tile svg { width: 26px; height: 26px; color: var(--accent); }
.tile b { font-size: 15px; } .tile span { font-size: 11.5px; color: var(--fg2); }

/* POS */
.pos { display: flex; flex-direction: column; gap: 8px; }
.pos .toolbar { display: flex; gap: 8px; align-items: center; }
.pos .toolbar .search { flex: 1; }
#view .toolbar input.search { padding-left: 38px; background: var(--bg2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ABB1BF' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4 4'/%3E%3C/svg%3E") no-repeat 12px 50% / 17px; border-radius: 999px; }
.pos .chips { position: sticky; top: calc(env(safe-area-inset-top) + 57px); z-index: 4; background: var(--bg); margin: 0 -16px; padding: 8px 16px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.prod { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 10px; text-align: left; display: flex; flex-direction: column; gap: 3px; transition: transform .08s, border-color .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.prod:hover { border-color: rgba(255,217,138,.35); box-shadow: 0 10px 26px rgba(0,0,0,.35); }
.prod .media { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 5/2; border-radius: 11px; overflow: hidden; margin-bottom: 5px; background: radial-gradient(circle at 50% 40%, rgba(255,217,138,.10), transparent 70%), var(--bg3); }
.prod .em { font-size: 30px; line-height: 1; }
.prod .pimg { width: 100%; height: 100%; object-fit: cover; }
.prod b, .prod .price { padding: 0 4px; }
.prod .badge { position: absolute; top: 4px; left: 4px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #2A0A07; font-family: var(--mono); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.45); animation: badgeIn .25s var(--ease); }
@keyframes badgeIn { from { transform: scale(.4); } to { transform: none; } }
.prod.incart { border-color: rgba(255,123,112,.55); }
.adm .li .thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 9px; background: var(--bg3); }
.pimgbox { width: 96px; height: 96px; border-radius: 12px; background: var(--bg3); border: 1px dashed rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; color: var(--fg2); font-size: 11px; }
.pimgbox img { width: 100%; height: 100%; object-fit: cover; }
.prod b { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod .price { font-family: var(--mono); color: var(--gold); font-size: 13.5px; font-weight: 700; margin-top: auto; }
.prod .stock { position: absolute; top: 12px; right: 12px; z-index: 1; }
.prod.out { opacity: .45; }
.prod.out::after { content: '售完'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--warn); font-size: 16px; }
.cartcol { display: none; }
.cartbar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px); z-index: 5; display: flex; align-items: center; gap: 10px; background: var(--fg); color: var(--bg); border-radius: 999px; padding: 8px 8px 8px 18px; box-shadow: 0 12px 32px rgba(0,0,0,.55); animation: viewIn .2s var(--ease); }
.cartbar .btn { padding: 10px 18px; }
.cartbar b { flex: 1; font-size: 14px; }
.cartbar .money { font-size: 16px; }
.cartbar .btn { background: var(--accent); color: #2A0A07; border: 0; }
.cart { display: flex; flex-direction: column; gap: 6px; }
#csheet > h3 .grow { visibility: hidden; } /* 抽屜外框已有標題,內層只留「清空」 */
#csheet > h3:not(:has(button)) { display: none; }
.cart .ci { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cart .ci .grow { flex: 1; min-width: 0; }
.cart .ci b { display: block; font-size: 13.5px; }
.cart .ci .opt { font-size: 11px; color: var(--fg2); }
.cart .qty { display: inline-flex; align-items: center; gap: 4px; }
.cart .qty output { min-width: 22px; text-align: center; font-family: var(--mono); font-weight: 700; }
.sum { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; color: var(--fg2); }
.sum.total { color: var(--fg); font-size: 17px; font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.seg { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 7px 8px; color: var(--fg2); font-size: 12.5px; }
.seg button.on { background: var(--bg4); color: var(--fg); font-weight: 700; }
.paymethods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.paymethods button { padding: 14px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg2); font-size: 14px; }
.paymethods button.on { border-color: var(--accent); background: rgba(255,123,112,.12); font-weight: 700; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.bigmoney { font-family: var(--mono); font-size: 34px; font-weight: 700; text-align: center; margin: 8px 0; }
.bigmoney small { font-size: 14px; color: var(--fg2); font-weight: 400; }
.change { text-align: center; font-size: 15px; color: var(--fg2); }
.change b { color: var(--ok); font-family: var(--mono); font-size: 22px; }

/* 桌位 */
.tables { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tblsum { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--fg2); margin: -2px 0 12px; }
.tblsum i { display: inline-block; width: 9px; height: 9px; border-radius: 999px; margin-right: 6px; background: var(--bg4); vertical-align: 0; }
.tblsum .busy i { background: var(--accent); } .tblsum .ready i { background: var(--ok); }
.tbl { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px 12px; text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 108px; transition: transform .08s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.tbl:hover { border-color: rgba(255,255,255,.2); }
.tbl .tn { font-size: 22px; font-weight: 700; font-family: var(--mono); line-height: 1.1; }
.tbl .ts { font-size: 11.5px; color: var(--fg2); }
.tbl .tm { font-size: 11px; color: var(--fg2); margin-top: auto; font-family: var(--mono); }
.tbl .money { font-size: 15px; margin-top: 6px; }
.tbl::after { content: ''; position: absolute; top: 14px; right: 12px; width: 9px; height: 9px; border-radius: 999px; background: var(--bg4); }
.tbl.busy { border-color: rgba(255,123,112,.45); background: linear-gradient(180deg, rgba(255,123,112,.12), rgba(255,123,112,.03)); }
.tbl.busy .ts { color: var(--accent); } .tbl.busy::after { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.tbl.ready { border-color: rgba(110,211,155,.5); background: linear-gradient(180deg, rgba(110,211,155,.13), rgba(110,211,155,.03)); }
.tbl.ready .ts { color: var(--ok); } .tbl.ready::after { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.readybox { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 4px 0 16px; }
@media (min-width: 600px) { .readybox { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.rdy { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: 18px; cursor: pointer; border: 1.5px solid rgba(110,211,155,.6); background: linear-gradient(135deg, rgba(110,211,155,.22), rgba(110,211,155,.06)); box-shadow: 0 0 24px rgba(110,211,155,.15); animation: rdyIn .3s var(--ease); }
@keyframes rdyIn { from { transform: scale(.94); opacity: 0; } }
.rdy > i { width: 16px; height: 16px; border-radius: 999px; background: var(--ok); box-shadow: 0 0 14px var(--ok), 0 0 4px var(--ok); flex: none; animation: blink 1.2s ease-in-out infinite; }
.rdy > b { font-family: var(--mono); font-size: 34px; font-weight: 700; line-height: 1; color: var(--ok); min-width: 64px; }
.rdy .grow { flex: 1; font-size: 14px; line-height: 1.35; color: var(--fg); }
.rdy .grow em { font-style: normal; font-weight: 900; font-size: 17px; color: var(--ok); }
.rdy .btn { padding: 12px 16px; font-size: 14px; }
/* 點餐頁精簡版:一行一桌,手機多桌時橫向滑動 */
.readybox.compact { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 10px; scrollbar-width: none; }
.readybox.compact::-webkit-scrollbar { display: none; }
.readybox.compact .rdy { flex: 1 0 auto; min-width: min(100%, 280px); gap: 10px; padding: 8px 8px 8px 12px; border-radius: 999px; }
.readybox.compact .rdy > i { width: 11px; height: 11px; }
.readybox.compact .rdy > b { font-size: 22px; min-width: 0; }
.readybox.compact .rdy .grow { font-size: 13px; white-space: nowrap; }
.readybox.compact .rdy .grow em { font-size: 14px; }
.readybox.compact .rdy .btn { padding: 8px 14px; font-size: 13px; }
.tblsum .prep i { background: var(--accent3); } .tblsum .fin i { background: var(--gold); }
.tbl.fin { border-color: rgba(255,217,138,.55); background: linear-gradient(180deg, rgba(255,217,138,.13), rgba(255,217,138,.03)); }
.tbl.fin .ts { color: var(--gold); } .tbl.fin::after { background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: blink 1.6s ease-in-out infinite; }
.btn.gold { background: var(--gold); color: #2A1A00; border-color: transparent; font-weight: 700; }
.tbl.prep { border-color: rgba(180,151,255,.5); background: linear-gradient(180deg, rgba(180,151,255,.13), rgba(180,151,255,.03)); }
.tbl.prep .ts { color: var(--accent3); } .tbl.prep::after { background: var(--accent3); box-shadow: 0 0 10px var(--accent3); }

/* 訂單清單 */
.order { background: var(--bg2); border: 1px solid var(--line); border-left: 4px solid var(--accent2); border-radius: 14px; padding: 12px 14px; margin: 8px 0; cursor: pointer; transition: border-color .15s, transform .08s; }
.order.paid { border-left-color: var(--ok); } .order.void { border-left-color: var(--warn); opacity: .7; }
.order:hover { border-color: rgba(255,255,255,.18); }
.olist { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 820px) { .olist { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; } }
.order .hd { display: flex; align-items: center; gap: 8px; }
.order .no { font-family: var(--mono); font-size: 20px; font-weight: 700; }
.order .hd .grow { flex: 1; min-width: 0; font-size: 12px; color: var(--fg2); }
.order .items { margin: 8px 0 4px; font-size: 12.5px; }
.order .items div { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.order .items .opt { color: var(--fg2); font-size: 11px; }
.order .ft { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.order .ft .grow { flex: 1; }

/* KDS 廚房 */
.kds { display: grid; grid-template-columns: 1fr; gap: 10px; }
.kcard { background: var(--bg2); border: 1px solid var(--line); border-left: 5px solid var(--accent3); border-radius: 14px; padding: 12px 14px; }
.kcard.ready { border-left-color: var(--ok); }
.kcard.late { border-left-color: var(--warn); box-shadow: 0 0 0 1px rgba(255,123,112,.35); }
.kcard.late .age { color: var(--warn); font-weight: 700; }
.kcard.ready .age { color: var(--ok); }
.kcard .hd { display: flex; align-items: baseline; gap: 10px; }
.kcard .no { font-family: var(--mono); font-size: 28px; font-weight: 700; }
.kcard .hd .grow { flex: 1; font-size: 13px; color: var(--fg2); }
.kcard .age { font-family: var(--mono); font-size: 13px; color: var(--fg2); }
.kcard .ki { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 16px; cursor: pointer; }
.kcard .ki .q { font-family: var(--mono); font-weight: 700; min-width: 34px; font-size: 18px; color: var(--accent2); }
.kcard .ki .opt { display: block; font-size: 12.5px; color: var(--fg2); }
.kcard .ki.done { opacity: .4; text-decoration: line-through; }
.kcard .ft { display: flex; gap: 8px; margin-top: 10px; }
.kcard .ft .btn { flex: 1; }

/* 後台清單 */
.adm .li .em { font-size: 20px; width: 30px; text-align: center; }
.optgrp { background: var(--bg3); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.optgrp .row { margin: 4px 0; }
.qrbox { text-align: center; padding: 12px; }
.qrbox img { width: 200px; height: 200px; background: #fff; border-radius: 12px; padding: 8px; }
.qrbox code { display: block; font-size: 11px; color: var(--fg2); word-break: break-all; margin-top: 6px; }

/* 登入 */
#loginwall { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: auto;
  background: radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.55), transparent), radial-gradient(1px 1px at 78% 14%, rgba(255,255,255,.45), transparent), radial-gradient(1.5px 1.5px at 88% 62%, rgba(255,255,255,.4), transparent), radial-gradient(1px 1px at 30% 80%, rgba(255,255,255,.35), transparent), radial-gradient(1px 1px at 55% 40%, rgba(255,255,255,.25), transparent),
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255,180,84,.16), transparent 70%), radial-gradient(ellipse at 50% 100%, #111317, var(--bg) 70%); }
.logincard { width: 100%; max-width: 380px; background: rgba(17,19,23,.82); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 24px; padding: 30px 24px 26px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.loginhero { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 8px; text-align: center; }
.loginhero img { width: 112px; height: 112px; border-radius: 28px; box-shadow: 0 16px 50px rgba(255,180,84,.2); }
.loginhero b { font-family: var(--mono); font-size: 26px; letter-spacing: .22em; margin-top: 8px; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.loginhero span { font-size: 13px; color: var(--fg2); letter-spacing: .2em; }
.logincard input { padding: 12px 14px; font-size: 15px; }
.logincard .btn { padding: 13px; font-size: 15px; margin-top: 4px; }

/* 更新橫幅/吐司/彈窗 */
#updatebar { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; transform: translateX(-50%); z-index: 30; display: flex; gap: 10px; align-items: center; background: var(--fg); color: var(--bg); border-radius: 999px; padding: 8px 8px 8px 14px; font-size: 13px; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
#updatebar button { border: 0; background: var(--accent); color: #2A0A07; border-radius: 999px; padding: 6px 12px; font-weight: 700; }
#toast { position: fixed; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 70px); left: 50%; transform: translateX(-50%); z-index: 30; background: var(--bg4); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font-size: 13px; max-width: 90vw; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
#toast.warn { border-color: rgba(255,123,112,.5); color: var(--warn); }
#modal { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
#modal { backdrop-filter: blur(3px); animation: fadeIn .18s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } }
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
.mbox { width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 12px 20px calc(env(safe-area-inset-bottom) + 18px); box-shadow: 0 -10px 40px rgba(0,0,0,.4); animation: sheetUp .24s var(--ease); }
.mbox::before { content: ''; display: block; width: 38px; height: 4px; border-radius: 9px; background: rgba(255,255,255,.18); margin: 0 auto 12px; }
.mbox h3 { margin: 0 0 10px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.mbox h3 .grow { flex: 1; }
.mbox .actions { display: flex; gap: 8px; margin-top: 14px; }
.mbox .actions .btn { flex: 1; }
.optlist { display: flex; flex-wrap: wrap; gap: 6px; }
.optlist button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg3); font-size: 12.5px; }
.optlist button.on { background: var(--accent); color: #2A0A07; border-color: transparent; font-weight: 700; }
.optlist button i { font-style: normal; font-family: var(--mono); font-size: 11px; opacity: .8; margin-left: 3px; }

/* 收據(列印) */
.receipt { font-family: 'Noto Serif TC', serif; background: #fff; color: #000; padding: 12px 10px; width: 58mm; max-width: 100%; margin: 0 auto; font-size: 12px; border-radius: 8px; }
.receipt h4 { margin: 0 0 4px; text-align: center; font-size: 14px; white-space: pre-line; }
.receipt .c { text-align: center; }
.receipt .ln { display: flex; justify-content: space-between; gap: 6px; padding: 1px 0; }
.receipt .ln.opt { font-size: 10.5px; color: #444; padding-left: 8px; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt .tot { font-weight: 700; font-size: 14px; }
@media print {
  body * { visibility: hidden; }
  #printarea, #printarea * { visibility: visible; }
  #printarea { position: absolute; left: 0; top: 0; width: 100%; }
  .receipt { width: 100%; border-radius: 0; }
  @page { margin: 4mm; }
}

/* ===== 三段版面(v20260916b)=====
   手機 <600:底導覽、商品 2 欄、購物車浮條+底抽屜
   平板 600-1099:600 起格子自動多欄、彈窗置中;820 起(FMU 電腦版斷點)左側圖示直欄+POS 右側固定購物車
   電腦 ≥1100:完整文字側欄(字級 15.5px)、寬購物車 */
@media (min-width: 600px) {
  #view { padding: 16px 20px calc(var(--nav-h) + env(safe-area-inset-bottom) + 28px); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .prod .media { aspect-ratio: 16/10; }
  .tables { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .kds { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
  .mbox { border-radius: 20px; margin-bottom: 16px; animation-name: pop; }
  .mbox::before { display: none; }
  #modal { align-items: center; }
  .cartbar { left: 50%; right: auto; width: min(520px, calc(100% - 40px)); transform: translateX(-50%); }
}
@media (min-width: 820px) {
  :root { --nav-h: 0px; --side-w: 88px; }
  #nav { position: fixed; top: 57px; bottom: 0; left: 0; right: auto; width: var(--side-w); flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 12px 8px; gap: 4px; background: rgba(8,9,11,.6); }
  #nav a { flex: none; padding: 10px 4px 8px; border-radius: 14px; font-size: 12.5px; gap: 4px; }
  #nav a svg { width: 24px; height: 24px; background: none !important; padding: 0; }
  #nav a.on { background: rgba(255,123,112,.12); }
  #nav a:hover:not(.on) { background: var(--bg2); color: var(--fg); }
  #view { margin-left: var(--side-w); padding: 22px 24px 40px; max-width: 1480px; }
  #toast { bottom: 40px; }
  /* POS:商品 | 購物車 */
  .pos { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
  .pos .left { min-width: 0; }
  .pos .chips { top: 57px; margin: 0; padding: 8px 0; }
  .pos .cartcol { position: sticky; top: 79px; background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; max-height: calc(100dvh - 100px); overflow: auto; display: block !important; box-shadow: 0 18px 40px rgba(0,0,0,.35); }
  .cartbar { display: none; }
}
@media (min-width: 1100px) {
  :root { --side-w: 216px; }
  #nav { padding: 14px 10px; }
  #nav a { flex-direction: row; gap: 12px; padding: 12px 14px; font-size: 15.5px; font-weight: 500; }
  #nav a svg { width: 22px; height: 22px; }
  #nav a.on { box-shadow: inset 3px 0 0 var(--accent); }
  #view { padding: 24px 32px 48px; }
  .pos { grid-template-columns: minmax(0, 1fr) 370px; gap: 22px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
}
@media (hover: none) { .btn:hover, .icon:hover { background: var(--bg3); } .prod:hover, .tbl:hover, .order:hover { border-color: var(--line); transform: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* v20260919b MIRA 操作優化:點餐情境條/選桌/卡片減一/結帳完成/訂單按鈕分層/菜單加密 */
.ctxbar { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; margin: 0 0 10px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); }
.ctxbar.add { border-color: rgba(90,215,224,.45); background: rgba(90,215,224,.07); }
.cx-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.cx-main b { font-size: 22px; font-weight: 900; font-family: var(--mono); letter-spacing: .02em; white-space: nowrap; }
.cx-main span { font-size: 12.5px; color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-main.warn b { color: var(--warn); font-family: var(--serif); font-size: 17px; }
.tpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.tpick button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg3); text-align: left; }
.tpick button b { font-family: var(--mono); font-size: 20px; }
.tpick button span { font-size: 11px; color: var(--fg2); }
.tpick button.busy { border-color: rgba(90,215,224,.4); }
.tpick button.busy span { color: var(--accent2); }
.tpick button.on { background: var(--fg); color: var(--bg); } .tpick button.on span { color: var(--bg); opacity: .7; }
.prod .dec { position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 999px; background: var(--bg4); border: 1px solid var(--line); color: var(--fg); display: grid; place-items: center; font-size: 18px; line-height: 1; font-family: var(--mono); z-index: 2; }
.prod .dec:active { transform: scale(.9); background: var(--bg3); }
.paidok { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; background: rgba(110,211,155,.12); border: 1px solid rgba(110,211,155,.35); }
.paidok > svg { width: 30px; height: 30px; color: var(--ok); stroke-width: 2.4; }
.paidok b { display: block; font-size: 15px; }
.paidok span { font-size: 13px; color: var(--fg2); }
.paidok em { font-style: normal; font-family: var(--mono); font-weight: 700; font-size: 26px; color: var(--ok); margin-left: 4px; }
.mbox .actions.state { margin-top: 8px; }
.mbox .actions.state .btn { padding: 11px 14px; }
.otools { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.otools .grow { flex: 1; }
@media (max-width: 599px) {
  .pos .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .pos .prod { padding: 6px 6px 8px; border-radius: 14px; }
  .pos .prod .media { aspect-ratio: 4/3; margin-bottom: 3px; }
  .pos .prod .em { font-size: 26px; }
  .pos .prod b { font-size: 13px; padding: 0 2px; }
  .pos .prod .price { font-size: 12.5px; padding: 0 2px; }
  .pos .prod .dec { width: 28px; height: 28px; right: 4px; bottom: 4px; }
}
.cx-main b { max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.sotog { flex: none; margin-left: 4px; min-width: 64px; padding: 7px 10px; border-radius: 999px; border: 1px solid rgba(110,211,155,.4); background: rgba(110,211,155,.1); color: var(--ok); font-size: 12px; font-weight: 700; }
.sotog.off { border-color: rgba(255,123,112,.45); background: rgba(255,123,112,.14); color: var(--warn); }
.li.tpo { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; padding: 12px 2px; }
.tbl .tm .multi { color: var(--accent2); font-weight: 700; }
/* 廚房:品項彙總、備註醒目、進度、剛出餐可復原 */
.ksum { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.ksum::-webkit-scrollbar { display: none; }
.ksum span { flex: none; display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); font-size: 14px; }
.ksum b { font-family: var(--mono); font-size: 18px; color: var(--accent2); }
.kcard .ki .knote { display: block; margin-top: 2px; font-size: 13.5px; font-weight: 700; color: #1B1206; background: var(--gold); border-radius: 6px; padding: 1px 7px; width: fit-content; }
.kcard .onote { margin: 6px 0 2px; padding: 6px 10px; border-radius: 8px; background: rgba(255,217,138,.14); color: var(--gold); font-weight: 700; font-size: 13.5px; }
.kcard .prog { font-family: var(--mono); font-size: 12px; color: var(--fg2); }
.kcard .age.warn { color: var(--gold); font-weight: 700; }
.kcard.new { animation: knew 1.2s ease 2; }
@keyframes knew { 50% { box-shadow: 0 0 0 3px var(--accent2); } }
.kcard .ki .tick { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; }
.kcard .ki.done .tick { background: var(--ok); border-color: var(--ok); }
.kcard .ki.done .tick::after { content: ''; width: 9px; height: 5px; border: solid #06210F; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); }
.kundo { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.kundo button { border: 0; border-radius: 999px; padding: 7px 14px; background: var(--bg); color: var(--fg); font-weight: 700; }
@media (min-width: 820px) { .pos .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; } }
@media (min-width: 1100px) { .pos .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); } }

/* v20260919a 線上訂單待接單橫幅 */
#onlinebar { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; transform: translateX(-50%); z-index: 29; display: flex; gap: 10px; align-items: center; background: var(--gold2); color: #2A1A00; border-radius: 999px; padding: 8px 8px 8px 16px; font-size: 13.5px; font-weight: 700; box-shadow: 0 8px 30px rgba(0,0,0,.45); animation: pulseBar 1.6s infinite; }
#onlinebar button { border: 0; background: #2A1A00; color: var(--gold); border-radius: 999px; padding: 6px 14px; font-weight: 700; }
@keyframes pulseBar { 50% { box-shadow: 0 8px 30px rgba(0,0,0,.45), 0 0 0 6px rgba(255,180,84,.25); } }
@media (prefers-reduced-motion: reduce) { #onlinebar { animation: none; } }
.oinfo { background: var(--bg3); border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-size: 13px; line-height: 1.7; }
.oinfo b { color: var(--gold); }
