/* 編輯器內建表格的手機樣式（客戶在編輯器選：縮進螢幕／卡片式／左右滑動，存成表格 class）。
 * 只作用在「帶了 jb-t-* class 的表格」——客戶沒選過的既有表格完全不受影響（老大 2026-10-28：不動其他客戶既有內容）。
 * :where() 零權重、不帶 !important：版型自己的表格樣式蓋得過。卡片式的欄名由伺服器存檔時寫進每格 data-th（Sanitizer::labelCards）。 */
@media (max-width: 640px) {
    :where(table.jb-t-fit) { width: 100%; max-width: 100%; table-layout: fixed; }
    :where(table.jb-t-fit th, table.jb-t-fit td) { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
    :where(table.jb-t-scroll) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
    :where(table.jb-t-scroll th, table.jb-t-scroll td) { min-width: 9em; }
    :where(table.jb-t-card, table.jb-t-card tbody, table.jb-t-card tr, table.jb-t-card td) { display: block; width: 100%; max-width: 100%; box-sizing: border-box; }
    :where(table.jb-t-card thead, table.jb-t-card tr.jb-t-head) { display: none; }
    :where(table.jb-t-card tr) { margin: 0 0 1rem; border: 1px solid rgba(0,0,0,.15); border-radius: 6px; overflow: hidden; }
    :where(table.jb-t-card td) { padding: .6rem .8rem; border-bottom: 1px solid rgba(0,0,0,.1); }
    :where(table.jb-t-card td:last-child) { border-bottom: 0; }
    :where(table.jb-t-card td:first-child) { background: rgba(0,0,0,.05); font-weight: 700; }
    :where(table.jb-t-card td[data-th]:not(:first-child))::before { content: attr(data-th); display: block; margin-bottom: .1rem; font-size: .85rem; font-weight: 700; opacity: .65; }
}
