*{box-sizing:border-box}:root{--bg:#f3f5f4;--card:#fff;--text:#17231f;--muted:#6b7772;--line:#e1e7e4;--primary:#166b4f;--primary2:#0e523c;--primarySoft:#e8f3ee;--danger:#c43b32;--warning:#fff3cd;--warningText:#6c5200;--shadow:0 8px 30px rgba(14,45,33,.08)}
html,body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,"Segoe UI","Noto Sans TC",sans-serif}body{padding-bottom:92px}button,input,select,textarea{font:inherit}button{cursor:pointer}.hidden{display:none!important}
.topbar{position:sticky;top:0;z-index:40;display:flex;justify-content:space-between;align-items:center;padding:13px 16px;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}.brand{font-size:20px;font-weight:900}.subtle{font-size:13px;color:var(--muted)}.top-actions{display:flex;gap:8px}
.icon-btn,.avatar-btn,.ghost-btn,.text-btn{border:1px solid var(--line);background:var(--card);color:var(--text);border-radius:11px;padding:8px 11px}.avatar-btn{width:38px;height:38px;padding:0;border-radius:50%;background:var(--primary);color:#fff;font-weight:800}.text-btn{border:none;background:transparent;color:var(--primary);padding:6px}
.shell{max-width:1050px;margin:auto;padding:14px}.view{min-height:60vh}.card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:16px;margin-bottom:14px;box-shadow:var(--shadow)}.hero-card{background:linear-gradient(135deg,var(--primary),var(--primary2));color:#fff;border:0}.hero-card p{opacity:.9}
.badge{display:inline-block;font-size:12px;font-weight:800;border-radius:999px;background:rgba(255,255,255,.2);padding:5px 8px}h1{font-size:28px;margin:8px 0 10px}h2{font-size:21px;margin:0 0 13px}h3{font-size:17px;margin:18px 0 10px}
label{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:700;margin-bottom:12px}input,select,textarea{width:100%;border:1px solid var(--line);border-radius:12px;padding:13px;background:#fff;color:var(--text);outline:none}input:focus,select:focus,textarea:focus{border-color:var(--primary)}
.primary-btn,.google-btn{border:0;border-radius:13px;padding:13px 16px;font-weight:900}.primary-btn{background:var(--primary);color:#fff}.full{width:100%}.small{padding:9px 12px}.google-btn{width:min(360px,100%);background:#fff;color:#222;border:1px solid #d9dddb;box-shadow:var(--shadow);font-size:17px}.google-g{font-weight:900;color:#4285f4;margin-right:10px}
.login-wrap{text-align:center;padding:80px 16px}.login-logo{font-size:72px}.login-wrap h1{font-size:34px}.login-wrap .text-btn{display:block;margin:18px auto}.notice{padding:12px 14px;border-radius:12px;margin:12px 0}.info{background:#eaf3ff;color:#254e7a}.warning{background:var(--warning);color:var(--warningText)}
.date-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}.date-tab{border:1px solid var(--line);background:var(--card);border-radius:14px;padding:11px;color:var(--muted)}.date-tab b{display:block;font-size:18px}.date-tab span{font-size:12px}.date-tab.active{background:var(--primary);color:#fff;border-color:var(--primary)}
.vendor-hero{background:linear-gradient(135deg,#166b4f,#218660);color:#fff;border:0}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.vendor-status{font-size:12px;font-weight:900;background:rgba(255,255,255,.18);padding:6px 9px;border-radius:999px}.vendor-meta{display:flex;flex-wrap:wrap;gap:10px 16px;font-size:14px;line-height:1.6}
.delivery-banner{padding:15px;border-radius:15px;margin-bottom:14px;font-size:16px;font-weight:900;text-align:center}.delivery-banner.warn{background:#fff0cf;color:#7a5700;border:1px solid #efd797}.delivery-banner.ok{background:#dff5e9;color:#16643f;border:1px solid #b7e6cc}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:3px}.chip{white-space:nowrap;border:1px solid var(--line);background:#fff;color:var(--text);border-radius:999px;padding:9px 13px;font-size:14px;font-weight:800}.chip.active{background:var(--primary);color:#fff;border-color:var(--primary)}
.menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;margin-bottom:14px}.menu-card{background:#fff;border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:var(--shadow);position:relative}.menu-card.disabled{opacity:.66}.menu-image{width:100%;aspect-ratio:16/10;object-fit:cover;background:#e9eeeb;display:block}.menu-placeholder{aspect-ratio:16/10;display:flex;align-items:center;justify-content:center;background:#e9eeeb;font-size:42px}.menu-body{padding:14px}.menu-title{font-size:22px;font-weight:950;line-height:1.25}.menu-desc{font-size:13px;color:var(--muted);min-height:18px;margin-top:5px}.menu-price{font-size:27px;font-weight:950;color:var(--primary);margin-top:8px}.menu-footer{display:flex;justify-content:space-between;align-items:center;margin-top:11px}.qty-controls{display:flex;align-items:center;gap:10px}.qty-controls button{width:44px;height:44px;border-radius:12px;border:1px solid var(--line);background:#fff;font-size:25px}.qty-controls b{font-size:20px;min-width:24px;text-align:center}.sold-label{position:absolute;right:10px;top:10px;background:#b53c34;color:#fff;padding:7px 10px;border-radius:999px;font-weight:900}
.people-list{display:flex;gap:8px;flex-wrap:wrap}.person-chip{background:var(--primarySoft);color:var(--primary);font-weight:800;border-radius:999px;padding:8px 11px}.count-pill,.role-badge{border-radius:999px;padding:6px 9px;background:var(--primarySoft);color:var(--primary);font-size:12px;font-weight:900}
.cart-bar{position:fixed;left:50%;transform:translateX(-50%);bottom:73px;z-index:45;width:min(720px,calc(100% - 20px));background:#12241d;color:#fff;border-radius:16px;padding:11px 12px;display:flex;justify-content:space-between;align-items:center;box-shadow:0 14px 38px rgba(0,0,0,.25)}.cart-bar span{font-size:13px;color:#c8d6d0}.cart-bar strong{display:block;font-size:32px}.cart-bar button{border:0;background:#f2c84b;color:#282000;padding:13px 18px;border-radius:12px;font-weight:950;font-size:17px}
.bottom-nav{position:fixed;left:0;right:0;bottom:0;z-index:44;display:flex;justify-content:center;background:#fff;border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}.nav-item{min-width:120px;border:0;background:transparent;color:var(--muted);padding:9px 16px;font-size:12px}.nav-item span{display:block;font-size:21px}.nav-item.active{color:var(--primary);font-weight:900}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.action-row{display:flex;gap:7px}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.stat{background:var(--bg);border-radius:14px;padding:13px}.stat span{color:var(--muted);font-size:12px}.stat b{display:block;font-size:24px;margin-top:4px}
.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;min-width:700px}th,td{font-size:13px;text-align:left;padding:9px;border-bottom:1px solid var(--line);vertical-align:top}th{background:var(--bg);color:var(--muted)}.table-btn{border:1px solid var(--line);background:#fff;border-radius:8px;padding:6px 8px}.check-big{font-size:19px}
.admin-tabs{display:flex;gap:7px;overflow-x:auto;margin-bottom:12px}.admin-tab{white-space:nowrap;border:1px solid var(--line);background:#fff;border-radius:12px;padding:9px 12px}.admin-tab.active{background:var(--primary);color:#fff}
.vendor-admin{border:1px solid var(--line);border-radius:15px;padding:13px;margin-bottom:10px}.vendor-admin-head{display:flex;justify-content:space-between;gap:8px}.menu-admin-row{display:grid;grid-template-columns:1fr auto auto;gap:7px;align-items:center;border-top:1px dashed var(--line);padding:9px 0}.availability{font-size:12px;font-weight:900;border-radius:999px;padding:5px 8px;background:var(--primarySoft);color:var(--primary)}
.history-card,.notify-card,.schedule-row{padding:12px 0;border-bottom:1px solid var(--line)}.history-title{font-weight:900}.history-meta{font-size:13px;color:var(--muted);line-height:1.5}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:70;display:flex;align-items:flex-end;justify-content:center;padding:14px}.modal-card{width:min(620px,100%);max-height:88vh;overflow:auto;background:#fff;border-radius:20px;padding:16px}
.profile-menu{position:fixed;right:12px;top:62px;z-index:65;background:#fff;border:1px solid var(--line);border-radius:14px;width:250px;padding:13px;box-shadow:var(--shadow)}.profile-name{font-size:18px;font-weight:900}.profile-menu button{width:100%;text-align:left;border:0;background:#fff;padding:10px 5px}.profile-menu hr{border:0;border-top:1px solid var(--line)}.danger-text{color:var(--danger)}
.toast{position:fixed;left:50%;bottom:150px;transform:translateX(-50%) translateY(15px);opacity:0;pointer-events:none;z-index:90;background:#111;color:#fff;border-radius:10px;padding:10px 14px;transition:.2s}.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
@media(max-width:720px){.shell{padding:10px}.menu-grid{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}.stats-grid{grid-template-columns:repeat(2,1fr)}.nav-item{min-width:90px}.vendor-meta{display:block}.vendor-meta span{display:block;margin:3px 0}}

/* V2.0.1：自己的訂單 */
.my-order-card{border:2px solid #85bfa9;background:#fbfffd}
.order-badge{background:var(--primarySoft);color:var(--primary)}
.my-order-amount{font-size:32px;color:var(--primary)}
.my-order-items{margin:10px 0;border-top:1px solid var(--line)}
.my-order-row{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--line);font-size:16px}
.order-deadline{margin:12px 0;padding:10px 12px;background:#f4f7f5;border-radius:10px;font-size:14px}
.my-order-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.danger-btn{border:0;border-radius:13px;padding:13px 16px;font-weight:900;background:#c43b32;color:#fff}
.primary-btn:disabled,.danger-btn:disabled{opacity:.4;cursor:not-allowed}
.print-only{display:none}
/* screen-only 保持元素原本的 display；列印模式再統一隱藏 */

@media(max-width:720px){
  .my-order-actions{grid-template-columns:1fr}
}

/* 列印：以一張 A4 為目標，依訂單列數自動挑最大可讀字級 */
@page{size:A4 portrait;margin:6mm}

@media print{
  html,body{width:210mm;min-height:297mm;background:#fff!important}
  body{padding:0!important;color:#000!important;font-family:"Microsoft JhengHei","Noto Sans TC",sans-serif!important}
  .topbar,.bottom-nav,.cart-bar,.admin-tabs,#printBtn,#refreshAdminBtn,.screen-only{display:none!important}
  .print-only{display:block!important}
  .shell{max-width:none!important;width:100%!important;padding:0!important;margin:0!important}
  .view{display:none!important}
  #adminView,#admin-today{display:block!important;min-height:0!important}
  #admin-today .card{border:0!important;box-shadow:none!important;padding:0!important;margin:0!important}
  .print-header{margin:0 0 4mm 0!important;border-bottom:1.5pt solid #000;padding-bottom:2.5mm}
  .print-title{font-weight:900;text-align:center;line-height:1.15}
  .print-meta{display:flex!important;flex-wrap:wrap;justify-content:center;gap:1mm 5mm;margin-top:2mm;font-weight:700}
  .stats-grid{display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:2mm!important;margin-bottom:3mm!important}
  .stat{border:1.3pt solid #000!important;background:#fff!important;border-radius:0!important;padding:2mm!important;text-align:center!important}
  .stat span{display:block!important;color:#000!important;font-weight:800!important}
  .stat b{display:block!important;color:#000!important;font-weight:950!important;line-height:1.05!important}
  h3{margin:2.5mm 0 1mm!important;font-weight:950!important}
  .table-wrap{overflow:visible!important}
  table{width:100%!important;min-width:0!important;border-collapse:collapse!important;table-layout:auto!important}
  th,td{border:1.2pt solid #000!important;color:#000!important;vertical-align:middle!important;line-height:1.2!important}
  th{background:#fff!important;font-weight:950!important}
  td:nth-child(1),th:nth-child(1){white-space:nowrap}
  .table-btn{display:none!important}
  .check-big,.check-box{font-weight:900!important;line-height:1!important}
  a{color:#000!important;text-decoration:none!important}
}

/* 1～12 列：最大字體 */
@media print{
  body.print-xl .print-title{font-size:26pt!important}
  body.print-xl .print-meta{font-size:14pt!important}
  body.print-xl .stat span{font-size:13pt!important}
  body.print-xl .stat b{font-size:23pt!important}
  body.print-xl h3{font-size:19pt!important}
  body.print-xl th,body.print-xl td{font-size:17pt!important;padding:2.7mm 2mm!important}
  body.print-xl .check-big,body.print-xl .check-box{font-size:25pt!important}
}
/* 13～22 列 */
@media print{
  body.print-lg .print-title{font-size:22pt!important}
  body.print-lg .print-meta{font-size:12pt!important}
  body.print-lg .stat span{font-size:11pt!important}
  body.print-lg .stat b{font-size:19pt!important}
  body.print-lg h3{font-size:16pt!important}
  body.print-lg th,body.print-lg td{font-size:14pt!important;padding:2mm 1.6mm!important}
  body.print-lg .check-big,body.print-lg .check-box{font-size:20pt!important}
}
/* 23～34 列 */
@media print{
  body.print-md .print-title{font-size:19pt!important}
  body.print-md .print-meta{font-size:10.5pt!important}
  body.print-md .stat span{font-size:10pt!important}
  body.print-md .stat b{font-size:16pt!important}
  body.print-md h3{font-size:14pt!important}
  body.print-md th,body.print-md td{font-size:11.5pt!important;padding:1.5mm 1.2mm!important}
  body.print-md .check-big,body.print-md .check-box{font-size:17pt!important}
}
/* 35 列以上：仍盡量塞入單張 A4 */
@media print{
  body.print-sm .print-title{font-size:16pt!important}
  body.print-sm .print-meta{font-size:9pt!important}
  body.print-sm .stat span{font-size:8.5pt!important}
  body.print-sm .stat b{font-size:14pt!important}
  body.print-sm h3{font-size:12pt!important}
  body.print-sm th,body.print-sm td{font-size:9.5pt!important;padding:1mm .9mm!important}
  body.print-sm .check-big,body.print-sm .check-box{font-size:14pt!important}
}

/* V2.0.3 日期按鈕：今天綠、明天紅 */
.date-tab[data-offset="0"]{border:2px solid #1f7a5a;color:#176347;background:#f5fbf8}
.date-tab[data-offset="0"].active{background:#176f52;color:#fff;border-color:#176f52}
.date-tab[data-offset="1"]{border:2px solid #d9655d;color:#b33931;background:#fff7f6}
.date-tab[data-offset="1"].active{background:#c7433a;color:#fff;border-color:#c7433a}

/* 餐點卡片：提高辨識度 */
.menu-card{border:3px solid #cbd6d0!important;box-shadow:0 7px 20px rgba(20,40,30,.12)!important;transition:.12s ease}
.menu-card:hover{border-color:#76a992!important;transform:translateY(-1px)}
.menu-card.selected{border:4px solid #177653!important;box-shadow:0 0 0 4px rgba(23,118,83,.13),0 12px 26px rgba(20,55,40,.16)!important}
.menu-card.selected .menu-body{background:#f2fbf6}
.menu-card.selected::after{content:"✓ 已選";position:absolute;top:10px;left:10px;background:#177653;color:#fff;border-radius:999px;padding:6px 10px;font-size:13px;font-weight:900;z-index:3}
.menu-title{font-size:24px!important}.menu-price{font-size:30px!important}

/* 底部購物車：顯示餐點內容與大字總額 */
.cart-bar{align-items:stretch!important;padding:13px 14px!important;gap:14px!important}
.cart-main{min-width:0;flex:1;display:flex;flex-direction:column;justify-content:center}
.cart-items{color:#fff;font-size:18px;font-weight:900;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:5px}
.cart-summary-line{display:flex;align-items:baseline;gap:12px}
.cart-summary-line #cartQty{font-size:15px!important;color:#d3e1db!important}
.cart-summary-line #cartTotal{display:inline!important;font-size:35px!important;color:#fff!important}
.cart-bar button{min-width:118px;align-self:center;font-size:18px!important;padding:15px 18px!important}
.history-section{margin-top:16px}.my-order-card{margin-bottom:16px}
@media(max-width:600px){.cart-bar{gap:9px!important}.cart-items{font-size:16px}.cart-summary-line #cartTotal{font-size:31px!important}.cart-bar button{min-width:104px;padding:13px 12px!important}}

/* V2.0.3 列印字體進一步放大 */
@media print{body.print-xxl .print-title{font-size:30pt!important}body.print-xxl .print-meta{font-size:16pt!important}body.print-xxl .stat span{font-size:15pt!important}body.print-xxl .stat b{font-size:26pt!important}body.print-xxl h3{font-size:23pt!important}body.print-xxl th,body.print-xxl td{font-size:21pt!important;padding:3.6mm 2.4mm!important}body.print-xxl .check-big,body.print-xxl .check-box{font-size:30pt!important}}
@media print{body.print-xl .print-title{font-size:27pt!important}body.print-xl .print-meta{font-size:14pt!important}body.print-xl .stat span{font-size:13pt!important}body.print-xl .stat b{font-size:23pt!important}body.print-xl h3{font-size:20pt!important}body.print-xl th,body.print-xl td{font-size:18pt!important;padding:3mm 2mm!important}body.print-xl .check-big,body.print-xl .check-box{font-size:26pt!important}}
@media print{body.print-lg .print-title{font-size:24pt!important}body.print-lg .print-meta{font-size:12.5pt!important}body.print-lg .stat span{font-size:11.5pt!important}body.print-lg .stat b{font-size:20pt!important}body.print-lg h3{font-size:17pt!important}body.print-lg th,body.print-lg td{font-size:15pt!important;padding:2.3mm 1.7mm!important}body.print-lg .check-big,body.print-lg .check-box{font-size:22pt!important}}
@media print{body.print-md .print-title{font-size:20pt!important}body.print-md .print-meta{font-size:10.5pt!important}body.print-md .stat span{font-size:9.5pt!important}body.print-md .stat b{font-size:17pt!important}body.print-md h3{font-size:14pt!important}body.print-md th,body.print-md td{font-size:12pt!important;padding:1.5mm 1.1mm!important}body.print-md .check-big,body.print-md .check-box{font-size:18pt!important}}
@media print{body.print-sm .print-title{font-size:17pt!important}body.print-sm .print-meta{font-size:9pt!important}body.print-sm .stat span{font-size:8pt!important}body.print-sm .stat b{font-size:14pt!important}body.print-sm h3{font-size:12pt!important}body.print-sm th,body.print-sm td{font-size:10pt!important;padding:.9mm .7mm!important}body.print-sm .check-big,body.print-sm .check-box{font-size:15pt!important}}

/* V2.0.4：合計區塊改為一般頁面內容，不再固定遮住畫面 */
.cart-bar.cart-panel{
  position:static!important;
  left:auto!important;
  right:auto!important;
  bottom:auto!important;
  transform:none!important;
  width:100%!important;
  margin:0 0 14px 0!important;
  border-radius:18px!important;
  padding:16px 18px!important;
  box-shadow:0 8px 24px rgba(0,0,0,.16)!important;
  z-index:auto!important;
  display:flex;
  align-items:center!important;
  gap:16px!important;
}
.cart-panel-title{
  color:#bcd5ca;
  font-size:13px;
  font-weight:800;
  margin-bottom:4px;
}
.cart-panel .cart-main{
  flex:1;
  min-width:0;
}
.cart-panel .cart-items{
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  color:#fff!important;
  font-size:19px!important;
  font-weight:900!important;
  line-height:1.45!important;
  margin-bottom:6px!important;
}
.cart-panel .cart-summary-line{
  display:flex!important;
  gap:12px!important;
  align-items:baseline!important;
}
.cart-panel #cartQty{
  font-size:15px!important;
}
.cart-panel #cartTotal{
  display:inline!important;
  font-size:38px!important;
  color:#fff!important;
}
.cart-panel #checkoutBtn{
  min-width:150px!important;
  align-self:center!important;
}
@media(max-width:600px){
  .cart-bar.cart-panel{
    display:block!important;
    padding:15px!important;
  }
  .cart-panel #checkoutBtn{
    width:100%!important;
    margin-top:12px!important;
    min-width:0!important;
  }
  .cart-panel .cart-items{
    font-size:17px!important;
  }
  .cart-panel #cartTotal{
    font-size:34px!important;
  }
}
/* 只替固定底部導覽預留空間 */
body{padding-bottom:76px!important}

/* V2.0.5 菜單複選說明 */
.filter-hint{
  margin-top:8px;
  font-size:12px;
  color:var(--muted);
  line-height:1.4;
}

/* 店家是否加入平日自動排程 */
.switch-row{
  display:flex!important;
  flex-direction:row!important;
  align-items:flex-start!important;
  gap:12px!important;
  padding:12px 13px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8faf9;
}
.switch-row input[type="checkbox"]{
  width:22px!important;
  height:22px!important;
  flex:0 0 22px;
  margin:1px 0 0 0;
  accent-color:var(--primary);
}
.switch-row span{display:block;font-weight:400}
.switch-row b{display:block;font-size:15px;margin-bottom:3px}
.switch-row small{display:block;color:var(--muted);line-height:1.45}
.schedule-flag{margin-top:3px;font-weight:800}
.schedule-flag.on{color:#177653}
.schedule-flag.off{color:#a35a1e}

/* V2.0.6 Header / Clock */
.topbar{display:grid!important;grid-template-columns:1fr auto 1fr;gap:10px}
.brand-block{min-width:0}.live-clock{align-self:center;justify-self:center;font-size:22px;font-weight:950;letter-spacing:1px;color:var(--primary);font-variant-numeric:tabular-nums}.top-actions{justify-self:end}
@media(max-width:600px){.brand{font-size:17px}.live-clock{font-size:18px}}

/* Browse vendors */
.browse-group{margin-bottom:18px}.browse-group-title{font-size:22px;font-weight:950;margin:0 4px 9px}.browse-vendor-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.browse-vendor-card{background:#fff;border:2px solid var(--line);border-radius:16px;overflow:hidden;box-shadow:var(--shadow)}.browse-vendor-head{width:100%;border:0;background:#fff;padding:15px;display:flex;justify-content:space-between;align-items:center;text-align:left}.browse-vendor-head b{display:block;font-size:20px;color:var(--text)}.browse-vendor-head span{display:block;color:var(--muted);font-size:13px;margin-top:4px}.browse-chevron{font-size:25px!important;color:var(--primary)!important;transition:.2s}.browse-vendor-head.open .browse-chevron{transform:rotate(180deg)}.browse-menu{border-top:1px solid var(--line)}.browse-menu-row{position:relative;display:grid;grid-template-columns:72px 1fr auto;gap:12px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line)}.browse-menu-row:last-child{border-bottom:0}.browse-menu-row img,.browse-menu-placeholder{width:72px;height:54px;object-fit:cover;border-radius:9px;background:#edf1ef}.browse-menu-placeholder{display:flex;align-items:center;justify-content:center;font-size:26px}.browse-menu-info b{display:block;font-size:17px}.browse-menu-info span{display:block;color:var(--muted);font-size:12px;margin-top:3px}.browse-menu-row strong{font-size:20px;color:var(--primary)}.browse-menu-row.disabled{opacity:.55}.browse-menu-row em{position:absolute;right:10px;top:5px;color:#b43c34;font-size:11px;font-style:normal;font-weight:900}
@media(max-width:700px){.browse-vendor-grid{grid-template-columns:1fr}}
.bottom-nav .nav-item{flex:1;min-width:0!important;max-width:150px;padding-left:8px!important;padding-right:8px!important}

/* V2.0.7 截止倒數 */
.countdown-card{
  margin-bottom:12px;
  border-radius:16px;
  padding:12px 16px;
  background:#e8f3ee;
  border:2px solid #9fcbb9;
  text-align:center;
}
.countdown-label{font-size:12px;font-weight:900;color:#4c655a}
.countdown-value{font-size:30px;font-weight:950;color:var(--primary);line-height:1.15;margin:2px 0}
.countdown-hint{font-size:13px;color:#52635c}
.countdown-card.warn{background:#fff4d6;border-color:#e7c86e}
.countdown-card.warn .countdown-value{color:#9a6b00}
.countdown-card.danger{background:#ffe4e0;border-color:#dc7f76}
.countdown-card.danger .countdown-value{color:#b92d25}
.countdown-card.closed{background:#ecefee;border-color:#c7cfcb}
.countdown-card.closed .countdown-value{color:#59645f}

/* 收藏 / 常點 */
.menu-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.fav-btn{
  flex:0 0 38px;
  width:38px;height:38px;
  border:1px solid #d9dfdc;
  border-radius:50%;
  background:#fff;
  color:#aab2ae;
  font-size:21px;
  line-height:1;
}
.fav-btn.active{color:#e4a900;background:#fff8d9;border-color:#e6ca68}
.favorite-items{display:flex;gap:8px;flex-wrap:wrap}
.favorite-chip{
  border:2px solid #d9dfdc;
  background:#fff;
  border-radius:13px;
  padding:9px 11px;
  display:flex;
  gap:12px;
  align-items:center;
  font-weight:800;
}
.favorite-chip b{color:var(--primary)}
.favorite-chip:disabled{opacity:.45}

/* 關閉今日訂購 */
#closeTodayBtn{background:#b94037;color:#fff}

/* V2.0.8 通知徽章 */
.notif-btn{position:relative}
.notif-badge{
  position:absolute;right:-4px;top:-5px;min-width:19px;height:19px;padding:0 5px;
  border-radius:999px;background:#d83a31;color:#fff;font-size:11px;font-weight:950;
  line-height:19px;text-align:center;border:2px solid #fff
}

/* 今日訂購關閉狀態 */
#closeTodayBtn.closed-state{
  background:#5f6d66!important;color:#fff!important;opacity:1!important;cursor:default!important
}
#closeTodayBtn:disabled{opacity:.78}

/* 負責人截止後編輯訂單 */
.edit-order-btn{white-space:nowrap}
.manager-edit-items{max-height:52vh;overflow:auto;border:1px solid var(--line);border-radius:13px}
.manager-edit-row{
  display:flex;justify-content:space-between;gap:12px;align-items:center;
  padding:11px 12px;border-bottom:1px solid var(--line)
}
.manager-edit-row:last-child{border-bottom:0}
.manager-edit-row b{display:block}
.manager-edit-row span{display:block;color:var(--muted);font-size:12px;margin-top:2px}

/* 防止舊版浮動結算列殘影 */
body > #cartBar{display:none!important}

/* V2.0.9 - 結算區只允許出現在訂餐頁，且不浮動 */
#orderView #cartBar{
  position:static!important;
  left:auto!important;
  right:auto!important;
  bottom:auto!important;
  transform:none!important;
  width:100%!important;
  z-index:auto!important;
  margin:0 0 14px 0!important;
}
#orderView #cartBar.hidden{display:none!important}
body > #cartBar{display:none!important}
.view:not(#orderView) #cartBar{display:none!important}

/* ==================== V2.1 ==================== */
.language-select{width:auto;max-width:132px;padding:8px 9px;border-radius:11px;background:#fff;font-size:13px;font-weight:800}
.data-tools-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.tool-card{border:2px solid var(--line);background:#fff;border-radius:16px;padding:18px;text-align:left;display:grid;grid-template-columns:44px 1fr;column-gap:10px;align-items:center}
.tool-card>span{font-size:30px;grid-row:1/3}.tool-card>b{font-size:16px}.tool-card>small{color:var(--muted);margin-top:4px}.tool-card:hover{border-color:var(--primary);background:var(--primarySoft)}
.tool-card.danger-outline{border-color:#e5b6b1}
.import-preview .stats-grid{margin-bottom:14px}

/* 明日：整個訂餐內容區改為柔和紅色系，與今天綠色明確區分 */
body.tomorrow-theme{--day-accent:#b84843;--day-accent2:#963833;--day-soft:#fbeceb;--day-line:#edc5c2}
body:not(.tomorrow-theme){--day-accent:var(--primary);--day-accent2:var(--primary2);--day-soft:var(--primarySoft);--day-line:#b9d7ca}
body.tomorrow-theme #orderView .card{border-color:var(--day-line)}
body.tomorrow-theme #orderView .vendor-hero{background:linear-gradient(135deg,#fff7f6,#fbe6e4);border:2px solid var(--day-line)}
body.tomorrow-theme #orderView .badge.light{background:#f3d1ce;color:#87312d}
body.tomorrow-theme #orderView .chip.active{background:var(--day-accent);border-color:var(--day-accent);color:#fff}
body.tomorrow-theme #orderView .menu-card{border-color:var(--day-line);box-shadow:0 7px 20px rgba(126,43,38,.08)}
body.tomorrow-theme #orderView .menu-card:has(.qty-value:not(:empty)){border-color:var(--day-accent)}
body.tomorrow-theme #orderView .countdown-card:not(.warn):not(.danger):not(.closed){background:var(--day-soft);border-color:var(--day-line)}
body.tomorrow-theme #orderView .countdown-value{color:var(--day-accent)}
body.tomorrow-theme #orderView .delivery-banner{border-color:var(--day-line)}
body.tomorrow-theme #orderView #cartBar{background:#5f2724!important}
body.tomorrow-theme #orderView #checkoutBtn{background:#ffd7d3!important;color:#66231f!important}
body.tomorrow-theme #orderView .text-btn{color:var(--day-accent)}
body.tomorrow-theme .date-tab[data-offset="1"].active{background:#b84843!important;color:#fff!important;border-color:#b84843!important}
body.tomorrow-theme #orderView input:focus,body.tomorrow-theme #orderView select:focus,body.tomorrow-theme #orderView textarea:focus{border-color:var(--day-accent)}

@media(max-width:650px){
 .language-select{max-width:108px;font-size:12px;padding:7px}
 .data-tools-grid{grid-template-columns:1fr}
 .tool-card{padding:14px}
}

/* ==================== V2.1.4 ==================== */

/* 1. 手機 Header：語言縮成地球圖示 */
.language-menu-wrap{
  position:relative;
  display:flex;
  align-items:center;
}
.language-btn{
  width:46px!important;
  height:46px!important;
  min-width:46px!important;
  padding:0!important;
  font-size:23px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.language-menu{
  position:absolute;
  right:0;
  top:54px;
  width:170px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:0 12px 30px rgba(20,40,30,.18);
  padding:6px;
  z-index:1000;
}
.language-menu button{
  width:100%;
  border:0;
  background:transparent;
  padding:12px 13px;
  border-radius:10px;
  text-align:left;
  font-size:14px;
  font-weight:800;
  color:var(--text);
}
.language-menu button:hover,
.language-menu button.active{
  background:var(--primarySoft);
  color:var(--primary);
}
@media(max-width:600px){
  .topbar{
    grid-template-columns:minmax(0,1fr) auto auto!important;
    gap:7px!important;
    padding-left:12px!important;
    padding-right:12px!important;
  }
  .brand-block{min-width:0}
  .brand{
    font-size:17px!important;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .brand-block .subtle{font-size:11px!important}
  .live-clock{
    font-size:18px!important;
    white-space:nowrap;
  }
  .top-actions{gap:6px!important}
  .language-btn{
    width:42px!important;
    height:42px!important;
    min-width:42px!important;
  }
}

/* 2. 底部導覽恢復大圖示、大按壓區域 */
.bottom-nav{
  min-height:78px!important;
  height:auto!important;
  padding:5px 6px max(5px,env(safe-area-inset-bottom))!important;
  display:flex!important;
  justify-content:space-around!important;
  align-items:stretch!important;
}
.bottom-nav .nav-item{
  flex:1 1 0!important;
  max-width:none!important;
  min-width:0!important;
  min-height:66px!important;
  border:0!important;
  background:transparent!important;
  border-radius:14px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:3px!important;
  padding:7px 3px!important;
  font-size:13px!important;
  font-weight:800!important;
  line-height:1.1!important;
}
.bottom-nav .nav-icon{
  display:block!important;
  font-size:27px!important;
  line-height:1!important;
  margin:0!important;
}
.bottom-nav .nav-label{
  display:block!important;
  white-space:nowrap;
}
.bottom-nav .nav-item.active{
  background:#edf7f2!important;
  color:var(--primary)!important;
}
.bottom-nav .nav-item:active{
  transform:scale(.96);
}
body{padding-bottom:92px!important}

/* 3. 今天 / 明天主題：強制作用在整個 orderView */
body.today-theme #orderView,
#orderView[data-day-theme="today"]{
  --order-accent:#177653;
  --order-accent-dark:#115a3f;
  --order-soft:#eaf5ef;
  --order-softer:#f6fbf8;
  --order-line:#abd2c1;
  --order-shadow:rgba(23,118,83,.09);
}
body.tomorrow-theme #orderView,
#orderView[data-day-theme="tomorrow"]{
  --order-accent:#c2463f;
  --order-accent-dark:#93332e;
  --order-soft:#fbe8e6;
  --order-softer:#fff7f6;
  --order-line:#e7b6b2;
  --order-shadow:rgba(166,54,48,.10);
}

#orderView .card{
  border-color:var(--order-line)!important;
}
#orderView .vendor-hero{
  background:linear-gradient(135deg,var(--order-softer),var(--order-soft))!important;
  border:2px solid var(--order-line)!important;
}
#orderView .badge.light,
#orderView .order-badge{
  background:var(--order-soft)!important;
  color:var(--order-accent)!important;
}
#orderView .chip.active{
  background:var(--order-accent)!important;
  border-color:var(--order-accent)!important;
  color:#fff!important;
}
#orderView .menu-card{
  border-color:var(--order-line)!important;
  box-shadow:0 7px 20px var(--order-shadow)!important;
}
#orderView .menu-card.selected{
  border-color:var(--order-accent)!important;
  box-shadow:0 0 0 4px color-mix(in srgb,var(--order-accent) 14%,transparent),0 10px 24px var(--order-shadow)!important;
}
#orderView .menu-card.selected::after{
  background:var(--order-accent)!important;
}
#orderView .menu-price,
#orderView .my-order-amount,
#orderView .text-btn{
  color:var(--order-accent)!important;
}
#orderView .countdown-card:not(.warn):not(.danger):not(.closed){
  background:var(--order-soft)!important;
  border-color:var(--order-line)!important;
}
#orderView .countdown-card:not(.warn):not(.danger):not(.closed) .countdown-value{
  color:var(--order-accent)!important;
}
#orderView .delivery-banner{
  border-color:var(--order-line)!important;
  background:var(--order-softer)!important;
}
#orderView #cartBar{
  background:var(--order-accent-dark)!important;
}
#orderView #checkoutBtn{
  background:#fff!important;
  color:var(--order-accent-dark)!important;
}
#orderView input:focus,
#orderView select:focus,
#orderView textarea:focus{
  border-color:var(--order-accent)!important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--order-accent) 12%,transparent)!important;
}

/* 日期按鈕本身明確保持兩色 */
.date-tab[data-offset="0"]{
  border-color:#72ae94!important;
  color:#176347!important;
  background:#f4faf7!important;
}
.date-tab[data-offset="0"].active{
  background:#176f52!important;
  border-color:#176f52!important;
  color:#fff!important;
}
.date-tab[data-offset="1"]{
  border-color:#dd8882!important;
  color:#ad3b35!important;
  background:#fff5f4!important;
}
.date-tab[data-offset="1"].active{
  background:#c2463f!important;
  border-color:#c2463f!important;
  color:#fff!important;
}

/* ==================== V2.1.5 ==================== */
/* 未來 7 天整列可點 */
.schedule-date-row{
  width:100%;border:0;border-bottom:1px solid var(--line);background:#fff;
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  padding:15px 2px;text-align:left;
}
.schedule-date-row:last-child{border-bottom:0}
.schedule-date-row:active{background:#f3f7f5}
.schedule-date-row.weekend{background:#fafafa}
.schedule-date-row.weekend .schedule-date-main{opacity:.68}
.schedule-date-main b{display:block;font-size:17px;color:var(--text)}
.schedule-date-main span{display:block;margin-top:4px;color:var(--muted)}
.schedule-date-side{display:flex;align-items:center;gap:10px}
.schedule-edit-arrow{font-size:30px;color:var(--primary);line-height:1}

/* 今日店家：深綠底白字 */
body.today-theme #orderView .vendor-hero,
#orderView[data-day-theme="today"] .vendor-hero{
  background:linear-gradient(135deg,#197653,#115b40)!important;
  border-color:#197653!important;color:#fff!important;
}
body.today-theme #orderView .vendor-hero *,
#orderView[data-day-theme="today"] .vendor-hero *{color:#fff!important}
body.today-theme #orderView .vendor-hero .badge.light,
#orderView[data-day-theme="today"] .vendor-hero .badge.light{
  background:rgba(255,255,255,.18)!important;color:#fff!important;
}

/* 明天店家：深紅底白字 */
body.tomorrow-theme #orderView .vendor-hero,
#orderView[data-day-theme="tomorrow"] .vendor-hero{
  background:linear-gradient(135deg,#c64a43,#a53631)!important;
  border-color:#c64a43!important;color:#fff!important;
}
body.tomorrow-theme #orderView .vendor-hero *,
#orderView[data-day-theme="tomorrow"] .vendor-hero *{color:#fff!important}
body.tomorrow-theme #orderView .vendor-hero .badge.light,
#orderView[data-day-theme="tomorrow"] .vendor-hero .badge.light{
  background:rgba(255,255,255,.18)!important;color:#fff!important;
}

/* 今日提示綠；明日提示紅 */
body.today-theme #orderView .delivery-banner,
#orderView[data-day-theme="today"] .delivery-banner{
  color:#176f52!important;border-color:#acd2c1!important;background:#f5fbf8!important;
}
body.today-theme #orderView .delivery-banner *,
#orderView[data-day-theme="today"] .delivery-banner *{color:#176f52!important}

body.tomorrow-theme #orderView .delivery-banner,
#orderView[data-day-theme="tomorrow"] .delivery-banner{
  color:#b53f39!important;border-color:#e5b7b3!important;background:#fff7f6!important;
}
body.tomorrow-theme #orderView .delivery-banner *,
#orderView[data-day-theme="tomorrow"] .delivery-banner *{color:#b53f39!important}

body.tomorrow-theme #orderView .section-head h2,
body.tomorrow-theme #orderView .filter-hint{
  color:#a83b35!important;
}
body.tomorrow-theme #orderView .menu-card.selected .menu-title,
body.tomorrow-theme #orderView .menu-card.selected .menu-price{color:#a83b35!important}
body.today-theme #orderView .menu-card.selected .menu-title,
body.today-theme #orderView .menu-card.selected .menu-price{color:#176f52!important}

/* V2.1.6：訂購單自動壓縮至單張 A4 */
@media print{
  @page{size:A4 portrait;margin:4mm}
  html,body{
    width:202mm!important;
    min-width:0!important;
    max-width:202mm!important;
    margin:0!important;
    padding:0!important;
    background:#fff!important;
    overflow:visible!important;
  }
  #adminView,#admin-today,#admin-today .card,.print-area,
  #adminItemSummary,#adminOrderTable,
  #adminItemSummary table,#adminOrderTable table{
    break-before:avoid!important;
    break-after:avoid!important;
    break-inside:avoid!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
    page-break-inside:avoid!important;
  }
  #admin-today .card{margin:0!important;padding:1.5mm!important;box-shadow:none!important}
  #adminItemSummary table,#adminOrderTable table{
    width:100%!important;
    border-collapse:collapse!important;
    table-layout:fixed!important;
  }
  #adminItemSummary tr,#adminOrderTable tr,
  #adminItemSummary td,#adminOrderTable td,
  #adminItemSummary th,#adminOrderTable th{
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  .print-header,.print-meta,.stats-grid,.print-section,#admin-today h3{
    margin-top:.8mm!important;
    margin-bottom:.8mm!important;
  }
  .stats-grid{gap:.8mm!important}
  .stat{padding:.8mm!important;min-height:0!important}
  .screen-only,.admin-tabs,.bottom-nav,.topbar,
  #closeTodayBtn,#printBtn,#refreshAdminBtn,.edit-order-btn,button[data-pick]{
    display:none!important;
  }

  body.print-fit-100 .print-title{font-size:24pt!important}
  body.print-fit-100 .print-meta{font-size:12pt!important}
  body.print-fit-100 h3{font-size:17pt!important}
  body.print-fit-100 th,body.print-fit-100 td{font-size:14pt!important;padding:2mm 1.3mm!important;line-height:1.15!important}
  body.print-fit-100 .stat span{font-size:10pt!important}
  body.print-fit-100 .stat b{font-size:19pt!important}

  body.print-fit-92 .print-title{font-size:22pt!important}
  body.print-fit-92 .print-meta{font-size:11pt!important}
  body.print-fit-92 h3{font-size:15.5pt!important}
  body.print-fit-92 th,body.print-fit-92 td{font-size:12.8pt!important;padding:1.6mm 1.1mm!important;line-height:1.11!important}
  body.print-fit-92 .stat span{font-size:9.4pt!important}
  body.print-fit-92 .stat b{font-size:17pt!important}

  body.print-fit-84 .print-title{font-size:20pt!important}
  body.print-fit-84 .print-meta{font-size:10pt!important}
  body.print-fit-84 h3{font-size:14pt!important}
  body.print-fit-84 th,body.print-fit-84 td{font-size:11.4pt!important;padding:1.3mm .9mm!important;line-height:1.08!important}
  body.print-fit-84 .stat span{font-size:8.7pt!important}
  body.print-fit-84 .stat b{font-size:15.5pt!important}

  body.print-fit-76 .print-title{font-size:18pt!important}
  body.print-fit-76 .print-meta{font-size:9pt!important}
  body.print-fit-76 h3{font-size:12.5pt!important}
  body.print-fit-76 th,body.print-fit-76 td{font-size:10pt!important;padding:1mm .75mm!important;line-height:1.05!important}
  body.print-fit-76 .stat span{font-size:8pt!important}
  body.print-fit-76 .stat b{font-size:14pt!important}

  body.print-fit-68 .print-title{font-size:16pt!important}
  body.print-fit-68 .print-meta{font-size:8pt!important}
  body.print-fit-68 h3{font-size:11pt!important}
  body.print-fit-68 th,body.print-fit-68 td{font-size:8.8pt!important;padding:.75mm .6mm!important;line-height:1.02!important}
  body.print-fit-68 .stat span{font-size:7.4pt!important}
  body.print-fit-68 .stat b{font-size:12.5pt!important}

  body.print-fit-60 .print-title{font-size:14pt!important}
  body.print-fit-60 .print-meta{font-size:7.2pt!important}
  body.print-fit-60 h3{font-size:9.5pt!important}
  body.print-fit-60 th,body.print-fit-60 td{font-size:7.7pt!important;padding:.5mm .45mm!important;line-height:1!important}
  body.print-fit-60 .stat span{font-size:6.8pt!important}
  body.print-fit-60 .stat b{font-size:11pt!important}

  body.print-fit-52 .print-title{font-size:12pt!important}
  body.print-fit-52 .print-meta{font-size:6.4pt!important}
  body.print-fit-52 h3{font-size:8.2pt!important;margin:.4mm 0!important}
  body.print-fit-52 th,body.print-fit-52 td{
    font-size:6.6pt!important;padding:.3mm .3mm!important;line-height:1!important;overflow-wrap:anywhere!important
  }
  body.print-fit-52 .stat span{font-size:5.8pt!important}
  body.print-fit-52 .stat b{font-size:9.5pt!important}
}

/* ==================== V2.1.7 ==================== */

/* 人員明細：每個餐點固定一行 */
.order-meal-lines{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.order-meal-line{
  display:block;
  white-space:nowrap;
  line-height:1.3;
}

/* 人員明細欄寬：移除編輯欄後，把空間讓給餐點 */
#adminOrderTable table th:nth-child(1),
#adminOrderTable table td:nth-child(1){width:15%}
#adminOrderTable table th:nth-child(2),
#adminOrderTable table td:nth-child(2){width:37%}
#adminOrderTable table th:nth-child(3),
#adminOrderTable table td:nth-child(3){width:17%}
#adminOrderTable table th:nth-child(4),
#adminOrderTable table td:nth-child(4){width:11%}
#adminOrderTable table th:nth-child(5),
#adminOrderTable table td:nth-child(5){width:10%}
#adminOrderTable table th:nth-child(6),
#adminOrderTable table td:nth-child(6){width:10%}

/* 修正空白第 2 頁：
   舊版曾設定 html/body min-height:297mm，
   部分 Chrome/印表機會把 A4 邊界計算成第二張空白頁。 */
@media print{
  @page{
    size:A4 portrait;
    margin:5mm;
  }

  html,
  body{
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
  }

  .shell{
    width:auto!important;
    max-width:none!important;
    min-height:0!important;
    height:auto!important;
    margin:0!important;
    padding:0!important;
  }

  .view,
  #adminView,
  #admin-today,
  #admin-today .card{
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
  }

  #adminView{
    width:100%!important;
    margin:0!important;
    padding:0!important;
  }

  #admin-today .card{
    width:100%!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
  }

  /* 不讓隱藏畫面或固定元素佔列印版面 */
  body > *:not(.topbar):not(.shell):not(.bottom-nav):not(.modal):not(.profile-menu):not(.toast){
    max-height:none;
  }

  .topbar,
  .bottom-nav,
  .cart-bar,
  .admin-tabs,
  #printBtn,
  #refreshAdminBtn,
  #closeTodayBtn,
  .screen-only,
  .modal,
  .profile-menu,
  .toast{
    display:none!important;
  }

  /* 防止瀏覽器在文件尾端製造額外空白分頁 */
  #adminView::after,
  #admin-today::after,
  #admin-today .card::after{
    content:none!important;
    display:none!important;
  }

  #adminOrderTable table{
    table-layout:fixed!important;
  }

  #adminOrderTable .order-meal-lines{
    gap:0!important;
  }

  #adminOrderTable .order-meal-line{
    white-space:nowrap!important;
    overflow:visible!important;
    line-height:1.16!important;
    margin:0!important;
    padding:0!important;
  }

  /* 移除編輯欄後重新分配列印欄寬 */
  #adminOrderTable th:nth-child(1),
  #adminOrderTable td:nth-child(1){width:14%!important}
  #adminOrderTable th:nth-child(2),
  #adminOrderTable td:nth-child(2){width:39%!important}
  #adminOrderTable th:nth-child(3),
  #adminOrderTable td:nth-child(3){width:16%!important}
  #adminOrderTable th:nth-child(4),
  #adminOrderTable td:nth-child(4){width:11%!important}
  #adminOrderTable th:nth-child(5),
  #adminOrderTable td:nth-child(5){width:10%!important}
  #adminOrderTable th:nth-child(6),
  #adminOrderTable td:nth-child(6){width:10%!important}

  /* 姓名保持單行；餐點每項各自單行 */
  #adminOrderTable th:nth-child(1),
  #adminOrderTable td:nth-child(1){
    white-space:nowrap!important;
  }

  /* 允許備註正常換行 */
  #adminOrderTable th:nth-child(3),
  #adminOrderTable td:nth-child(3){
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
}


/* ==================== V2.1.8 多語底部導覽 ==================== */
.bottom-nav .nav-item{
  flex:1 1 25%!important;
  width:25%!important;
  min-width:0!important;
  max-width:none!important;
  min-height:72px!important;
  padding:6px 2px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  gap:5px!important;
  overflow:hidden!important;
}
.bottom-nav .nav-icon{
  flex:0 0 auto!important;
  display:block!important;
  font-size:27px!important;
  line-height:1!important;
}
.bottom-nav .nav-label{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  min-height:2.25em!important;
  padding:0 2px!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  text-align:center!important;
  font-size:clamp(10px,3.15vw,14px)!important;
  font-weight:850!important;
  line-height:1.08!important;
}
html[lang="vi"] .bottom-nav .nav-label{font-size:clamp(9px,2.8vw,12px)!important;}
html[lang="ja"] .bottom-nav .nav-label{font-size:clamp(10px,2.95vw,13px)!important;}
.real-name-box p{line-height:1.6;color:var(--muted);margin-top:0}
.real-name-box input{width:100%;box-sizing:border-box;margin-top:7px;font-size:18px}

/* ==================== V2.1.9 店家重大異動流程 ==================== */
.vendor-change-banner{
  display:flex;
  gap:12px;
  align-items:flex-start;
  margin:12px 0;
  padding:15px 16px;
  border:2px solid #dc7770;
  border-radius:17px;
  background:#fff1ef;
  color:#8e2f2a;
}
.vendor-change-banner.hidden{display:none!important}
.vendor-change-icon{font-size:28px;line-height:1}
.vendor-change-content{flex:1;min-width:0}
.vendor-change-content>b{display:block;font-size:20px;margin-bottom:6px}
.vendor-change-content>div{line-height:1.55}
.vendor-change-action{margin-top:8px;padding-top:8px;border-top:1px solid #efc1bd}

.change-admin-panel{
  border:2px solid #df7770;
  background:#fff5f4;
  border-radius:16px;
  padding:14px;
  margin-bottom:14px;
}
.change-admin-panel.hidden{display:none!important}
.danger-badge{background:#c8433d!important;color:#fff!important}
.change-deadline{font-weight:900;color:#9f332e}
.change-progress-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin:10px 0 12px;
}
.change-progress-grid>div{
  background:#fff;
  border:1px solid #edc2bf;
  border-radius:12px;
  padding:10px;
  text-align:center;
}
.change-progress-grid span{display:block;font-size:12px;color:#7c5a57}
.change-progress-grid b{display:block;font-size:25px;color:#aa3832;margin-top:3px}
.pending-person-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  padding:10px 4px;
  border-top:1px solid #edd2cf;
}
.pending-person-row>div{min-width:0}
.pending-person-row b{display:block}
.pending-person-row span{display:block;color:var(--muted);font-size:12px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.vendor-change-compare{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  gap:8px;
  align-items:center;
  margin:14px 0;
}
.vendor-change-compare>div:not(.change-arrow){
  background:#f7f8f7;
  border-radius:13px;
  padding:12px;
  text-align:center;
}
.vendor-change-compare span{display:block;font-size:12px;color:var(--muted)}
.vendor-change-compare b{display:block;margin-top:4px;font-size:17px}
.change-arrow{font-size:26px;font-weight:900}
.check-line{display:flex!important;align-items:center;gap:9px;margin:12px 0}
.check-line input{width:20px;height:20px}
.danger-notice{background:#ffebe8;border-color:#de8a83;color:#8f302a}
.change-history-card{border-left:5px solid #c64a43!important}

@media(max-width:600px){
  .change-progress-grid{grid-template-columns:repeat(3,1fr)}
  .change-progress-grid>div{padding:8px 3px}
  .change-progress-grid b{font-size:21px}
  .vendor-change-compare b{font-size:14px}
}
@media print{
  #vendorChangeAdminPanel{display:none!important}
}

/* V2.2.0 */
.danger-text{color:#b43d35!important}
.archive-badge{display:inline-block;margin-left:6px;padding:2px 7px;border-radius:999px;background:#ecefed;color:#68726d;font-size:11px;vertical-align:middle}
.archived-row{opacity:.68;background:#f7f8f7!important}
.category-admin-list{display:grid;gap:7px}
.category-admin-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:#fff}
.category-admin-row b{display:block;font-size:16px}
.category-admin-row span{display:block;font-size:12px;color:var(--muted);margin-top:2px}
@media(max-width:600px){.vendor-admin-head>.action-row,.category-admin-row .action-row{flex-wrap:wrap;justify-content:flex-end}}


/* ==================== V2.2.0f ==================== */
/* Excel 匯入真實進度 */
.excel-import-progress{
  margin:14px 0;
  padding:14px;
  border:1px solid #bed7cc;
  border-radius:14px;
  background:#f5fbf8;
}
.excel-import-progress.error{
  border-color:#e3aaa5;
  background:#fff4f3;
}
.import-progress-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  margin-bottom:10px;
}
.import-progress-head>div:first-child{
  display:flex;
  gap:10px;
  align-items:baseline;
}
.import-progress-head b{font-size:16px}
#importProgressPercent{font-size:22px;font-weight:950;color:var(--primary)}
#importProgressElapsed{font-size:12px;color:var(--muted);white-space:nowrap}
.import-progress-track{
  width:100%;
  height:14px;
  overflow:hidden;
  border-radius:999px;
  background:#dce8e2;
}
.import-progress-bar{
  height:100%;
  border-radius:inherit;
  background:var(--primary);
  transition:width .18s ease;
}
.import-progress-current{
  min-height:42px;
  margin-top:10px;
  padding:9px 10px;
  border-radius:10px;
  background:#fff;
  font-size:14px;
  line-height:1.5;
}
.import-progress-meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:7px;
  font-size:12px;
  color:var(--muted);
}

/* 手機訂餐：菜單兩欄 + 約半高的緊湊卡片 */
@media(max-width:600px){
  #orderView .menu-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    margin-bottom:10px!important;
  }

  #orderView .menu-card{
    border-width:2px!important;
    border-radius:13px!important;
    min-width:0!important;
    box-shadow:0 4px 12px var(--order-shadow)!important;
  }

  #orderView .menu-card.selected{
    border-width:3px!important;
    box-shadow:0 0 0 2px color-mix(in srgb,var(--order-accent) 13%,transparent),0 5px 14px var(--order-shadow)!important;
  }

  #orderView .menu-card.selected::after{
    top:5px!important;
    left:5px!important;
    padding:3px 7px!important;
    font-size:10px!important;
  }

  #orderView .menu-image,
  #orderView .menu-placeholder{
    aspect-ratio:16/7!important;
    max-height:76px!important;
  }

  #orderView .menu-placeholder{
    font-size:27px!important;
  }

  #orderView .menu-body{
    padding:8px!important;
  }

  #orderView .menu-title-row{
    gap:3px!important;
    align-items:flex-start!important;
  }

  #orderView .menu-title{
    font-size:16px!important;
    line-height:1.13!important;
    min-width:0!important;
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    overflow:hidden!important;
  }

  #orderView .fav-btn{
    flex:0 0 auto!important;
    width:29px!important;
    height:29px!important;
    min-width:29px!important;
    padding:0!important;
    font-size:18px!important;
  }

  #orderView .menu-desc{
    font-size:11px!important;
    line-height:1.15!important;
    min-height:0!important;
    margin-top:2px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }

  #orderView .menu-price{
    font-size:21px!important;
    line-height:1!important;
    margin-top:5px!important;
  }

  #orderView .menu-footer{
    margin-top:6px!important;
    gap:4px!important;
  }

  #orderView .menu-footer>.subtle{
    display:none!important;
  }

  #orderView .qty-controls{
    width:100%!important;
    justify-content:flex-end!important;
    gap:6px!important;
  }

  #orderView .qty-controls button{
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    padding:0!important;
    border-radius:9px!important;
    font-size:21px!important;
    line-height:1!important;
  }

  #orderView .qty-controls b{
    min-width:20px!important;
    font-size:16px!important;
  }

  #orderView .sold-label{
    top:5px!important;
    right:5px!important;
    padding:4px 6px!important;
    font-size:10px!important;
  }
}

/* 極窄手機仍維持雙欄，但再壓縮一點 */
@media(max-width:380px){
  #orderView .menu-grid{gap:6px!important}
  #orderView .menu-body{padding:7px!important}
  #orderView .menu-title{font-size:15px!important}
  #orderView .menu-price{font-size:19px!important}
  #orderView .qty-controls button{width:32px!important;height:32px!important;min-width:32px!important}
}


/* ==================== V2.2.0g ==================== */

/* 今天 / 明天日期稍微放大 */
#todayBtn .date,
#tomorrowBtn .date,
.day-tab .date,
.date-tab .date,
.day-switch .date,
.day-selector .date{
  font-size:1.14em!important;
  font-weight:850!important;
}

/* 開放訂購文字移除後，不顯示空 badge */
.vendor-card .status-badge:empty,
.vendor-card .badge:empty,
.schedule-card .status-badge:empty{
  display:none!important;
}

/* 店家菜單選單式 */
.vendor-picker-wrap{
  display:grid;
  grid-template-columns:auto minmax(240px,1fr) auto;
  gap:10px;
  align-items:center;
  padding:12px;
  margin:8px 0 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f7faf8;
}
.vendor-picker-label{
  margin:0!important;
  font-weight:900;
  white-space:nowrap;
}
.vendor-admin-select{
  width:100%;
  min-height:46px;
  padding:9px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  font-size:16px;
  font-weight:800;
}
.vendor-admin-count{white-space:nowrap}
.vendor-select-empty{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-height:180px;
  border:2px dashed var(--line);
  border-radius:16px;
  color:var(--muted);
}
.vendor-select-empty-icon{font-size:38px}
.vendor-select-empty b{font-size:18px;color:var(--text)}
.vendor-admin-single{margin-top:0!important}
.vendor-admin-title{display:block;font-size:22px!important;margin-bottom:7px}
.vendor-main-actions{align-self:flex-start;flex-wrap:wrap;justify-content:flex-end}
.vendor-menu-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin:16px 0 8px;
  padding-top:12px;
  border-top:1px solid var(--line);
}
.vendor-menu-head h3{margin:0}
.vendor-menu-head span{font-size:12px;color:var(--muted)}
.vendor-menu-admin-list{display:grid;gap:7px}

@media(max-width:600px){
  .vendor-picker-wrap{grid-template-columns:1fr;gap:6px}
  .vendor-picker-label{font-size:14px}
  .vendor-admin-count{white-space:normal}
  .vendor-main-actions{width:100%;justify-content:flex-start}
  .vendor-main-actions .table-btn{flex:1 1 auto}

  #todayBtn .date,
  #tomorrowBtn .date,
  .day-tab .date,
  .date-tab .date{
    font-size:1.22em!important;
  }
}


/* ===== V2.2.0g final patch ===== */

/* 今天 / 明天：日期字體放大 */
#todayBtn .date,
#tomorrowBtn .date,
#todayBtn .day-date,
#tomorrowBtn .day-date,
.day-tab .date,
.date-tab .date,
.day-switch .date,
.day-selector .date,
.today-tab .date,
.tomorrow-tab .date {
  font-size: 1.28em !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
}

/* 部分版本日期沒有 class，按鈕內第二行也放大 */
#todayBtn small,
#tomorrowBtn small,
#todayBtn .subtle,
#tomorrowBtn .subtle {
  font-size: 17px !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
}

/* 開放訂購被移除後，空白狀態膠囊直接隱藏 */
.vendor-card .status-badge:empty,
.vendor-card .badge:empty,
.schedule-card .status-badge:empty,
.vendor-status:empty,
.order-status-badge:empty {
  display: none !important;
}

@media (max-width: 600px) {
  #todayBtn .date,
  #tomorrowBtn .date,
  #todayBtn .day-date,
  #tomorrowBtn .day-date,
  #todayBtn small,
  #tomorrowBtn small,
  #todayBtn .subtle,
  #tomorrowBtn .subtle {
    font-size: 18px !important;
    font-weight: 900 !important;
  }
}


/* ==================== V2.2.0h ==================== */

/* 日期放大到接近「今天 / 明天」標題 */
#todayBtn .date,
#tomorrowBtn .date,
#todayBtn .day-date,
#tomorrowBtn .day-date,
#todayBtn small,
#tomorrowBtn small,
#todayBtn .subtle,
#tomorrowBtn .subtle{
  font-size:22px!important;
  font-weight:900!important;
  line-height:1.05!important;
  margin-top:4px!important;
}

/* 店家資訊重新排版：減少右側空白、資訊字體放大 */
#scheduleArea .vendor-card,
#scheduleArea .schedule-card{
  position:relative!important;
}

#scheduleArea .vendor-meta,
#scheduleArea .vendor-info{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px 14px!important;
  width:100%!important;
  max-width:none!important;
  margin-top:12px!important;
}

#scheduleArea .vendor-meta>*,
#scheduleArea .vendor-info>*{
  font-size:18px!important;
  line-height:1.3!important;
  font-weight:800!important;
}

#vendorName{
  font-size:32px!important;
  line-height:1.1!important;
}

/* open 完全隱藏；空 badge 不占空間 */
#scheduleArea .status-badge:empty,
#scheduleArea .badge:empty,
#scheduleArea .vendor-status:empty,
#scheduleArea .order-status-badge:empty{
  display:none!important;
}

/* 菜單照片放大至卡片主要區域，完整顯示不裁切 */
#orderView .menu-card{
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}

#orderView .menu-image,
#orderView .menu-placeholder{
  width:100%!important;
  aspect-ratio:4/3!important;
  max-height:none!important;
  object-fit:contain!important;
  object-position:center!important;
  background:#f3f5f4!important;
}

#orderView .menu-body{
  padding:6px 7px 7px!important;
}

#orderView .menu-title{
  font-size:15px!important;
  line-height:1.1!important;
}

#orderView .menu-desc{
  font-size:10px!important;
  line-height:1.1!important;
  margin-top:2px!important;
}

#orderView .menu-price{
  font-size:20px!important;
  margin-top:4px!important;
}

#orderView .menu-footer{
  margin-top:5px!important;
}

@media(max-width:600px){
  #todayBtn .date,
  #tomorrowBtn .date,
  #todayBtn .day-date,
  #tomorrowBtn .day-date,
  #todayBtn small,
  #tomorrowBtn small,
  #todayBtn .subtle,
  #tomorrowBtn .subtle{
    font-size:22px!important;
  }

  #scheduleArea .vendor-meta,
  #scheduleArea .vendor-info{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px 10px!important;
  }

  #scheduleArea .vendor-meta>*,
  #scheduleArea .vendor-info>*{
    font-size:17px!important;
  }

  #vendorName{
    font-size:30px!important;
  }

  #orderView .menu-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }

  #orderView .menu-image,
  #orderView .menu-placeholder{
    aspect-ratio:4/3!important;
  }
}


/* ==================== V2.2.0i ==================== */

/* 今天 / 明天：標題與日期固定同尺寸 */
#orderView .date-tab b,
#orderView .date-tab span{
  display:block!important;
  font-size:24px!important;
  line-height:1.12!important;
  font-weight:900!important;
}
#orderView .date-tab span{
  margin-top:5px!important;
}

/* open 狀態永遠不留空間 */
#scheduleStatus.hidden,
#scheduleStatus:empty{
  display:none!important;
}
#scheduleStatus{
  min-width:0!important;
}

/* 分類拖曳排序 */
.category-admin-main{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.category-drag-handle{
  display:flex!important;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:9px;
  background:#eef4f1;
  color:var(--primary);
  font-size:22px!important;
  cursor:grab;
  user-select:none;
  flex:0 0 auto;
}
.category-sort-row.dragging{
  opacity:.45;
}
.category-sort-row.drag-over{
  outline:3px solid var(--primary);
  outline-offset:2px;
}
.category-move-btn{
  min-width:36px;
  font-size:18px!important;
  font-weight:900;
}
.category-archive-title{
  margin:18px 0 7px;
  padding-top:12px;
  border-top:1px solid var(--line);
  font-weight:900;
  color:var(--muted);
}

@media(max-width:600px){
  #orderView .date-tab b,
  #orderView .date-tab span{
    font-size:24px!important;
  }
  .category-admin-row{
    gap:7px!important;
  }
  .category-admin-main{
    flex:1 1 100%;
  }
}

/* 排序後菜單在視覺上不受更新時間影響 */
#orderView .menu-grid,
.browse-menu{
  align-items:start;
}

/* ==================== V2.2.0j ==================== */
.menu-photo-status{display:inline-flex;width:26px;height:26px;align-items:center;justify-content:center;border-radius:8px;font-size:15px;vertical-align:middle}
.menu-photo-status.has-photo{background:#edf8f3}
.menu-photo-status.no-photo{background:#fff1ef;outline:1px solid #eab5ae}

.image-preview-modal{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.82);backdrop-filter:blur(3px)}
.image-preview-modal.hidden{display:none!important}
.image-preview-inner{max-width:min(94vw,1200px);max-height:90vh;display:flex;flex-direction:column;align-items:center;gap:10px}
.image-preview-inner img{display:block;max-width:100%;max-height:82vh;width:auto;height:auto;object-fit:contain;object-position:center;border-radius:14px;background:#111;box-shadow:0 18px 50px rgba(0,0,0,.4)}
.image-preview-caption{color:#fff;font-size:18px;font-weight:900;text-align:center;text-shadow:0 1px 4px #000}
.image-preview-close{position:fixed;top:max(14px,env(safe-area-inset-top));right:16px;z-index:100000;width:48px;height:48px;padding:0;border:0;border-radius:999px;background:rgba(255,255,255,.94);color:#111;font-size:34px;line-height:1;cursor:pointer;box-shadow:0 4px 18px rgba(0,0,0,.25)}
body.image-preview-open{overflow:hidden}

.photo-import-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px}
.photo-import-summary .stat{padding:10px;border-radius:12px;background:#f3f6f4}
.photo-import-summary .stat span{display:block;font-size:12px;color:var(--muted)}
.photo-import-summary .stat b{display:block;margin-top:3px;font-size:22px}
.photo-overwrite-row{margin:10px 0 12px}
.photo-preview-list{max-height:42vh;overflow:auto;border:1px solid var(--line);border-radius:12px}
.photo-preview-row{display:grid;grid-template-columns:minmax(180px,1.4fr) minmax(180px,1.4fr) auto;gap:10px;align-items:center;padding:9px 10px;border-bottom:1px solid var(--line);font-size:13px}
.photo-preview-row:last-child{border-bottom:0}
.photo-preview-row.nomatch,.photo-preview-row.badname{background:#fff5f3}
.photo-preview-row.existing{background:#f7faf8}
.photo-preview-name{overflow-wrap:anywhere;font-weight:800}
.photo-preview-match{color:var(--muted)}
.photo-preview-status{white-space:nowrap;font-weight:800}
@media(max-width:600px){
 .image-preview-modal{padding:12px}
 .image-preview-inner{max-width:96vw}
 .image-preview-inner img{max-height:78vh}
 .image-preview-caption{font-size:16px}
 .photo-import-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
 .photo-preview-row{grid-template-columns:1fr;gap:3px}
 .photo-preview-status{white-space:normal}
}

/* ==================== V2.3.0 客製選項 ==================== */
.customizable-badge{display:inline-flex;align-items:center;padding:2px 7px;border-radius:999px;background:#fff0d9;color:#9a5700;font-size:11px;font-weight:900;vertical-align:middle}
.customize-add-btn{border:0;border-radius:10px;background:var(--primary);color:#fff;padding:9px 13px;font-weight:900}
.custom-setting-card{margin:14px 0;padding:14px;border:1px solid var(--line);border-radius:14px;background:#fafcfb}
.custom-enable-row{display:flex;gap:10px;align-items:flex-start}
.custom-enable-row input{width:22px;height:22px;margin-top:2px}
.custom-enable-row span{display:grid;gap:3px}.custom-enable-row small{color:var(--muted)}
.option-editor-group{margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#fff}
.option-editor-head{display:grid;grid-template-columns:minmax(150px,1fr) 110px auto auto;gap:8px;align-items:center}
.option-editor-limits{display:flex;gap:10px;margin:8px 0}.option-editor-limits label{max-width:130px}
.option-editor-items{display:grid;gap:7px}
.option-editor-item{display:grid;grid-template-columns:minmax(150px,1fr) 120px auto auto;gap:8px;align-items:center;padding:8px;border-radius:10px;background:#f6f8f7}
.inline-check{display:flex!important;flex-direction:row!important;align-items:center;gap:5px}.inline-check input{width:18px!important}
.danger-text{border:0;background:transparent;color:#bb2b2b;font-weight:800;cursor:pointer}

.customize-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:12px}
.customize-head h3{margin:0;font-size:24px}.customize-head span{color:var(--muted)}.customize-head strong{font-size:28px}
.custom-option-groups{display:grid;gap:12px;max-height:48vh;overflow:auto}
.custom-option-group{padding:12px;border:1px solid var(--line);border-radius:13px}
.custom-group-title{display:flex;justify-content:space-between;gap:10px;margin-bottom:8px}.custom-group-title div{display:grid}.custom-group-title span,.custom-group-title small{color:var(--muted);font-size:12px}
.custom-option-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.custom-option-card{display:grid!important;grid-template-columns:auto 1fr auto;align-items:center;gap:8px;padding:10px!important;border:1px solid var(--line);border-radius:10px;cursor:pointer}
.custom-option-card:has(input:checked){border-color:var(--primary);background:#eff8f3}
.custom-option-card input{width:19px!important;height:19px}
.custom-option-card b{font-size:13px}
.custom-group-error{color:#c5352b;font-weight:800;font-size:13px;margin-top:7px}
.custom-qty-row,.custom-total-row{display:flex;justify-content:space-between;align-items:center;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.custom-total-row strong{font-size:20px}

.cart-line-list{display:grid;gap:7px;max-height:220px;overflow:auto}
.cart-line-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;align-items:center;padding:7px;border-radius:10px;background:rgba(255,255,255,.75)}
.cart-line-main{display:grid;text-align:left;border:0;background:transparent;min-width:0}.cart-line-main b,.cart-line-main span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-line-main span{font-size:12px;color:var(--muted)}
.cart-line-actions{display:flex;gap:4px}.cart-line-actions button{width:30px;height:30px;border:1px solid var(--line);border-radius:8px;background:#fff}
.checkout-line-list{display:grid;gap:7px;margin:10px 0 14px}.checkout-line-list>div{display:flex;justify-content:space-between;gap:10px;padding:8px;border-bottom:1px solid var(--line)}.checkout-line-list span{display:grid}.checkout-line-list small,.order-option-summary,.order-meal-line small{display:block;color:var(--muted);font-size:12px;margin-top:2px}

@media(max-width:640px){
 .option-editor-head,.option-editor-item{grid-template-columns:1fr 1fr}.option-editor-head .danger-text,.option-editor-item .danger-text{justify-self:end}
 .custom-option-list{grid-template-columns:1fr}
 .cart-line-row{grid-template-columns:minmax(0,1fr) auto}.cart-line-actions{grid-column:1/-1;justify-content:flex-end}
}

/* ==================== V2.3.0b 手機購物車修正 ==================== */
.cart-bar{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:end!important;
  gap:10px;
  max-height:min(58vh,520px);
  overflow:hidden;
}
#cartItems{
  grid-column:1/-1;
  min-width:0;
  overflow:hidden;
}
.cart-line-list{
  display:grid;
  gap:8px;
  max-height:min(34vh,300px);
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:3px;
}
.cart-line-row{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:7px!important;
  align-items:stretch!important;
  padding:9px!important;
  border-radius:11px;
  background:rgba(255,255,255,.94)!important;
  color:#312313;
}
.cart-line-summary{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
}
.cart-line-main{
  width:100%;
  min-width:0;
  padding:0!important;
  color:#312313!important;
  background:transparent!important;
  text-align:left;
}
.cart-line-main b{
  display:block;
  font-size:16px;
  color:#312313;
}
.cart-line-main span{
  display:block;
  margin-top:3px;
  color:#7a5a24!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
}
.cart-line-price{
  display:block!important;
  font-size:24px!important;
  line-height:1;
  color:#312313;
  white-space:nowrap;
}
.cart-line-actions{
  display:grid!important;
  grid-template-columns:repeat(3,1fr);
  gap:6px;
  width:100%;
}
.cart-line-actions button{
  width:100%!important;
  height:36px!important;
  padding:0!important;
  border:1px solid #ded8cf!important;
  border-radius:9px!important;
  background:#fff!important;
  color:#312313!important;
  font-size:18px!important;
}
#cartQty{
  align-self:center;
}
#cartTotal{
  font-size:31px!important;
  line-height:1;
}
#checkoutBtn{
  grid-column:1/-1;
  width:100%;
}
@media(max-width:640px){
  .cart-bar{
    bottom:76px;
    width:calc(100% - 20px);
    padding:11px 14px;
  }
  .cart-line-list{max-height:31vh}
}

/* ==================== V2.3.0c 已選餐點與列印修正 ==================== */
.cart-line-actions{display:none!important}
.cart-line-row{grid-template-columns:1fr!important}
.cart-line-summary{grid-template-columns:minmax(0,1fr) auto!important}

@media print{
  .order-meal-line small,
  .order-option-summary,
  .checkout-line-list small{
    display:inline!important;
    margin-left:6px!important;
    margin-top:0!important;
    font-size:inherit!important;
    line-height:inherit!important;
    font-weight:inherit!important;
    color:inherit!important;
  }
  .order-meal-line small::before,
  .order-option-summary::before{
    content:"｜";
    margin-right:4px;
  }
}

/* ==================== V2.4.0 Stable：今日訂餐 / 明日預告 / 想吃 ==================== */
.date-tab b{font-size:19px!important}
.date-tab span{font-size:15px!important;font-weight:800;margin-top:3px;display:block}
.preview-banner{display:flex;align-items:center;gap:12px;padding:15px 16px;margin-bottom:14px;border:2px solid #e8b8b4;border-radius:16px;background:linear-gradient(135deg,#fff7f6,#f9e2df);color:#7b2e2a;box-shadow:var(--shadow)}
.preview-banner-icon{font-size:30px}.preview-banner b{display:block;font-size:18px;margin-bottom:3px}.preview-banner span{display:block;font-size:14px;line-height:1.5}
body.preview-mode #deadlineCountdown,body.preview-mode #deliveryBanner,body.preview-mode #cartBar,body.preview-mode #publicOrdersCard,body.preview-mode #vendorChangeBanner{display:none!important}
body.preview-mode #scheduleStatus{display:none!important}
body.preview-mode #orderView .vendor-hero{background:linear-gradient(135deg,#b84843,#963833)!important}
body.preview-mode #orderView .menu-card.selected::after{display:none!important}
.menu-title-row{gap:9px}.menu-card-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.want-btn,.fav-btn{width:38px;height:38px;border-radius:999px;border:1px solid var(--line);background:#fff;font-size:20px;font-weight:900;display:inline-flex;align-items:center;justify-content:center;padding:0}
.want-btn{color:#a1aaa6}.want-btn.active{background:#ffe7e8;border-color:#ef9da2;color:#d72f3b;box-shadow:0 0 0 3px rgba(215,47,59,.08)}
.menu-card.wanted{box-shadow:0 0 0 2px rgba(215,47,59,.12),var(--shadow)}
.want-card{border:2px solid #f0b5b9;background:#fffafb}.want-card h2{color:#b42e38}
.want-chip{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #efc4c7;background:#fff;border-radius:999px;padding:9px 13px;font-weight:900;color:var(--text)}
.want-chip b{color:#b42e38}.want-chip:disabled{opacity:.45}
.preview-only-note{color:#a3423d;font-weight:900}.preview-badge{padding:7px 10px;border-radius:999px;background:#f8dfdd;color:#8a332e;font-size:13px;font-weight:900}
.preview-custom-btn{background:#b84843!important;color:#fff!important;border-color:#b84843!important}
.preview-notice{background:#fbeceb;color:#7c302c;border:1px solid #e9bfbc}
#closeTodayBtn.reopen-state{background:#168456!important;color:#fff!important}

/* 指定列印格式：餐點 | 單選規格；加料逐行顯示 */
.print-meal-block{display:block;line-height:1.22}
.print-meal-main{display:block;font-size:inherit;font-weight:inherit;line-height:inherit}
.print-meal-addon{display:block;font-size:inherit;font-weight:inherit;line-height:inherit;margin-top:1px}
#adminItemSummary .print-meal-addon,#adminOrderTable .print-meal-addon{white-space:normal}
@media print{
  #adminOrderTable .order-meal-line{white-space:normal!important;overflow:visible!important;line-height:1.18!important}
  .print-meal-block,.print-meal-main,.print-meal-addon{font-size:inherit!important;font-weight:inherit!important;color:inherit!important;line-height:1.18!important}
  .print-meal-addon{margin-top:.25mm!important}
}
@media(max-width:640px){
  .date-tab{padding:12px 8px}.date-tab b{font-size:18px!important}.date-tab span{font-size:14px!important}
  .preview-banner{padding:13px}.preview-banner-icon{font-size:26px}
  .menu-card-actions{gap:4px}.want-btn,.fav-btn{width:36px;height:36px}
}


/* ==================== V2.4.0a Stable FIX ==================== */
.admin-action-row{display:grid!important;grid-template-columns:minmax(0,1fr) 58px 58px;gap:8px;align-items:stretch;min-width:min(100%,440px)}
.admin-action-row #closeTodayBtn{min-width:0;white-space:nowrap;line-height:1.2}
.admin-icon-btn{width:58px!important;min-width:58px!important;padding:8px!important;font-size:25px!important;display:inline-flex;align-items:center;justify-content:center;line-height:1}
.cart-order-note{width:100%;box-sizing:border-box;margin:10px 0 2px;padding:11px 13px;border:1px solid rgba(255,255,255,.28);border-radius:12px;background:rgba(255,255,255,.96);color:var(--text);font-size:15px;outline:none}
.cart-order-note:focus{border-color:#f2c84b;box-shadow:0 0 0 3px rgba(242,200,75,.22)}
#checkoutBtn:disabled{opacity:.68;cursor:wait}
body.preview-mode #scheduleStatus{display:none!important}
@media(max-width:640px){
  #admin-today .section-head.screen-only{align-items:flex-start;gap:10px}
  #admin-today .section-head.screen-only>h2{white-space:nowrap}
  .admin-action-row{grid-template-columns:minmax(0,1fr) 54px 54px;gap:7px;min-width:0;flex:1}
  .admin-icon-btn{width:54px!important;min-width:54px!important;font-size:24px!important}
}


/* ==================== V2.4.0e Stable FIX：重大異動區塊完整顯示 ==================== */
#vendorChangeAdminPanel.change-admin-panel{display:block;width:100%;clear:both;}
#vendorChangeAdminPanel.hidden{display:none!important;}
#vendorChangeAdminPanel>.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;}
#vendorChangeAdminPanel .danger-badge{margin-bottom:6px;}
#vendorChangeAdminPanel h3{margin:0;}
#vendorChangeAdminPanel .change-deadline{margin-left:auto;white-space:nowrap;}
@media(max-width:640px){
  #vendorChangeAdminPanel>.section-head{display:grid;grid-template-columns:1fr auto;align-items:end;}
  #vendorChangeAdminPanel .change-deadline{font-size:13px;text-align:right;}
}

/* ==================== V2.4.1 Stable：訂單管理與歷史查詢 ==================== */
.order-admin-actions{display:flex;gap:5px;flex-wrap:wrap;margin-top:7px}
.order-admin-actions .table-btn{padding:5px 7px;font-size:12px;font-weight:900;white-space:nowrap}
.delete-order-btn{border-color:#e6a5a1!important;color:#a82f2a!important;background:#fff7f6!important}
.person-cell>b{display:block}
.notify-body{white-space:pre-line;line-height:1.65;margin:7px 0}

.manager-edit-line-list{display:grid;gap:12px;margin:12px 0}
.manager-order-line{border:1px solid var(--line);border-radius:14px;padding:12px;background:#fafcfb}
.manager-order-line-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.manager-order-line-head>div{min-width:0}.manager-order-line-head b{display:block;font-size:17px}.manager-order-line-head span{display:block;color:var(--muted);font-size:13px;margin-top:2px}
.manager-line-options{display:grid;gap:9px;margin:10px 0}
.manager-line-option-group{border-top:1px dashed var(--line);padding-top:8px}
.manager-option-title{display:flex;justify-content:space-between;gap:8px;margin-bottom:7px}.manager-option-title span{font-size:12px;color:var(--muted)}
.manager-option-list{display:flex;flex-wrap:wrap;gap:7px}
.manager-option-choice{display:inline-flex!important;align-items:center;gap:6px;border:1px solid var(--line);border-radius:999px;padding:7px 10px!important;background:#fff;font-size:13px;font-weight:800;margin:0!important}
.manager-option-choice input{width:auto!important;margin:0!important}
.manager-line-bottom{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:9px}
.manager-line-bottom strong{font-size:19px;color:var(--primary)}
.manager-add-line-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin:12px 0 15px}
.manager-add-line-row select{min-width:0}
.manager-edit-summary{display:flex;justify-content:space-between;align-items:center;padding:13px 15px;margin:12px 0;border-radius:13px;background:var(--primarySoft)}
.manager-edit-summary strong{font-size:24px;color:var(--primary)}
.delete-order-preview{display:grid;gap:8px;margin:12px 0;padding:12px;border:1px solid var(--line);border-radius:13px;background:#fafcfb}
.delete-order-preview>div{display:grid;grid-template-columns:72px 1fr;gap:8px}.delete-order-preview span{color:var(--muted)}

.history-query-card{margin-bottom:12px}
.history-quick-row{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0}
.history-date-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.history-date-grid label{margin:0}.history-date-grid input{margin-top:6px}
.history-action-row{display:flex;gap:9px;flex-wrap:wrap;margin-top:12px}
.history-delete-note{margin-top:12px}
.history-status-card{padding:12px 16px;margin-bottom:12px}
.history-report-list{display:grid;gap:16px}
.history-report-card{padding:18px}
.history-report-toolbar{border-bottom:1px solid var(--line);padding-bottom:10px;margin-bottom:12px}
.history-report-toolbar h2{margin:5px 0 0}
.history-print-header{margin-bottom:12px;border-bottom:2px solid var(--line);padding-bottom:10px}
.history-print-header .print-title{text-align:center;font-size:25px;font-weight:950}
.history-print-header .print-meta{display:flex;justify-content:center;flex-wrap:wrap;gap:5px 18px;margin-top:7px;font-weight:800}
.history-report-card .stats-grid{margin-bottom:14px}
.history-report-card table{min-width:700px}
.history-order-table .order-meal-line{margin-bottom:4px}
.purge-preview-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:12px 0}
.purge-preview-grid>div{padding:11px;border:1px solid var(--line);border-radius:12px;background:#fafcfb;text-align:center}
.purge-preview-grid span{display:block;color:var(--muted);font-size:12px}.purge-preview-grid b{display:block;margin-top:4px;font-size:17px}
.purge-backup-status{padding:8px 2px 12px;overflow-wrap:anywhere}

@media(max-width:720px){
  .history-date-grid{grid-template-columns:1fr}
  .history-action-row{display:grid;grid-template-columns:1fr 1fr}
  .history-action-row .danger-btn{grid-column:1/-1}
  .history-report-card{padding:13px}
  .history-print-header .print-title{font-size:21px}
  .history-print-header .print-meta{font-size:12px;gap:3px 10px}
  .manager-add-line-row{grid-template-columns:1fr}
  .manager-option-list{display:grid;grid-template-columns:1fr 1fr}
  .manager-option-choice{border-radius:10px}
}

/* 歷史單張列印：與今日訂購清點單維持相同 6 欄格式，不列印編輯 / 刪除按鈕 */
@media print{
  body.history-print-mode .view{display:none!important}
  body.history-print-mode #adminView,
  body.history-print-mode #admin-history,
  body.history-print-mode #adminHistoryResults,
  body.history-print-mode .history-report-card.print-selected{display:block!important}
  body.history-print-mode #admin-today,
  body.history-print-mode .history-query-card,
  body.history-print-mode .history-status-card,
  body.history-print-mode .history-report-card:not(.print-selected){display:none!important}
  body.history-print-mode #adminView,
  body.history-print-mode #admin-history,
  body.history-print-mode #adminHistoryResults{width:100%!important;margin:0!important;padding:0!important;min-height:0!important;height:auto!important}
  body.history-print-mode .history-report-card.print-selected{border:0!important;box-shadow:none!important;margin:0!important;padding:0!important;break-inside:avoid!important;page-break-inside:avoid!important}
  body.history-print-mode .history-print-header{display:block!important;margin:0 0 4mm!important;border-bottom:1.5pt solid #000!important;padding-bottom:2.5mm!important}
  body.history-print-mode .history-print-header .print-title{font-weight:900!important;text-align:center!important;line-height:1.15!important}
  body.history-print-mode .history-print-header .print-meta{display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:1mm 5mm!important;margin-top:2mm!important;font-weight:700!important}
  body.history-print-mode .history-report-card .stats-grid{display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:.8mm!important;margin-bottom:1mm!important}
  body.history-print-mode .history-report-card .stat{border:1.3pt solid #000!important;background:#fff!important;border-radius:0!important;padding:.8mm!important;text-align:center!important}
  body.history-print-mode .history-report-card h3{margin:.8mm 0!important;font-weight:950!important}
  body.history-print-mode .history-item-summary,
  body.history-print-mode .history-order-table{overflow:visible!important}
  body.history-print-mode .history-item-summary table,
  body.history-print-mode .history-order-table table{width:100%!important;min-width:0!important;border-collapse:collapse!important;table-layout:fixed!important;break-inside:avoid!important;page-break-inside:avoid!important}
  body.history-print-mode .history-item-summary tr,
  body.history-print-mode .history-order-table tr,
  body.history-print-mode .history-item-summary td,
  body.history-print-mode .history-order-table td,
  body.history-print-mode .history-item-summary th,
  body.history-print-mode .history-order-table th{break-inside:avoid!important;page-break-inside:avoid!important}
  body.history-print-mode .history-order-table th:nth-child(1),body.history-print-mode .history-order-table td:nth-child(1){width:14%!important;white-space:nowrap!important}
  body.history-print-mode .history-order-table th:nth-child(2),body.history-print-mode .history-order-table td:nth-child(2){width:39%!important}
  body.history-print-mode .history-order-table th:nth-child(3),body.history-print-mode .history-order-table td:nth-child(3){width:16%!important;white-space:normal!important;overflow-wrap:anywhere!important}
  body.history-print-mode .history-order-table th:nth-child(4),body.history-print-mode .history-order-table td:nth-child(4){width:11%!important}
  body.history-print-mode .history-order-table th:nth-child(5),body.history-print-mode .history-order-table td:nth-child(5){width:10%!important}
  body.history-print-mode .history-order-table th:nth-child(6),body.history-print-mode .history-order-table td:nth-child(6){width:10%!important}
  body.history-print-mode .history-order-table .order-meal-line{white-space:normal!important;overflow:visible!important;line-height:1.18!important;margin:0!important;padding:0!important}
}


/* V2.4.1b：訂購頁餐點金額排序 */
.menu-filter-toolbar{display:flex;justify-content:flex-end;align-items:center;margin:4px 0 10px}
.menu-sort-control{display:flex;flex-direction:row;align-items:center;gap:9px;margin:0;font-size:14px;font-weight:900;color:var(--muted)}
.menu-sort-control select{width:auto;min-width:148px;padding:9px 34px 9px 12px;border-radius:12px;background:#fff;font-weight:850;color:var(--text)}
body.tomorrow-theme #orderView .menu-sort-control select{border-color:var(--day-line)}
@media(max-width:520px){
  .menu-filter-toolbar{justify-content:stretch}
  .menu-sort-control{width:100%;justify-content:space-between}
  .menu-sort-control select{flex:1;min-width:0;max-width:190px}
}

/* ==================== V2.4.1c：訂購頁餐點名稱／說明字級放大 ==================== */
/* 餐點名稱較 V2.4.1b 再放大一階；說明提高到接近原本餐點名稱的大小。 */
#orderView .menu-title{
  font-size:18px!important;
  line-height:1.22!important;
}
#orderView .menu-desc{
  font-size:15px!important;
  line-height:1.32!important;
  min-height:20px!important;
  margin-top:5px!important;
  white-space:normal!important;
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  overflow:hidden!important;
}
@media(max-width:380px){
  #orderView .menu-title{font-size:17px!important}
  #orderView .menu-desc{font-size:14px!important;line-height:1.3!important}
}


/* ==================== V2.4.1d Stable FIX：單一品項備註 ==================== */
.custom-item-note-label,.manager-line-note-label{display:grid;gap:6px;margin-top:12px;font-weight:900;color:var(--text)}
.custom-item-note-label input,.manager-line-note-label input{width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid var(--line);border-radius:11px;background:#fff;color:var(--text);font-size:15px}
.cart-item-note-label{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;color:#6d5c47;font-size:12px;font-weight:900}
.cart-item-note-label input{min-width:0;width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid #ded8cf;border-radius:9px;background:#fff;color:#312313;font-size:14px;outline:none}
.cart-item-note-label input:focus,.custom-item-note-label input:focus,.manager-line-note-label input:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(25,119,82,.14)}
.order-item-note{display:block!important;color:#9a4b26!important;font-size:13px!important;font-weight:900;margin-top:3px}
.print-meal-note{display:block;font-size:inherit;line-height:inherit;margin-top:1px;font-weight:800;color:#8b3f25}
#adminItemSummary .print-meal-note,#adminOrderTable .print-meal-note,.history-report-card .print-meal-note{white-space:normal}
@media(max-width:640px){.cart-item-note-label{grid-template-columns:1fr;gap:4px}.cart-item-note-label span{font-size:12px}}
@media print{.print-meal-note{font-size:inherit!important;line-height:1.18!important;margin-top:.25mm!important;font-weight:inherit!important;color:inherit!important}}
