/* ==========================================================================
   JustOrder 設計系統 v2 ・「系統原生」（參考 Apple 人機介面）
   --------------------------------------------------------------------------
   2026-09 改版方向 A：像 iPhone 內建 App —— 淺灰底、白色分組清單、細分隔線，
   品牌藍只出現在「能按的地方」。完成類動作（完成出餐、打卡成功）才用綠色，
   LINE 綠只給 LINE 相關動作。

   範圍：只作用在 <body class="hig"> 的頁面，不影響還沒改版的頁面。
   改版中的頁面「不載入」舊的 justorder-ui.css —— 那支檔會以很高的權重接管
   所有 button／input，兩套疊在一起會互相覆蓋。

   命名：一律 hg- 開頭（避開 Tailwind 的 h- 高度類別與舊系統的 jo-）。
   字體：系統字（蘋方／微軟正黑／思源黑體），不下載網路字型 —— LINE 內建瀏覽器
   開頁速度優先，且系統字本身就是「原生感」的一部分。
   ========================================================================== */

body.hig {
  /* ── 顏色（全部角色化，頁面不直接寫色碼） ── */
  --bg:          #F5F5F7;   /* 分組底色 */
  --surface:     #FFFFFF;   /* 分組、卡片 */
  --ink:         #1D1D1F;   /* 主要文字 */
  --ink2:        #515154;   /* 次要文字 */
  --muted:       #86868B;   /* 說明、註腳 */
  --sep:         #D8D8DC;   /* 分隔線 */
  --fill:        #EDEDF0;   /* 次要按鈕、分段控制底 */
  --fill-strong: #E3E3E8;
  --tint:        #0B72B5;   /* JustOrder 藍：只給可點擊元素 */
  --tint-press:  #095E96;
  --tint-soft:   #E7F1F9;
  --ok:          #1E8E3E;   /* 完成 */
  --ok-soft:     #E8F5EC;
  --warn:        #A15C07;
  --warn-soft:   #FFF4E5;
  --danger:      #D70015;
  --danger-soft: #FFEDEE;
  --hot:         #C2410C;   /* 「人氣」「招牌」標籤 */
  --line:        #06C755;   /* LINE 相關動作專用 */

  /* ── 形狀 ── */
  --r-ctl:   10px;          /* 輸入框、小按鈕 */
  --r-btn:   12px;          /* 主要按鈕 */
  --r-group: 14px;          /* 分組、卡片 */
  --r-sheet: 20px;          /* 底部面板 */

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC",
          "Microsoft JhengHei", "Heiti TC", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);

  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.hig * { box-sizing: border-box; }
body.hig input, body.hig select, body.hig textarea, body.hig button { font-family: inherit; }
body.hig .hg-num { font-variant-numeric: tabular-nums; }

/* 手機寬度的 App 殼 */
.hig .hg-app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; display: flex; flex-direction: column; }

/* ── 字級：只有五階 ── */
.hig .hg-large-title { font-size: 28px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin: 0; }
.hig .hg-title       { font-size: 20px; font-weight: 600; line-height: 1.3; margin: 0; }
.hig .hg-headline    { font-size: 17px; font-weight: 600; line-height: 1.35; margin: 0; }
.hig .hg-footnote    { font-size: 13px; color: var(--muted); line-height: 1.45; }
.hig .hg-caption     { font-size: 12px; color: var(--muted); }
.hig .hg-muted  { color: var(--muted); }
.hig .hg-danger { color: var(--danger); }
.hig .hg-warn   { color: var(--warn); }
.hig .hg-ok     { color: var(--ok); }

/* ── 頁首 ── */
.hig .hg-hero { aspect-ratio: 3 / 1; max-height: 180px; position: relative; overflow: hidden; background: linear-gradient(180deg, #DCE9F4, var(--bg)); }
.hig .hg-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hig .hg-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 56px; background: linear-gradient(0deg, var(--bg), rgba(245,245,247,0)); }
.hig .hg-head { padding: 0 20px 4px; margin-top: -30px; position: relative; z-index: 1; }
.hig .hg-head-logo { width: 60px; height: 60px; border-radius: 14px; object-fit: cover; background: var(--surface); box-shadow: 0 0 0 3px var(--bg), 0 1px 3px rgba(0,0,0,.08); display: block; }
.hig .hg-head-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.hig .hg-mode { font-size: 13px; font-weight: 600; color: var(--tint); }
.hig .hg-head .hg-large-title { margin-top: 2px; }
.hig .hg-head-meta { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ── 分組清單 ── */
.hig .hg-section { margin-top: 22px; }
.hig .hg-section-title { font-size: 13px; color: var(--muted); font-weight: 400; padding: 0 20px 7px; margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hig .hg-section-foot { font-size: 13px; color: var(--muted); padding: 7px 20px 0; line-height: 1.45; }
.hig .hg-group { background: var(--surface); border-radius: var(--r-group); margin: 0 16px; overflow: hidden; }
.hig .hg-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 11px 16px; background: var(--surface); }
.hig .hg-row + .hg-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.hig .hg-row-label { flex: none; width: 5.2em; font-size: 16px; color: var(--ink); }
.hig .hg-row-value { margin-left: auto; color: var(--muted); font-size: 16px; }

/* 內嵌欄位：無框，靠分組撐出層次 */
.hig .hg-field { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; color: var(--ink); padding: 4px 0; outline: none; appearance: none; -webkit-appearance: none; border-radius: 0; }
.hig .hg-field::placeholder { color: #B3B3B8; }
.hig select.hg-field { padding-right: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='13' viewBox='0 0 8 13'%3E%3Cpath d='M1 1l5.5 5.5L1 12' fill='none' stroke='%23C4C4C8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right center no-repeat; color: var(--tint); text-align: right; text-align-last: right; }
.hig .hg-field:disabled { color: var(--muted); }
.hig input.border-red-400 { color: var(--danger); }
.hig input.border-emerald-400 { color: var(--ok); }
/* 獨立輸入框（不在分組裡時） */
.hig .hg-input { width: 100%; border: 0; background: var(--surface); border-radius: var(--r-ctl); padding: 12px 14px; font-size: 16px; color: var(--ink); outline: none; }
.hig .hg-input:focus { box-shadow: 0 0 0 2px var(--tint-soft), 0 0 0 1px var(--tint) inset; }

/* ── 分段控制（二選一，例：自取／外送） ── */
.hig .hg-seg { display: flex; gap: 2px; padding: 2px; background: var(--fill-strong); border-radius: 9px; }
.hig .hg-seg-btn { flex: 1; height: 32px; border: 0; border-radius: 7px; background: transparent; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; transition: background .2s var(--ease); }
.hig .hg-seg-btn.is-active { background: var(--surface); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
.hig .hg-seg-btn.is-disabled, .hig .hg-seg-btn:disabled { color: var(--muted); cursor: not-allowed; }

/* ── 分類膠囊（可橫向捲動） ── */
.hig .hg-chipbar { position: sticky; top: 0; z-index: 10; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; background: rgba(245,245,247,.9); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); scrollbar-width: none; }
.hig .hg-chipbar::-webkit-scrollbar { display: none; }
.hig .hg-chip { flex: none; height: 34px; padding: 0 15px; border: 0; border-radius: 17px; background: var(--fill); color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.hig .hg-chip.is-active { background: var(--ink); color: #fff; font-weight: 600; }

/* ── 商品列 ── */
.hig .hg-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.hig .hg-item.no-img { grid-template-columns: 1fr auto; }
.hig .hg-item-img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--fill); display: block; }
.hig .hg-item-name { font-size: 16px; font-weight: 600; line-height: 1.3; }
.hig .hg-item-tag { font-size: 12px; font-weight: 600; color: var(--hot); margin-left: 6px; white-space: nowrap; }
.hig .hg-item-desc { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hig .hg-item-price { font-size: 15px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hig .hg-item-limit { font-size: 12px; color: var(--danger); margin-left: 6px; }
.hig .hg-item.is-off { opacity: .45; }

/* 數量步進器 */
.hig .hg-stepper { display: flex; align-items: center; gap: 6px; }
.hig .hg-step { width: 32px; height: 32px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1; cursor: pointer; background: var(--fill); color: var(--ink); transition: transform .12s var(--ease), background .15s; }
.hig .hg-step.is-plus { background: var(--tint); color: #fff; }
.hig .hg-step:active { transform: scale(.9); }
.hig .hg-qty { min-width: 20px; text-align: center; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── 按鈕 ── */
.hig .hg-btn { height: 50px; padding: 0 18px; border: 0; border-radius: var(--r-btn); font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; cursor: pointer; transition: transform .12s var(--ease), background .15s, opacity .15s; text-decoration: none; }
.hig .hg-btn:active { transform: scale(.98); }
.hig .hg-btn-primary { background: var(--tint); color: #fff; }
.hig .hg-btn-primary:hover { background: var(--tint-press); }
.hig .hg-btn-secondary { background: var(--fill); color: var(--ink); }
.hig .hg-btn-tinted { background: var(--tint-soft); color: var(--tint); }
.hig .hg-btn-plain { background: transparent; color: var(--tint); padding: 0 6px; }
.hig .hg-btn-ok { background: var(--ok); color: #fff; }
.hig .hg-btn-line { background: var(--line); color: #fff; }
.hig .hg-btn-sm { height: 34px; padding: 0 14px; border-radius: 17px; font-size: 14px; }
.hig .hg-btn.is-disabled, .hig .hg-btn:disabled { background: #D1D1D6; color: #fff; cursor: not-allowed; transform: none; }
.hig .hg-grow { flex: 1; }
.hig .hg-close { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--fill-strong); color: var(--ink2); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.hig .hg-close svg, .hig .hg-ico { width: 18px; height: 18px; flex: none; }

/* ── 選擇列（單選／多選：iPhone 清單的打勾） ── */
.hig .hg-choice { cursor: pointer; }
.hig .hg-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.hig .hg-choice-main { flex: 1; min-width: 0; }
.hig .hg-choice-name { font-size: 16px; }
.hig .hg-choice-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.hig .hg-choice-price { font-size: 15px; color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hig .hg-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #C4C4C8; flex: none; display: flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s; }
.hig .hg-choice input:checked ~ .hg-check { background: var(--tint); border-color: var(--tint); }
.hig .hg-choice input:checked ~ .hg-check::after { content: ""; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.hig .hg-choice input:focus-visible ~ .hg-check { box-shadow: 0 0 0 3px var(--tint-soft); }
.hig .hg-choice.is-off { opacity: .45; cursor: not-allowed; }

/* ── 提示框 ── */
.hig .hg-note { margin: 12px 16px 0; border-radius: var(--r-group); padding: 12px 14px; font-size: 14px; line-height: 1.5; background: var(--surface); }
.hig .hg-note b { display: block; font-size: 15px; font-weight: 600; }
.hig .hg-note.is-danger { background: var(--danger-soft); color: #8E000E; }
.hig .hg-note.is-warn { background: var(--warn-soft); color: #7A4400; }
.hig .hg-note.is-tint { background: var(--tint-soft); color: #064A78; }

/* 標籤 */
.hig .hg-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.hig .hg-pill.is-tint { background: var(--tint-soft); color: var(--tint-press); }
.hig .hg-pill.is-ok { background: var(--ok-soft); color: var(--ok); }
.hig .hg-pill.is-warn { background: var(--warn-soft); color: var(--warn); }
.hig .hg-pill.is-danger { background: var(--danger-soft); color: var(--danger); }
.hig .hg-pill.is-muted { background: var(--fill); color: var(--ink2); }

/* 公告跑馬燈 */
.hig .hg-announce { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.hig .hg-announce-track { display: inline-flex; white-space: nowrap; animation: hg-marquee 22s linear infinite; font-size: 14px; color: var(--ink2); }
.hig .hg-announce-track > span { padding-right: 48px; }
@keyframes hg-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── 底部結帳列（半透明材質） ── */
.hig .hg-bar { position: sticky; bottom: 0; z-index: 20; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(250,250,252,.88); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--sep); }
.hig .hg-bar-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.hig .hg-bar-total .hg-amount { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hig .hg-bar-actions { display: flex; gap: 8px; }
.hig .hg-bar-actions .hg-btn-secondary { padding: 0 14px; }
.hig .hg-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--tint); color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }

/* ── 底部面板（取代彈出視窗） ── */
.hig .hg-sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.36); display: flex; align-items: flex-end; justify-content: center; }
.hig .hg-sheet-wrap.hidden { display: none; }
.hig .hg-sheet { width: 100%; max-width: 480px; max-height: 90vh; background: var(--bg); border-radius: var(--r-sheet) var(--r-sheet) 0 0; display: flex; flex-direction: column; box-shadow: 0 -8px 30px rgba(0,0,0,.12); animation: hg-sheet-in .38s var(--ease); }
@keyframes hg-sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.hig .hg-grabber { width: 36px; height: 5px; border-radius: 3px; background: #C7C7CC; margin: 8px auto 0; flex: none; }
.hig .hg-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 6px 20px; flex: none; }
.hig .hg-sheet-body { overflow-y: auto; padding-bottom: 14px; flex: 1; }
.hig .hg-sheet-foot { flex: none; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: .5px solid var(--sep); background: rgba(250,250,252,.92); }
.hig .hg-sum-row { display: flex; justify-content: space-between; font-size: 15px; color: var(--ink2); padding: 2px 0; font-variant-numeric: tabular-nums; }
.hig .hg-sum-row.is-total { font-size: 18px; font-weight: 700; color: var(--ink); padding-top: 6px; }

/* 空狀態／載入 */
.hig .hg-empty { text-align: center; color: var(--muted); font-size: 15px; padding: 32px 16px; }

/* 鍵盤焦點 */
.hig button:focus-visible, .hig a:focus-visible, .hig select:focus-visible, .hig input:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }

/* 仍由程式產生的少數字色，對齊到這套色票 */
.hig .text-red-400, .hig .text-red-500 { color: var(--danger) !important; }
.hig .text-emerald-600 { color: var(--ok) !important; }
.hig .text-amber-500, .hig .text-amber-600 { color: var(--warn) !important; }
.hig .text-slate-400 { color: var(--muted) !important; }
.hig .text-sky-700 { color: var(--tint) !important; }

@media (prefers-reduced-motion: reduce) {
  .hig *, .hig *::before, .hig *::after { animation: none !important; transition: none !important; }
}

/* ── 補充：Tailwind 移除後要自己提供的狀態類別，與分組分隔線的邊界情況 ── */
.hig .hidden { display: none !important; }
/* 列被包在 div 裡時（例如取餐時間那組），相鄰 div 的第一列也要有分隔線 */
.hig .hg-group > * + * > .hg-row:first-child::before,
.hig .hg-group > * + .hg-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
/* 沒有封面圖時，頁首不留一大塊空白 */
.hig .hg-hero:has(img.hidden) { aspect-ratio: auto; height: 84px; }
/* 金額列的語意色（權重要高過 .hg-sum-row 的預設字色） */
.hig .hg-sum-row.hg-ok { color: var(--ok); }
.hig .hg-sum-row.hg-warn { color: var(--warn); }
.hig .hg-section-foot.hg-danger { color: var(--danger); }
.hig .hg-section-foot.hg-warn { color: var(--warn); }
.hig .hg-empty.hg-danger { color: var(--danger); }

/* ── 訂位：時段格 ── */
.hig .hg-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px; }
.hig .hg-slot { height: 50px; border: 0; border-radius: var(--r-ctl); background: var(--fill); color: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; cursor: pointer; transition: background .15s, color .15s, transform .12s var(--ease); }
.hig .hg-slot small { font-size: 11px; font-weight: 500; color: var(--muted); }
.hig .hg-slot:active { transform: scale(.96); }
.hig .hg-slot.is-active { background: var(--tint); color: #fff; }
.hig .hg-slot.is-active small { color: rgba(255,255,255,.8); }
.hig .hg-slot.is-off { background: transparent; color: #C7C7CC; text-decoration: line-through; cursor: not-allowed; box-shadow: inset 0 0 0 .5px var(--sep); }
.hig .hg-slots .hg-empty { grid-column: 1 / -1; padding: 18px 8px; }

/* 整列都是按鈕（例：用餐日期 ›） */
.hig .hg-row-btn { width: 100%; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.hig .hg-row-btn .hg-row-value { color: var(--tint); display: flex; align-items: center; gap: 6px; }
.hig .hg-chev { width: 8px; height: 13px; flex: none; }

/* ── 訂位：月曆 ── */
.hig .hg-cal-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 16px 8px; }
.hig .hg-cal-nav { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fill); color: var(--tint); font-size: 20px; line-height: 1; cursor: pointer; }
.hig .hg-cal-week, .hig .hg-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 12px; text-align: center; }
.hig .hg-cal-week span { font-size: 12px; color: var(--muted); padding-bottom: 4px; }
.hig .hg-day { aspect-ratio: 1; max-width: 46px; margin: 0 auto; width: 100%; border: 0; border-radius: 50%; background: transparent; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; cursor: pointer; }
.hig .hg-day.is-today { color: var(--tint); font-weight: 600; }
.hig .hg-day.is-active { background: var(--tint); color: #fff; font-weight: 600; }
.hig .hg-day.is-off { color: #C7C7CC; cursor: default; }

/* ── 結果畫面圖示（訂位成功／已取消） ── */
.hig .hg-result-icon { width: 64px; height: 64px; border-radius: 50%; margin: 6px auto 0; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 600; background: var(--ok-soft); color: var(--ok); }
.hig .hg-result-icon.is-muted { background: var(--fill); color: var(--ink2); }
.hig .hg-btn-destructive { background: transparent; color: var(--danger); }

/* 舊頁面遺留、仍由程式切換的少數工具類 */
.hig .opacity-50 { opacity: .5; }
.hig .pointer-events-none { pointer-events: none; }
/* 分組裡的內嵌欄位聚焦時不畫外框：游標本身就是焦點提示，外框在清單裡顯得突兀 */
.hig .hg-field:focus-visible { outline: none; }

/* ── 會員中心 ── */
/* 會員卡：白底分組，點數是整張卡唯一的大數字 */
.hig .hg-card { padding: 16px; }
.hig .hg-card-top { display: flex; align-items: center; gap: 12px; }
.hig .hg-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--fill); flex: none; }
.hig .hg-points { margin-left: auto; text-align: right; flex: none; }
.hig .hg-points-num { font-size: 34px; font-weight: 600; line-height: 1.05; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.hig .hg-points-num small { font-size: 15px; font-weight: 400; color: var(--ink2); margin-left: 2px; }
.hig .hg-stats { display: grid; grid-template-columns: 1fr 1fr; margin-top: 14px; padding-top: 12px; border-top: .5px solid var(--sep); }
.hig .hg-stats > div + div { border-left: .5px solid var(--sep); padding-left: 14px; }
.hig .hg-stat-val { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 1px; }
.hig .hg-progress { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin-top: 6px; }
.hig .hg-progress > div { height: 100%; border-radius: 3px; background: var(--tint); transition: width .6s var(--ease); }
/* 兩行以上內容的清單列（訂單、優惠券、點數記錄） */
.hig .hg-li { align-items: flex-start; }
.hig .hg-li-main { flex: 1; min-width: 0; }
.hig .hg-li-title { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.hig .hg-li-sub { font-size: 14px; color: var(--ink2); margin-top: 2px; overflow-wrap: anywhere; }
.hig .hg-li-meta { font-size: 13px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; column-gap: 10px; }
.hig .hg-li-end { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-variant-numeric: tabular-nums; }
.hig .hg-li-amt { font-size: 16px; font-weight: 600; }
.hig .hg-li.is-off { opacity: .5; }
/* 狀態訊息（未登入、未開放…） */
.hig .hg-msg { text-align: center; padding: 26px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hig .hg-msg .hg-footnote { max-width: 30em; }
/* 長按確認：進度條疊在按鈕上方，不攔截手勢 */
.hig .hg-hold { position: relative; border-radius: var(--r-btn); overflow: hidden; }
.hig .hg-hold .hg-btn { width: 100%; user-select: none; -webkit-user-select: none; touch-action: none; }
.hig .hg-hold-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255,255,255,.28); pointer-events: none; }

/* ── 員工頁（登入、打卡…）共用 ── */
.hig .hg-note.is-ok { background: var(--ok-soft); color: #14622B; }
.hig .hg-note.is-center { text-align: center; }
/* 表單頁：置中的品牌頭 + 分組欄位，桌機也維持手機寬度 */
.hig .hg-brand { text-align: center; padding: 44px 20px 4px; }
.hig .hg-brand img { width: 72px; height: 72px; border-radius: 16px; display: block; margin: 0 auto 14px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.hig .hg-actions { margin: 18px 16px 0; display: flex; flex-direction: column; gap: 6px; }
.hig .hg-actions .hg-btn { width: 100%; }
.hig .hg-code-input { letter-spacing: .4em; font-variant-numeric: tabular-nums; }
/* 結果圖示：失敗 */
.hig .hg-result-icon.is-danger { background: var(--danger-soft); color: var(--danger); }
/* 狀態小圓點（GPS、連線） */
.hig .hg-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.hig .hg-dot.is-ok { background: var(--ok); }
.hig .hg-dot.is-warn { background: #E8A33D; animation: hg-pulse 1.4s ease-in-out infinite; }
.hig .hg-dot.is-danger { background: var(--danger); }
@keyframes hg-pulse { 50% { opacity: .35; } }
/* 打卡：大時鐘與兩顆大按鈕 */
.hig .hg-clock { text-align: center; padding: 22px 16px 18px; }
.hig .hg-clock-time { font-size: 56px; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.hig .hg-bigbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 16px 0; }
.hig .hg-bigbtns .hg-btn { height: 76px; font-size: 18px; border-radius: var(--r-group); }
/* 日期／時間欄位：值靠右、用可點色，像 iOS 設定頁 */
.hig input.hg-field[type="date"], .hig input.hg-field[type="time"], .hig input.hg-field[type="datetime-local"], .hig input.hg-field[type="month"] { text-align: right; color: var(--tint); min-height: 28px; }
.hig input.hg-field::-webkit-date-and-time-value { text-align: right; }
.hig textarea.hg-field { resize: vertical; line-height: 1.45; min-height: 48px; }
.hig .hg-row.is-top { align-items: flex-start; }
.hig .hg-row.is-top .hg-row-label { padding-top: 4px; }
/* 捲動時固定在頂端的分段控制 */
.hig .hg-sticky { position: sticky; top: 0; z-index: 20; padding: 10px 16px; background: rgba(245,245,247,.9); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
/* 2×2 數字格（出勤統計） */
.hig .hg-stat-grid { display: grid; grid-template-columns: 1fr 1fr; }
.hig .hg-stat-grid > div { padding: 12px 16px; }
.hig .hg-stat-grid > div:nth-child(odd) { border-right: .5px solid var(--sep); }
.hig .hg-stat-grid > div:nth-child(n+3) { border-top: .5px solid var(--sep); }
.hig .hg-stat-grid .hg-stat-val { font-size: 22px; }
/* 日期欄（班表） */
.hig .hg-daycol { width: 38px; flex: none; text-align: center; font-variant-numeric: tabular-nums; }
.hig .hg-daycol b { display: block; font-size: 18px; font-weight: 600; line-height: 1.1; }
.hig .hg-row.is-today { background: var(--tint-soft); }
.hig .hg-row.is-rest .hg-daycol b { color: var(--muted); }
/* 讀取中轉圈 */
.hig .hg-spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--fill-strong); border-top-color: var(--tint); animation: hg-spin .8s linear infinite; margin: 0 auto; }
@keyframes hg-spin { to { transform: rotate(360deg); } }
/* 結果頁（付款）：置中圖示＋標題＋明細 */
.hig .hg-result { text-align: center; padding: 8px 20px 0; }
.hig .hg-result .hg-title { margin-top: 14px; }
.hig .hg-result .hg-footnote { margin: 6px auto 0; max-width: 28em; font-size: 15px; color: var(--ink2); }

/* ── 叫號大螢幕：深色版（電視／平板牆面用，暗底比較不刺眼、數字更醒目） ── */
body.hig.hg-dark {
  --bg: #000; --surface: #1C1C1E; --ink: #F5F5F7; --ink2: #C7C7CC; --muted: #8E8E93;
  --sep: #38383A; --fill: #2C2C2E; --fill-strong: #3A3A3C;
  --tint: #0A84FF; --tint-press: #0070E0; --tint-soft: #0A2A4A;
  --ok: #30D158; --ok-soft: #0E2E17; --warn: #FF9F0A; --warn-soft: #3A2600; --danger: #FF453A;
}
.hig .hg-tv { min-height: 100vh; display: flex; flex-direction: column; user-select: none; }
.hig .hg-tv-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; border-bottom: .5px solid var(--sep); }
.hig .hg-tv-title { font-size: 30px; font-weight: 600; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hig .hg-tv-title small { font-size: 18px; font-weight: 400; color: var(--muted); margin-left: 10px; }
.hig .hg-tv-clock { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink2); }
.hig .hg-tv-main { flex: 1; display: grid; grid-template-columns: 2fr 1fr; gap: 28px; padding: 28px; }
@media (max-width: 1023px) { .hig .hg-tv-main { grid-template-columns: 1fr; } }
.hig .hg-tv-h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: 30px; font-weight: 600; }
.hig .hg-tv-count { font-size: 18px; font-weight: 600; min-width: 36px; height: 32px; padding: 0 12px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.hig .hg-tv-ready { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; align-content: start; }
.hig .hg-tv-card { background: var(--surface); border-radius: 20px; padding: 26px 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: inset 0 0 0 1px rgba(48,209,88,.35); animation: hg-pop .45s var(--ease); }
.hig .hg-tv-card.new { animation: hg-pop .45s var(--ease), hg-glow 1.2s ease-in-out 4; }
.hig .hg-tv-num { font-size: 68px; font-weight: 600; line-height: 1; color: var(--ok); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hig .hg-tv-label { font-size: 24px; color: var(--ink2); }
.hig .hg-tv-making { display: flex; flex-wrap: wrap; gap: 10px; align-content: start; }
.hig .hg-tv-chip { background: var(--surface); border-radius: 14px; padding: 10px 16px; display: flex; align-items: baseline; gap: 8px; }
.hig .hg-tv-chip b { font-size: 26px; font-weight: 600; color: var(--warn); font-variant-numeric: tabular-nums; }
.hig .hg-tv-chip span { font-size: 18px; color: var(--ink2); }
.hig .hg-tv-empty { color: var(--muted); font-size: 22px; text-align: center; padding: 40px 0; }
.hig .hg-tv-foot { display: flex; justify-content: space-between; gap: 16px; padding: 14px 28px; border-top: .5px solid var(--sep); color: var(--muted); font-size: 16px; }
.hig.hg-dark .hg-btn-secondary { background: var(--fill); color: var(--ink); }
@keyframes hg-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.05); opacity: 1; } 100% { transform: none; } }
@keyframes hg-glow { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(48,209,88,.35), 0 0 0 0 rgba(48,209,88,.5); } 50% { box-shadow: inset 0 0 0 2px rgba(48,209,88,.9), 0 0 40px 6px rgba(48,209,88,.3); } }
.hig .hg-code-input:placeholder-shown { letter-spacing: normal; }

/* ══ POS 櫃台（平板橫向為主，手機可用）══ */
body.hig.hg-pos { height: 100vh; height: 100dvh; overflow: hidden; display: flex; }
.hig .opacity-40 { opacity: .4; }
.hig .hg-pos-side { width: 92px; flex: none; background: var(--surface); border-right: .5px solid var(--sep); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0 12px; }
.hig .hg-pos-clock { text-align: center; }
.hig .hg-pos-clock b { display: block; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hig .hg-pos-shop { font-size: 12px; font-weight: 600; text-align: center; padding: 6px 6px 0; line-height: 1.3; overflow-wrap: anywhere; }
.hig .hg-pos-ctx { font-size: 11px; font-weight: 600; text-align: center; margin: 2px 6px 6px; padding: 4px 6px; border-radius: 8px; background: var(--tint-soft); color: var(--tint-press); line-height: 1.35; }
.hig .hg-nav { width: 76px; padding: 9px 0 8px; border: 0; border-radius: 12px; background: transparent; color: var(--ink2); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.hig .hg-nav svg { width: 26px; height: 26px; }
.hig .hg-nav:hover { background: var(--fill); }
.hig .hg-nav.is-active { background: var(--tint-soft); color: var(--tint); }
.hig .hg-pos-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hig .hg-pos-top { display: none; }
.hig .hg-pos-view { flex: 1; overflow-y: auto; padding: 20px; }
.hig .hg-pos-h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.hig .hg-pos-h h2 { font-size: 22px; font-weight: 600; margin: 0; }
/* 桌況 */
.hig .hg-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.hig .hg-table { min-height: 100px; border: 0; border-radius: var(--r-group); background: var(--surface); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 12px 8px; cursor: pointer; box-shadow: 0 0 0 .5px rgba(0,0,0,.06); transition: transform .08s; }
.hig .hg-table:active { transform: scale(.96); }
.hig .hg-table b { font-size: 24px; font-weight: 600; line-height: 1.15; }
.hig .hg-table span { font-size: 13px; color: var(--muted); }
.hig .hg-table.is-occ { background: var(--ok); color: #fff; box-shadow: none; }
.hig .hg-table.is-occ span { color: rgba(255,255,255,.85); }
.hig .hg-table i { font-style: normal; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hig .hg-floor { position: relative; width: 100%; border-radius: var(--r-group); overflow: hidden; container-type: inline-size; aspect-ratio: 16 / 9; background-color: var(--surface); background-image: radial-gradient(circle, var(--fill-strong) 1.5px, transparent 1.5px); background-size: 24px 24px; }
.hig .hg-floor .hg-table { position: absolute; min-height: 0; border-radius: 10px; padding: .5cqw; box-shadow: 0 0 0 1px var(--sep); overflow: hidden; }
.hig .hg-floor .hg-table.is-occ { box-shadow: none; }
/* 點餐：分類／商品／購物車三欄 */
.hig #view-menu { flex: 1; min-height: 0; display: flex; }
.hig .hg-pos-cats { width: 120px; flex: none; overflow-y: auto; background: var(--surface); border-right: .5px solid var(--sep); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.hig .hg-pos-cat { width: 100%; text-align: left; border: 0; background: transparent; padding: 11px 12px; border-radius: 10px; font-size: 15px; color: var(--ink); cursor: pointer; line-height: 1.3; }
.hig .hg-pos-cat:hover { background: var(--fill); }
.hig .hg-pos-cat.is-active { background: var(--tint-soft); color: var(--tint); font-weight: 600; }
.hig .hg-pos-items { flex: 1; min-width: 0; overflow-y: auto; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; }
.hig .hg-pos-item { min-height: 92px; border: 0; border-radius: var(--r-group); background: var(--surface); padding: 12px 14px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; cursor: pointer; box-shadow: 0 0 0 .5px rgba(0,0,0,.06); transition: transform .08s, box-shadow .15s; }
.hig .hg-pos-item:hover { box-shadow: 0 0 0 1.5px var(--tint); }
.hig .hg-pos-item:active { transform: scale(.97); }
.hig .hg-pos-item b { font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.hig .hg-pos-item span { font-size: 15px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.hig .hg-pos-item small { font-size: 12px; font-weight: 600; color: var(--tint-press); margin-left: 4px; white-space: nowrap; }
.hig .hg-pos-item:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.hig .hg-pos-item em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--danger); }
.hig .hg-pos-empty { grid-column: 1 / -1; }
.hig .hg-cart { width: 340px; flex: none; background: var(--surface); border-left: .5px solid var(--sep); display: flex; flex-direction: column; min-height: 0; }
.hig .hg-cart-head { padding: 12px 14px 10px; border-bottom: .5px solid var(--sep); display: flex; flex-direction: column; gap: 8px; }
.hig .hg-cart-ctx { font-size: 15px; font-weight: 600; }
.hig .hg-cart-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hig .hg-cart-fields .hg-input { background: var(--fill); padding: 9px 12px; font-size: 15px; }
.hig .hg-cart-list { flex: 1; overflow-y: auto; padding: 0 14px; }
.hig .hg-cart-line { padding: 10px 0; border-bottom: .5px solid var(--sep); }
.hig .hg-cart-line:last-child { border-bottom: 0; }
.hig .hg-cart-line-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hig .hg-cart-line-name { font-size: 15px; font-weight: 600; line-height: 1.35; }
.hig .hg-cart-line-name span { font-weight: 400; color: var(--ink2); }
.hig .hg-cart-line p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.hig .hg-cart-line p.is-note { color: var(--warn); }
.hig .hg-cart-line-bot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.hig .hg-cart-line .hg-step { width: 28px; height: 28px; font-size: 18px; }
.hig .hg-x { width: 26px; height: 26px; flex: none; border: 0; border-radius: 50%; background: var(--fill); color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; }
.hig .hg-cart-foot { border-top: .5px solid var(--sep); padding: 10px 14px 14px; }
.hig .hg-cart-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.hig .hg-cart-tools .hg-btn { height: 38px; padding: 0 4px; font-size: 14px; border-radius: 10px; }
.hig .hg-link { border: 0; background: none; padding: 0 2px; color: var(--tint); font-size: 14px; cursor: pointer; }
.hig .hg-cart-foot #btn-checkout { width: 100%; height: 54px; font-size: 18px; }
/* 今日訂單 */
.hig .hg-order-row { flex-wrap: wrap; row-gap: 8px; }
.hig .hg-order-row .hg-order-id { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hig .hg-order-acts { display: flex; gap: 6px; flex-wrap: wrap; }
/* 人數 / 選桌 格 */
.hig .hg-numgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 12px; }
.hig .hg-num-btn { height: 48px; border: 0; border-radius: var(--r-ctl); background: var(--fill); font-size: 18px; font-weight: 600; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.hig .hg-num-btn.is-active { background: var(--tint); color: #fff; }
.hig .hg-pickgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; max-height: 50vh; overflow-y: auto; }
.hig .hg-pickgrid .hg-table { min-height: 72px; background: var(--fill); box-shadow: none; }
.hig .hg-pickgrid .hg-table b { font-size: 18px; }
/* 結帳金額 */
.hig .hg-due { text-align: center; padding: 6px 16px 4px; }
.hig .hg-due b { display: block; font-size: 44px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.hig .hg-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 16px 0; }
.hig .hg-quick .hg-btn { height: 44px; font-size: 16px; }
.hig .hg-change { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ok); }
.hig .hg-change.is-neg { color: var(--danger); }
.hig .hg-toggle-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--ok); flex: none; }
/* 手機版浮動分頁列 */
.hig .hg-tabbar { display: none; }
@media (min-width: 641px) {
  .hig.hg-pos .hg-sheet-wrap { align-items: center; padding: 24px; }
  .hig.hg-pos .hg-sheet { border-radius: var(--r-sheet); max-width: 440px; }
  .hig.hg-pos .hg-sheet .hg-grabber { display: none; }
}
@media (max-width: 640px) {
  body.hig.hg-pos { height: auto; min-height: 100dvh; overflow: visible; padding-bottom: 12px; }
  .hig .hg-pos-side { display: none; }
  .hig .hg-pos-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface); border-bottom: .5px solid var(--sep); position: sticky; top: 0; z-index: 20; }
  .hig .hg-pos-top h1 { font-size: 17px; font-weight: 600; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hig .hg-pos-view { padding: 14px 14px 96px; }
  .hig #view-menu { flex-direction: column; }
  .hig .hg-pos-cats { width: 100%; flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: .5px solid var(--sep); padding: 8px 12px; gap: 6px; }
  .hig .hg-pos-cat { width: auto; flex: none; white-space: nowrap; padding: 7px 14px; border-radius: 17px; background: var(--fill); }
  .hig .hg-pos-cat.is-active { background: var(--ink); color: #fff; }
  .hig .hg-pos-items { padding: 12px 12px 96px; grid-template-columns: repeat(2, 1fr); min-width: 0; }
  .hig .hg-cart { position: fixed; left: 10px; right: 10px; bottom: 82px; width: auto; max-height: calc(100dvh - 120px); z-index: 35; border: 0; border-radius: var(--r-sheet); box-shadow: 0 -8px 30px rgba(0,0,0,.2); transform: translateY(115%); visibility: hidden; transition: transform .2s var(--ease), visibility .2s; }
  .hig .hg-cart.mobile-open { transform: none; visibility: visible; }
  .hig .hg-floor { aspect-ratio: 4 / 3; }
  .hig .hg-tabbar { display: flex; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 40; height: 62px; border-radius: 20px; background: rgba(250,250,252,.92); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 4px 24px rgba(0,0,0,.14), 0 0 0 .5px rgba(0,0,0,.08); }
  .hig .hg-tabbar .hg-nav { flex: 1; width: auto; border-radius: 16px; font-size: 11px; gap: 2px; padding: 6px 0; position: relative; }
  .hig .hg-tabbar .hg-nav.is-active { background: transparent; }
  .hig .hg-tabbar .hg-nav svg { width: 24px; height: 24px; }
  .hig .hg-tabbar .hg-badge { position: absolute; top: 4px; right: 22%; }
}
/* 收據列印：只印收據區塊 */
#receipt { display: none; font-family: ui-monospace, Menlo, monospace; white-space: pre-wrap; }
@media print {
  body * { visibility: hidden !important; }
  #receipt, #receipt * { visibility: visible !important; }
  #receipt { display: block !important; position: absolute; left: 0; top: 0; width: 72mm; padding: 4mm; font-size: 12px; color: #000; }
}

/* ── 第三方登入按鈕（login.html）：品牌規範色，Apple 黑、Google 白框、LINE 綠 ── */
.hig .hg-or { display: flex; align-items: center; gap: 12px; margin: 18px 16px 6px; color: var(--muted); font-size: 13px; }
.hig .hg-or::before, .hig .hg-or::after { content: ""; flex: 1; height: 1px; background: var(--sep); }
.hig .hg-social { display: flex; flex-direction: column; gap: 10px; padding: 8px 16px 0; }
.hig .hg-social .hg-btn { width: 100%; gap: 10px; font-weight: 600; }
.hig .hg-social svg { width: 20px; height: 20px; flex: none; }
.hig .hg-btn-apple { background: #000; color: #fff; }
.hig .hg-btn-google { background: #fff; color: #1F1F1F; box-shadow: inset 0 0 0 1px #DADCE0; }
.hig .hg-btn-line { background: #06C755; color: #fff; }
.hig .hg-social .hg-btn:disabled { opacity: .5; }
.hig .hg-social-pending { text-align: center; color: var(--muted); font-size: 14px; padding: 12px 16px; }
