/* JC 10/23 整站重構：全站外框與共用元件，照 docs/ia-prototype/site 一比一（JC：「就照上面的樣式做 我很喜歡」）。
   數值全部用 design-tokens.css 的 --wb-*；這支最後載入，蓋過 site-shell.css／redesign.css 的舊外框。
   圖示：/assets/icons.svg（Lucide v0.460.0，ISC，見 icons-LICENSE.txt），用 SiteShell::icon('名稱')。 */
.site-shell .icon{width:var(--wb-icon);height:var(--wb-icon);flex:none;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;vertical-align:-4px}
.site-shell:not(.auth-shell){background:var(--wb-page);color:var(--wb-text);font:var(--wb-font)/var(--wb-line-height) var(--wb-family)}

/* 按鈕：動詞＋對象，下方一行白話說明（.help）。 */
.site-shell .btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:var(--wb-control-h);padding:6px 14px;border:1px solid var(--wb-line-strong);border-radius:var(--wb-radius-control);
  background:var(--wb-surface);color:var(--wb-text);text-decoration:none;cursor:pointer;white-space:nowrap;font-weight:400}
.site-shell .btn:hover{border-color:var(--wb-primary);background:var(--wb-surface);text-decoration:none}
.site-shell .btn.primary{background:var(--wb-primary);border-color:var(--wb-primary);color:var(--wb-on-primary)}
.site-shell .btn.primary:hover{background:var(--wb-primary-hover)}
.site-shell .btn.primary::after{content:none}
.site-shell .btn.danger{background:var(--wb-surface);color:var(--wb-bad);border-color:var(--wb-bad)}
.site-shell .help{margin:4px 0 0;color:var(--wb-muted);font-size:13px}
.site-shell .act{display:flex;flex-direction:column;max-width:240px}

/* 狀態切換一律是開關：旁邊寫目前狀態；機台還沒回報時顯示「切換中…」。 */
.site-shell .switch{display:inline-flex;align-items:center;gap:10px;cursor:pointer;user-select:none;min-height:0;padding:0}
.site-shell .switch input{position:absolute;opacity:0;width:1px;height:1px}
.site-shell .switch .track{position:relative;width:44px;height:26px;border-radius:13px;background:var(--wb-line-strong);transition:background .15s;flex:none}
.site-shell .switch .track::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0003;transition:transform .15s}
.site-shell .switch input:checked+.track{background:var(--wb-primary)}
.site-shell .switch input:checked+.track::after{transform:translateX(18px)}
.site-shell .switch input:focus-visible+.track{outline:2px solid var(--wb-primary);outline-offset:2px}
.site-shell .switch.pending .track{background:var(--wb-warn)}
.site-shell .switch .state{font-weight:600}

/* 分頁：手機上是可橫滑的一列，不收起來。 */
.site-shell .tabs{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;border:0;border-bottom:1px solid var(--wb-line);border-radius:0;margin:0 0 var(--wb-s4);padding:0;background:none}
.site-shell .tabs::-webkit-scrollbar{display:none}
.site-shell .tabs a{display:inline-flex;align-items:center;gap:6px;padding:10px 14px;white-space:nowrap;color:var(--wb-muted);text-decoration:none;border:0;border-bottom:2px solid transparent;border-radius:0;margin-bottom:-1px;background:none;min-height:0;box-shadow:none}
.site-shell .tabs a[aria-selected=true],.site-shell .tabs a[aria-current=page]{color:var(--wb-primary);border-bottom-color:var(--wb-primary);font-weight:600;background:none}

.site-shell .panel{background:var(--wb-surface);border:1px solid var(--wb-line);border-radius:var(--wb-radius);padding:var(--wb-s4) 20px}
.site-shell a.panel{color:inherit;text-decoration:none}
.site-shell a.panel:hover{border-color:var(--wb-primary);text-decoration:none}
.site-shell .badge{display:inline-block;padding:1px 8px;border-radius:999px;font-size:13px;background:var(--wb-idle-bg);color:var(--wb-idle)}
.site-shell .badge.ok{background:var(--wb-ok-bg);color:var(--wb-ok)}
.site-shell .badge.warn{background:var(--wb-warn-bg);color:var(--wb-warn)}
.site-shell .badge.bad{background:var(--wb-bad-bg);color:var(--wb-bad)}
.site-shell .muted{color:var(--wb-muted)}

/* 側欄：目錄可展開；目前所在的目錄自動展開、項目用科技藍。 */
.site-shell .side{position:fixed;inset:0 auto 0 0;z-index:7;width:var(--wb-sidebar);background:var(--wb-surface);border-right:1px solid var(--wb-line);padding:14px 10px 24px;overflow-y:auto}
.site-shell .side .console-navigation{display:block}
.site-shell .brand{display:flex;align-items:center;gap:8px;font-weight:700;font-size:17px;padding:4px 10px 14px;color:var(--wb-text);background:none;text-decoration:none}
.site-shell .brand .logo{width:28px;height:28px;border-radius:8px;background:var(--wb-primary);color:#fff;display:grid;place-items:center;font-size:14px}
.site-shell .side .grp{margin:2px 0}
.site-shell .side .grp>a,.site-shell .side .grp>summary{display:flex;align-items:center;gap:10px;width:100%;min-height:0;min-width:0;padding:8px 10px;margin:0;border:0;border-radius:8px;background:none;color:var(--wb-text);
  text-decoration:none;font-weight:600;font-size:var(--wb-font);cursor:pointer;text-align:left;box-shadow:none;list-style:none;justify-content:flex-start}
.site-shell .side .grp>summary::-webkit-details-marker{display:none}
.site-shell .side .grp>summary .chev{margin-left:auto;transition:transform .15s}
.site-shell .side .grp[open]>summary .chev{transform:rotate(180deg)}
.site-shell .side .subs{padding:2px 0 6px}
.site-shell .side .subs a{display:flex;align-items:center;gap:10px;min-height:0;padding:7px 10px 7px 20px;margin:0;border-radius:8px;color:var(--wb-muted);text-decoration:none;font-size:var(--wb-font);font-weight:400;box-shadow:none}
.site-shell .side a:hover,.site-shell .side summary:hover{background:var(--wb-surface-alt);text-decoration:none}
.site-shell .side a[aria-current=page]{background:var(--wb-primary-soft);color:var(--wb-primary);font-weight:600;box-shadow:none}
.site-shell .side .grp.has-current>summary{color:var(--wb-primary)}
.site-shell .side .tag-platform{margin:14px 10px 4px;font-size:12px;color:var(--wb-muted)}

/* 頁首：桌面是「目錄 › 頁面」，手機換成品牌名；右邊是告警數、外觀與帳號選單。 */
.site-shell .topbar{position:fixed;top:0;left:var(--wb-sidebar);right:0;z-index:6;height:var(--wb-topbar);display:flex;align-items:center;gap:12px;padding:0 24px;background:var(--wb-surface);border-bottom:1px solid var(--wb-line)}
.site-shell .topbar .tb-brand{display:none;padding:0;font-size:var(--wb-font)}
.site-shell .topbar .tb-brand .logo{width:24px;height:24px;border-radius:6px;font-size:12px}
.site-shell .topbar .crumbs{flex:1;color:var(--wb-muted);font-size:14px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.site-shell .topbar .crumbs b{color:var(--wb-text)}
.site-shell .topbar .crumbs a{color:var(--wb-muted);text-decoration:none}
.site-shell .topbar .crumbs a:hover{color:var(--wb-primary)}
.site-shell .topbar .top-fill{flex:1}
.site-shell .topbar .top-tools{display:flex;align-items:center;gap:8px;min-width:0}
.site-shell .topbar .top-status{display:inline-flex;align-items:center;gap:4px;font-size:14px;color:var(--wb-text);text-decoration:none;white-space:nowrap}
.site-shell .topbar .count-badge{min-width:20px;padding:0 6px;border-radius:999px;background:var(--wb-bad-bg);color:var(--wb-bad);font-size:12px;text-align:center}
.site-shell .topbar .console-search{display:flex;align-items:center;gap:6px;border:1px solid var(--wb-line-strong);border-radius:var(--wb-radius-control);padding:0 10px;min-height:var(--wb-control-h)}
.site-shell .topbar .console-search input{border:0;outline:0;background:none;min-height:0;padding:0;width:200px}
.site-shell .topbar .theme-control select,.site-shell .topbar .lang-control select{min-height:var(--wb-control-h);padding:0 8px;font-size:16px;border:1px solid var(--wb-line-strong);border-radius:var(--wb-radius-control);background:var(--wb-surface);color:var(--wb-text)}
.site-shell .topbar .who{position:relative}
.site-shell .topbar .who>summary{display:flex;align-items:center;justify-content:center;gap:8px;min-height:36px;min-width:44px;padding:0;border:0;background:none;font-size:14px;list-style:none;cursor:pointer}
.site-shell .topbar .who>summary::-webkit-details-marker{display:none}
.site-shell .topbar .who .name{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.site-shell .topbar .who .avatar{width:30px;height:30px;border-radius:50%;background:var(--wb-primary-soft);color:var(--wb-primary);display:grid;place-items:center}
.site-shell .topbar .who .popover{position:absolute;right:0;top:calc(100% + 8px);min-width:220px;display:grid;padding:6px;background:var(--wb-surface);border:1px solid var(--wb-line);border-radius:var(--wb-radius);box-shadow:var(--wb-shadow-overlay);z-index:30}
.site-shell .topbar .who .popover a,.site-shell .topbar .who .popover button,.site-shell .topbar .who .popover span{display:flex;align-items:center;gap:8px;width:100%;min-height:40px;padding:0 10px;border:0;border-radius:8px;background:none;color:var(--wb-text);text-decoration:none;font-size:14px;justify-content:flex-start}
.site-shell .topbar .who .popover a:hover,.site-shell .topbar .who .popover button:hover{background:var(--wb-surface-alt)}
.site-shell .topbar .who .popover form{margin:0;border-top:1px solid var(--wb-line);padding-top:4px;margin-top:4px}
.site-shell .tenant-view-banner{position:fixed;top:var(--wb-topbar);left:var(--wb-sidebar);right:0;z-index:5}

/* 主區 */
.site-shell:not(.auth-shell) .site-main{margin:var(--wb-topbar) 0 0 var(--wb-sidebar);padding:24px;max-width:calc(1280px + 48px);width:auto}
.site-shell .tenant-view-banner~.site-main{margin-top:calc(var(--wb-topbar) + 40px)}

/* 底部五格與「更多」只在手機出現 */
.site-shell .bottom,.site-shell .nojs-navigation{display:none}
.site-shell .more-sheet{border:0;padding:12px 16px 16px;background:var(--wb-surface);color:var(--wb-text)}
.site-shell dialog.more-sheet{position:fixed;inset:auto 0 calc(var(--wb-bottombar) + env(safe-area-inset-bottom));margin:0;width:100%;max-width:100%;max-height:75dvh;overflow-y:auto;border-radius:16px 16px 0 0;box-shadow:var(--wb-shadow-overlay)}
.site-shell dialog.more-sheet::backdrop{background:#1118274d}
.site-shell .more-sheet>header{display:flex;align-items:center;justify-content:space-between}
.site-shell .more-sheet>header h2{font-size:var(--wb-font-h2);margin:0}
.site-shell .more-sheet>header [data-dialog-close]{border:0;background:none;min-height:44px;min-width:44px;font-size:22px}
.site-shell .more-sheet h3{font-size:13px;color:var(--wb-muted);margin:12px 0 6px;font-weight:600}
.site-shell .more-sheet .items{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.site-shell .more-sheet .items a{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 4px;border:1px solid var(--wb-line);border-radius:10px;text-decoration:none;color:var(--wb-text);font-size:13px;text-align:center}
.site-shell .more-sheet .items .icon{width:24px;height:24px;color:var(--wb-primary)}

@media (max-width:767px){
  .site-shell .side{display:none}
  .site-shell .topbar{left:0;padding:0 16px}
  .site-shell .topbar .tb-brand{display:flex;align-items:center;gap:6px;font-weight:700;flex:1;min-width:0;min-height:44px}
  .site-shell .topbar .who>summary,.site-shell .topbar .who .popover a,.site-shell .topbar .who .popover button{min-height:44px}
  .site-shell .topbar .crumbs,.site-shell .topbar .top-fill,.site-shell .topbar .who .name,.site-shell .topbar .status-label,.site-shell .topbar .console-search,.site-shell .topbar .theme-control{display:none}
  .site-shell .tenant-view-banner{left:0}
  .site-shell:not(.auth-shell) .site-main{margin-left:0;padding:16px 16px calc(var(--wb-bottombar) + 24px + env(safe-area-inset-bottom))}
  .site-shell .bottom{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);position:fixed;left:0;right:0;bottom:0;height:calc(var(--wb-bottombar) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background:var(--wb-surface);border-top:1px solid var(--wb-line);z-index:20}
  .site-shell .bottom a,.site-shell .bottom button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:44px;min-width:0;padding:0;border:0;border-radius:0;background:none;color:var(--wb-muted);text-decoration:none;font-size:12px;cursor:pointer;box-shadow:none}
  .site-shell .bottom .icon{width:24px;height:24px}
  .site-shell .bottom span{font-size:12px;line-height:1.3}
  .site-shell .bottom [aria-current=page]{color:var(--wb-primary);font-weight:600;background:none;border:0}
  .site-shell:not(.has-ui) .bottom button{display:none}
  .site-shell:not(.has-ui) .nojs-navigation{display:block;margin:0 16px calc(var(--wb-bottombar) + 16px)}
}
/* 舊頁面樣式把連結 hover 加底線、按鈕加框；新版型的卡片、分頁、按鈕不吃這些。 */
.site-shell .site-main a.panel:hover,.site-shell .site-main a.kpi:hover,.site-shell .site-main a.btn:hover,.site-shell .site-main .tabs a:hover,.site-shell .site-main .chip:hover{text-decoration:none}
.site-shell .site-main .btn::after{content:none}
/* 頁面共用版型（原型 index.html 的 main 區，加上 .site-shell .site-main 前綴）：標題列＋動作、KPI 卡、機台畫面卡、表格（手機變卡片）、篩選列、表單、長條圖、清單。 */
.site-shell .site-main h1{font-size:var(--wb-font-h1);margin:0 0 6px}
.site-shell .site-main h2{font-size:var(--wb-font-h2);margin:0 0 10px;display:flex;align-items:center;gap:8px}
.site-shell .site-main .lead{margin:0 0 18px;color:var(--wb-muted)}
.site-shell .site-main .head{display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px 20px;margin-bottom:16px}
.site-shell .site-main .head .titles{flex:1;min-width:220px}
.site-shell .site-main .head .actions{display:flex;flex-wrap:wrap;gap:12px}
.site-shell .site-main .act{display:flex;flex-direction:column;max-width:240px}
.site-shell .site-main .grid{display:grid;gap:16px}
.site-shell .site-main .g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.site-shell .site-main .kpis{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
.site-shell .site-main .home-fleet,.site-shell .site-main .overview-trend{margin-top:28px}
/* 首頁機台卡的名稱與待處理連結也是點擊目標：桌面 32px、手機 44px */
.site-shell .site-main .home-fleet .device-card-body a{display:inline-flex;align-items:center;min-height:32px}
@media (max-width:767px){.site-shell .site-main .home-fleet .device-card-body a,.site-shell .site-main #dashboard-range select{min-height:44px}}
/* CLOUD-DISPLAY-1114 M4：只有一台時手機整欄寬，畫面放左、資訊放右，不留右半空白 */
@media (max-width:767px){.site-shell .site-main .home-fleet .device-cards[data-single] .device-card{grid-column:1/-1;flex-direction:row}
  .site-shell .site-main .home-fleet .device-cards[data-single] .device-card>.thumb{flex:0 0 112px;width:112px;align-self:flex-start;aspect-ratio:9/16;border-bottom:0;border-right:1px solid var(--wb-line,#e5e7eb)}
  .site-shell .site-main .home-fleet .device-cards[data-single] .device-card-body{flex:1;min-width:0;align-content:start}}
.site-shell .site-main .g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.site-shell .site-main .g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.site-shell .site-main .stack>*+*{margin-top:16px}
.site-shell .site-main .kpi{display:block;text-decoration:none;color:inherit}
.site-shell .site-main .kpi>span{display:block}
.site-shell .site-main .kpi .n{font-size:var(--wb-font-kpi);font-weight:700;line-height:1.2}
.site-shell .site-main .kpi .l{display:flex;align-items:center;gap:6px;color:var(--wb-muted)}
.site-shell .site-main .kpi .go{margin-top:6px;font-size:13px;color:var(--wb-primary)}
.site-shell .site-main a.panel:hover{border-color:var(--wb-primary)}
.site-shell .site-main .todo.bad .n{color:var(--wb-bad)}.site-shell .site-main .todo.warn .n{color:var(--wb-warn)}
.site-shell .site-main .mcard{display:block;text-decoration:none;color:inherit;padding:0;overflow:hidden}
.site-shell .site-main .mcard .shot{height:220px;width:100%;background:linear-gradient(160deg,#1e3a8a,#2563eb 55%,#60a5fa);color:#fff;display:flex;flex-direction:column;justify-content:space-between;padding:10px}
.site-shell .site-main .mcard .shot.off{filter:grayscale(1) brightness(.8)}
.site-shell .site-main .mcard .shot .ts{align-self:flex-end;font-size:12px;background:#0006;border-radius:6px;padding:1px 6px}
.site-shell .site-main .mcard .shot .scr{font-size:13px;opacity:.9}
.site-shell .site-main .mcard .body{padding:10px 12px 12px}
.site-shell .site-main .mcard .name{font-weight:700}
.site-shell .site-main .mcard .meta{display:flex;flex-wrap:wrap;gap:4px 10px;font-size:13px;color:var(--wb-muted);margin-top:4px}
/* C1-29 (M841): 看全部 N 台機台 is a short full-width link under the cards, not an empty card; 8 home cards sit 4×2 on a wide screen. */
.site-shell .site-main .mcard.all{display:flex;flex-direction:row;align-items:center;justify-content:center;grid-column:1/-1;min-height:44px;padding:10px 12px;color:var(--wb-primary);font-weight:600;gap:6px;text-align:center}
@media (min-width:1100px){.site-shell .site-main .kpis{grid-template-columns:repeat(4,minmax(0,1fr))}}
.site-shell .site-main .dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--wb-ok);margin-right:4px}
.site-shell .site-main .dot.off{background:var(--wb-bad)}
.site-shell .site-main .rt{width:100%;border-collapse:collapse;font-size:var(--wb-font-table);background:var(--wb-surface)}
.site-shell .site-main .rt th,.site-shell .site-main .rt td{padding:10px 12px;border-bottom:1px solid var(--wb-line);text-align:left;vertical-align:middle}
.site-shell .site-main .rt th{color:var(--wb-muted);font-weight:600;background:var(--wb-surface-alt)}
.site-shell .site-main .rt tbody th,.site-shell .site-main .rt tfoot th{color:var(--wb-text);background:var(--wb-surface)}
.site-shell .site-main .rt tr.low td{background:var(--wb-bad-bg)}
.site-shell .site-main .rt .num{text-align:right}
.site-shell .site-main .tablebox{border:1px solid var(--wb-line);border-radius:var(--wb-radius);overflow:hidden}
.site-shell .site-main .thumb{width:40px;height:40px;border-radius:8px;background:var(--wb-idle-bg);display:grid;place-items:center;color:var(--wb-muted)}
.site-shell .site-main .toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 12px}
.site-shell .site-main .search{flex:1;min-width:180px;display:flex;align-items:center;gap:6px;border:1px solid var(--wb-line-strong);border-radius:var(--wb-radius-control);padding:0 10px;background:var(--wb-surface);min-height:var(--wb-control-h)}
.site-shell .site-main .search input{border:0;outline:0;background:none;flex:1;min-width:0}
.site-shell .site-main .chips{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;min-width:0;max-width:100%}
.site-shell .site-main .chip{display:inline-flex;align-items:center;gap:4px;padding:4px 12px;border:1px solid var(--wb-line-strong);border-radius:999px;white-space:nowrap;text-decoration:none;color:var(--wb-text);font-size:14px;background:var(--wb-surface)}
.site-shell .site-main .chip[aria-pressed=true]{background:var(--wb-primary-soft);border-color:var(--wb-primary);color:var(--wb-primary)}
.site-shell .site-main form.fm{display:grid;gap:14px;max-width:640px}
.site-shell .site-main .field label{display:block;font-weight:600;margin-bottom:4px}
.site-shell .site-main .field input,.site-shell .site-main .field select,.site-shell .site-main .field textarea{width:100%;min-height:var(--wb-control-h);padding:6px 10px;border:1px solid var(--wb-line-strong);border-radius:var(--wb-radius-control);background:var(--wb-surface)}
.site-shell .site-main .row2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.site-shell .site-main .formbar{display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start;padding-top:6px}
.site-shell .site-main .note{padding:10px 14px;border-radius:var(--wb-radius);background:var(--wb-primary-soft);color:var(--wb-text);font-size:14px;display:flex;gap:8px}
.site-shell .site-main .note .icon{color:var(--wb-primary)}
.site-shell .site-main .bars{display:flex;align-items:flex-end;gap:6px;height:140px;padding:8px 0}
.site-shell .site-main .bars span{flex:1;background:var(--wb-primary);border-radius:4px 4px 0 0;min-width:6px;opacity:.85}
.site-shell .site-main .bars-x{display:flex;gap:6px;font-size:12px;color:var(--wb-muted)}.site-shell .site-main .bars-x span{flex:1;min-width:0;text-align:center;overflow:hidden;font-size:11px}
.site-shell .site-main .list{list-style:none;margin:0;padding:0}
.site-shell .site-main .list li{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--wb-line)}
.site-shell .site-main .list li:last-child{border-bottom:0}
.site-shell .site-main .list .grow{flex:1;min-width:0}
.site-shell .site-main .perm{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:6px 16px}
.site-shell .site-main .perm label{display:flex;gap:8px;align-items:center}
.site-shell .site-main .iconmap td:first-child{width:44px}
@media (max-width:767px){
.site-shell .site-main .kpi .n{font-size:24px;overflow-wrap:anywhere}
.site-shell .site-main .kpis .kpi{padding:14px}.site-shell .site-main .kpi .l{font-size:13px;gap:4px} /* C2-13 (M841): 快賣完的貨道 stays on one line at 390 */
.site-shell .site-main .g4,.site-shell .site-main .g3,.site-shell .site-main .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
.site-shell .site-main .g2,.site-shell .site-main .row2{grid-template-columns:1fr}
.site-shell .site-main .head .actions{width:100%}
.site-shell .site-main .head .actions .act{flex:1;max-width:none}
.site-shell .site-main .head .actions .btn{width:100%;min-height:var(--wb-control-h-touch)}
.site-shell .site-main .tablebox{border:0;overflow:visible}
.site-shell .site-main .rt,.site-shell .site-main .rt tbody,.site-shell .site-main .rt tfoot,.site-shell .site-main .rt tr,.site-shell .site-main .rt td,.site-shell .site-main .rt tr>th{display:block;width:100%}
.site-shell .site-main .rt thead{display:none}
.site-shell .site-main .rt tr{border:1px solid var(--wb-line);border-radius:var(--wb-radius);margin-bottom:10px;padding:6px 12px;background:var(--wb-surface)}
.site-shell .site-main .rt td,.site-shell .site-main .rt tr>th{border:0;padding:5px 0;display:flex;justify-content:space-between;gap:12px;text-align:right;background:none}
.site-shell .site-main .rt td::before,.site-shell .site-main .rt tr>th::before{content:attr(data-l);color:var(--wb-muted);font-weight:400;text-align:left;flex:none}
.site-shell .site-main .rt td[data-l=""]::before,.site-shell .site-main .rt tr>th[data-l=""]::before{content:none}
.site-shell .site-main .rt .num{text-align:right}
.site-shell .site-main .mcard .shot{height:160px}
}
.site-shell .site-main a.panel:hover,.site-shell .site-main a.kpi:hover,.site-shell .site-main a.btn:hover,.site-shell .site-main .tabs a:hover,.site-shell .site-main .chip:hover{text-decoration:none}
.site-shell .site-main .btn::after{content:none}
/* 既有頁面的標題列、動作與分頁對齊原型的 .head／.act／.tabs（JC 10/23 整站重構）：同一套字級、間距與手機排法。 */
.site-shell .site-main .page-heading{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:12px 20px;min-height:0;margin:0 0 16px}
.site-shell .site-main .page-heading>div:first-child{flex:1;min-width:220px}
.site-shell .site-main .page-heading h1{font-size:var(--wb-font-h1);margin:0 0 6px}
.site-shell .site-main .page-heading p{margin:0;font-size:15px;color:var(--wb-muted);white-space:normal}
.site-shell .site-main .page-actions{display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px}
.site-shell .site-main .page-actions .act .help{max-width:240px}
.site-shell .site-main .report-tabs{display:flex}
.site-shell .site-main .page-heading>.report-tabs{order:3;flex:1 0 100%;margin:0}
.site-shell .site-main .back-link{margin:0 0 8px}.site-shell .site-main .back-link a{display:inline-flex;align-items:center;gap:4px}
.site-shell .site-main .rt td a:not(.btn),.site-shell .site-main p.help a,.site-shell .site-main .back-link a{color:var(--wb-primary)}.site-shell .site-main .rt td a:not(.btn){display:inline-flex;align-items:center;gap:4px}
.site-shell .site-main .page-heading p.lead+p{margin-top:4px;font-size:13px}
@media (max-width:767px){.site-shell .site-main .page-heading>div:first-child{width:100%;min-height:0}.site-shell .site-main .page-heading p{font-size:14px}.site-shell .site-main .page-actions{width:100%;justify-content:flex-start}.site-shell .site-main .page-actions .act{flex:1;max-width:none}.site-shell .site-main .page-actions .act .help{max-width:none}}
@media print{.site-shell .side,.site-shell .topbar,.site-shell .bottom,.site-shell .more-sheet,.site-shell .nojs-navigation{display:none!important}.site-shell:not(.auth-shell) .site-main{margin:0!important;padding:0!important}}
/* JC 11/04 視覺精簡：說明放 tooltip（title），畫面只留圖示＋動詞；兩步驗證提醒是頂列一顆黃色盾牌；手機的語言選單收進帳號選單；表格只留橫向一層捲軸。 */
.site-shell .factor-chip{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:0 10px;border-radius:999px;background:var(--wb-warn-bg);color:var(--wb-warn);font-size:13px;font-weight:600;text-decoration:none;white-space:nowrap}
.site-shell .factor-chip:hover{text-decoration:none;box-shadow:inset 0 0 0 1px var(--wb-warn)}
.site-shell .who .popover .lang-in-menu{display:none}
.site-shell .ui-table-wrap{max-height:none;overflow-x:auto;overflow-y:visible}
.site-shell .info-tip .icon,.site-shell .tip-icon{width:16px;height:16px;color:var(--wb-muted);vertical-align:-3px;cursor:help}
@media (max-width:767px){
  .site-shell .factor-chip{min-width:44px;min-height:44px;padding:0;justify-content:center;background:none}
  .site-shell .factor-chip .icon{width:22px;height:22px}
  .site-shell .factor-chip span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .site-shell .top-tools .lang-control{display:none}
  .site-shell .who .popover .lang-in-menu{display:flex;align-items:center;gap:8px;margin:0;padding:4px 8px}
  .site-shell .who .popover .lang-in-menu select{flex:1;min-height:44px}
  .site-shell .session-notice{bottom:calc(var(--wb-bottombar) + 12px + env(safe-area-inset-bottom))}
}
/* 首頁機台卡：在線／離線／尚未連線是三顆燈號加數字，字在 tooltip；卡片去處是右下角一個箭頭。 */
.site-shell .site-main .kpi .presence-lights{display:flex;flex-wrap:wrap;gap:12px;margin-top:4px;font-size:14px;font-weight:600}
.site-shell .site-main .presence-lights .light{display:inline-flex;align-items:center;gap:6px;color:var(--wb-text)}
.site-shell .site-main .presence-lights .light::before{content:"";width:10px;height:10px;border-radius:50%;background:var(--wb-ok)}
.site-shell .site-main .presence-lights .light.bad::before{background:var(--wb-bad)}.site-shell .site-main .presence-lights .light.idle::before{background:var(--wb-line-strong)}
.site-shell .site-main .kpi{position:relative}.site-shell .site-main a.kpi .l{padding-right:22px}.site-shell .site-main .kpi .go{position:absolute;right:14px;top:14px;margin:0;line-height:0}
.site-shell .site-main .kpi .go .icon{width:18px;height:18px}.site-shell .site-main .history-previous .icon{width:16px;height:16px;margin-right:4px;vertical-align:-3px;color:var(--wb-muted)}
/* 平台首頁（11/04 併入平台總覽）：數字卡在上、告警卡與重新配對在下；重新配對的說明是標題旁的 info 圖示。 */
.site-shell .reinstall-dashboard #dashboard-overview{margin:0 0 16px}.site-shell .reinstall-heading{justify-content:flex-start;align-items:center;gap:6px}
/* 登入入口與設定密碼（11/04）：入口是兩張大圖示卡；設定密碼的商戶與帳號是兩列圖示，規則是一行淡字，返回是次要按鈕。 */
.site-shell .site-main a.entry-choice{grid-template-columns:40px 1fr;column-gap:14px;align-items:center}
.site-shell .site-main a.entry-choice .icon{grid-row:span 2;width:32px;height:32px;color:var(--ui-link)}
.site-shell .login-help,.site-shell .setup-policy{margin:0 0 16px;font-size:14px;color:var(--wb-muted)}
.site-shell .setup-who{display:grid;gap:8px;margin:8px 0 12px;padding:0;list-style:none}
.site-shell .setup-who li{display:flex;align-items:center;gap:8px;overflow-wrap:anywhere}.site-shell .setup-who .icon{flex:none;width:18px;height:18px;color:var(--wb-muted)}
.site-shell .tenant-form label{display:block;margin-top:8px}.site-shell .tenant-form button.primary{width:100%;margin-top:8px}
.site-shell .setup-back{margin-top:16px}.site-shell .setup-back .btn,.site-shell .sessions-nav .btn{display:inline-flex;align-items:center;gap:6px;min-height:44px}
/* 報表（11/04）：頁首日期是一顆日曆 chip（台灣日期在 tooltip），取代導言；毛利的計算方式是 info 圖示；成本未填的提醒帶黃色警示圖示與補填按鈕。 */
.site-shell .range-chip{display:inline-flex;align-items:center;gap:6px;margin:4px 0 0;padding:2px 10px;border-radius:999px;background:var(--wb-primary-soft);color:var(--wb-text);font-size:14px}
.site-shell .range-chip .icon{width:16px;height:16px;color:var(--wb-primary)}
.site-shell .info-tip{display:inline-flex;align-items:center;gap:4px;color:var(--wb-muted);cursor:help}
.site-shell [data-profit-unknown] p:first-child{display:flex;align-items:flex-start;gap:6px;margin:0}.site-shell [data-profit-unknown] .icon{flex:none;color:var(--wb-warn)}
/* 員工與我的帳號（11/04）：角色是徽章（主帳號戴皇冠）、啟用／停用是綠灰燈號；兩步驗證分頁帶燈號；啟用兩步驗證是三格圖示步驟條。 */
.site-shell .role-badge{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;background:var(--wb-idle-bg);color:var(--wb-text);font-size:13px;font-weight:600}
.site-shell .role-badge .icon{width:14px;height:14px;color:var(--wb-muted)}.site-shell .role-badge.is-owner{background:var(--wb-primary-soft);color:var(--wb-primary)}.site-shell .role-badge.is-owner .icon{color:var(--wb-primary)}
.site-shell .staff-state.is-on,.site-shell .staff-state.is-off{width:10px;height:10px;padding:0;border-radius:50%;background:var(--wb-ok)}.site-shell .staff-state.is-off{background:var(--wb-line-strong)}
.site-shell .staff-state.is-pending::before{content:"";display:inline-block;width:8px;height:8px;margin-right:6px;border-radius:50%;background:var(--wb-warn)}
.site-shell .tab-light{display:inline-block;width:8px;height:8px;margin-left:6px;border-radius:50%;background:var(--wb-ok)}.site-shell .tab-light.is-warn{background:var(--wb-warn)}
.site-shell .factor-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:8px 0 16px;padding:0;list-style:none;counter-reset:step}
.site-shell .factor-steps li{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 6px;border-radius:var(--wb-radius);background:var(--wb-primary-soft);font-size:13px;text-align:center;counter-increment:step}
.site-shell .factor-steps li::before{content:counter(step);font-weight:700;color:var(--wb-primary)}.site-shell .factor-steps .icon{width:22px;height:22px;color:var(--wb-primary)}
/* JC 11/04: the status dot is drawn in CSS in the badge's own colour, not a text bullet. */
.badge-dot{display:inline-block;width:7px;height:7px;margin-right:6px;border-radius:50%;background:currentColor;vertical-align:middle;flex:none}
.site-shell .reinstall-list .console-badge{align-self:flex-start}
.site-shell .site-main .entry-lead{margin:4px 0 0;color:var(--ui-muted);font-size:14px}
/* M841 C2-35: small text links on phones still get a 40px touch target. */
@media (max-width:767px){.site-shell .device-switch-machine,.site-shell .device-pending,.site-shell .monitor-adjudicate a,.site-shell #pay-m-cash-help a,.site-shell .poster-plays-link{display:inline-flex;align-items:center;min-height:40px}}
/* M841 C1-37／C2-19: 需要注意的機台 — PresenceText under the machine name (red 離線 · 5 小時前, grey 尚未連線). The generic .site-main .dot is green, so the presence lights restate their colours. */
.site-shell .reinstall-list .presence-text{font-size:13px;color:var(--ui-muted)}
.site-shell .reinstall-list a.button{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:44px;min-height:44px}
.site-shell .site-main .presence-text .dot{margin-right:0;background:var(--ui-muted)}.site-shell .site-main .presence-text[data-presence-light=online] .dot{background:var(--ui-success)}.site-shell .site-main .presence-text[data-presence-light=offline] .dot{background:var(--ui-danger)}
.site-shell .reinstall-empty .icon{width:18px;height:18px;margin-right:6px;vertical-align:-3px;color:var(--wb-ok)}
