/* LM1 通用 LIFF：底部列（捷徑＋中間模式切換鈕）、展開列、門市選擇條、模式選單、模式首頁 */
body.nv-ready:not(.top-tools) #liff-header .bell,
body.nv-ready:not(.top-tools) #liff-header .theme-btn { display: none !important; }
#liff-nav.nv { display: block; position: sticky; bottom: 0; z-index: 200; background: var(--bg); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0); }
#nav-row { display: flex; align-items: stretch; position: relative; }
.nb { flex: 1 1 0; min-width: 0; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: none; border: 0; color: var(--text-muted); font: inherit; font-size: 0.6875rem; cursor: pointer; padding: 4px 0; -webkit-tap-highlight-color: transparent; }
.nb .ic { font-size: 1.25rem; line-height: 1.1; }
.nb .lb { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb.on { color: var(--accent); font-weight: 700; }
.nb.empty { visibility: hidden; }
#nav-row.compact .nb .lb { display: none; }
#nav-row.compact .nb .ic { font-size: 1.4rem; }
.nb.sw { flex: 0 0 60px; }
.nb.sw .bub { width: 46px; height: 46px; border-radius: 50%; margin-top: -16px; background: var(--accent); color: var(--accent-text, #fff); display: flex; align-items: center; justify-content: center; font-size: 1.35rem; box-shadow: 0 2px 8px rgba(0,0,0,.3); border: 3px solid var(--bg); box-sizing: content-box; width: 40px; height: 40px; }
.nb.sw .lb { font-size: 0.625rem; color: var(--text-muted); }
#nav-row.compact .nb.sw .lb { display: block; }
.nb.up { flex: 0 0 36px; color: var(--text-muted); }
.nb.up .ic { font-size: 1.1rem; }
#nav-expand { position: absolute; left: 0; right: 0; bottom: 100%; background: var(--bg); border: 1px solid var(--border); border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 20px rgba(0,0,0,.22); display: none; padding: 6px 6px 2px; z-index: 1; }
#nav-expand.open { display: flex; }
#nav-expand .nb { min-height: 56px; }
#nav-backdrop { position: fixed; left: 0; right: 0; top: 0; bottom: 0; background: rgba(0,0,0,.28); display: none; z-index: -1; }
#nav-backdrop.open { display: block; }
#nav-store { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 44px; border-bottom: 1px solid var(--border); font-size: 0.8125rem; color: var(--text-muted); }
#nav-store select { flex: 1; min-height: 40px; background: var(--bg-sub); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; font: inherit; }
#nav-sheet { position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 400; display: none; }
#nav-sheet.open { display: block; }
#nav-sheet .sh-bg { position: absolute; left: 0; right: 0; top: 0; bottom: 0; background: rgba(0,0,0,.45); }
#nav-sheet .sh-box { position: absolute; left: 0; right: 0; bottom: 0; background: var(--bg); border-radius: 18px 18px 0 0; padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0)); box-shadow: 0 -10px 30px rgba(0,0,0,.35); }
#nav-sheet .sh-t { font-size: 0.75rem; color: var(--text-muted); padding: 0 6px 8px; }
#nav-sheet .sh-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 12px; margin-bottom: 6px; background: var(--bg-sub); color: var(--text); border: 1px solid var(--border); border-radius: 12px; font: inherit; font-size: 1rem; cursor: pointer; text-align: left; }
#nav-sheet .sh-row.cur { border-color: var(--accent); color: var(--accent); font-weight: 700; }
#nav-sheet .sh-row .ic { font-size: 1.5rem; }
.nv-title { display: flex; align-items: center; gap: 8px; padding: 14px 14px 4px; font-weight: 700; font-size: 1rem; }
.nv-note { padding: 4px 14px 10px; color: var(--text-muted); font-size: 0.75rem; }
.nv-empty { padding: 28px 18px; text-align: center; color: var(--text-muted); font-size: 0.875rem; }
.nv-bottom { padding: 6px 12px 14px; }
.nv-big { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 12px; font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 8px; }
.nv-list { padding: 0 12px 16px; }
.nv-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 12px; margin-bottom: 8px; background: var(--bg-sub); color: var(--text); border: 1px solid var(--border); border-radius: 12px; font: inherit; font-size: 0.9375rem; cursor: pointer; text-align: left; }
.nv-row .ic { font-size: 1.4rem; width: 1.8rem; text-align: center; }
.nv-row .lb { flex: 1; }
.nv-row .chev { color: var(--text-muted); }
.nv-row .bd { background: var(--danger, #dc2626); color: #fff; border-radius: 10px; font-size: 0.6875rem; padding: 1px 7px; }
.nv-card { margin: 10px 12px; padding: 12px 14px; background: var(--bg-sub); border: 1px solid var(--border); border-radius: 12px; font-size: 0.8125rem; line-height: 1.6; }
.nv-card b { display: block; margin-top: 6px; }
.nv-card b:first-child { margin-top: 0; }
.nv-h { padding: 12px 14px 4px; font-weight: 700; font-size: 0.875rem; }
.sc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 12px; }
.sc-slot { min-height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--bg-sub); color: var(--text); border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 0.8125rem; cursor: pointer; text-align: left; }
.sc-slot.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.sc-slot small { color: var(--text-muted); display: block; font-size: 0.625rem; }
.sc-pick { padding: 4px 12px 8px; }
.sc-pick .nv-row { min-height: 46px; margin-bottom: 4px; font-size: 0.875rem; }
.sc-pick .cat { font-size: 0.6875rem; color: var(--text-muted); padding: 8px 4px 2px; }
.sc-lay { display: flex; gap: 8px; padding: 0 12px; }
.sc-lay label { flex: 1; min-height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-sub); font-size: 0.8125rem; cursor: pointer; }
.sc-lay label.on { border-color: var(--accent); }
.sc-lay input { width: 20px; height: 20px; }
.nv-btn { display: block; margin: 10px 12px 0; min-height: 48px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-sub); color: var(--text); font: inherit; font-size: 0.9375rem; cursor: pointer; width: calc(100% - 24px); }
.nv-btn.pri { background: var(--accent); color: var(--accent-text, #fff); border-color: var(--accent); }
.nv-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 12px; }
.nv-chip { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--border); background: var(--bg-sub); color: var(--text); font: inherit; cursor: pointer; }
.nv-chip.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }
#emb { display: block; width: 100%; border: 0; background: var(--bg); }

/* LFF1：問 AI 入口放底部列（liff_ai_entry=bar）；展開把手改放底部列上方中央 */
.nb.ai .ic { color: var(--accent); font-weight: 700; }
#nav-row.has-ai.compact .nb.sw { flex: 0 0 52px; }
#nav-row.has-ai.compact .nb.sw .bub { width: 42px; height: 42px; }
/* 底部列上方一行：門市（靠左，只有門市模式）＋「︿ 更多」（靠右） */
#nav-line { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px; min-height: 30px; border-bottom: 1px solid var(--border); }
#nav-line .sp { flex: 1; }
#nav-line #nav-store.chip { position: relative; display: inline-flex; align-items: center; min-height: 40px; max-width: 62%; padding: 0 12px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-sub); color: var(--text); font-size: 0.8125rem; font-weight: 600; gap: 0; border-bottom: 1px solid var(--border); cursor: pointer; }
#nav-line #nav-store.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nav-line #nav-store.chip select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; border: 0; padding: 0; }
#nav-handle { min-height: 24px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.6875rem; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; white-space: nowrap; }
#nav-handle .t-fold { display: none; }
#liff-nav.exp-open #nav-handle .t-fold { display: inline; }
#liff-nav.exp-open #nav-handle .t-more { display: none; }

/* LFX1 2026-10-12：選單設定回來前不顯示舊首頁／舊底部列（liff-nav.js 加減 class） */
html.nav-pending #liff-nav { visibility: hidden; }
html.nav-pending-home #liff-content > * { display: none !important; }
html.nav-pending-home #liff-content::before { content: '載入中…'; display: block; text-align: center; padding: 48px 0; color: var(--text-muted); }

/* LNB1 2026-10-13：第二行左邊「‹ 返回」；在首頁時隱藏；只有返回鈕的第二行在首頁整行不顯示 */
#nav-back { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-sub); color: var(--text); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; white-space: nowrap; }
#liff-nav.at-home #nav-back { display: none; }
#liff-nav.at-home #nav-line.only-back { display: none; }
#nav-line #nav-store.chip { min-width: 0; flex: 0 1 auto; }

/* NAVX 員工拖放設定捷徑：編輯模式 */
@keyframes nv-wig { 0% { transform: rotate(-1.4deg); } 50% { transform: rotate(1.4deg); } 100% { transform: rotate(-1.4deg); } }
body.nv-editing { padding-top: 84px; }
#nv-edit-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 450; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0)) 12px 8px; background: var(--bg); border-bottom: 2px solid var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
#nv-edit-bar .eb-main { flex: 1; min-width: 0; }
#nv-edit-bar .eb-t { font-weight: 700; font-size: 0.9375rem; color: var(--text); }
#nv-edit-bar .eb-s { font-size: 0.75rem; color: var(--text-muted); }
#nv-edit-bar .eb-s.err { color: var(--danger, #dc2626); }
#nv-edit-bar button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-text, #fff); font: inherit; font-weight: 700; cursor: pointer; }
body.nv-editing [data-nt] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.nv-editing [data-nt].dnd-ok { animation: nv-wig .3s ease-in-out infinite; touch-action: none; cursor: grab; }
body.nv-editing #liff-nav [data-slot] { touch-action: none; position: relative; }
body.nv-editing #liff-nav .nb[data-slot] { outline: 2px dashed var(--border); outline-offset: -3px; border-radius: 10px; }
#liff-nav .nb.ed-empty { color: var(--text-muted); opacity: .8; }
#liff-nav .nb.dz-over { outline: 2px solid var(--accent) !important; background: rgba(37,99,235,.12); }
.dz-sel { box-shadow: 0 0 0 3px var(--accent) inset; border-radius: 10px; }
.dz-src { opacity: .35; animation: none !important; }
body.dz-home #liff-content { outline: 3px dashed var(--accent); outline-offset: -6px; }
.nv-ghost { position: fixed; z-index: 500; width: 64px; padding: 6px 4px; text-align: center; background: var(--bg-sub, var(--bg)); border: 2px solid var(--accent); border-radius: 12px; box-shadow: 0 8px 22px rgba(0,0,0,.4); pointer-events: none; opacity: .92; }
.nv-ghost span { display: block; font-size: 1.5rem; line-height: 1.2; }
.nv-ghost small { display: block; font-size: 0.625rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.nv-dragging { overscroll-behavior: none; }
@media (prefers-reduced-motion: reduce) {
  body.nv-editing [data-nt].dnd-ok { animation: none; outline: 2px dashed var(--accent); outline-offset: -3px; }
}

/* LSIM 2026-10-19：owner「展開列 button 太大」⇒ 縮成小字把手（約 24px 高），只有把手的那一行同步變矮 */

/* LSIM2 2026-10-19：底部列正上方的分類按鈕列（只在首頁、有分類時顯示） */
#nav-cats { display: flex; gap: 6px; overflow-x: auto; padding: 4px 10px 6px; scrollbar-width: none; border-bottom: 1px solid var(--border); }
#nav-cats::-webkit-scrollbar { display: none; }
.nc-chip { flex: none; min-height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-sub); color: var(--text); font: inherit; font-size: 0.78rem; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; }
.nc-chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
#liff-nav:not(.at-home) #nav-cats { display: none; }
#nav-cats:empty { display: none; }

/* LIFFSW1 2026-10-26：中間切換鈕——扇形選單、切換提示、個人設定「底部中間鈕」 */
.nb.sw { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.nb.sw.direct .lb { color: var(--accent); font-weight: 600; max-width: 76px; }
.nb.sw:focus-visible, .fan-it:focus-visible, .fan-x:focus-visible, #nav-sheet .sh-row:focus-visible, .nv-opt:focus-visible, .nv-i:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#nav-toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 14px); z-index: 600; transform: translate(-50%, -12px); max-width: 86vw; padding: 9px 18px; border-radius: 20px; background: rgba(20,20,20,.92); color: #fff; font-size: 0.875rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nav-toast.show { opacity: 1; transform: translate(-50%, 0); }
#nav-fan { position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 410; }
#nav-fan .fan-bg { position: absolute; left: 0; right: 0; top: 0; bottom: 0; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .18s; }
#nav-fan.open .fan-bg { opacity: 1; }
#nav-fan .fan-it { position: absolute; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; background: none; border: 0; font: inherit; color: #fff; cursor: pointer; transform: translate(0, 0) scale(.3); opacity: 0; transition: transform .22s cubic-bezier(.2,.9,.3,1.25), opacity .15s; }
#nav-fan.open .fan-it { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 1; }
#nav-fan .fan-it .circ { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-sub, var(--bg)); color: var(--text); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
#nav-fan .fan-it.cur .circ { border-color: var(--accent); background: var(--accent); color: var(--accent-text, #fff); }
#nav-fan .fan-it .nm { max-width: 72px; font-size: 0.72rem; line-height: 1.2; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nav-fan .fan-x { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--bg); background: var(--accent); color: var(--accent-text, #fff); font-size: 1.1rem; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.35); opacity: 0; transition: opacity .15s; }
#nav-fan.open .fan-x { opacity: 1; }
.nv-sub { padding: 10px 14px 2px; font-size: 0.8125rem; color: var(--text-muted); }
.nv-opts { display: flex; flex-direction: column; gap: 6px; padding: 4px 12px; }
.nv-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 52px; padding: 8px 14px; text-align: left; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-sub); color: var(--text); font: inherit; cursor: pointer; }
.nv-opt small { color: var(--text-muted); font-size: 0.72rem; }
.nv-opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.nv-opt.on b { color: var(--accent); }
.nv-i { margin-left: 6px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-sub); color: var(--text-muted); font: inherit; font-size: 0.9rem; cursor: pointer; vertical-align: middle; }
.nv-card { margin: 4px 12px 6px; padding: 10px 12px; border-radius: 12px; background: var(--bg-sub); border: 1px solid var(--border); font-size: 0.78rem; line-height: 1.55; color: var(--text); }
.nv-card[hidden] { display: none; }
.nv-card .hd { font-weight: 700; margin-top: 6px; }
.nv-card .hd:first-child { margin-top: 0; }
.nv-chip[disabled] { opacity: .45; cursor: default; }
@media (prefers-reduced-motion: reduce) {
  #nav-fan .fan-it, #nav-fan .fan-bg, #nav-fan .fan-x, #nav-toast { transition: none !important; }
  #nav-fan .fan-it { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 1; }
}
