/* =====================================================================
 * 驛上創能 報價系統 — Design System v2.0 "Flame Paper"
 * ---------------------------------------------------------------------
 * Brand DNA：對齊主站 https://easylistst.com/
 * Style: Warm paper + flame accent + serif gravitas
 *
 * Primary palette: Deep Walnut #3E352E + Flame Gradient (#B84627→#F49366)
 * Typography: Noto Serif TC (h1/h2 襯線) + Noto Sans TC (body) + Montserrat (eyebrow)
 *
 * 一鍵換主色：改 --brand-primary / --brand-accent，並同步
 *   index.html / sign.html 的 Quasar.config.brand 區塊。
 * ===================================================================== */

:root {
  /* ---------- Brand Core (Deep Walnut, 像合約紙的深色) ---------- */
  --brand-primary:        #3E352E;     /* 深棕主色：CTA / header / footer */
  --brand-primary-dark:   #2C2620;     /* hover / active / 文字最深 */
  --brand-primary-soft:   #4A4036;     /* 中階：body 主文字、icon 描邊 */
  --brand-primary-50:     #F9F8F4;     /* 米白頁底 (paper) */
  --brand-primary-100:    #FAF6F1;     /* 紙紋 highlight / 卡片暖底 */

  /* ---------- Flame Accent (Logo 漸層, 用於強調) ---------- */
  --brand-accent:         #B84627;     /* 主火焰紅：垂直 bar / 強調字 / 簽名 CTA */
  --brand-accent-mid:     #D95D39;     /* 漸層中段 */
  --brand-accent-light:   #E8805E;
  --brand-accent-pale:    #F49366;     /* 漸層尾端 */
  --brand-accent-dark:    #8E2F18;     /* hover */
  --brand-accent-soft:    #FDF1EA;     /* 火焰柔色背景 */
  --brand-line:           #06C755;     /* LINE 官方品牌綠，非漂移色——ui-consistency-sweep Batch 1 收斂，僅 line-message-center 使用 */
  --line-avatar-user:     #C9967A;     /* LINE 個人(1:1)對話頭像底色，沿用 line-message-center.vue.html 既有裸 hex 值
                                           （:75/:113，本次未動）——project-center-line-binding-20260929 命名成 token，
                                           供 project-detail.vue.html 綁定視窗候選列新增使用，避免新增裸 hex */
  --brand-accent-gradient: linear-gradient(135deg,
                            #B84627 0%,
                            #D95D39 38%,
                            #E8805E 70%,
                            #F49366 100%);
  --brand-accent-glow:    radial-gradient(ellipse at center,
                            rgba(184, 70, 39, 0.18) 0%,
                            transparent 65%);

  /* ---------- 暖色中性 (warm grey, 不要冷藍) ---------- */
  --neutral-0:            #FFFFFF;
  --neutral-50:            #F9F8F4;    /* page bg, 紙感米白 */
  --neutral-75:            #F4F0E7;    /* card alt 暖灰底 */
  --neutral-100:           #F0EBE0;    /* hover 暖灰 / soft border */
  --neutral-200:           #E8E2D6;    /* border default */
  --neutral-300:           #D6CDBE;    /* border strong */
  --neutral-400:           #A39A8E;    /* muted text */
  --neutral-500:           #8B8175;    /* secondary text */
  --neutral-600:           #6B5F52;    /* secondary deep */
  --neutral-700:           #4A4036;    /* primary text alt */
  --neutral-800:           #2C2620;    /* heading */
  --neutral-900:           #1A1612;    /* title 最深 */

  /* ---------- 文字色語意 ---------- */
  --text-primary:          #2C2620;
  --text-body:             #4A4036;    /* 主站 body 顏色 */
  --text-secondary:        #6B5F52;
  --text-muted:            #A39A8E;    /* 白底 2.77:1，未達 WCAG 1.4.3 的 4.5:1，不可當內容文字色（僅供
                                           已知有既有豁免的裝飾/佔位用途）；內容文字弱化一律改用
                                           --text-secondary（6.2:1）。同一類約束見 --color-warning／
                                           --progress-start 上方註解。既有違規清單見本次回報，逐步遷移中。 */
  --text-on-brand:         #FAF6F1;    /* 深區反白用紙感米白，不用純白 */
  --text-on-accent:        #FFFFFF;
  --text-link:             var(--brand-accent);

  /* ---------- 背景色語意 ---------- */
  --bg-page:               #F9F8F4;    /* 紙感米白 */
  --bg-card:               #FFFFFF;
  --bg-paper:              #FAF6F1;    /* 報價單紙張感 */
  --bg-surface-alt:        #F4F0E7;
  --bg-datehead:           var(--neutral-200);   /* 日期標頭底（週／月格線的日期列）；--neutral-200 註解寫「border default」，拿來當底色讀不懂，所以另取語意別名（批 D） */
  --bg-today:              #EAE5DC;    /* 今天的欄身／格子底（批 D）；灰調，與假日黃 --color-warning-soft 色相分開 */
  --bg-deep:               #3E352E;    /* 深棕區（footer / hero CTA） */
  --bg-deep-soft:          #4A4036;
  --bg-footer:             #F2F5F7;    /* 主站 footer 淡灰 */

  /* ---------- 邊框 ---------- */
  --border-default:        #E8E2D6;
  --border-strong:         #D6CDBE;
  --border-control:        #E2D8C8;   /* 對話內控制項邊框(訊息中心對話設定鈕;值取自核可 mockup lmc-header-menu-btn-2026-11-04,與 .lmc-btn-s 同色) */
  --border-soft:           #F0EBE0;
  --border-brand:          rgba(184, 70, 39, 0.30);

  /* ---------- 語意色 (warm tones) ---------- */
  --color-success:         #5C7A4D;    /* 暖綠 (橄欖 sage) —— soft 底上 4.13:1，不可當文字色 */
  --color-success-soft:    #EAEFE2;
  /* 2026-09-06 ui-component-standard-layer：success 語意的文字色。
     --color-success 落在 --color-success-soft 上只有 4.13:1，不過 WCAG 1.4.3 的
     4.5:1（與當年 --color-warning 2.88:1 同一根因）。此 token 在 soft 底上 5.18:1 過。
     「已入帳／已開立」這類 success chip 一律用這個當文字色，--color-success 只當框線／底色。 */
  --color-success-text:    #4E6A41;

  /* 完整度／進度條漸層的起點色（ui-consistency-sweep Batch 2，2026-09-07）。
     不是語意色——它是「進度從少到多」漸層的一端，另一端是 --color-success。
     白底 1.96:1，**只能當底色／漸層，不可當文字色**（與 --color-warning 同一類約束）。
     來源：project-detail 的 .pd-cf-fill 原本就硬寫這個值；Batch 2 把同一條漸層
     沿用到 customers-list 與 customer-detail 的完整度條（核可 mockup 第 1、2 組），
     同一顏色一旦有三個消費者就該是 token，不該三頁各寫一次。 */
  --progress-start:        #E0B34D;
  --color-warning:         #C28F3C;    /* 暗金 —— 白底 2.88:1，只能當框線／底色，不可當文字色 */
  --color-warning-soft:    #F8EFD9;
  /* 2026-09-06 quote-order-unified-page：warning 白底文字對比達標用，
     mockup-handoff §6 提案（--color-warning 當文字色白底僅 2.88:1，不過 4.5:1
     門檻；此 token 白底 6.35:1 過）。待收款／未決定 chip 一律用這個 token 當
     文字色，--color-warning 只當框線／底色。 */
  --color-warning-text:    #7A5A1E;
  --color-danger:          #B84627;    /* 與 brand accent 同色 */
  --color-danger-soft:     #FDF1EA;
  --color-info:            #4A4036;    /* 用主色 */
  --color-info-soft:       #FAF6F1;
  /* 長期維運階段色(stage-maintenance mockup):不在線性流程內、但屬進行中的獨立區塊,
     不能撞既有階段色(灰/深棕/火焰紅/暗金/綠)。暖調梅褐,白底 5.9:1、soft 底 5.1:1,框線與文字皆可用。 */
  --stage-maintenance:      #7D5A6B;
  --stage-maintenance-soft: #F3ECF0;
  /* 2026-10-02 referral-vendor-labor-20260930：發票「已開立」藍色 pill。數值沿用
     projects-center.vue.html .pc-pill.inv-issued（核可 mockup 同色），收成 token
     供 referrals-list.vue.html 使用；projects-center 既有寫法未改。 */
  --invoice-issued-bg:     #E3EDF5;
  --invoice-issued-text:   #3D6488;

  /* 2026-10-08 gcal-multi-account 3.3：Google 日曆色票（使用者替每本日曆挑的顏色，6 色白名單，
     值與核可 mockup personal-calendar-2026-10-08 的 ACT.PALETTE 相同；後端 gcal_calendar_service.COLOR_KEYS
     存的是 blue/green/purple/orange/pink/slate 這六個鍵）。
     **只能當色點／虛線框／邊線，不可當文字色**：白底對比 藍 5.47／綠 5.00／紫 4.95／橘 4.01／粉紅 5.31／灰 5.47，
     橘在白底就不到 4.5:1；落在 12% 同色淡底上綠 4.26／紫 4.23／橘 3.49 也不到。非文字圖形需 ≥ 3:1（WCAG 1.4.11），
     六色白底與 --bg-page 底皆 ≥ 3.78:1，達標。文字一律維持 --text-primary。 */
  --cal-blue:              #2F6DA3;
  --cal-green:             #2E7D5B;
  --cal-purple:            #8A5BB5;
  --cal-orange:            #C2662D;
  --cal-pink:              #B0447A;
  --cal-slate:             #5F6B73;

  /* 2026-11-02 company-calendar-person-color（ELOP-71）：公司日曆「人員色盤」，7 色依帳號建立順序輪流發（第 8 位起接回第 1 色）。
     值與核可 mockup docs/company-calendar-person-color/mockup/mock-color.css 相同。
     **只能當左線／色點／徽章細框／淡底（30% 混卡片底），不可當文字色**：白底對比 金黃 3.59／橄欖 4.73／森綠 5.20／湖青 4.87／紫藤 6.32／莓果 6.30／赭褐 5.82
     （金黃不到文字的 4.5:1）；頁底 --bg-page 對比最低 3.38（金黃），非文字圖形 ≥ 3:1（WCAG 1.4.11）七色皆過；深色字 --text-primary 落在 30% 淡底 ≥ 9.3:1。
     這是 §1「不引入冷藍/冷灰」的登記例外（森綠、湖青、紫藤非純暖色），例外範圍僅限色點、線、徽章細框與淡底。 */
  --person-1:              #AE7F0E;
  --person-2:              #6B7A2A;
  --person-3:              #2F7A55;
  --person-4:              #2E7C80;
  --person-5:              #6A5496;
  --person-6:              #A23A66;
  --person-7:              #8A5A3C;

  /* ---------- 圓角 (紙感→偏方角) ---------- */
  --radius-xs:             3px;
  --radius-sm:             4px;
  --radius-md:             8px;
  --radius-lg:             16px;
  --radius-pill:           999px;

  /* ---------- 陰影 (基於暖棕，不靠藍黑) ---------- */
  --shadow-xs:             0 1px 2px rgba(62, 53, 46, 0.05);
  --shadow-sm:             0 1px 3px rgba(62, 53, 46, 0.06),
                           0 1px 2px rgba(62, 53, 46, 0.04);
  --shadow-md:             0 4px 12px rgba(62, 53, 46, 0.08),
                           0 2px 4px rgba(62, 53, 46, 0.04);
  --shadow-lg:             0 8px 32px rgba(62, 53, 46, 0.10),
                           0 4px 8px rgba(62, 53, 46, 0.06);
  --shadow-paper:          0 2px 6px rgba(62, 53, 46, 0.08),
                           0 12px 32px rgba(62, 53, 46, 0.08);
  --shadow-flame:          0 8px 24px rgba(184, 70, 39, 0.22);

  /* ---------- 間距 (8pt grid, 與品牌一致) ---------- */
  --space-1:               4px;
  --space-2:               8px;
  --space-3:               12px;
  --space-4:               16px;
  --space-5:               24px;
  --space-6:               32px;
  --space-7:               48px;
  --space-8:               64px;
  /* alias 給舊程式碼用，避免破壞 */
  --space-10:              40px;
  --space-12:              48px;
  --space-16:              64px;

  /* ---------- 字體 (品牌全套) ---------- */
  --font-serif:            "Noto Serif TC", serif;
  --font-sans:             "Noto Sans TC", -apple-system, "system-ui",
                           "PingFang TC", sans-serif;
  --font-mono:             "JetBrains Mono", ui-monospace, monospace;
  --font-en-display:       Manrope, -apple-system, sans-serif;
  --font-eyebrow:          "Montserrat", "Inter", -apple-system, sans-serif;

  /* ---------- Paper design tokens (v2.5 範本精確值) ---------- */
  --paper-ink-1:           #4A4036;
  --paper-ink-2:           #6B5D51;
  --paper-ink-3:           #8A7B6F;
  --paper-ink-4:           #A89B8F;
  --paper-accent:          #D95D39;

  /* ---------- 字級 ---------- */
  --fs-xs:                 12px;
  --fs-sm:                 13px;
  --fs-base:               14px;
  --fs-md:                 15px;
  --fs-lg:                 18px;
  --fs-xl:                 24px;
  --fs-2xl:                36px;
  --fs-3xl:                56px;
  --fs-hero:               72px;

  /* ---------- 過渡 ---------- */
  --transition-fast:       120ms ease;
  --transition-normal:     220ms ease;
  --transition-slow:       360ms ease;
}

/* =====================================================================
 *  全域 base
 * ===================================================================== */
html, body {
  background: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-feature-settings: "tnum" 1, "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}
body { margin: 0; padding: 0; }

/* 標題：襯線 + 暖色 (品牌主站手法) */
h1, h2, h3, .heading-serif {
  font-family: var(--font-serif);
  color: var(--text-primary);
  letter-spacing: 0.01em;
  font-weight: 700;
}
h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--text-primary);
  font-weight: 600;
}

/* 金額/編號等寬數字 */
.mono, .num, .text-num {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.01em;
}

/* 區段 wrapper */
.page-wrap {
  max-width: 1280px;
  margin: 0 auto;
}
/* 做滿版流式的頁面用（2026-09-12 §8.2 E4 收斂）：取代逐頁 inline
   style="max-width:none;" 的寫法，顯式宣告意圖，不依賴 :3958-3962 的
   !important 補丁生效與否。 */
.page-wrap--full {
  max-width: none;
}
/* =====================================================================
 *  頁面大標標準 — .page-head（全站唯一大標寫法，規格見 UI-GUIDELINES.md §3）
 * ===================================================================== */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}
.page-head h1 {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
  letter-spacing: 0.01em;
}
.page-head-sub {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}
.page-head-actions { flex-shrink: 0; display: flex; gap: 8px; }

/* =====================================================================
 *  大標停駐（sticky page-head）— openspec change `sticky-page-head`
 *  核可 mockup：mockups/sticky-page-head-mockup-2026-09-12.html
 *  handoff：mockups/sticky-page-head-handoff-2026-09-12.md §3
 *
 *  只對「大標是標準容器第一個元素」的頁面生效（白名單容器，上內距皆為 16px）。
 *  詳情頁（大標上方有 .page-back／返回鈕）自動不符 :first-child，維持 static。
 *
 *  --dvc-page 上內距實查為 14px（舊工程維護中心頁(已退場)），不是 16px，
 *  故不納入白名單（design.md Open Questions；負 margin -16px 會露出容器邊界）。
 *
 *  頂部高度只有一個真相來源 --app-header-bottom（§4.1 鐵律 1），fallback 寫法
 *  同 §4.1.1 標準式（SSOT 掛掉時退回 58px + 橫幅高，等於今日 layout 讓位值）。
 *  16px = --space-4 = 容器 q-pa-md 的上內距：負 margin 吃掉它、padding 補回來，
 *  未捲動時大標文字位置不變；停駐時這 16px 就是大標與 chrome 的間距（與未捲動一致，
 *  design D2——不是鐵律 9 的 12px，那是「捲動對齊目標」的呼吸間距，見下方 §3 規則）。
 *  12px = --space-3 = 原本的 margin-bottom，改成 padding-bottom 讓底色蓋住縫隙。
 * ===================================================================== */
.q-pa-md.page-wrap > .page-head:first-child,
.pc-page > .page-head:first-child {
  position: -webkit-sticky;
  position: sticky;
  top: var(--app-header-bottom, calc(58px + var(--app-banner-h, 0px)));
  /* 高於表格凍結欄（.pin-*／.ops-td z 1-3），低於 q-header／teleport 的 q-menu／q-dialog（≥2000） */
  z-index: 10;
  background: var(--bg-page);
  margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) 0;
  padding: var(--space-4) var(--space-4) var(--space-3);
}
/* 停駐時才出現的邊界線；用 box-shadow 不用 border，避免 1px 版面位移。
   html.app-scrolled 由 app-metrics.js 依 window.scrollY > 0 掛上（見下方 app-metrics.js 段落）。
   指令碼未執行時只少這條線，不透明底色與停駐行為（純 CSS）仍完整成立（spec 停駐視覺
   Requirement「指令碼未執行時的降級」）。 */
html.app-scrolled .q-pa-md.page-wrap > .page-head:first-child,
html.app-scrolled .pc-page > .page-head:first-child {
  box-shadow: 0 1px 0 var(--border-default);
}

/* 詳情頁「返回上一層」連結——三個詳情頁（project-detail／order-detail／
   customer-detail）原本各寫一套（.pd-back／q-btn flat／卡片內按鈕），
   ui-consistency-sweep Batch 2/4 收編（老闆核可 mockup 技術附註 §7）。
   2026-09-08 tab-a11y-regression：collapse 成 <a class="page-back"> 卻沒有
   href（三頁的返回目標要嘛是條件判斷（customer-detail 的 goBack() 視
   sessionStorage 而定，非固定 URL），要嘛就是走 SPA 的 window.location.hash
   賦值），結果鍵盤完全到不了——改前三頁分別是 <q-btn>／原生互動元素，是回歸。
   統一改回 <button type="button">，故這裡補一組按鈕重置（同 .unified-tab-item
   的 appearance:none 那組，理由相同：不重置會落回瀏覽器預設按鈕外觀）。 */
.page-back {
  display: inline-block;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 6px;
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
}
.page-back:hover { color: var(--brand-accent); }
.page-back:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* =====================================================================
 *  Quasar override — 讓 q-* 元件吸收火焰深棕 token
 * ===================================================================== */

/* Header bar：深棕底 + 火焰紅細邊 */
.q-header.bg-primary,
.bg-primary {
  background: var(--brand-primary) !important;
  color: var(--text-on-brand) !important;
}
.q-header.bg-primary {
  box-shadow: 0 2px 8px rgba(62, 53, 46, 0.15);
  border-bottom: 2px solid var(--brand-accent);
}

.text-primary {
  color: var(--brand-primary) !important;
}

/* 註：`.el-card` 刻意放在元件基底區的最前面（原本在檔案末段，2026-09-14 移動）。
 * 原因見 openspec change `el-card-migration` design D7：存量容器中有 30 個的背景帶語意
 * （漸層 hero、警告黃、紙張米色、凹陷區底色、強調紅），收編時只統一形狀、保留底色。
 * `.el-card` 與容器 class 特異度相同、後定義者勝——放在前面，容器保留的 background／border
 * 才贏得過標準，而移除掉的 padding／border-radius 才會落回標準。
 * 移動不影響「新寫卡片」的效果（新卡片不會自訂這四項）。
 */
/* ============================================================
 * .el-card —— 卡片容器標準（openspec change `ai-dev-gates` 任務 5.3）
 * ------------------------------------------------------------
 * 2026-09-14 老闆拍板「統一」。盤點依據 `_reports/card-inventory-2026-09-14.md`：
 * 全站 54 個卡片級容器（判準＝背景＋圓角＋邊框或陰影＋內距，排除互動元素），
 * 內距有 38 種相異值、圓角 15 種，只有 9 個全部使用 token。
 * 最刺眼的證據是 `9px` 用了 8 次，比正解的等價硬寫值 `8px`（4 次）還多——
 * 肉眼幾乎分不出，但就是兩個值。沒有可驗數值時，每個人憑手感各寫各的。
 *
 * 數值不是憑感覺訂的：
 *   padding —— 現況垂直內距中位數 11px、水平通常大 2–4px，最集中的組合是
 *              12px 16px（`var(--space-3) var(--space-4)`）。
 *   radius  —— `var(--radius-md)`（8px）在現況出現 18 次，遠多於其他值。
 *
 * MUST NOT 收編（語意不同，不是通用卡片）：
 *   - 紙張模擬 `.a4-page` / `.doc-paper` / `.sign-area-paper`：尺寸用 mm、與列印綁定
 *   - 警示條 `.errbar` / `.cc-failed-banner` / `.pd-lcalert` / `.pd-pay-err`：語意色優先
 *   - 藥丸狀小元件（`border-radius: 999px`）與內距 < 9px 者：屬 chip／標記層級
 *
 * 存量遷移（54 個容器）不在本次範圍——會改變現有頁面外觀，需逐頁驗證。
 * 本次先立標準並讓守門擋住「新的分歧」。規格見 UI-GUIDELINES §5.12。
 * ============================================================ */
.el-card {
  background: var(--bg-card);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
}

/* 大型情境區塊（問卷 hero、簽署狀態頁等內容量大的容器） */
.el-card--roomy {
  padding: var(--space-5);
}

/* 需要浮起感時改用陰影，不與框線疊加（兩者並用會讓邊緣看起來髒） */
.el-card--raised {
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
 * .kpi-strip／.kpi —— KPI 數字卡骨架（openspec change
 * `partner-cases-hero-and-sidebar-group-20260929` 任務 5.1）。規格見 UI-GUIDELINES §5.13。
 * 卡片外觀（底色／框線／圓角／內距）一律搭 `.el-card`，本骨架只管排版與字級，
 * 刻意不設 background／box-shadow，避免蓋掉 `.el-card--raised`。
 * 欄數與互動（可點選、語意色）由頁面覆寫。既有 `.qol-page`、`.finance-cost-table-page`
 * 的頁面專用規則特異度較高，本骨架不改變它們的外觀；兩頁的遷移待收編（§8）。
 * ============================================================ */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.kpi .k-lb { font-size: var(--fs-xs); color: var(--text-secondary); }
.kpi .k-num {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.kpi .k-trial {
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 3px;
}
.kpi .k-sub { font-size: 11px; color: var(--text-secondary); }

/* 可點的 KPI 卡（eng-milestone-redesign 收編，UI-GUIDELINES §5.13）：<button class="kpi el-card kpi--btn" aria-expanded>。
 * 展開態用深棕框與底線，不用火焰紅（火焰紅保留給 CTA）；數字語意色靠 .k-num.bad／.warn／.zero。 */
.kpi--btn { appearance: none; font-family: inherit; text-align: left; cursor: pointer; width: 100%; position: relative; }
.kpi--btn:hover { background: var(--bg-paper); }
.kpi--btn:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.kpi--btn[aria-expanded="true"] { border-color: var(--brand-primary); box-shadow: inset 0 -3px 0 var(--brand-primary); }
.kpi--btn .k-num.bad { color: var(--brand-accent-dark); }
.kpi--btn .k-num.warn { color: var(--color-warning-text); }
.kpi--btn .k-num.zero { color: var(--text-secondary); }
.kpi--btn .k-lb { display: flex; align-items: center; gap: var(--space-1); }
.kpi--btn .k-lb .material-icons { font-size: 16px; }

/* 篩選按鈕 .filter-chip（eng-milestone-redesign 收編，原 mockup 的 .ms-fchip，UI-GUIDELINES §5.13）：
 * 用 aria-pressed 表選中；選中態深棕；.warn 為警示變體（例如未排入超過 10 件）；.n 為計數。 */
.ms-fchips { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.filter-chip {
  appearance: none; display: inline-flex; align-items: center; gap: var(--space-2); min-height: 32px; padding: 0 var(--space-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--bg-card); color: var(--text-secondary);
  font-family: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; position: relative; white-space: nowrap;
}
.filter-chip::after { content: ""; position: absolute; inset: -6px -2px; }
.filter-chip:hover { background: var(--bg-paper); color: var(--text-primary); }
.filter-chip:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.filter-chip .n {
  font-variant-numeric: tabular-nums; font-size: var(--fs-xs); font-weight: 700; background: var(--neutral-100);
  color: var(--text-secondary); border-radius: var(--radius-pill); padding: 0 var(--space-2); line-height: 18px;
}
.filter-chip[aria-pressed="true"] { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--text-on-brand); }
.filter-chip[aria-pressed="true"] .n { background: var(--brand-primary-soft); color: var(--text-on-brand); }
.filter-chip.warn { background: var(--color-warning-soft); border-color: var(--color-warning); color: var(--color-warning-text); }
.filter-chip.warn .n { background: var(--bg-card); color: var(--color-warning-text); }
.filter-chip.warn[aria-pressed="true"] { background: var(--color-warning-text); border-color: var(--color-warning-text); color: var(--bg-card); }
.filter-chip .material-icons { font-size: 16px; }

/* 主按鈕：unelevated 深棕 / 火焰紅二擇一 */
.q-btn {
  letter-spacing: 0.04em;
  font-weight: 500;
  border-radius: var(--radius-sm);
}
.q-btn--unelevated {
  box-shadow: var(--shadow-xs);
  transition: background-color var(--transition-fast),
              box-shadow var(--transition-fast),
              transform var(--transition-fast);
}
.q-btn--unelevated:hover:not(:disabled) {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.q-btn--outline { border-width: 1px !important; }

/* 火焰紅按鈕 (新增 utility) */
.btn-accent,
.q-btn.btn-accent {
  background: var(--brand-accent) !important;
  color: #fff !important;
}
.q-btn.btn-accent:hover:not(:disabled) {
  background: var(--brand-accent-dark) !important;
  box-shadow: var(--shadow-flame);
}

/* 主 CTA：深棕 + 火焰漸層上邊條 */
.btn-primary-deep,
.q-btn.btn-primary-deep {
  background: var(--brand-primary) !important;
  color: var(--text-on-brand) !important;
  position: relative;
  overflow: hidden;
}

/* 卡片 — 紙感邊框 + 暖陰影 */
.q-card { border-radius: var(--radius-md); }
.q-card--bordered {
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xs);
  background: var(--bg-card);
  transition: box-shadow var(--transition-normal),
              border-color var(--transition-fast);
}
.q-card--bordered:hover {
  border-color: var(--border-strong);
}

/* 輸入框：focus 用火焰紅 (品牌 accent) */
.q-field--outlined .q-field__control {
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.q-field--outlined .q-field__control:before {
  border-color: var(--border-default);
}
.q-field--outlined.q-field--focused .q-field__control:before {
  border-color: var(--brand-accent);
}
.q-field--outlined.q-field--focused .q-field__control:after {
  border-color: var(--brand-accent);
  border-width: 1.5px;
}
.q-field--focused .q-field__label {
  color: var(--brand-accent) !important;
}

/* Toolbar tab (預覽頁深棕 nav) */
.q-tabs.bg-primary {
  background: var(--brand-primary) !important;
  border-bottom: 2px solid var(--brand-accent);
}
.q-tab--active {
  font-weight: 600;
}
.q-tab__indicator {
  background: var(--brand-accent) !important;
  height: 3px !important;
}

/* Badge / Chip */
.q-badge {
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
}

/* Table 紙感 */
.q-table {
  border-radius: var(--radius-md);
  overflow: hidden;
}
.q-table tbody tr:hover {
  background: var(--brand-primary-100) !important;
}
.q-table thead tr {
  background: var(--neutral-75);
}
.q-table thead th {
  /* 2026-09-06 ui-component-standard-layer：對齊 .data-table 表頭標準。
     原本是 --font-eyebrow ＋ uppercase ＋ letter-spacing 0.06em——eyebrow 語彙已由
     page-header-standard 規格宣告廢除，且中文無大小寫，uppercase 只會把字距撐開。
     此規則涵蓋 7 個仍在使用 q-table 的管理頁（items/terms/users/plan-drafts/
     subtask-templates/payment-info-templates/partners），改一處即全數對齊。 */
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 11.5px;
  background: var(--bg-surface-alt);
  text-align: left;
  font-family: var(--font-sans);
  border-bottom: 1px solid var(--border-default);
}
.q-table tbody td {
  font-size: var(--fs-base);
  color: var(--text-body);
  border-bottom: 1px solid var(--border-soft);
}

/* Notification (toast) */
.q-notification__message {
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* =====================================================================
 *  登入頁 (米白紙感 + 火焰光暈)
 * ===================================================================== */
.login-bg {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top right,
                    rgba(184, 70, 39, 0.10) 0%,
                    transparent 55%),
    radial-gradient(ellipse at bottom left,
                    rgba(244, 147, 102, 0.08) 0%,
                    transparent 50%),
    var(--bg-page);
  position: relative;
}
.login-bg::before {
  /* 紙紋細格 */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(62, 53, 46, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 53, 46, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.login-bg::after {
  /* 火焰光暈 */
  content: "";
  position: absolute;
  top: 18%;
  right: 8%;
  width: 380px;
  height: 380px;
  background: var(--brand-accent-glow);
  pointer-events: none;
  filter: blur(20px);
}

.login-foot-note { font-size: 10px; } /* 原 inline 10px 移出,桌面不變;768 內改 11(批 H H-10) */
.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-default);
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.login-card::before {
  /* 卡片頂部火焰漸層細邊 */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--brand-accent-gradient);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--space-3);
  padding-bottom: var(--space-2);
}
.login-brand .login-logo {
  height: 56px;
  width: auto;
  margin-bottom: var(--space-3);
  filter: drop-shadow(0 4px 12px rgba(184, 70, 39, 0.20));
}
.login-brand .brand-name {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}
.login-brand .brand-name .accent-word { color: var(--brand-accent); }
.login-brand .brand-tagline {
  font-family: var(--font-eyebrow);
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.28em;
  margin-top: var(--space-2);
  text-transform: uppercase;
}

/* =====================================================================
 *  Header / Navbar (admin SPA)
 * ===================================================================== */
.app-brand-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: var(--font-serif);
}
.app-brand-title .nav-logo {
  height: 32px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.20));
}
.app-brand-title .nav-divider {
  opacity: 0.4;
  margin: 0 4px;
  font-weight: 300;
}
.app-brand-title .nav-tag {
  font-family: var(--font-eyebrow);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* 角色 chip：admin 用火焰紅，basic 用米色 */
.role-chip {
  /* 2026-09-06 ui-component-standard-layer：移除 --font-eyebrow（已廢除語彙）。
     letter-spacing/uppercase 保留——此 chip 顯示的是 ADMIN／BASIC 英文角色碼，
     英文全大寫加字距是有意義的；中文標籤才不適用（見 .status-chip）。 */
  font-weight: 700;
  font-size: 10px !important;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-sans);
}

/* app-shell-header-sidebar-redesign(2026-09-04):頭部使用者資訊區間距微調,貼近 Asana 質感
 * 老闆核可幅度限定的小改——不動 nav-logo/nav-tag/toolbar-title 既有(已多次修補)排版規則。 */
html body .q-header.bg-primary .q-toolbar > .q-btn[icon="logout"] {
  margin-right: var(--space-3, 12px) !important;
}
html body .q-header.bg-primary .role-chip {
  border-radius: 999px;
}

/* =====================================================================
 *  狀態 Chip (重新配色，全用 warm tones)
 * ===================================================================== */
/* 2026-09-06 ui-component-standard-layer（老闆核可 mockup：
   mockups/ui-component-standard-mockup-2026-09-06.html 第 3 組）。
   三處修正：
   ① 移除 --font-eyebrow ＋ uppercase ＋ letter-spacing——eyebrow 語彙已由
      page-header-standard 宣告廢除；中文無大小寫，uppercase 只把字距撐開。
   ② --signback 不再用火焰紅（§5：火焰紅保留給 CTA），改深棕實底；
      對比從 5.33:1 提升到 11.13:1。
   ③ --deprecated 原本 neutral-75 底 ＋ text-muted 字只有 2.44:1（未達 4.5:1），
      改 neutral-100 ＋ text-secondary，並加刪除線讓「失效」一眼可辨。
   語意色分工與 frontend/shared/deal-rules.js 的 TONES 完全對齊——那份是 SSOT，
   本組 class 是它的 CSS 對應物，改一邊必須改另一邊。 */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
}
/* 待遞交／草稿：中性 */
.status-chip--none {
  background: var(--neutral-100);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
/* 已遞交／待簽回：中性（與草稿同色階，靠標籤文字區分——皆為「還沒發生事情」的狀態） */
.status-chip--submitted {
  background: var(--neutral-100);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
/* 已簽回：深棕實底（品牌主色，非強調色） */
.status-chip--signback {
  background: var(--brand-primary);
  color: var(--text-on-brand);
}
/* 已作廢：中性＋虛線＋刪除線（對齊 deal-rules TONES 的 neutral-dashed） */
.status-chip--deprecated {
  background: var(--neutral-100);
  color: var(--text-secondary);
  border: 1px dashed var(--border-strong);
  text-decoration: line-through;
}
/* 已入帳／已開立：success（文字用 --color-success-text，非 --color-success） */
.status-chip--success {
  background: var(--color-success-soft);
  color: var(--color-success-text);
}
/* 已過期／開立失敗：danger */
.status-chip--danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
/* 待收款／分潤未付等「warning」語意：補齊既有缺口。
   deal-rules.js:69-72 TONES.warning 早已用這組值（那份是 SSOT），本檔卻一直
   沒有對應 class——ui-consistency-sweep Batch 2/4（老闆核可 mockup
   ui-consistency-sweep-mockup-2026-09-07.html 技術附註 §7）補上，非新設計。 */
.status-chip--warning {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
}

/* ── 小 chip（.p-chip）：類型／身分標記，比 .status-chip 小一號 ──
   2026-10-02 referral-vendor-labor-20260930：partners-list 與 labor-slips 兩頁
   規格相同（核可 mockup .p-chip），收進共用元件。partners-list 的頁面前綴版本
   數值一致，未改動。 */
.p-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px; /* space-exempt: 照 mockup .p-chip 1:1 */
  margin-left: 6px; /* space-exempt: 照 mockup .p-chip 1:1 */
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  vertical-align: middle;
}
/* 公司（夥伴） */
.p-chip--co {
  background: var(--brand-primary-100);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
/* 個人（外包） */
.p-chip--person {
  background: var(--neutral-100);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

/* ── 頭尾款角色標籤（.ipm-role-tag）：報價管理列表／專案詳情頁共用 ──
   2026-10-02 quote-installment-payment 任務 6.1/6.2：核可 mockup
   mockups/quote-installment-payment-mockup-v2-2026-09-30.html §③④⑤。
   兩個消費頁一開始就會用到同一組樣式，比照 .p-chip 的收編慣例直接放
   共用層，不先開在單頁再搬。 */
.ipm-role-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 8px; /* space-exempt: 照 mockup .ipm-role-tag 1:1 */
  border-radius: var(--radius-pill);
  background: var(--brand-primary-100);
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary-100);
}

/* ── 一張單兩期付款（報價管理列表）：總額／已收／未收、展開列逐期區塊、列上警示點、帳號框、拆單逐期列 ──
   2026-10-17 openspec change installment-one-quote（任務 A.3／A.4）：核可 mockup
   mockups/installment-one-quote-2026-10-16.html 的「新增」樣式 1:1 收編。
   全部掛在 .qol-page 之下（q-dialog 也帶 .qol-page，teleport 後仍命中）。
   自訂 class 已比對 Quasar 禁用清單（row／column／flex／col-*／xs～xl），帳號框的列用 .acct-line。 */
.qol-page .amt-stack { display: grid; grid-template-columns: auto auto; justify-content: end; column-gap: var(--space-2); row-gap: 1px; align-items: baseline; }
.qol-page .amt-stack .k { font-size: 11px; font-weight: 500; color: var(--text-secondary); text-align: left; }
.qol-page .amt-stack .amt { font-size: var(--fs-sm); text-align: right; }
.qol-page .amt-stack .amt.sub { font-weight: 500; font-size: var(--fs-xs); }
.qol-page .amt-stack .amt.unpaid { color: var(--color-warning-text); font-weight: 700; }
.qol-page .cell-sub { display: block; margin-top: 2px; font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.qol-page .ipd { display: grid; grid-template-columns: 88px 92px minmax(150px, 1.1fr) minmax(130px, 1fr) auto; gap: 6px 14px; align-items: center; }
.qol-page .ipd + .ipd { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border-soft); }
.qol-page .ipd .p-amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.qol-page .ipd .p-acts { display: inline-flex; align-items: center; gap: var(--space-3); justify-content: flex-end; flex-wrap: wrap; }
.qol-page .ipd .p-lab { font-size: 11px; color: var(--text-secondary); display: none; }
.qol-page .ipd .p-sub { display: block; margin-top: 3px; font-size: 11px; color: var(--text-secondary); }
.qol-page .ipd .p-sub .mono { font-family: var(--font-mono); }
.qol-page .ipd .p-next { color: var(--text-primary); white-space: normal; max-width: 280px; }
.qol-page .ipd .p-why { flex: 1 1 100%; font-size: 11px; color: var(--text-secondary); text-align: right; }
.qol-page .ipd-foot { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border-strong); font-size: 11px; }
.qol-page .p-caution { color: var(--color-warning-text); font-weight: 600; }
.qol-page .chip.bs-building { border-style: dashed; color: var(--text-secondary); }
.qol-page .btn.link[disabled] { opacity: 1; color: var(--text-secondary); text-decoration: none; cursor: not-allowed; }
.qol-page .alert-dot { appearance: none; border: 0; background: transparent; padding: 0; margin-top: 3px; display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 11px; font-weight: 600; color: var(--color-danger); cursor: pointer; white-space: nowrap; }
.qol-page .alert-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--color-danger); display: inline-block; }
.qol-page .alert-dot:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.qol-page .pstep { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.qol-page .pstep .ps { border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); background: var(--bg-card); min-width: 0; }
.qol-page .pstep .ps .ps-t { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.qol-page .pstep .ps .ps-a { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 700; font-size: var(--fs-base); margin: 2px 0 4px; }
.qol-page .pstep .ps.now { border-color: var(--brand-accent); box-shadow: inset 0 0 0 1px var(--brand-accent); background: var(--brand-accent-soft); }
.qol-page .pstep .ps.done { background: var(--bg-surface-alt); }
.qol-page .pstep .ps .chip { height: 20px; font-size: 11px; }
.qol-page .dlg-sum { background: var(--bg-surface-alt); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); font-size: var(--fs-sm); }
.qol-page .dlg-hint { font-size: var(--fs-xs); color: var(--text-secondary); margin-top: var(--space-2); }
.qol-page .acct { border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface-alt); padding: var(--space-3); margin-top: var(--space-3); display: grid; gap: var(--space-2); }
.qol-page .acct .acct-line { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.qol-page .acct .k { font-size: 11px; color: var(--text-secondary); width: 64px; flex: 0 0 64px; }
.qol-page .acct .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: var(--fs-sm); }
.qol-page .acct.is-fail { border-color: var(--color-danger); background: var(--bg-card); }
.qol-page .acct.is-exp { border-color: var(--color-warning); background: var(--bg-card); }
.qol-page .acct .msg { font-size: var(--fs-sm); }
.qol-page .split-row { border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-3); display: grid; gap: var(--space-2); }
.qol-page .split-row + .split-row { margin-top: var(--space-2); }
.qol-page .split-row .sr-h { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-weight: 600; }
.qol-page .split-row .sr-h .amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
@media (max-width: 768px) {
  :where(html.app-shell) .qol-page .ipd { grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-3); }
  :where(html.app-shell) .qol-page .ipd .p-lab { display: block; }
  :where(html.app-shell) .qol-page .ipd > .p-role { grid-column: 1 / -1; }
  :where(html.app-shell) .qol-page .ipd .p-acts { grid-column: 1 / -1; justify-content: flex-start; }
  :where(html.app-shell) .qol-page .ipd .p-why { text-align: left; font-size: 12px; }
  :where(html.app-shell) .qol-page .ipd .p-sub { font-size: 12px; }
  :where(html.app-shell) .qol-page .alert-dot { position: relative; font-size: 12px; min-height: 28px; }
  :where(html.app-shell) .qol-page .alert-dot::after { content: ''; position: absolute; inset: -8px -4px; }
  :where(html.app-shell) .qol-page .acct .k { font-size: 12px; }
  :where(html.app-shell) .qol-page .pstep .ps .ps-a { font-size: 15px; }
}

/* =====================================================================
 *  A4 列印 / 報價單紙張感
 * ===================================================================== */
.a4-page {
  width: 210mm;
  min-height: 297mm;
  max-width: 100%;
  background: var(--bg-paper);
  margin: var(--space-5) auto;
  padding: 22mm 18mm;
  box-shadow: var(--shadow-paper);
  box-sizing: border-box;
  border-radius: 2px;
  position: relative;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-body);
  font-family: var(--font-sans);
}
.a4-page::before {
  /* 火焰紅垂直 bar (取代 Slate Teal 藍綠) */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--brand-accent-gradient);
  border-radius: 2px 0 0 2px;
}

.a4-page h1, .a4-page h2, .a4-page h3 {
  font-family: var(--font-serif);
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.a4-page h4, .a4-page h5, .a4-page h6 {
  color: var(--text-primary);
  font-weight: 600;
}

.cover-page {
  text-align: center;
  padding-top: 50mm;
}
.cover-page .doc-title {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.45em;
  color: var(--text-primary);
  margin: var(--space-7) 0 var(--space-4);
  position: relative;
}
.cover-page .doc-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  background: var(--brand-accent-gradient);
  margin: var(--space-4) auto 0;
  border-radius: 2px;
}
.cover-page .doc-subtitle {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--text-body);
  margin-bottom: var(--space-1);
  font-weight: 500;
  letter-spacing: 0.06em;
}
.cover-page .doc-meta-grid {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: var(--space-3) var(--space-7);
  margin-top: var(--space-7);
  padding: var(--space-5) var(--space-7);
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  font-size: 14px;
}
.cover-page .doc-meta-label {
  font-family: var(--font-eyebrow);
  color: var(--text-secondary);
  text-align: right;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
}
.cover-page .doc-meta-value {
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-sans);
}
.cover-page .doc-meta-value.mono {
  font-family: var(--font-mono);
}

.stamp-placeholder {
  width: 100px;
  height: 100px;
  border: 2px dashed var(--brand-accent);
  border-radius: 50%;
  color: var(--brand-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 0.12em;
  font-family: var(--font-serif);
  transform: rotate(-12deg);
  background: rgba(184, 70, 39, 0.04);
}

/* 表格樣式 (A4 內) */
.a4-page table,
.a4-page .q-markup-table table {
  border-collapse: collapse;
  width: 100%;
}
.a4-page .q-markup-table thead tr,
.a4-page table thead tr {
  background: var(--brand-primary-100) !important;
}
.a4-page .q-markup-table thead th,
.a4-page table thead th {
  color: var(--brand-primary);
  font-weight: 600;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--brand-accent);
  font-family: var(--font-sans);
}
.a4-page .q-markup-table .text-h6.text-primary,
.a4-page .text-primary {
  color: var(--brand-accent) !important;
  font-family: var(--font-mono);
  font-weight: 700;
}
/* 蓋掉舊 page 用的 bg-blue-1 (Quasar 預設藍底) */
.a4-page .bg-blue-1,
.a4-page tr.bg-blue-1,
.a4-page tr.bg-blue-1 td {
  background: var(--brand-primary-100) !important;
}

/* =====================================================================
 *  服務條款內容 (.term-html) — term-table-rendering, 2026-08-04
 *  核可 mockup：mockups/term-table-render-2026-08-04.html = 1:1 規格
 *
 *  為什麼用專屬 class 而不是全域 table：
 *    全域改 table 會波及 Quasar q-table 與報價單品項表(上面 .a4-page table
 *    已有既有規則)，風險面過大。條款內容統一掛 .term-html 把影響面關起來。
 *
 *  為什麼要定義 td：
 *    既有 .a4-page table 只定義了 thead(底色/字色/下框)，td 完全沒有樣式
 *    —— 直接放表格進去資料列會沒有格線、整片貼在一起。
 * ===================================================================== */
.term-html table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0 12px;
  font-size: 11.5px;
}
.term-html thead tr {
  background: var(--brand-primary-100);
}
.term-html thead th {
  color: var(--brand-primary);
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-strong);
  border-bottom: 2px solid var(--brand-accent);
  padding: 7px 10px;
  text-align: left;
  white-space: nowrap;
}
.term-html tbody td {
  border: 1px solid var(--border-strong);
  padding: 6px 10px;
  vertical-align: top;
}
.term-html tbody tr:nth-child(even) {
  background: var(--bg-paper);
}

/* =====================================================================
 *  編輯頁右欄 aside（即時預覽 + 分潤夥伴，共用一個 sticky 父層）
 *  quote-preview-parties-and-sticky-fixes D1/D2：兩張卡各自 sticky／文檔流會
 *  互相遮蔽，改由 wrapper 整組吸附；wrapper 自身可捲避免內容高於視窗時卡死。
 *
 *  layout-offset-contract 補洞（2026-09-12）：初版 top 只寫 var(--space-5)，
 *  完全沒為全域固定 q-header（58px）讓位，吸附後上緣被 header 蓋住約 34px
 *  （老闆截圖可見「即時預覽」標題行被吃掉，只剩副標）。
 *  底數＝量測 SSOT --app-header-bottom（已內含橫幅位移，MUST NOT 再與
 *  --app-banner-h 相加）；SSOT 掛掉退「58px + 橫幅」等效補償（純增益 fallback）。
 *  加項 --space-5(24px) = 呼吸間距，沿用改版前 .preview-sticky 的原值，不是底數的一部分。
 * ===================================================================== */
.doc-edit-aside {
  position: sticky;
  top: calc(var(--app-header-bottom, calc(58px + var(--app-banner-h, 0px))) + var(--space-5));
  /* max-height 扣除量 = 底數（同上，header 讓位）+ 上下呼吸間距各一份 --space-5，
     避免 header 越高、aside 底部越容易超出視窗。 */
  max-height: calc(100vh - var(--app-header-bottom, calc(58px + var(--app-banner-h, 0px))) - var(--space-5) * 2);
  overflow-y: auto;
  /* 2.8（ux-auditor M1，2026-09-12）：矮視窗下自身捲動需要可視提示。
   *
   * ⚠️ 這裡刻意【保留原生卷軸】，不用「零寬卷軸 + mask-image 邊緣漸隱」。
   * 2026-09-12 第二輪稽核（N1，_reports/ux-audit-quote-parties-task1.3-a11y-fixes-2026-09-12.md）
   * 實測：mask-image 讓漸隱帶內的文字本身變半透明，合成後對比從 14.06:1 一路掉到
   * 1.90:1，中段跌破 WCAG 1.4.3 的 4.5:1。漸隱是「把文字變不見」，不是「把文字蓋住」，
   * 對比不可控。這個坑（對比 1.9:1）在本專案已是第四次，見 memory
   * feedback_verify_geometry_not_just_computed_values。
   *
   * 當初的提案理由是「照搬既有 sidebar-scroll-affordance 做法」，但全庫 grep 後確認
   * 那份【只是 mockup、從未落地】——`mask-image` 在 theme.css 中只有這裡用過。
   * 「照搬既有 mockup」≠「照搬已驗證機制」。
   *
   * 原生卷軸是使用者最熟悉、且完全不影響內容對比的線索；scroll-padding-block 讓
   * 鍵盤 focus 不會緊貼容器邊緣，overscroll-behavior 避免捲到底把整頁一起帶走。 */
  overscroll-behavior: contain;
  scroll-padding-block: 12px;
}

/* =====================================================================
 *  即時預覽 sticky sidebar (深棕 header + 火焰 accent)
 * ===================================================================== */
.preview-sticky {
  position: static;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-default) !important;
  box-shadow: var(--shadow-sm) !important;
}
.preview-sticky .preview-header {
  background: linear-gradient(135deg,
    var(--brand-primary) 0%,
    var(--brand-primary-soft) 100%);
  color: var(--text-on-brand);
  padding: var(--space-4) var(--space-5);
  position: relative;
}
.preview-sticky .preview-header::after {
  /* header 底部火焰漸層細邊 */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--brand-accent-gradient);
}
.preview-sticky .preview-header .preview-title {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.preview-sticky .preview-header .preview-subtitle {
  font-family: var(--font-eyebrow);
  font-size: 10px;
  opacity: 0.75;
  margin-top: 4px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.preview-sticky .preview-amount-total {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--brand-accent);
  font-size: 24px;
  letter-spacing: 0.02em;
}

/* =====================================================================
 *  必填指示 / 警示
 * ===================================================================== */
.q-field__label .text-red,
.required-mark {
  color: var(--brand-accent);
  margin-left: 2px;
  font-weight: 700;
}

.floor-price-warning {
  color: var(--color-warning);
  font-size: var(--fs-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* =====================================================================
 *  簽署頁 (sign.html) 共用樣式 — 火焰風格
 * ===================================================================== */
.sign-paper {
  background: var(--bg-paper);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
  position: relative;
}
.sign-paper--with-stripe::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand-accent-gradient);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* 簽名 canvas：深棕框 + 紙感橫線 */
.sign-canvas {
  border: 2px solid var(--brand-primary);
  border-radius: var(--radius-md);
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 39px,
      rgba(62, 53, 46, 0.06) 39px,
      rgba(62, 53, 46, 0.06) 40px
    ),
    var(--bg-card);
  width: 100%;
  height: 200px;
  cursor: crosshair;
  touch-action: none;
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast);
}
.sign-canvas:hover {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 4px rgba(184, 70, 39, 0.10);
}
.sign-canvas-hint {
  text-align: center;
  font-family: var(--font-eyebrow);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--space-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* 簽名 CTA (火焰紅) */
.sign-cta {
  background: var(--brand-accent) !important;
  color: #fff !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
}
.sign-cta:hover {
  background: var(--brand-accent-dark) !important;
  box-shadow: var(--shadow-flame) !important;
}

/* 簽署完成 / 失效 / 密碼頁 hero card */
.sign-state-card {
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.sign-state-card::before {
  /* 頂部火焰漸層 */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--brand-accent-gradient);
}

.sign-state-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}
.sign-state-icon--success {
  background: var(--color-success-soft);
  color: var(--color-success);
  box-shadow: 0 4px 16px rgba(92, 122, 77, 0.20);
}
.sign-state-icon--gone {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  box-shadow: 0 4px 16px rgba(184, 70, 39, 0.20);
}
.sign-state-icon--password {
  background: var(--brand-primary-100);
  color: var(--brand-primary);
}
.sign-state-icon--warn {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

/* sign.html 客戶頁 sticky CTA banner */
.sign-cta-banner {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg,
                              transparent,
                              rgba(249, 248, 244, 0.95) 35%);
  padding: var(--space-3) 0 var(--space-2);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--brand-accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  z-index: 10;
}

/* =====================================================================
 *  頁尾 (主站 footer 淡灰)
 * ===================================================================== */
.app-footer {
  text-align: center;
  padding: var(--space-3) var(--space-4);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.18em;
  font-family: var(--font-eyebrow);
  text-transform: uppercase;
}
.q-footer.bg-grey-2,
.q-footer.bg-transparent {
  background: var(--bg-footer) !important;
  color: var(--text-muted) !important;
  border-top: 1px solid var(--border-default);
}

/* =====================================================================
 *  Skeleton / Empty / Loading
 * ===================================================================== */
.list-skeleton-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
}

.empty-state {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  color: var(--text-secondary);
}
.empty-state .q-icon,
.empty-state .empty-icon {
  font-size: 64px;
  color: var(--neutral-300);
  margin-bottom: var(--space-3);
}
.empty-state .empty-title {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.empty-state .empty-desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

/* =====================================================================
 *  列印樣式 (A4)
 * ===================================================================== */
@media print {
  @page { size: A4; margin: 0; }
  html, body {
    background: white !important;
    color: #000 !important;
  }
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .no-print,
  .q-header,
  .q-footer,
  .q-drawer,
  .q-tabs,
  .preview-sticky,
  .sign-cta-banner {
    display: none !important;
  }
  .q-page-container { padding: 0 !important; }
  .q-tab-panels { background: white !important; }
  .q-tab-panel { padding: 0 !important; }
  .a4-page {
    width: 210mm;
    min-height: 297mm;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 18mm 16mm !important;
    page-break-after: always;
    border-radius: 0 !important;
    background: white !important;
  }
  .a4-page::before {
    /* 列印時保留垂直火焰條（淡化），給文件一個品牌印記 */
    background: var(--brand-accent) !important;
    opacity: 0.9;
  }
  .a4-page:last-child { page-break-after: auto; }
  table, tr, td, th { page-break-inside: avoid; }
}

/* =====================================================================
 *  Reduced motion
 * ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}

/* =====================================================================
 *  響應式 (mobile)
 * ===================================================================== */
/* mobile-full-system 批 H(8.1):文件預覽(document-preview)與客戶簽署頁(sign.html)的紙張寬度機制,
   600 斷點保留不改成 768(pdm Q9;這兩頁是文件,不是 app 版面)。 */
@media (max-width: 600px) {
  .a4-page {
    padding: var(--space-5) var(--space-4);
    margin: var(--space-3) auto;
  }
  .cover-page { padding-top: var(--space-7); }
  .cover-page .doc-title {
    font-size: 28px;
    letter-spacing: 0.28em;
  }
  .cover-page .doc-meta-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2) 0;
    padding: var(--space-4);
  }
  /* quote-preview-parties-and-sticky-fixes D3：wrapper 回到 static。
     解除 max-height/overflow-y 的斷點【不在這裡】——見下方 1023.98px 的規則，
     原因是 Quasar 的 `col-md-4` 從 1024px 才生效，601–1023px 右欄已經是全寬堆疊。 */
  .doc-edit-aside {
    position: static;
  }
  .login-card { box-shadow: var(--shadow-md); }
}

/* ---- .doc-edit-aside：601–1023px 解除高度上限（QA F5 回歸修復，2026-09-13） ----
 * Quasar 的 `col-md-4` 從 **1024px** 才生效，601–1023px 之間右欄已經是 `col-12` 全寬、
 * 堆在表單下方——此時 `max-height: calc(100vh - …)` ＋ `overflow-y: auto` 會讓這個
 * 全寬區塊長出**自己的內部卷軸**（800×700 實測內容 906px > 容器 594px）。
 * 改版前的 `.preview-sticky` 沒有 max-height，所以這一帶本來沒有內卷軸 ⇒ 這是本次引入的回歸。
 *
 * 只解除高度上限、**保留 sticky**：與改版前 `.preview-sticky` 在這一帶的行為一致（最小改動）。
 * ≤600px 另有規則讓它連 sticky 一起回 static。 */
@media (max-width: 1023.98px) {
  .doc-edit-aside {
    max-height: none;
    overflow-y: visible;
  }
}

/* =====================================================================
 *  §15 v1.5 一頁式預覽頁 — 雙裝置 layout
 *  desktop 70/30 grid + mobile 全寬單欄
 * ===================================================================== */
.preview-layout {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) var(--space-8);
  gap: var(--space-5);
}
.preview-main {
  min-width: 0;
}
.preview-toc-wrap {
  display: none;  /* mobile 預設隱藏 */
}

@media (min-width: 1024px) {
  .preview-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
    padding: var(--space-5) var(--space-6) var(--space-8);
    gap: var(--space-6);
  }
  .preview-toc-wrap {
    display: block;
    grid-column: 2;
  }
}

.preview-toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* =====================================================================
 *  §16 浮動目錄 (desktop sticky)
 * ===================================================================== */
.preview-toc {
  position: sticky;
  top: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  font-family: var(--font-sans);
}
.preview-toc-progress {
  height: 2px;
  background: var(--neutral-100);
  position: relative;
}
.preview-toc-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brand-accent-gradient);
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
  transition: transform var(--transition-normal);
}
.preview-toc-list {
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0;
}
.preview-toc-list > li {
  margin: 0;
}
.preview-toc-item {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--space-4);
  color: var(--text-secondary);
  font-size: var(--fs-base);
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: background var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast);
}
.preview-toc-item:hover {
  background: rgba(184, 70, 39, 0.08);
  color: var(--text-primary);
}
.preview-toc-item.active {
  border-left-color: var(--brand-accent);
  color: var(--brand-primary);
  font-weight: 600;
  background: rgba(184, 70, 39, 0.04);
}
.preview-toc-item:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: -2px;
}

/* =====================================================================
 *  §17 浮動目錄 (mobile FAB + bottom sheet)
 * ===================================================================== */
.preview-toc-mobile-fab .q-fab__icon-holder,
.preview-toc-mobile-fab.q-fab .q-btn--fab {
  background: var(--brand-accent-gradient) !important;
  color: var(--text-on-accent) !important;
  box-shadow: var(--shadow-flame);
}
.preview-toc-mobile-fab.is-shrunk {
  transform: scale(0.85);
  transition: transform var(--transition-normal);
}
.preview-toc-bottom-sheet {
  background: var(--bg-card);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4) var(--space-5);
  min-width: 100vw;
  max-height: 75vh;
  overflow-y: auto;
}
.preview-toc-bottom-sheet__handle {
  width: 40px;
  height: 4px;
  background: var(--neutral-300);
  border-radius: var(--radius-pill);
  margin: 0 auto var(--space-3);
}
.preview-toc-bottom-sheet h4 {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  margin: 0 0 var(--space-3);
  color: var(--text-primary);
}
.preview-toc-bottom-sheet .preview-toc-item {
  height: 56px;            /* mobile 觸控目標 */
  font-size: var(--fs-md);
}

/* =====================================================================
 *  §18 section anchor 樣式 (連續排版 + smooth scroll target)
 * ===================================================================== */
.section-anchor {
  /* scroll-margin-top 已移除（scroll-contract-v1 / L4-a）：
   * 讓位改由 html:has(.q-header) 的 scroll-padding-top 統一負責。留著會與它疊加
   * ——96 + 70 = 166px，元素會被推到 header 下方一大段空白處。
   * 頂部高度只有一個真相來源：--app-header-bottom。 */
  margin-bottom: var(--space-6);
}
.section-anchor:last-child {
  margin-bottom: 0;
}
.preview-section-eyebrow {
  margin-bottom: var(--space-2);
}
.section-cover,
.section-main,
.section-services,
.section-terms,
.section-signatures {
  /* 沿用既有 .a4-page 樣式 (596 行起) */
  /* 此處只負責 anchor 行為，視覺套 .a4-page */
}
.term-block {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px dashed var(--border-default);
}
.term-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.term-block h3 {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--brand-primary);
  margin: 0 0 var(--space-2);
}
.preview-signature-block {
  display: grid;
  grid-template-columns: 120px 1fr 200px;
  gap: var(--space-4);
  align-items: center;
  margin-top: var(--space-7);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border-default);
}
.preview-signature-block .signature-stamp img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}
.preview-signature-block .signature-party {
  font-size: var(--fs-base);
  line-height: 1.8;
  color: var(--text-body);
}
.preview-signature-block .signature-date {
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  color: var(--text-primary);
  text-align: right;
}
@media (max-width: 1023px) {
  .preview-signature-block {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .preview-signature-block .signature-date { text-align: center; }
}

/* =====================================================================
 *  §19 共用元件 — draft banner / autosave chip / confirm dialog /
 *               term chip selector / item detail block (system/service)
 * ===================================================================== */

/* 19.1 Draft Banner (頂部 sticky 提示恢復草稿) */
.draft-banner {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--neutral-100);
  border-bottom: 1px solid var(--border-default);
  font-size: var(--fs-base);
  color: var(--text-secondary);
}
.draft-banner__icon {
  color: var(--color-warning);
  flex-shrink: 0;
}
.draft-banner__text { flex: 1; }
.draft-banner__actions { display: flex; gap: var(--space-2); }

/* 19.2 Autosave Chip (右下角浮動指示) */
.autosave-chip {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-family: var(--font-sans);
  background: var(--neutral-100);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-default);
  z-index: 10;
  transition: all var(--transition-normal);
}
.autosave-chip--saving { background: var(--neutral-100); color: var(--text-secondary); }
.autosave-chip--saved {
  background: var(--color-success-soft);
  color: var(--color-success);
  border-color: rgba(92, 122, 77, 0.25);
}
.autosave-chip--failed {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border-color: rgba(184, 70, 39, 0.30);
}
.autosave-chip .q-spinner { color: var(--text-secondary); }
@media (max-width: 1023px) {
  .autosave-chip {
    right: 50%;
    bottom: var(--space-4);
    transform: translateX(50%);
    font-size: 11px;
    padding: 4px var(--space-2);
  }
}

/* 19.3 Confirm Dialog (destructive vs info) */
.confirm-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  min-width: 320px;
  max-width: 480px;
  overflow: hidden;
}
.confirm-dialog__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
}
.confirm-dialog__body {
  padding: 0 var(--space-5) var(--space-4);
  font-size: var(--fs-base);
  color: var(--text-body);
  line-height: 1.7;
}
.confirm-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--neutral-50);
  border-top: 1px solid var(--border-default);
}
.confirm-dialog--destructive .confirm-dialog__title {
  color: var(--color-danger);
}
.confirm-dialog--destructive .confirm-dialog__title .q-icon {
  font-size: 32px;
  color: var(--color-danger);
}
.confirm-dialog--info .confirm-dialog__title {
  color: var(--brand-primary);
}
.confirm-dialog--info .confirm-dialog__title .q-icon {
  font-size: 24px;
  color: var(--color-info);
}
/* 延期原因視窗（工作台）：欄位區塊與輔助說明；專案詳情的延期視窗另有頁內樣式，不受影響 */
.dlg-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-3);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.dlg-field textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  font-size: var(--fs-sm);
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-card);
}
.dlg-field .pd-muted { font-size: var(--fs-xs); color: var(--text-secondary); }

/* 19.3.1 destructive button (outline 紅 + hover 才填底, 防誤點) */
.btn-destructive.q-btn {
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  background: transparent;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.btn-destructive.q-btn:hover {
  background: var(--color-danger);
  color: var(--text-on-accent);
}

/* 19.4 Term Chip Selector (適用條款多選) */
.term-chip-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  min-height: 56px;
}
.term-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px var(--space-2) 4px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--brand-accent-soft);
  color: var(--brand-primary);
  font-size: var(--fs-sm);
  border: 1px solid transparent;
  transition: background var(--transition-fast);
}
.term-chip:hover { background: rgba(184, 70, 39, 0.16); }
.term-chip__remove {
  cursor: pointer;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.term-chip__remove:hover {
  color: var(--color-danger);
  background: rgba(184, 70, 39, 0.12);
}
.term-chip-selector__add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px var(--space-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  cursor: pointer;
  background: transparent;
  transition: all var(--transition-fast);
}
.term-chip-selector__add:hover {
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}

/* 19.4b 條款標題後綴「· 備註」（openspec change `service-term-variant-label`，
   核可 mockup v2 變體② mockups/service-term-variant-label-mockup-v2-2026-09-11.html）。
   用於條款管理列表／預覽 dialog／項目管理條款選擇器／報價單編輯頁勾選清單四處，
   顯示只有後台看得到的 variant_label（絕不進客戶可見輸出，見
   backend/app/services/document_service.py build_terms_blocks()／
   merge_applicable_terms() 的邊界註解與 tests/test_public_no_variant_label_leak.py）。
   2026-09-11 起由 terms-admin.vue.html／items-admin.vue.html／document-edit.vue.html
   三頁各自 <style> 複製移入本檔——mockup 當時「本頁專用不收編」的前提（僅
   terms-admin 一處消費）已隨三頁同步實作而不再成立，收編觸發條件成立。
   .sep／.val 改為 BEM 巢狀命名（__sep／__val，比照上方既有 .term-chip__remove
   慣例），避免通用短名進 theme.css 後與其他頁面既有／未來 class 全域碰撞。 */
.term-variant-suffix {
  margin-left: 6px;
  font-size: inherit; /* 永遠跟隨所在脈絡的標題字級（列表 14px／預覽 dialog text-h6／chip 13px 皆適用） */
}
.term-variant-suffix__sep { color: var(--text-muted); margin-right: 4px; }
.term-variant-suffix__val { color: var(--text-secondary); font-weight: 400; }

/* 19.5 Item Detail Block (system / service 切換 fade-in) */
.item-detail-block {
  margin-top: var(--space-3);
  background: var(--neutral-50);
  border: 1px solid var(--border-soft);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}
.item-detail-block.is-entering {
  opacity: 0;
  transform: translateY(-8px);
}
.item-detail-block--system {
  background: var(--neutral-50);
}
.item-detail-block--service {
  background: var(--bg-card);
  border-left: 1px solid var(--brand-accent);
  padding-left: calc(var(--space-4) - 1px);
}
.item-detail-block__title {
  font-family: var(--font-eyebrow);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* 19.6 service-items-stats：報價編輯頁品項卡「服務細項」勾選清單（document-edit.vue.html 使用，
 * 不影響金額，僅供內部統計；照 mockups/service-items-stats-mockup-2026-09-27.html A 區 1:1 收編） */
.svc-items-hd { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.svc-items-hd .lbl { font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); }
.svc-items-hd .hint { font-size: var(--fs-xs); color: var(--text-secondary); }
.svc-items-list { display: flex; flex-direction: column; gap: 1px; }
.svc-items-row {
  display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer;
  font-size: var(--fs-sm); color: var(--text-secondary);
}
.svc-items-cb { width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--brand-primary); cursor: pointer; }
.svc-items-name { flex: 1; }
.svc-items-row.is-on .svc-items-name { color: var(--text-primary); font-weight: 600; }
.svc-items-qty {
  width: 72px; text-align: right; font-family: var(--font-mono); font-size: var(--fs-sm);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  padding: 3px 7px; background: var(--bg-card); color: var(--text-primary);
}
.svc-items-qty:focus { outline: none; border-color: var(--brand-accent); }
.svc-items-qty:disabled { background: var(--bg-surface-alt); color: var(--text-muted); border-color: var(--border-soft); }
.svc-items-unit { width: 22px; flex: 0 0 auto; color: var(--text-secondary); font-size: var(--fs-xs); }
.svc-content-sep { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-soft); }

/* =====================================================================
 *  §20 ADMIN PREVIEW (浮水印 + banner + 模擬簽名 modal)
 *  解 UX 衝突點 3：用 neutral-700 + 8% opacity, 不入品牌色
 * ===================================================================== */
.admin-preview-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-deep);
  color: var(--text-on-brand);
  font-family: var(--font-eyebrow);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--brand-accent);
}
.admin-preview-banner__back {
  margin-left: auto;
  color: var(--brand-accent-pale);
  text-decoration: none;
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
  font-size: var(--fs-sm);
  text-transform: none;
}
.admin-preview-banner__back:hover { color: var(--text-on-accent); }

.admin-preview-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-family: var(--font-eyebrow);
  font-size: 96px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--neutral-700);
  opacity: 0.08;
  pointer-events: none;
  user-select: none;
  z-index: 99;
  white-space: nowrap;
}
@media (max-width: 1023px) {
  .admin-preview-banner { font-size: 10px; padding: 6px var(--space-3); }
  .admin-preview-watermark { font-size: 56px; }
}

/* =====================================================================
 *  §21 Terms-Admin (服務條款 CRUD 列表)
 * ===================================================================== */
.terms-admin-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 1024px) {
  .terms-admin-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
.terms-admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.terms-admin-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}
.terms-admin-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}
.terms-admin-card__head h3 {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  margin: 0;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}
.terms-admin-card__refs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  background: var(--neutral-50);
}
.terms-admin-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.terms-admin-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  border-top: 1px dashed var(--border-soft);
  padding-top: var(--space-3);
}
.term-refs-readonly {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-2);
}
.term-refs-readonly .term-chip {
  background: var(--neutral-50);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  cursor: default;
}

/* =====================================================================
 *  §22 Dirty Banner (建單頁未儲存提示) + Share Dialog 客戶預覽連結
 * ===================================================================== */
.dirty-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--neutral-50);
  border-top: 2px solid var(--color-warning);
  box-shadow: 0 -4px 12px rgba(62, 53, 46, 0.08);
  transform: translateY(0);
  transition: transform var(--transition-normal);
}
.dirty-banner.is-hidden { transform: translateY(100%); }
.dirty-banner__icon { color: var(--color-warning); flex-shrink: 0; }
.dirty-banner__text {
  flex: 1;
  font-size: var(--fs-base);
  color: var(--text-primary);
}
.dirty-banner__actions { display: flex; gap: var(--space-2); }
@media (max-width: 1023px) {
  .dirty-banner { padding: var(--space-2) var(--space-3); }
  .dirty-banner__text { font-size: var(--fs-sm); }
}

.share-dialog__divider {
  margin: var(--space-4) 0;
}
.share-dialog__customer-preview {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}
.share-dialog__customer-preview-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-accent);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--fs-base);
}
.share-dialog__customer-preview-link:hover {
  color: var(--brand-accent-dark);
  text-decoration: underline;
}
.share-dialog__customer-preview-link .q-icon {
  font-size: 16px;
  color: var(--brand-accent);
}
.share-dialog__customer-preview-hint {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* =====================================================================
 *  §23 Print mode 對齊 — v1.5 新元件統一隱藏
 * ===================================================================== */
@media print {
  .preview-toc-wrap,
  .preview-toc-mobile-fab,
  .draft-banner,
  .autosave-chip,
  .dirty-banner,
  .admin-preview-banner,
  .admin-preview-watermark,
  .preview-toolbar-actions,
  .terms-admin-card__actions { display: none !important; }
  .section-anchor {
    page-break-after: always;
    margin-bottom: 0;
    scroll-margin-top: 0;
  }
  .section-anchor:last-child { page-break-after: auto; }
  .preview-layout {
    display: block;
    padding: 0;
    max-width: none;
  }
}

/* =====================================================================
 *  §24 共用 sign.html 樣式 — 供 admin 預覽頁重用
 *  原本只在 sign.html <style> 中定義，現提升至共用 theme
 * ===================================================================== */

/* 客戶簽署頁的 a4 區塊：紙感卡片 */
.a4-block {
  background: var(--bg-paper);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
  position: relative;
}
.a4-block--titled {
  padding-top: var(--space-5);
}
.a4-block-title {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* 客戶 Hero — 火焰漸層 (品牌主視覺) */
.customer-hero {
  background: linear-gradient(135deg,
    #B84627 0%,
    #C44E2C 25%,
    #D95D39 50%,
    #E8805E 75%,
    #F49366 100%);
  color: #fff;
  padding: var(--space-7) var(--space-6) var(--space-6);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(184, 70, 39, 0.28);
}
.customer-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.customer-hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 200, 160, 0.12) 35%,
    transparent 65%);
  pointer-events: none;
}
.customer-hero > * { position: relative; z-index: 1; }
.customer-hero .hero-eyebrow {
  font-family: var(--font-eyebrow);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  opacity: 0.92;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.customer-hero .hero-eyebrow::before {
  content: "\2014";
  font-weight: 400;
  letter-spacing: 0;
}
.customer-hero .hero-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
  line-height: 1.25;
}
.customer-hero .hero-subtitle {
  opacity: 0.92;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.customer-hero .hero-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 13px;
}
.customer-hero .hero-meta-label {
  font-family: var(--font-eyebrow);
  opacity: 0.78;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.customer-hero .hero-meta-value {
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.customer-hero .hero-meta-value.mono {
  font-family: var(--font-mono);
}

/* 簽名區塊 — 深棕主視覺 + 火焰紅 pill */
.signature-section {
  background: var(--bg-paper);
  border: 2px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  position: relative;
  box-shadow: 0 4px 16px rgba(62, 53, 46, 0.10);
}
.signature-section::before {
  content: "\8ACB\5728\6B64\7C3D\540D";
  position: absolute;
  top: -12px;
  left: var(--space-5);
  background: var(--brand-accent);
  color: #fff;
  padding: 4px var(--space-4);
  font-family: var(--font-eyebrow);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 12px rgba(184, 70, 39, 0.32);
}
.signature-title {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  letter-spacing: 0.04em;
}

/* mobile-full-system 批 H(8.1):同上,文件預覽／簽署頁專用,600 保留(pdm Q9) */
@media (max-width: 600px) {
  .a4-block { padding: var(--space-4); }
  .customer-hero {
    padding: var(--space-6) var(--space-4) var(--space-4);
  }
  .customer-hero .hero-title { font-size: 24px; }
  .customer-hero .hero-meta { grid-template-columns: 1fr; }
  .signature-section { padding: var(--space-5) var(--space-4); }
}

/* =====================================================================
 *  §22 v1.8 — 條款 checkbox 區
 * ===================================================================== */
.terms-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  border: 1px solid var(--border-default);
  background: var(--bg-soft);
}
.terms-checkbox-list .q-checkbox {
  border-bottom: 1px dashed var(--border-default);
}
.terms-checkbox-list .q-checkbox:last-child {
  border-bottom: none;
}

/* =====================================================================
 *  §23 v1.8 — Documents 列表「制式化資訊」快捷區
 * ===================================================================== */
.preset-shortcut-card {
  background: linear-gradient(135deg, var(--bg-soft) 0%, var(--bg-card) 100%);
  border-color: var(--border-default);
}
.preset-shortcut-btn {
  height: 64px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
/* v2.2 D-91：.preset-shortcut-btn__sub 已移除（簡化按鈕） */

/* =====================================================================
 *  §24 v1.9 — 3 欄簽署 + PROVIDER 圖層疊加（中式合約視覺）
 * ===================================================================== */
.signoff-row {
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-3);
}
.signoff-cell {
  flex: 1;
  min-width: 130px;
  max-width: 200px;
}
.signoff-frame {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  overflow: hidden;
}
.signoff-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.signoff-placeholder {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}
/* PROVIDER 區圖層疊加：手寫簽名（底層）+ 公司大章（上層 multiply 半透明） */
.provider-stamp-layer {
  position: relative;
}
.provider-stamp-layer .provider-signature {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.provider-stamp-layer .provider-stamp {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.85;
  mix-blend-mode: multiply;
}

/* =====================================================================
 *  §25 v2.0 — 範本 PDF Layout（對齊 V1 _ _ Restrained.html 視覺）
 *  紙感報價單版型，雙欄 grid 為主軸
 * ===================================================================== */

/* === 紙張感容器 v2.5 — typography tokens 完整對齊範本 === */
.doc-paper {
  max-width: 794px;
  margin: 24px auto;
  background: #fff;
  color: var(--paper-ink-1);
  padding: 24px 48px 18px 48px;
  box-shadow: 0 4px 24px rgba(74, 64, 54, 0.08);
  border-radius: 4px;
  /* v2.5：範本 body = sans 10.5px / 16.8 / 0.0525 */
  font-family: var(--font-sans);
  font-size: 10.5px;
  line-height: 16.8px;
  letter-spacing: 0.0525px;
}
.doc-paper .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.doc-paper b, .doc-paper strong {
  font-weight: 700;
  color: var(--paper-ink-1);
}

/* === Header：左 brand 右 doc-title === */
.doc-paper .head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--paper-ink-1);
  padding: 0 0 18px 0;
  margin-bottom: 18px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 16.8px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
}
/* v2.37 撤回: 247 line 還原回 .who (用戶 image #17 指示舊版才對),.head-address 規則作廢 */
.doc-paper .head .brand {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 16.8px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
}
.doc-paper .head .brand img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.doc-paper .head .brand .sep {
  width: 1px;
  align-self: stretch;
  background: #C9C0B5;
  margin: 0 4px;
}
/* v2.5 issue 8：.who 容器 = sans 10.5 / 16.275 / ink-2 */
.doc-paper .head .brand .who {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 16.275px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-2);
}
/* v2.5：公司名 <b> = serif 13 / 700 / 20.15 / 0.13 / ink-1 */
.doc-paper .head .brand .who b {
  display: block;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  line-height: 20.15px;
  letter-spacing: 0.13px;
  color: var(--paper-ink-1);
  margin: 0 0 1px 0;
}
.doc-paper .head .doc-title {
  text-align: right;
  flex-shrink: 0;
}
/* v2.5：h1 = serif 28 / 700 / 28 / 5.04 / ink-1 */
.doc-paper .head .doc-title h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 5.04px;
  color: var(--paper-ink-1);
  margin: 0 0 4px 0;
  line-height: 28px;
}
/* v2.5：en-title = Manrope 10 / 400 / 16 / 3.2 / ink-3 / uppercase */
.doc-paper .head .doc-title .en-title {
  font-family: var(--font-en-display);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 3.2px;
  color: var(--paper-ink-3);
  text-transform: uppercase;
}

/* === Meta：3 cell grid === */
.doc-paper .meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  background: transparent;
  margin: 10px 0 0 0;
  padding: 0 0 10px 0;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 16.8px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
}
.doc-paper .meta .cell {
  padding: 0 16px;
}
/* v2.7.2：撤回 mono 改回 sans（範本 inline 確認是 Noto Sans TC，PDM 之前誤判視覺） */
.doc-paper .meta .cell .k {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  line-height: 14.4px;
  letter-spacing: 1.26px;
  color: var(--paper-ink-3);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.doc-paper .meta .cell .v {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 22.4px;
  letter-spacing: 0.28px;
  color: var(--paper-ink-1);
  font-variant-numeric: tabular-nums;
}

/* === Parties：CLIENT + PROVIDER 雙欄 === */
.doc-paper .parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 12px 0 20px 0;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 16.8px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
}
/* v2.37 縮排 r4 (用戶 image #20):Cement inline dump 同時放 padding-bottom:10px + 邏輯屬性 padding-block-end:10px,
 * shorthand !important 在 Chrome 邏輯屬性 cascade 下行為不一致。改成「全 longhand + 全邏輯屬性」雙寫 + !important
 * 雙保險強行覆蓋 inline 值。
 * quote-preview-parties-and-sticky-fixes（2026-09-12，老闆核可 prod 實機套用畫面後拍板）：
 * 上 14／下 30 改為四邊統一 16px。真根因是 3A 的 grid-template-rows Cement 鎖死
 * （root-cause-parties-grid-lock.md），30px 是舊根因判斷下的過度補償，鎖解開後
 * 16px 已足夠（最後一列到框底 16.8px）。八個宣告（4 longhand + 4 邏輯屬性）維持
 * 全部保留且皆帶 !important，理由不變：cleanup.js 是 onMounted 後才跑，初始渲染
 * 那一瞬間仍需要 CSS 保底，不得以「cleanup.js 會清」為由簡化。
 * （註解移到規則外：inline 註解會吃掉 tasks.md 3B.1 驗證行 `grep -A10 ... | grep -c
 * "!important"` 的行數預算，讓它抓不滿 8 個宣告——此為既有 spec 潛在瑕疵，一併修正，
 * 不更動驗證行本身的判準「為 8」。） */
.doc-paper .parties > div {
  background: transparent;
  border: 1px solid #E5DED6;
  padding-top: 16px !important;
  padding-right: 16px !important;
  padding-bottom: 16px !important;
  padding-left: 16px !important;
  padding-block-start: 16px !important;
  padding-block-end: 16px !important;
  padding-inline-start: 16px !important;
  padding-inline-end: 16px !important;
}
/* v2.7.1：.role = mono 9 / 500 / 14.4 / 1.26 / accent (#D95D39) / uppercase（範本等寬字） */
.doc-paper .parties .role {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  line-height: 14.4px;
  letter-spacing: 1.26px;
  color: var(--paper-accent);
  margin: 0 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #E5DED6;
  text-transform: uppercase;
}
/* v2.5：parties dl = grid 64px 1fr / row-gap 4 / column-gap 12 */
/* v2.37 縮排: label 64→48, column-gap 12→8, row-gap 4→2 內縮 ~20px + 行距收緊 */
.doc-paper .parties dl {
  display: grid;
  grid-template-columns: 48px 1fr;
  row-gap: 2px;
  column-gap: 8px;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 10.5px;
  line-height: 16.8px;
  letter-spacing: 0.0525px;
}
/* v2.5：dt = sans 10.5 / 400 / 16.8 / ink-3 */
.doc-paper .parties dt {
  font-weight: 400;
  color: var(--paper-ink-3);
}
/* v2.5：dd = sans 10.5 / 500 / 16.8 / ink-1 */
.doc-paper .parties dd {
  margin: 0;
  font-weight: 500;
  color: var(--paper-ink-1);
}

/* === Section title：01 服務項目明細 === */
/* v2.5：h3.section = serif 12 / 700 / 19.2 / 0.72 / ink-1 */
.doc-paper h3.section {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 19.2px;
  letter-spacing: 0.72px;
  color: var(--paper-ink-1);
  margin: 14px 0 6px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--paper-ink-1);
}
.doc-paper h3.section .num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #B84627;
}

/* === Items table === */
.doc-paper table.items {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  line-height: 16.8px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
}
/* v2.6：thead th = mono 9 / 500 / 14.4 / 1.08 / ink-2 / uppercase / #F4EEE6 底 */
.doc-paper table.items thead th {
  background: #F4EEE6;
  color: var(--paper-ink-2, #6B5D51);
  border-top: 1px solid var(--paper-ink-1, #4A4036);
  border-bottom: 1px solid var(--paper-ink-1, #4A4036);
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-size: 9px;
  font-weight: 500;
  line-height: 14.4px;
  letter-spacing: 1.08px;
  padding: 6px 10px;
  text-align: left;
  text-transform: uppercase;
}
.doc-paper table.items thead th.num,
.doc-paper table.items td.num { text-align: right; font-variant-numeric: tabular-nums; }
.doc-paper table.items thead th:first-child,
.doc-paper table.items td.no { text-align: center; }
.doc-paper table.items col.col-no { width: 50px; }
.doc-paper table.items col.col-qty { width: 70px; }
.doc-paper table.items col.col-unit { width: 60px; }
.doc-paper table.items col.col-price { width: 130px; }
.doc-paper table.items col.col-amt { width: 140px; }
/* v2.5：tbody td = sans 10.5 / 400 / 16.8 / 0.0525 / ink-1 / padding 6 _ 6 _ */
.doc-paper table.items tbody td {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 16.8px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
  padding: 6px 12px;
  border-bottom: 1px solid #E5DDD0;
  vertical-align: top;
}
/* v2.5：td.num = mono 10.5 */
.doc-paper table.items td.num {
  font-family: var(--font-mono);
  font-size: 10.5px;
}
/* v2.5：tr.group td = serif 11 / 700 / 17.6 / 0.88 / ink-1 / padding 5 _ 5 _ */
.doc-paper table.items tr.group td {
  background: #F5EFE5;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 700;
  line-height: 17.6px;
  letter-spacing: 0.88px;
  color: var(--paper-ink-1);
  padding: 5px 12px;
}
.doc-paper table.items tr.group .bar {
  display: inline-block;
  width: 16px;
  height: 1px;
  background: #B84627;
  margin-right: 8px;
  vertical-align: middle;
}
/* v2.5：.item-name = sans 11 / 500 / 17.6 / 0.0525 / ink-1 */
.doc-paper table.items .item-name {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  line-height: 17.6px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
  margin-bottom: 2px;
}
.doc-paper table.items .item-desc {
  color: var(--paper-ink-2);
  font-size: 11.5px;
  line-height: 1.55;
}
.doc-paper table.items .item-details {
  font-size: 11px;
  color: var(--paper-ink-2);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #E5DED6;
  white-space: pre-wrap;
  line-height: 1.55;
}
.doc-paper table.items td.no {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #B84627 !important;
  font-variant-numeric: tabular-nums;
}

/* === v2.2 D-82：Totals + Terms + Bank 合併 4-cell grid === */
.doc-paper .totals-terms-block {
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-rows: auto 1fr;
  column-gap: 16px;
  row-gap: 16px;
  margin-bottom: 24px;
}
.doc-paper .totals-terms-block .terms {
  grid-column: 1;
  grid-row: 1 / 3;
  background: transparent;
  border: none;
  padding: 0 16px 0 0;
  align-self: stretch;
}
/* v2.5 issue 3：.terms h4 / .bank h4 / .block-title 統一 = mono 9 / 500 / 1.44 / uppercase / ink-3 */
.doc-paper .totals-terms-block .terms h4,
.doc-paper .totals-terms-block .bank h4,
.doc-paper .service-details-block .block-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  line-height: inherit;
  letter-spacing: 1.44px;
  color: var(--paper-ink-3);
  text-transform: uppercase;
  margin: 0 0 8px 0;
}
/* v2.5：.terms ol = sans 10 / 400 / 17 / 0.0525 / ink-2 */
.doc-paper .totals-terms-block .terms ol {
  margin: 0;
  padding-left: 20px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 17px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-2);
}
/* v2.5：.terms ol li = same + margin-bottom 3 */
.doc-paper .totals-terms-block .terms ol li {
  margin-bottom: 3px;
}
/* v2.5：.terms ol li b = sans 9.5 / 500 / 15.2 / ink-1 */
.doc-paper .totals-terms-block .terms ol li b {
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 15.2px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
}
.doc-paper .totals-terms-block .sumbox {
  grid-column: 2;
  grid-row: 1;
  background: transparent;
  border: none;
}
/* v2.5：sumbox .row padding 5 0 5 0 */
.doc-paper .totals-terms-block .sumbox .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid #E5DED6;
}
.doc-paper .totals-terms-block .sumbox .row:last-child { border-bottom: none; }
/* v2.5：.row .k = sans 9 / 400 / 14.4 / 1.26 / ink-3 / uppercase */
.doc-paper .totals-terms-block .sumbox .row .k {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  line-height: 14.4px;
  letter-spacing: 1.26px;
  color: var(--paper-ink-3);
  text-transform: uppercase;
}
/* v2.5：.row .v = sans 10.5 / 400 / 16.8 / 0.0525 / ink-1 */
.doc-paper .totals-terms-block .sumbox .row .v {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 16.8px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
  font-variant-numeric: tabular-nums;
}
/* v2.5：.row.grand 保留上下深棕線（v2.3 已對）/ margin 2 0 0 0 / padding 8 0 8 0 / sans 10.5 */
.doc-paper .totals-terms-block .sumbox .row.grand {
  border-top: 2px solid var(--paper-ink-1);
  border-bottom: 2px solid var(--paper-ink-1);
  margin: 2px 0 0 0;
  padding: 8px 0;
  background: transparent;
}
.doc-paper .totals-terms-block .sumbox .row.grand .k {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  line-height: 14.4px;
  letter-spacing: 1.26px;
  color: var(--paper-ink-3);
}
.doc-paper .totals-terms-block .sumbox .row.grand .v {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 16.8px;
  color: var(--paper-ink-1);
}
/* v2.6：bank 背景明確設 --paper，border-left 改 2px（範本實值） */
.doc-paper .totals-terms-block .bank {
  grid-column: 2;
  grid-row: 2;
  background: var(--paper, #FAF6F1);
  border: none;
  border-left: 2px solid var(--terra-500, #D95D39);
  padding: 10px 12px;
  margin: 0;
}
/* .bank h4 已由上方共用 selector 處理 */
/* v2.5 issue 4：.bank dl = grid 60px 1fr / row-gap 4 / column-gap 10 */
.doc-paper .totals-terms-block .bank dl {
  display: grid;
  grid-template-columns: 60px 1fr;
  row-gap: 4px;
  column-gap: 10px;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.0525px;
}
/* v2.5：bank dt = sans 10 / 400 / 16 / ink-3 */
.doc-paper .totals-terms-block .bank dt {
  color: var(--paper-ink-3);
  margin: 0;
}
/* v2.5：bank dd = sans 10 / 400 / 16 / ink-1 */
.doc-paper .totals-terms-block .bank dd {
  margin: 0;
  font-weight: 400;
  color: var(--paper-ink-1);
}
/* v2.5：bank dd.name = sans 10 / 500 / 16 / ink-1 */
.doc-paper .totals-terms-block .bank dd.name {
  font-weight: 500;
  color: var(--paper-ink-1);
}

/* === Signoff：CLIENT + PROVIDER 雙欄 === */
.doc-paper .signoff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
  row-gap: 20px;
  margin: 14px 0 24px 0;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 16.8px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
}
/* v2.5：sigbox padding 8 12 30 12 */
.doc-paper .signoff .sigbox {
  position: relative;
  border: 1px solid #C4B9AE;
  padding: 8px 12px 30px 12px;
  min-height: 160px;
}
/* v2.5：sigbox .role = sans 9 / 400 / 14.4 / 1.26 / ink-3 / uppercase */
.doc-paper .signoff .sigbox .role {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  line-height: 14.4px;
  letter-spacing: 1.26px;
  color: var(--paper-ink-3);
  margin: 0 0 6px 0;
  text-transform: uppercase;
}
/* v2.6 D-111：sigbox .who = serif 18 / 700 / 28.8 / 0.0525 / ink-1（PDM 仲裁用 18px） */
.doc-paper .signoff .sigbox .who {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 28.8px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1, #4A4036);
  margin: 0 0 3px 0;
}
/* v2.6：統編 inline span（sans 13 / 500 / ink-2，與 .who 主體拉開） */
.doc-paper .signoff .sigbox .who .tax-inline {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2, #6B5D51);
  letter-spacing: 0.05px;
  margin-left: 8px;
}
/* v2.5：sigbox .addr = sans 9.5 / 400 / 14.725 / 0.0525 / ink-2 */
.doc-paper .signoff .sigbox .addr {
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 400;
  line-height: 14.725px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-2);
  margin-bottom: 14px;
}
/* v2.5：sigbox .date-line = sans 9 / 400 / 14.4 / 0.36 / ink-3 */
.doc-paper .signoff .sigbox .date-line {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  line-height: 14.4px;
  letter-spacing: 0.36px;
  color: var(--paper-ink-3);
  border-top: 1px dashed #C9C0B5;
  padding-top: 10px;
}
/* v2.5：sigbox .stamp = mono 8.5 / 400 / 13.6 / 1.02 / ink-4 / 46x46 / 1px dashed ink-4 */
.doc-paper .signoff .sigbox .stamp {
  position: absolute;
  bottom: 8px;
  right: 10px;
  width: 46px;
  height: 46px;
  border: 1px dashed var(--paper-ink-4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 400;
  line-height: 13.6px;
  letter-spacing: 1.02px;
  color: var(--paper-ink-4);
  background: transparent;
}
.doc-paper .signoff .sigbox .stamp.has-image {
  border: none;
  background: transparent;
}
.doc-paper .signoff .sigbox .stamp .stamp-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.doc-paper .signoff .sigbox .stamp.layered .stamp-img {
  position: absolute;
  inset: 0;
}
.doc-paper .signoff .sigbox .stamp.layered .stamp-img.signature {
  z-index: 1;
}
.doc-paper .signoff .sigbox .stamp.layered .stamp-img.seal {
  z-index: 2;
  mix-blend-mode: multiply;
  opacity: 0.85;
}

/* === Foot === */
/* v2.5：.foot = mono 8.5 / 400 / 13.6 / 1.02 / ink-4 / uppercase */
.doc-paper .foot {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 400;
  line-height: 13.6px;
  letter-spacing: 1.02px;
  color: var(--paper-ink-4);
  border-top: 1px solid #E5DDD0;
  padding: 6px 0 0 0;
  margin: 8px 0 0 0;
  text-transform: uppercase;
}

/* === 響應式 === */
@media (max-width: 768px) {
  .doc-paper { padding: 20px 18px; }
  .doc-paper .head { flex-direction: column; gap: 20px; }
  .doc-paper .head .doc-title { text-align: left; }
  .doc-paper .head .doc-title h1 { font-size: 22px; letter-spacing: 3px; }
  .doc-paper .meta { grid-template-columns: 1fr; }
  .doc-paper .meta .cell { border-right: none; border-bottom: 1px solid #C9C0B5; }
  .doc-paper .meta .cell:last-child { border-bottom: none; }
  .doc-paper .parties,
  .doc-paper .signoff { grid-template-columns: 1fr; gap: 16px; }
  /* v2.2 D-82: mobile single column fallback */
  .doc-paper .totals-terms-block {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .doc-paper .totals-terms-block .terms { grid-column: 1; grid-row: auto; }
  .doc-paper .totals-terms-block .sumbox { grid-column: 1; grid-row: auto; }
  .doc-paper .totals-terms-block .bank { grid-column: 1; grid-row: auto; }
}

/* === v2.2 D-90：admin 返回按鈕標準樣式 === */
.admin-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  color: var(--brand-primary);
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 4px;
  transition: background var(--transition-fast);
}
.admin-back-btn:hover { background: var(--bg-surface-alt); }

/* =====================================================================
 *  §26 v2.1 — sign.html 簽名區紙感 (doc-paper 同 design language)
 * ===================================================================== */
.sign-area-paper {
  max-width: 820px;
  margin: 24px auto;
  background: #FAF9F5;
  color: #4A4036;
  padding: 36px 48px;
  box-shadow: 0 4px 24px rgba(74, 64, 54, 0.08);
  border-radius: 4px;
  font-family: 'Noto Serif TC', 'PingFang TC', serif;
}
.sign-area-paper h3.section {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 16px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #4A4036;
  letter-spacing: 0.06em;
  color: #2C2620;
}
.sign-area-paper h3.section .num {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #B84627;
}
.sign-area-paper canvas.signature-canvas {
  display: block;
  width: 100%;
  height: 220px;
  border: 1.5px dashed #B84627;
  border-radius: 4px;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}
.sign-area-paper .test-mode-watermark {
  display: inline-block;
  background: #B84627;
  color: #fff;
  padding: 4px 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  border-radius: 2px;
  margin-bottom: 12px;
}
.sign-area-paper .sign-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .sign-area-paper { padding: 20px 18px; }
  .sign-area-paper canvas.signature-canvas { height: 160px; }
}

/* =====================================================================
 *  §27 v2.1 D-81 — 列印 CSS (對齊範本)
 * ===================================================================== */
@media print {
  /* 隱藏 admin / sign 共用 UI */
  .q-header,
  .q-toolbar,
  .preview-toolbar,
  .sign-area-paper,
  .signature-section,
  .sign-back-banner,
  .admin-preview-watermark,
  .preset-shortcut-card,
  .draft-banner,
  .q-banner,
  .q-btn,
  .autosave-chip,
  nav, .nav, .navbar,
  footer.footer-strip,
  .no-print { display: none !important; }

  /* 強制色彩印出（grand row 黑底 / 火焰紅編號） */
  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* v2.2 D-83：Quasar 容器 padding/margin 歸零 */
  /* v2.6 fix：補 .q-pa-md（QA 發現 16px padding 撐高使列印 2 頁） */
  .q-page-container, .q-layout, .q-page,
  .q-pa-md, .q-pa-sm, .q-pa-lg {
    padding: 0 !important;
    margin: 0 !important;
  }
  /* v2.6 fix（Phase D 重驗）：拔 Quasar viewport 高度鎖 + 拔 notifications fixed 容器
   * 根因：Quasar 把 body/html/.q-layout/.q-page 的 height 鎖在 viewport 1700px，
   * 加上 3 個 .q-notifications__list fixed 容器各 1690px，導致 body scrollHeight 撐 A4 第二頁 */
  .q-notifications__list { display: none !important; }
  html, body, .q-layout, .q-page-container, .q-page {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  body, html {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  /* 隱藏 watermark / pseudo 元素 */
  .q-page::before, .q-page::after,
  [class*="watermark"],
  .admin-preview-watermark {
    display: none !important;
  }

  /* doc-paper 列印優化
   * v2.9 fix: transform→zoom，transform 不影響佈局高度導致 5-row 分頁為 2 頁。
   * zoom 會實際縮小佈局盒模型，讓分頁計算正確。 */
  .doc-paper {
    margin: 0 auto !important;
    box-shadow: none !important;
    padding: 24px 32px !important;
    max-width: 100% !important;
    page-break-after: auto;
    font-size: 11px;
    line-height: 1.5;
    /* zoom: 非標準 CSS，Chromium/Safari 14+/Firefox 126+ 支援；老 Firefox 不縮放會列印 2 頁（可接受降級） */
    zoom: 0.85;
  }
  .doc-paper:last-of-type { page-break-after: auto; }
  .doc-paper .head .doc-title h1 { font-size: 26px; }

  /* v2.6 D-115：撤回強制分頁，改 auto（讓隱藏的 terms-fulltext-page 自然消失） */
  .doc-paper + .doc-paper { page-break-before: auto !important; }

  /* v2.6：列印時隱藏 terms 全文頁 + 簽名紀錄 */
  .terms-fulltext-page,
  .signature-record,
  .signature-history { display: none !important; }

  /* 避免區塊跨頁裁切 */
  .doc-paper .signoff,
  .doc-paper .totals-terms-block,
  .doc-paper table.items tr { page-break-inside: avoid; }
}

/* =====================================================================
 *  §28 v2.5 — 服務細項區塊（issue 8 集中顯示 + issue 3 h4 統一）
 * ===================================================================== */
.doc-paper .service-details-block {
  margin: 16px 0 6px 0;   /* v2.37 縮排: bottom 20→6,服務細項 ↔ 報價條款間距減少 14px */
  padding: 14px 16px;
  background: #FAF6F1;
  border-left: 4px solid var(--paper-ink-1);
}
/* .block-title 樣式已由 §25 共用 selector 處理：mono 9 / 500 / 1.44 / ink-3 / uppercase */
.doc-paper .service-details-block .block-title {
  padding-bottom: 6px;
  border-bottom: 1px solid #E5DED6;
}
.doc-paper .service-details-block .detail-row {
  margin-bottom: 10px;
}
.doc-paper .service-details-block .detail-row:last-child { margin-bottom: 0; }
.doc-paper .service-details-block .detail-name {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-weight: 700;
  color: var(--paper-ink-1);
  font-size: 12px;
  margin-bottom: 4px;
}
.doc-paper .service-details-block .detail-no {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #B84627;
  font-size: 11px;
}
.doc-paper .service-details-block .detail-content {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--paper-ink-1);
  white-space: pre-wrap;
  /* service-items-stats D3：24px → 39.45px，對齊 .detail-name 品名文字左緣（.detail-no 固定寬度 39.45px，見 §2.4 #4） */
  padding-left: 39.45px;
}

/* service-items-stats（design D3）：客戶端細項數字列，置於品名與服務內容之間，
 * 只顯示 quantity > 0 者，千分位；由 Vue v-if 整段移除（非 :empty），故無需 :empty 規則。
 * 照 mockups/service-items-stats-mockup-2026-09-27.html C 區 1:1 收編。 */
.doc-paper .service-details-block .detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  column-gap: 16px;
  row-gap: 5px;
  margin: 6px 0 10px;
  padding-left: 39.45px;
}
.doc-paper .service-details-block .detail-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  min-width: 0;
}
.doc-paper .service-details-block .detail-stat-name { color: var(--paper-ink-2); white-space: nowrap; }
.doc-paper .service-details-block .detail-stat-val {
  font-weight: 600;
  color: var(--paper-ink-1);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .doc-paper .service-details-block .detail-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ================================================================
 * v2.7：範本 body paste 結構改動
 * - .sumbox 從 .totals-terms-block 內拉出為獨立區塊
 * - .terms + .bank 改用 .terms-grid 包裹（對齊範本 DOM）
 * - .signoff .who 18px !important 覆蓋範本 inline 12px
 * ================================================================ */

/* v2.7：.sumbox 獨立區塊（不再在 grid 容器內）*/
.doc-paper > .sumbox {
  margin-bottom: 16px;
}
.doc-paper > .sumbox .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid #E5DED6;
}
.doc-paper > .sumbox .row:last-child { border-bottom: none; }
.doc-paper > .sumbox .row .k {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  line-height: 14.4px;
  letter-spacing: 1.26px;
  color: var(--paper-ink-3);
  text-transform: uppercase;
}
.doc-paper > .sumbox .row .v {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 16.8px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
  font-variant-numeric: tabular-nums;
}
.doc-paper > .sumbox .row.grand {
  border-top: 2px solid var(--paper-ink-1);
  border-bottom: 2px solid var(--paper-ink-1);
  margin: 2px 0 0 0;
  padding: 8px 0;
  background: transparent;
}
.doc-paper > .sumbox .row.grand .k {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  line-height: 14.4px;
  letter-spacing: 1.26px;
  color: var(--paper-ink-3);
  text-transform: uppercase;
}
/* v2.7 fix（QA Phase C）：grand .v 是總計金額，範本 20px serif 700 accent-red 醒目大字 */
.doc-paper > .sumbox .row.grand .v {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  letter-spacing: 0.04em;
  color: var(--brand-accent, #B84627);
  font-variant-numeric: tabular-nums;
}

/* v2.7：.terms-grid — 範本結構（.terms + .bank 2-cell grid）*/
.doc-paper .terms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  row-gap: 16px;
  margin-bottom: 24px;
}
.doc-paper .terms-grid .terms {
  grid-column: 1;
  background: transparent;
  border: none;
  padding: 0 16px 0 0;
  align-self: stretch;
}
.doc-paper .terms-grid .terms h4,
.doc-paper .terms-grid .bank h4 {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  line-height: inherit;
  letter-spacing: 1.44px;
  color: var(--paper-ink-3);
  text-transform: uppercase;
  margin: 0 0 8px 0;
}
.doc-paper .terms-grid .terms ol {
  margin: 0;
  padding-left: 20px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 17px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-2);
}
.doc-paper .terms-grid .terms ol li {
  margin-bottom: 3px;
}
.doc-paper .terms-grid .terms ol li b {
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 15.2px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
}
.doc-paper .terms-grid .bank {
  grid-column: 2;
  background: var(--paper, #FAF6F1);
  border: none;
  border-left: 2px solid var(--terra-500, #D95D39);
  padding: 10px 12px;
  margin: 0;
}
.doc-paper .terms-grid .bank dl {
  display: grid;
  grid-template-columns: 60px 1fr;
  row-gap: 4px;
  column-gap: 10px;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.0525px;
}
.doc-paper .terms-grid .bank dt {
  color: var(--paper-ink-3);
  margin: 0;
}
.doc-paper .terms-grid .bank dd {
  margin: 0;
  font-weight: 400;
  color: var(--paper-ink-1);
}
.doc-paper .terms-grid .bank dd.name {
  font-weight: 500;
  color: var(--paper-ink-1);
}

/* v2.7 B-10：.who 18px !important 覆蓋範本 inline 12px（D-111 仲裁保留） */
.doc-paper .signoff .sigbox .who {
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 28.8px !important;
}
.doc-paper .signoff .sigbox .who .tax-inline {
  font-size: 13px !important;
  font-weight: 500 !important;
}

/* v2.7：.terms-grid 響應式 — 被 §29 v2.10 取代，保留向後相容 */
@media (max-width: 768px) {
  .doc-paper .terms-grid {
    grid-template-columns: 1fr;
  }
  .doc-paper .terms-grid .terms { grid-column: 1; }
  .doc-paper .terms-grid .bank { grid-column: 1; }
}

/* === §29 v2.10 LAYOUT GRID REARRANGE — sumbox+bank 搬進 terms-grid 右欄 === */
.doc-paper .terms-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  column-gap: 16px;
  row-gap: 0;
  margin-bottom: 24px;
}
.doc-paper .terms-grid .terms { grid-column: 1; }
.doc-paper .terms-grid .right-stack {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;            /* v2.37 縮排: sumbox ↔ bank 間距 12→4 */
  align-self: start;
}
.doc-paper .terms-grid .right-stack .sumbox {
  margin: 0 !important;     /* 抵銷 v2.9 區塊 B 的 !important */
}
.doc-paper .terms-grid .right-stack .bank { margin: 0; }

/* 響應式：≤768px 收回單欄 */
@media (max-width: 768px) {
  .doc-paper .terms-grid { grid-template-columns: 1fr; }
  .doc-paper .terms-grid .right-stack { grid-column: 1; }
}

/* 列印：縮 right-stack 留 A4 邊 + gap 緊湊 */
@media print {
  .doc-paper .terms-grid {
    grid-template-columns: 1fr 260px !important;
  }
  .doc-paper .terms-grid .right-stack { gap: 4px !important; }  /* v2.37 縮排: print 10→4 */
  .doc-paper .terms-grid .right-stack .sumbox { margin: 0 !important; }
}

/* ================================================================
 * §30 v2.11 — 使用者視覺修復（2026-05-08）
 * 1. grand total no-wrap
 * 2. terms/bank font size 增大
 * 3. terms-grid align-items: start
 * 4. service-details box 視覺清理
 * 5. right-stack 加寬至 300px
 * 6. print 置中
 * ================================================================ */

/* Fix 1: grand total 不換行 */
.doc-paper .sumbox .row.grand .v {
  white-space: nowrap !important;
  font-size: 16px !important;
  line-height: 24px !important;
}

/* Fix 2a: terms 文字放大 */
.doc-paper .terms-grid .terms h4 {
  font-size: 10.5px !important;
  letter-spacing: 1.4px !important;
  margin-bottom: 10px !important;
}
.doc-paper .terms-grid .terms ol {
  font-size: 12px !important;
  line-height: 19px !important;
}
.doc-paper .terms-grid .terms ol li {
  margin-bottom: 2px !important;   /* v2.37 縮排: 5→2,行距收緊 */
}

/* Fix 2b: bank 文字放大 */
.doc-paper .terms-grid .bank h4 {
  font-size: 10.5px !important;
  margin-bottom: 10px !important;
}
.doc-paper .terms-grid .bank dl {
  font-size: 12px !important;
  line-height: 18px !important;
}
.doc-paper .terms-grid .bank dt {
  font-size: 12px !important;
}
.doc-paper .terms-grid .bank dd {
  font-size: 12px !important;
}

/* Fix 3 + Fix 5: terms-grid 垂直對齊 + 加寬 */
.doc-paper .terms-grid {
  align-items: start !important;
  grid-template-columns: 1fr 300px !important;
}
.doc-paper .terms-grid .terms {
  align-self: start !important;
}
.doc-paper .terms-grid .right-stack {
  align-self: start !important;
}

/* Fix 4: service-details-block — 移除 box 外觀 */
.doc-paper .service-details-block {
  background: transparent !important;
  border-left: none !important;
  border-top: 1px solid #E5DED6 !important;
  border-bottom: 1px solid #E5DED6 !important;
  padding: 14px 0 !important;
}

/* Fix 6: print 置中 */
@media print {
  .a4-page {
    margin: 0 auto !important;
  }
  .doc-paper .terms-grid {
    grid-template-columns: 1fr 270px !important;
    align-items: start !important;
  }
  .doc-paper .service-details-block {
    background: transparent !important;
    border-left: none !important;
  }
  .doc-paper .sumbox .row.grand .v {
    white-space: nowrap !important;
    font-size: 16px !important;
  }
}

/* ================================================================
 * v2.18 — section header 統一 + layout 置中 + 視覺收尾
 * SSOT：admin preview（document-preview.vue.html）的 inline <style> 被
 *       index.html 的 vue.html loader 拋棄（只取 <script>），所以
 *       admin preview 的 CSS 唯一生效來源是 theme.css。
 *       客戶簽署頁 sign.html 的 inline <style> 另外同步維護。
 * ================================================================ */

/* 2.1 #1 — 4 處 section header 字型/字色統一（不動底色！）
 *        items thead / SERVICE DETAILS .block-title 保留原米色底（theme.css §15 / v2.12 既有）
 *        terms h4 / bank h4 保持 transparent，只統一字色字型 */
.doc-paper .terms-grid .terms h4,
.doc-paper .terms-grid .bank h4,
.doc-paper .totals-terms-block .terms h4,
.doc-paper .totals-terms-block .bank h4 {
  background: transparent !important;
  color: #6B5D51 !important;
  font-family: var(--font-mono, monospace) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.72px !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid #E5DED6 !important;
  padding: 5px 0 !important;
  margin-bottom: 8px !important;
}

/* 2.2 #2 — bank 帳號下方留白歸零（用戶反饋 2px 仍嫌多） */
.doc-paper .terms-grid .bank,
.doc-paper .totals-terms-block .bank {
  padding-bottom: 0 !important;
}
.doc-paper .terms-grid .bank dl,
.doc-paper .totals-terms-block .bank dl {
  margin-bottom: 0 !important;
}

/* 2.3 #3 — sumbox label/value 字級 11px（總計 .grand 除外） */
.doc-paper .sumbox .row .k,
.doc-paper .sumbox .row .v,
.doc-paper > .sumbox .row .k,
.doc-paper > .sumbox .row .v {
  font-size: 11px !important;
}
.doc-paper .sumbox .row.grand .v,
.doc-paper > .sumbox .row.grand .v {
  font-size: 16px !important;
}

/* 2.4 #4 — detail-row 維持 block（detail-name 在上、detail-content 在下）
 *        detail-name 內 [detail-no][網站代建置服務] 強制 50px 第一欄
 *        對齊上方 items 表結構（col-no 50px + td.no padding-left 10px → 「01」10px 起、文字 50px 起） */
.doc-paper .service-details-block .detail-row {
  display: block !important;
}
.doc-paper .service-details-block .detail-name {
  display: flex !important;
  gap: 0 !important;
  align-items: baseline !important;
  padding-left: 0 !important;
}
.doc-paper .service-details-block .detail-no {
  display: inline-block !important;
  width: 39.45px !important;
  min-width: 39.45px !important;
  box-sizing: border-box !important;
  padding-left: 10px !important;
  text-align: left !important;
  flex-shrink: 0 !important;
}
.doc-paper .service-details-block .detail-content {
  column-count: 2 !important;
  columns: 2 !important;
  column-gap: 24px !important;
  column-fill: balance !important;
  white-space: pre-wrap !important;
}

/* 2.5 #5 — PROVIDER stamp 容器圓圈消除（dashed border + border-radius 50% 全清） */
.doc-paper .signoff .sigbox .stamp,
.doc-paper .signoff .stamp,
.doc-paper .stamp {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
}

/* 2.6 #6 — 合約附件 .a4-block-title 靠左對齊 */
.a4-block-title {
  text-align: left !important;
  justify-content: flex-start !important;
}

/* 2.7 #7 — 第一頁版面水平置中（兩側留白對稱） */
.doc-paper {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 2.8 #8 — 第二頁（合約附件 .a4-block）寬度等同第一頁 .doc-paper */
.a4-block {
  max-width: 800px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* 2.9 print 鏡像 */
@media print {
  .doc-paper .terms-grid .terms h4,
  .doc-paper .terms-grid .bank h4,
  .doc-paper .totals-terms-block .terms h4,
  .doc-paper .totals-terms-block .bank h4 {
    background: transparent !important;
    color: #6B5D51 !important;
    font-family: var(--font-mono, monospace) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.72px !important;
    text-transform: uppercase !important;
    border-bottom: 1px solid #E5DED6 !important;
    padding: 5px 0 !important;
    margin-bottom: 8px !important;
  }
  .doc-paper .terms-grid .bank,
  .doc-paper .totals-terms-block .bank { padding-bottom: 0 !important; }
  .doc-paper .terms-grid .bank dl,
  .doc-paper .totals-terms-block .bank dl { margin-bottom: 0 !important; }
  .doc-paper .sumbox .row .k,
  .doc-paper .sumbox .row .v,
  .doc-paper > .sumbox .row .k,
  .doc-paper > .sumbox .row .v { font-size: 11px !important; }
  .doc-paper .sumbox .row.grand .v,
  .doc-paper > .sumbox .row.grand .v { font-size: 16px !important; }
  .doc-paper .service-details-block .detail-row {
    display: block !important;
  }
  .doc-paper .service-details-block .detail-name {
    display: flex !important;
    gap: 0 !important;
    align-items: baseline !important;
    padding-left: 0 !important;
  }
  .doc-paper .service-details-block .detail-no {
    display: inline-block !important;
    width: 50px !important;
    min-width: 50px !important;
    box-sizing: border-box !important;
    padding-left: 10px !important;
    text-align: left !important;
    flex-shrink: 0 !important;
  }
  .doc-paper .service-details-block .detail-content {
    column-count: 2 !important;
    columns: 2 !important;
    column-gap: 24px !important;
    column-fill: balance !important;
    white-space: pre-wrap !important;
  }
  .doc-paper .signoff .sigbox .stamp,
  .doc-paper .signoff .stamp,
  .doc-paper .stamp {
    border: none !important;
    border-radius: 0 !important;
  }
  .a4-block-title {
    text-align: left !important;
    justify-content: flex-start !important;
  }
  .doc-paper {
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .a4-block {
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ================================================================
 * v2.19 — final visual corrections（image #15 ~ #22）
 * 基準：SERVICE DETAILS .block-title 字體 9px / 500 / 1.44px / mono / uppercase
 *   v2.18 把 terms h4 / bank h4 設 11px/600/0.72px 為錯方向，本版覆蓋
 *   底色維持各自原狀不動（items thead 米色既有 / blockTitle 米色既有 / TERMS / 匯款 透明）
 * ================================================================ */

/* 2.1 #1 — sumbox 3 個金額右邊界對齊 */
.doc-paper .sumbox .row .v,
.doc-paper > .sumbox .row .v,
.doc-paper .sumbox .row.grand .v,
.doc-paper > .sumbox .row.grand .v {
  text-align: right !important;
  margin-left: auto !important;
}

/* 2.2 #2 — 真正要刪的水平線：bank h4 border-bottom（image #23 紅框：穿過 REMITTANCE 字的線）
            .row.grand border-top（sumbox 上方線）保留 */
.doc-paper .terms-grid .bank h4,
.doc-paper .totals-terms-block .bank h4 {
  border-bottom: none !important;
}

/* 2.3b #3 強化 — 強制 bank 不被 grid 拉伸（用戶 EL2026050802 仍 stretch） */
.doc-paper .terms-grid > .bank,
.doc-paper .terms-grid .bank,
.doc-paper .totals-terms-block > .bank {
  align-self: start !important;
  height: fit-content !important;
}

/* 2.4 #4 — 4 處 header **只統一字色**（用戶明示：字本身屬性不動）
 *        其他屬性（fontSize / fontWeight / fontFamily / letter-spacing / text-transform）保留各自原樣 */
.doc-paper table.items thead th,
.doc-paper .service-details-block .block-title,
.doc-paper .terms-grid .terms h4,
.doc-paper .terms-grid .bank h4,
.doc-paper .totals-terms-block .terms h4,
.doc-paper .totals-terms-block .bank h4 {
  color: #6B5D51 !important;
}

/* 2.5 #5 — PROVIDER 驛上創能企業社 字級 13px */
.doc-paper .signoff .sigbox:last-child .who {
  font-size: 13px !important;
}

/* 2.6 #6 — 第一頁版面真置中：縮 doc-paper max-width 讓 auto margin 有空間 */
.doc-paper {
  max-width: 760px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 2.7 #7 — 合約附件 .a4-block-title 靠左強化 */
.a4-block-title {
  text-align: left !important;
  justify-content: flex-start !important;
  align-self: flex-start !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

/* 2.8 #8 — 第二頁 .a4-block 寬度與 doc-paper 同（760px）+ 置中 */
.a4-block {
  max-width: 760px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* 2.9 print 鏡像 */
@media print {
  .doc-paper .sumbox .row .v,
  .doc-paper > .sumbox .row .v {
    text-align: right !important;
    margin-left: auto !important;
  }
  .doc-paper .terms-grid .bank h4,
  .doc-paper .totals-terms-block .bank h4 { border-bottom: none !important; }
  .doc-paper .terms-grid > .bank,
  .doc-paper .terms-grid .bank,
  .doc-paper .totals-terms-block > .bank {
    align-self: start !important;
    height: fit-content !important;
  }
  .doc-paper table.items thead th,
  .doc-paper .service-details-block .block-title,
  .doc-paper .terms-grid .terms h4,
  .doc-paper .terms-grid .bank h4,
  .doc-paper .totals-terms-block .terms h4,
  .doc-paper .totals-terms-block .bank h4 {
    color: #6B5D51 !important;
  }
  .doc-paper .signoff .sigbox:last-child .who { font-size: 13px !important; }
  .doc-paper { max-width: 760px !important; margin-left: auto !important; margin-right: auto !important; }
  .a4-block-title {
    text-align: left !important;
    justify-content: flex-start !important;
    align-self: flex-start !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
  }
  .a4-block {
    max-width: 760px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* v2.19 補丁：bank 內容置中（用戶新需求 image 文字描述） */
.doc-paper .terms-grid .bank h4,
.doc-paper .totals-terms-block .bank h4 {
  text-align: center !important;
}
.doc-paper .terms-grid .bank dl,
.doc-paper .totals-terms-block .bank dl {
  width: fit-content !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
@media print {
  .doc-paper .terms-grid .bank h4,
  .doc-paper .totals-terms-block .bank h4 { text-align: center !important; }
  .doc-paper .terms-grid .bank dl,
  .doc-paper .totals-terms-block .bank dl {
    width: fit-content !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* === v2.19 第三輪 — 撤掉所有「動字本身」的規則（用戶明示僅調字色） === */
/* 移除原 grand .v font-family / letter-spacing override（撤），grand .v 維持 v2.7 既有 serif */

/* Q3 #7 合約附件 .terms-grid 改單欄（命中沒 .bank 的 grid）+ h3.section 緊貼左 */
.doc-paper .terms-grid:not(:has(.bank)) {
  grid-template-columns: 1fr !important;
}
.doc-paper .terms-grid:not(:has(.bank)) > .terms,
.doc-paper .terms-grid:not(:has(.bank)) h3.section {
  padding-left: 0 !important;
  margin-left: 0 !important;
}

@media print {
  .doc-paper .terms-grid:not(:has(.bank)) {
    grid-template-columns: 1fr !important;
  }
  .doc-paper .terms-grid:not(:has(.bank)) > .terms,
  .doc-paper .terms-grid:not(:has(.bank)) h3.section {
    padding-left: 0 !important;
    margin-left: 0 !important;
  }
}

/* === v2.20 第一輪 — 4 項新需求 === */

/* 1. 報價條款 bar 風格一致（撤 .terms grid-column 1/-1 — 跨整行破壞 sumbox/bank 並排 layout） */
.doc-paper .terms-grid .terms h4 {
  background: #F4EEE6 !important;
  padding: 5px 8px !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* 2. sumbox NT$ 38,000 / NT$ 1,900 向左移 0.5px（用戶試水溫值） */
.doc-paper .sumbox .row:not(.grand) .v,
.doc-paper > .sumbox .row:not(.grand) .v {
  padding-right: 0.5px !important;
}

/* 3. 匯款資訊內容上下置中（撤 v2.19 align-self:start，讓 bank stretch 高度，內容才有空間置中） */
.doc-paper .terms-grid > .bank,
.doc-paper .terms-grid .bank,
.doc-paper .totals-terms-block > .bank {
  align-self: stretch !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

/* 4. 合約附件 h3.section ::before 「02」序號移除 + 緊貼 padding 左緣 */
.doc-paper > h3.section::before {
  content: none !important;
  display: none !important;
}
.doc-paper > h3.section {
  padding-left: 0 !important;
  margin-left: 0 !important;
  text-indent: 0 !important;
}

@media print {
  .doc-paper .terms-grid .terms h4 {
    background: #F4EEE6 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    padding: 5px 8px !important;
  }
  .doc-paper .sumbox .row:not(.grand) .v,
  .doc-paper > .sumbox .row:not(.grand) .v { padding-right: 0.5px !important; }
  .doc-paper .terms-grid .bank,
  .doc-paper .totals-terms-block .bank {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }
  .doc-paper > h3.section::before { content: none !important; display: none !important; }
  .doc-paper > h3.section { padding-left: 0 !important; margin-left: 0 !important; text-indent: 0 !important; }
}

/* === v2.20 第二輪強化 === */
/* #1 強化 specificity 強蓋 v2.18 transparent + padding 5px 0 */
/* v2.37: 加 line-height: 1.4 + display: flex + align-items: center 讓文字與底色垂直置中 */
html body .doc-paper .terms-grid .terms h4 {
  background: #F4EEE6 !important;
  padding: 5px 8px !important;
  line-height: 1.4 !important;
  display: flex !important;
  align-items: center !important;
}

/* #3 bank 上下置中：用 padding 撐空間（.terms 跨整行後 bank 在獨立 row 高度=內容高，stretch 無空間，改用 padding 模擬置中視覺） */
html body .doc-paper .terms-grid .bank,
html body .doc-paper .totals-terms-block .bank {
  padding-top: 24px !important;
  padding-bottom: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

@media print {
  html body .doc-paper .terms-grid .terms h4 {
    background: #F4EEE6 !important;
    padding: 5px 8px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  html body .doc-paper .terms-grid .bank,
  html body .doc-paper .totals-terms-block .bank {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }
}

/* === v2.20 第三輪 === */
/* #2 sumbox 38000/1900 往左 3px（evaluate 字像素差 3px） */
html body .doc-paper .sumbox .row:not(.grand) .v,
html body .doc-paper > .sumbox .row:not(.grand) .v {
  padding-right: 3px !important;
}

/* #3 匯款內容靠左（撤 h4 center / dl margin auto），保留 padding 24/24 + 垂直置中 */
html body .doc-paper .terms-grid .bank h4,
html body .doc-paper .totals-terms-block .bank h4 {
  text-align: left !important;
}
html body .doc-paper .terms-grid .bank dl,
html body .doc-paper .totals-terms-block .bank dl {
  width: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* #4 合約附件 h3.section outdent -48px，突破 doc-paper paddingLeft 貼齊邊緣 */
html body .doc-paper > h3.section {
  margin-left: -24px !important;
  padding-left: 0 !important;
}

@media print {
  html body .doc-paper .sumbox .row:not(.grand) .v,
  html body .doc-paper > .sumbox .row:not(.grand) .v { padding-right: 3px !important; }
  html body .doc-paper .terms-grid .bank h4,
  html body .doc-paper .totals-terms-block .bank h4 { text-align: left !important; }
  html body .doc-paper .terms-grid .bank dl,
  html body .doc-paper .totals-terms-block .bank dl {
    width: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  html body .doc-paper > h3.section {
    margin-left: -24px !important;
    padding-left: 0 !important;
  }
}

/* === v2.20 第四輪：sumbox padding 改 margin（padding 對 flex margin-left:auto 的 .v 沒推效） === */
html body .doc-paper .sumbox .row:not(.grand) .v,
html body .doc-paper > .sumbox .row:not(.grand) .v {
  padding-right: 0 !important;
  margin-right: 3px !important;
}
@media print {
  html body .doc-paper .sumbox .row:not(.grand) .v,
  html body .doc-paper > .sumbox .row:not(.grand) .v {
    padding-right: 0 !important;
    margin-right: 3px !important;
  }
}

/* === v2.20 第五輪 === */
/* #1 bank 上下留白縮 24 → 8 */
html body .doc-paper .terms-grid .bank,
html body .doc-paper .totals-terms-block .bank {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

/* #2 合約附件 h3.section 撤 outdent，回到 doc-paper padding 內（標題對齊水平線位置） */
html body .doc-paper > h3.section {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

@media print {
  html body .doc-paper .terms-grid .bank,
  html body .doc-paper .totals-terms-block .bank {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }
  html body .doc-paper > h3.section {
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
}

/* === v2.20 第六輪：合約附件字對齊注意事項字（差 13px） === */
html body .doc-paper > h3.section {
  padding-left: 0 !important;
}
@media print {
  html body .doc-paper > h3.section {
    padding-left: 0 !important;
  }
}

/* === v2.20 第七輪：合約附件加紅 bar（同注意事項風格） === */
html body .doc-paper > h3.section {
  border-left: 3px solid rgb(184, 70, 39) !important;
  padding-left: 10px !important;
}
@media print {
  html body .doc-paper > h3.section {
    border-left: 3px solid rgb(184, 70, 39) !important;
    padding-left: 10px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* === v2.20 第八輪：合約附件標題與水平線解綁 === */
/* 撤 h3.section 的 border-bottom（水平線從 h3 拆出） */
html body .doc-paper > h3.section {
  border-bottom: none !important;
}
/* 水平線改放在 h3 之後第一個元素（注意事項 div）的 top（保留水平線在原 left=308 位置） */
html body .doc-paper > h3.section + div {
  border-top: 1px solid #E5DED6 !important;
  padding-top: 12px !important;
  margin-top: 0 !important;
}

@media print {
  html body .doc-paper > h3.section { border-bottom: none !important; }
  html body .doc-paper > h3.section + div {
    border-top: 1px solid #E5DED6 !important;
    padding-top: 12px !important;
    margin-top: 0 !important;
  }
}

/* === v2.20 第九輪：合約附件標題 outdent -48px（用戶選 C 貼齊 doc-paper 邊） === */
html body .doc-paper > h3.section {
  margin-left: -24px !important;
}
@media print {
  html body .doc-paper > h3.section {
    margin-left: -24px !important;
  }
}

/* === v2.20 第十輪：撤掉合約附件 h3.section 的紅 bar（用戶不要） === */
html body .doc-paper > h3.section {
  border-left: none !important;
  padding-left: 0 !important;
}
@media print {
  html body .doc-paper > h3.section {
    border-left: none !important;
    padding-left: 0 !important;
  }
}

/* v2.20 final 補丁：grand .v 改 mono 對齊 subtotal/tax 字 metrics（image #38-41 sumbox 3px 差） */
html body .doc-paper .sumbox .row.grand .v,
html body .doc-paper > .sumbox .row.grand .v {
  font-family: var(--font-mono, monospace) !important;
  letter-spacing: 0.0525px !important;
}
@media print {
  html body .doc-paper .sumbox .row.grand .v,
  html body .doc-paper > .sumbox .row.grand .v {
    font-family: var(--font-mono, monospace) !important;
    letter-spacing: 0.0525px !important;
  }
}

/* v2.20 final 補丁 2：grand .v 也 margin-right 3px（跟 subtotal/tax 一致對齊） */
html body .doc-paper .sumbox .row.grand .v,
html body .doc-paper > .sumbox .row.grand .v {
  margin-right: 3px !important;
}
@media print {
  html body .doc-paper .sumbox .row.grand .v,
  html body .doc-paper > .sumbox .row.grand .v {
    margin-right: 3px !important;
  }
}

/* v2.20 final 補丁 3：viewport < 800px 環境（用戶 790）下 doc-paper 沒置中 → 強制 viewport-aware center */
html body .doc-paper {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: min(760px, calc(100vw - 16px)) !important;
}
html body main.q-page > .q-pa-md,
html body .q-page > .q-pa-md {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: min(800px, 100vw) !important;
}

@media print {
  html body .doc-paper {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 760px !important;
  }
}

/* v2.20 final 補丁 4：scrollbar 占用導致 layout 不對稱 → 兩側預留 scrollbar 空間 */
html {
  scrollbar-gutter: stable both-edges !important;
}

/* === v2.21 真.viewport 中央置中 — scrollbar 跨瀏覽器補償 ===
 * 原因：scrollbar-gutter: stable both-edges 在部分 Chromium 版本 fallback 為 stable，
 *      只在右邊預留 scrollbar 寬，導致 doc-paper margin auto 後左右不對稱（左邊比右邊寬 ~8px）。
 * 修法：強制 html overflow-y:scroll 永遠顯示 scrollbar 預留位，並用 padding-left = (100vw - 100%)
 *      把 scrollbar 寬度補償在 q-page-container 左側，內容左右對稱於 viewport。
 *      用 :has(.doc-paper) 限制 scope，只 preview 頁套用，不影響其他列表/dashboard 頁面。
 */
html {
  overflow-y: scroll !important;
  scrollbar-gutter: auto !important;
}
.q-page-container:has(.doc-paper) {
  padding-left: calc(100vw - 100%) !important;
  box-sizing: border-box !important;
}

/* =====================================================================
 *  §N 捲動讓位契約（scroll contract）— openspec change `scroll-contract-v1` / L2
 *
 *  q-header 是 position:fixed → 脫離文檔流。Quasar 只做了「layout 讓位」
 *  （q-page-container 的 padding-top），那**只保證不捲的時候**不被蓋。
 *
 *  瀏覽器的捲動對齊演算法（scrollIntoView / focus 自動捲動 / find-in-page / 錨點）
 *  完全不知道 fixed header 存在，會把目標對齊到 scrollport 頂端 y=0 —— 而 y=0
 *  正是 header 佔據的那條帶。實測（未修 prod，A/B/G/H 四個 case）：目標 top 被精準
 *  對齊到 0，gap = -58（開橫幅時 -86），大標整個被吃掉。
 *
 *  scroll-padding-top 是平台**唯一**的告知機制。本系統過去從沒設過
 *  （computed 值一直是 auto）——這是同一個 bug 復發三次的根因。
 *
 *  :has(.q-header) 的作用：把契約限定在「真的有 app chrome」的頁面。
 *    - 公開頁（客戶問卷 / 簽署頁，index.html:89 明載「無 drawer/header」）沒有
 *      q-header，若無條件套用會給一個不存在的 header 讓位 → 反而製造新 bug。
 *    - 不支援 :has() 的舊瀏覽器整條規則失效 → 退回今天的行為，不會更糟。
 *
 *  12px = --space-3，捲停時大標與 chrome 底線的呼吸間距（uiux-designer 規格）。
 *  --app-header-bottom 由 frontend/shared/app-metrics.js 實測寫入；58px 是它掛掉
 *  時的 fallback（等於今天的 layout 讓位值，純增益、不成為新的單點失效）。
 *
 *  2026-09-12（openspec change `sticky-page-head` design D4）：加入
 *  --app-sticky-head-h。大標停駐後就是新的最低一層固定 chrome，這條鐵律 3
 *  （scrollport 頂緣被覆蓋就要補讓位）同樣適用在它身上——不補的話，
 *  scrollIntoView / focus 自動捲動的目標會落在停駐大標底下，等於把這個修好
 *  三次的 bug 換個形狀復發。--app-sticky-head-h 由 app-metrics.js 實測「目前
 *  頁面實際停駐的大標」高度寫入；沒有停駐大標的頁面該變數不存在，fallback 0px
 *  → 行為與今天完全相同，純增益、不是新的單點失效。
 * ===================================================================== */
html:has(.q-header) {
  scroll-padding-top: calc(var(--app-header-bottom, 58px) + var(--app-sticky-head-h, 0px) + 12px);
}

/* === v2.22 doc-paper 內部左右對稱 — Cement Studio inline width:698 補償 ===
 * 真兇：Cement Studio 匯出 .head/.meta/.parties/.items/.terms-grid/.signoff/.foot 時，
 *      把當時的 computed style dump 到 inline style，包含 width:698px hardcode。
 *      後續 doc-paper padding 改 48/48 → content area = 664 → 子元素 overflow padding-right 34px。
 *      用戶肉眼 leftFromDoc=48 / rightFromDoc=14 不對稱（左寬右窄）。
 * 修法：doc-paper padding-left/right 改 31/31，content area = 760-62 = 698 = 子元素 width，
 *      左右各 31px 留白真對稱。padding-top/bottom 保留 24/18。 */
html body .doc-paper {
  padding-left: 31px !important;
  padding-right: 31px !important;
}

@media print {
  html { overflow-y: visible !important; }
  .q-page-container:has(.doc-paper) { padding-left: 0 !important; }
  html body .doc-paper {
    padding-left: 31px !important;
    padding-right: 31px !important;
  }
}

/* === v2.24 doc-paper 內部垂直間距收斂 — 三處 horizontal gap 24/20/18 → 12 ===
 * 真兇：Cement Studio 匯出時 inline style hardcode .head/.parties/.terms-grid 的
 *      margin-bottom（18~24px）+ .meta/.items/.signoff 的 margin-top（10~14px），
 *      累加後 gap 達 18~24px，視覺上頁面留白過多。
 * 修：
 *   (1) `.doc-paper > .head/.parties/.terms-grid` margin-bottom: 12px !important
 *   (2) `.doc-paper > .meta/.items/.signoff` margin-top: 0 !important
 *   結果 gap = 12 + 0 = 12px ± 1（瀏覽器 fractional 容差）
 * 不動：
 *   - doc-paper 自己 padding（v2.22 的 24/31/18/31 保留）
 *   - 子元素 leftFromDoc/rightFromDoc（v2.22 對稱 31/31 保留）
 *   - 子元素內部 padding（.meta cell 高度等）
 *   - .items table row 間距 */
html body .doc-paper > .head { margin-bottom: 12px !important; }
html body .doc-paper > .parties { margin-bottom: 12px !important; }
html body .doc-paper > .terms-grid { margin-bottom: 12px !important; }
html body .doc-paper > .meta { margin-top: 0 !important; }
html body .doc-paper > .items { margin-top: 0 !important; }
html body .doc-paper > .signoff { margin-top: 0 !important; }

@media print {
  html body .doc-paper > .head { margin-bottom: 12px !important; }
  html body .doc-paper > .parties { margin-bottom: 12px !important; }
  html body .doc-paper > .terms-grid { margin-bottom: 12px !important; }
  html body .doc-paper > .meta { margin-top: 0 !important; }
  html body .doc-paper > .items { margin-top: 0 !important; }
  html body .doc-paper > .signoff { margin-top: 0 !important; }
}

/* === v2.25 admin SPA dashboard 容器寬度放寬到 1400px ===
 * 用戶反饋（image #60）：admin dashboard 系列頁面（列表 / 項目庫 / 服務條款 / 系統設定）
 *   內容塞在 viewport 中央 800px 區域，浪費螢幕。
 * 根因（CDP 驗證 baseline-v225-before.json）：
 *   - q-page-container 本來就 fill viewport（1920），不是它太窄
 *   - 真兇是 v2.20 final 補丁 3 (line 3722) 鎖死 `.q-page > .q-pa-md` max-width: min(800px, 100vw)
 *     這條原本給 preview 頁兜底（preview 頁 wrapper 是 `<div class="q-pa-md" style="max-width:800px">`，
 *     有 inline style 800，這條 CSS 是同步）
 *   - 但 dashboard 頁的 wrapper 也是 `.q-pa-md.page-wrap`，被誤套
 * 修法（雙層）：
 *   (1) q-page-container（無 .doc-paper 的 dashboard 頁）max-width 1400 + margin auto
 *       — 滿足 spec D1 字面 + 提供視覺對稱中軸
 *   (2) .q-pa-md.page-wrap（dashboard 內層 wrapper，dashboard SPA 各 admin 頁都有此 class）
 *       max-width 1400 — 真正放寬內容區（v2.20 補丁 3 不動，留給沒 .page-wrap class 的 preview wrapper）
 * 不影響 preview 頁：
 *   - preview wrapper 是 `<div class="q-pa-md" style="max-width:800px">`，沒 `.page-wrap` class，
 *     不被 (2) 套用；同時 preview 頁 q-page-container `:has(.doc-paper)` 也不被 (1) 套用
 *   - v2.22 doc-paper 760 + 子元素 31/31 對稱完整保留
 * v2.28（ux-batch-discard-upload-fullwidth）：1400px 上限取消，dashboard 改滿版流式
 *   （用戶要求四大頁面版面做滿＋自適應）。max-width:none 仍需 !important 壓過
 *   v2.20 補丁 3 的 min(800px, 100vw)；:has(.doc-paper) 排除照舊，preview 頁不受影響；
 *   內距沿用 .q-pa-md 不變。 */
html body .q-page-container:not(:has(.doc-paper)) {
  max-width: none !important;
}
html body main.q-page > .q-pa-md.page-wrap,
html body .q-page > .q-pa-md.page-wrap {
  max-width: none !important;
}

/* === v2.27 signoff 兩 sigbox 等高（grid stretch 強制） ===
 * 用戶反饋（image #62 / #63）：.signoff 內「業主簽章 CLIENT」與「立約人 PROVIDER」
 *   兩 sigbox 不等高（PROVIDER 比 CLIENT 高 ~40px），原因是 PROVIDER 內容多
 *   （公司名+統編+地址+stamp 4-5 行）vs CLIENT 內容少（標題+dotted line+回傳日期 3 行）。
 * 根因：
 *   .signoff 用 `display: grid; grid-template-columns: 339px 339px`，
 *   預設 grid `align-items: normal`（≈stretch）理論上兩格應自動等高，
 *   但 Cement Studio inline style hardcode `height: 97.3px` 在 sigbox 上凍結
 *   兩格各自取 content height（stamp 撐高後 content height 不一），stretch 失效。
 * 修法（雙保險）：
 *   (1) `.signoff { grid-auto-rows: 1fr }` 強制 grid row 等高
 *   (2) `.signoff > .sigbox { align-self: stretch + height: auto !important }`
 *       覆蓋 inline `height: 97.3px` 讓 grid stretch 生效
 *   (3) min-height: 78px 保留（v2.22 既有，避免極短時擠在一起）
 * 不影響 stamp absolute（脫離 normal flow）、不破 v2.22 對稱、不破 v2.23/24/25。 */
html body .doc-paper .signoff {
  grid-auto-rows: 1fr !important;
}
html body .doc-paper .signoff > .sigbox {
  align-self: stretch !important;
  height: auto !important;
}
@media print {
  html body .doc-paper .signoff {
    grid-auto-rows: 1fr !important;
  }
  html body .doc-paper .signoff > .sigbox {
    align-self: stretch !important;
    height: auto !important;
  }
}

/* === v2.28 PROVIDER 大小章 horizontal 並排（image #64）===
 * 用戶反饋：PROVIDER 區大小章原為 vertical 上下疊放（v2.5 .stamp flex-direction:column），
 *   小章撐高容器、大章溢出視覺擁擠。改 horizontal row 左右並排（左小右大），
 *   兩枚章同列可見、品牌呈現更平衡。
 * 既有 baseline (v2.27)：
 *   .stamp position:absolute / width:46px / height:46px / right:10 / bottom:8 / flex-direction:column
 *   vue.html 內 stamp 已含兩 img（小章 base64 36x36 + 大章 stampBigSrc 46x46，src 不同）
 *   sign.html 內 stamp 僅 1 img（大章），horizontal 規則套用無視覺影響，保留為一致性
 * 修法：
 *   (1) .stamp 容器：display:flex / flex-direction:row / align-items:flex-end / gap:8px
 *   (2) .stamp width / height 改 auto（從 46x46 鎖死解除），讓容器自然包覆兩 img
 *       靠 right:10 / bottom:8 維持貼 PROVIDER 右下角（v2.5 規則繼續生效）
 *   (3) 第一個 img（小章）height:30px / 第二個 img（大章）height:46px
 *       width:auto 讓比例自由，object-fit:contain
 *   (4) 蓋掉舊 .stamp-small-img width/height:36px 規則（vue.html inline style 用了該 class）
 * 不影響：
 *   - v2.22 對稱 31/31（doc-paper padding 不動）
 *   - v2.23 inline cleanup（.stamp 內 inline style 仍由 cleanup script 處理）
 *   - v2.24 三處 12px 間距（signoff margin-top:0 不動）
 *   - v2.25 dashboard 1400 / preview 760（doc-paper width 不動）
 *   - v2.26 navbar 強化（不同 scope）
 *   - v2.27 sigbox 等高（grid stretch + height auto，stamp absolute 脫離 normal flow 不撐高 sigbox）
 *   - CLIENT 區 stamp display:none 行為（sign.html 未簽前）
 * 用 html body 提升 specificity 蓋過 inline style 與 v2.5 既有 column rules。 */
html body .doc-paper .signoff .sigbox .stamp {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  width: auto !important;
  height: auto !important;
  left: auto !important;
}
html body .doc-paper .signoff .sigbox .stamp > img {
  width: auto !important;
  object-fit: contain !important;
}
html body .doc-paper .signoff .sigbox .stamp > img:first-child {
  height: 30px !important;
}
html body .doc-paper .signoff .sigbox .stamp > img:last-child {
  height: 46px !important;
}
/* 蓋掉 vue.html 內 .stamp-small-img 的 36px hardcode 規則 */
html body .doc-paper .signoff .sigbox .stamp > img.stamp-small-img {
  width: auto !important;
  height: 30px !important;
}
@media print {
  html body .doc-paper .signoff .sigbox .stamp {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    width: auto !important;
    height: auto !important;
    left: auto !important;
  }
  html body .doc-paper .signoff .sigbox .stamp > img {
    width: auto !important;
    object-fit: contain !important;
  }
  html body .doc-paper .signoff .sigbox .stamp > img:first-child {
    height: 30px !important;
  }
  html body .doc-paper .signoff .sigbox .stamp > img:last-child {
    height: 46px !important;
  }
  html body .doc-paper .signoff .sigbox .stamp > img.stamp-small-img {
    width: auto !important;
    height: 30px !important;
  }
}

/* === v2.26 admin navbar 強化（image #61）===
 * 用戶反饋：admin SPA 上方深褐色 header bar 「沒什麼用」，logo 不夠醒目。
 * 強化：
 *   (1) `.q-header.bg-primary` min-height: 56px（從 52）容納放大後的 logo
 *   (2) `.nav-logo` height: 32 → 40px（+25%，視覺對比明顯）
 *   (3) `.nav-tag` fontSize 11 → 16px / fontWeight 500 → 600 / letter-spacing 0.18em → 1.5px
 *       — 「Quotation System」副標加粗強化，平衡 logo 放大後的視覺密度
 *   (4) `.nav-divider` fontSize 21 → 16px / opacity 0.4 → 0.6 / margin 0 4px → 0 12px
 *       — 與放大後的 logo + 加粗的 nav-tag 視覺呼吸一致
 * Scope：
 *   - 用 `.q-header.bg-primary` 限定，避免影響 document-preview.vue.html 內部
 *     sticky admin toolbar（無 .bg-primary，bg=var(--bg-card)）
 *   - 不改 bg-primary 配色（保持 ink-900 深褐，D3 決策）
 *   - 桌面 menu (.gt-sm) 不動字級，由放大後容器自動置中
 * 同時連動：
 *   - sign.html 客戶頁 navbar 視覺也跟著強化（品牌一致），但 .doc-paper 31/31
 *     對稱與 signoff 兩 sigbox 等高（v2.22/v2.27）完全不受影響（不同 scope）。
 * 前置 fix（不在 spec 內但不修無法達成 v2.26）：
 *   - frontend/index.html line 39, 50, 52-56 的 `<q-btn .../>` self-closing
 *     在 Vue compile + HTML parser 邊界產生 sibling-eating 副作用，導致整個
 *     navbar 內容（logo / nav-tag / 桌面 menu / user dropdown）全被吞進
 *     mobile menu button DOM 內、看不見。改成 `<q-btn ...></q-btn>` explicit
 *     close 後 navbar 才能正確渲染（v2.26 強化的視覺前提）。 */
html body .q-header.bg-primary { min-height: 56px !important; }
html body .q-header.bg-primary .q-toolbar { min-height: 56px !important; }
html body .q-header.bg-primary .nav-logo,
html body .q-header.bg-primary .app-brand-title .nav-logo {
  height: 40px !important;
  width: auto !important;
}
html body .q-header.bg-primary .nav-tag,
html body .q-header.bg-primary .app-brand-title .nav-tag {
  font-size: 16px !important;
  font-weight: 600 !important;
  letter-spacing: 1.5px !important;
}
html body .q-header.bg-primary .nav-divider,
html body .q-header.bg-primary .app-brand-title .nav-divider {
  font-size: 16px !important;
  opacity: 0.6 !important;
  margin: 0 12px !important;
}
/* (5) toolbar-title 不要 ellipsis 把 brand-title 切掉。
 * Quasar 預設 q-toolbar-title `flex: 1 1 0%` 會在 menu 多時被壓縮、
 * 配合 .ellipsis 切掉 nav-tag。v2.26 加大 nav-tag (16px+600+1.5px) 後
 * brand 寬度 ~362px，需要 toolbar-title 顯示完整：
 *   - flex-shrink: 0 → 不壓縮自己（保住 nav-tag 寬度）
 *   - flex-basis: auto → 寬度 = content（不靠 grow 撐開）
 *   - flex-grow: 0 → 不再吃多餘空間（避免 menu 被 push 出右邊）
 *   - overflow visible / text-overflow clip → 完全 disable ellipsis
 * 配合 q-toolbar 既有 `display:flex` + 後面 .gt-sm + dropdown 自動排列，
 * brand-title 之後 .gt-sm menu 可用 margin-left:auto 推到右側（既有 q-space？無）— 改用 q-toolbar gap 補空隙 */
html body .q-header.bg-primary .q-toolbar__title,
html body .q-header.bg-primary .q-toolbar-title {
  flex: 0 0 auto !important;
  overflow: visible !important;
  text-overflow: clip !important;
  width: auto !important;
}
html body .q-header.bg-primary .app-brand-title {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}
/* .gt-sm 桌面 menu 推到右側 + 強制 flex row 不換行（既有 inline-block 預設會 wrap）*/
html body .q-header.bg-primary > .q-toolbar > .gt-sm {
  margin-left: auto !important;
  display: flex !important;
  flex: 0 0 auto !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  align-items: center !important;
}
/* 桌面 menu 內 q-btn 縮小水平 padding（從 16 → 10）讓 6 button 在 1280-1440 都 fit */
html body .q-header.bg-primary > .q-toolbar > .gt-sm > .q-btn {
  padding-left: 10px !important;
  padding-right: 10px !important;
  flex-shrink: 0 !important;
}
/* dropdown 在 menu 之後，flex-shrink:0 確保 menu 不擠它 */
html body .q-header.bg-primary > .q-toolbar > .q-btn-dropdown {
  flex-shrink: 0 !important;
}
/* viewport < 1440 時，dropdown 隱藏 displayName + ADMIN chip（保 avatar + chevron）
 * 避免 brand+menu+dropdown 加總超過 toolbar width 視覺溢出。
 * 1024-1280-1440 區段：縮 dropdown，1440+ 完整顯示。 */
@media (max-width: 1439px) {
  html body .q-header.bg-primary > .q-toolbar > .q-btn-dropdown .q-btn__content > span.gt-xs,
  html body .q-header.bg-primary > .q-toolbar > .q-btn-dropdown .q-btn__content > .role-chip {
    display: none !important;
  }
}

@media print {
  /* 列印時 navbar 隱藏（既有 .no-print 行為），不必特別覆蓋 v2.26 規則 */
}

/* v2.20 final 補丁 5（已撤回 — 破壞 admin toolbar） */

/* === v2.29 admin SPA sub-toolbar sticky 修正（image #66）===
 * 用戶反饋：admin SPA preview 頁滾動時頂部 toolbar（返回列表/遞交/作廢/列印/客戶視角預覽）
 *   消失，希望 sticky 固定。
 *
 * 結構診斷（baseline scrollY=800）：
 *   - 全域 navbar：.q-header.bg-primary（index.html，position:fixed top:0 height:58px）— 已 sticky OK
 *   - sub-toolbar：document-preview.vue.html 內 .q-header.preview-sub-toolbar（含 q-layout__section--marginal fixed-top class）
 *     原 inline 設 position:sticky / top:0 — 導致 scroll 時 top:0 與 navbar 重疊（兩者都搶 viewport top:0）
 *
 * 修法：
 *   (1) 移除 inline position:sticky/top:0（已在 vue.html 改）
 *   (2) CSS 改 sticky top:58px（navbar 高度），讓 sub-toolbar 貼在 navbar 之下
 *   (3) z-index:100 維持原值（< navbar 的 quasar 預設 z-index 6000，但 sub-toolbar 在 navbar 之下不衝突）
 *   (4) Quasar fixed-top class 預設 position:fixed/top:0 — 用 html body 提升 specificity 蓋過
 *
 * 不影響：
 *   - q-header.bg-primary navbar（v2.26 規則維持）
 *   - doc-paper 內容（v2.22 對稱、v2.27 sigbox、v2.28 stamp 都不在 sub-toolbar scope）
 *   - sign.html 客戶頁（無 .preview-sub-toolbar class）
 *   - dashboard / list / settings 等其他 admin route（無此 sub-toolbar） */
/* 2026-09-13 `preview-subtoolbar-not-qheader`：元素已從 <q-header> 改為 <div>
   （理由見 document-preview.vue.html 該處註解：q-header 會洗掉主 layout 的 header
   狀態，導致回列表後側欄與內容區失去讓位）。選擇器同步拿掉 .q-header；
   !important 也退場——那幾個 !important 原本是為了打贏 Quasar 對 .q-header 套的
   fixed-top（position:fixed; top:0），現在沒有那個對手了。 */
html body .preview-sub-toolbar {
  position: -webkit-sticky;
  position: sticky;
  /* layout-metrics-cleanup:讓位接量測 SSOT --app-header-bottom(已內含橫幅,不得再加
     --app-banner-h,會雙重加總)。SSOT 掛掉退 58px + 橫幅 CSS 變數 = 今日行為(純增益)。 */
  top: var(--app-header-bottom, calc(58px + var(--app-banner-h, 0px)));
  z-index: 100;
}
/* sub-toolbar 是全寬 q-header,左側永久側欄(240px,overlay 蓋在內容上)會壓住「返回列表」鈕。
   桌機(側欄常駐)時把工具列內容往右讓出側欄寬度,讓返回鈕可見;手機(側欄 overlay 隱藏)不讓。
   1024px 對齊 q-drawer show-if-above 預設斷點。 */
@media (min-width: 1024px) {
  html body .preview-sub-toolbar > .row { padding-left: 252px !important; }
}

/* === v2.29 客戶視角預覽按鈕在 doc.status='submitted' 時 enabled（spec Requirement 3）
 * 當前 vue.html v-if="doc.share_token" 渲染按鈕，無 :disabled binding，
 * baseline 驗證 submitted doc 按鈕 disabled=false / 無 q-btn--disabled class，已符合 spec。
 * 此規則為防衛性 — 確保未來不會有人加 :disabled="doc.status==='submitted'" 蓋上來。
 * 用 html body specificity 強制 enabled 狀態於 .preview-sub-toolbar 內部按鈕。 */
html body .preview-sub-toolbar .preview-toolbar-actions .q-btn[aria-label*="客戶視角"],
html body .preview-sub-toolbar .preview-toolbar-actions .q-btn:has(.q-btn__content:has-text("客戶視角預覽")) {
  pointer-events: auto;
}

@media print {
  /* 列印時 sub-toolbar 隱藏（.no-print 既有），不必額外規則 */
}

/* === v2.30 客戶簽名 inline render + 簽回日期 ROC（image #65）===
 * 用戶反饋：sign.html 客戶簽完，sigbox CLIENT 內 dotted line + 「報價回傳日期 年 月 日」
 *   未把 latestSignature dataURL 嵌入展示。應該：
 *     1) 簽完立即把簽名圖渲染在 sigbox CLIENT 內（auto-fit, 不擋其他元素）
 *     2) 「報價回傳日期」自動填 doc.customer_returned_at（民國 ROC 格式）
 *     3) admin SPA preview 同步顯示
 *
 * 技術決策：
 *   - sigbox.client 改 flex column，垂直排列：role / sig-img / who / addr / date-line / stamp
 *     （sig-img 緊接 role 之後，符合「業主簽章」block 視覺優先）
 *   - sig-img 用 max-width:100% / max-height:60px / object-fit:contain auto-fit
 *     不擋 stamp（既有 stamp 是 absolute 右下 46x46，sig-img 在 normal flow 不衝突）
 *   - 維持 v2.27 sigbox 兩格等高（grid-auto-rows:1fr + align-self:stretch）：
 *     sigbox 變成 flex column 但仍 stretch height，內容變多時兩格仍等高
 *
 * 不影響：
 *   - v2.22 對稱 31/31（grid-template-columns 不動）
 *   - v2.23 inline-style cleanup（sig-img 是 Vue 渲染的新 element，沒有 inline style 污染）
 *   - v2.24 三處 12px 間距
 *   - v2.25 dashboard 1400 寬度
 *   - v2.26 navbar logo
 *   - v2.27 sigbox 兩格等高（flex column 不影響 grid-row stretch）
 *   - v2.28 stamp horizontal 並排
 *   - v2.29 sticky header */
html body .doc-paper .signoff .sigbox.client,
html body .doc-paper .signoff > .sigbox:first-child {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
html body .doc-paper .signoff .sigbox.client .sig-img,
html body .doc-paper .signoff > .sigbox:first-child .sig-img {
  display: block !important;
  max-width: 100% !important;
  max-height: 60px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: left center !important;
  align-self: flex-start !important;
  margin: 2px 0 !important;
  /* 確保不被 stamp（absolute 右下）擋到，z-index normal flow */
  position: relative !important;
  z-index: 1 !important;
}

@media print {
  html body .doc-paper .signoff .sigbox.client,
  html body .doc-paper .signoff > .sigbox:first-child {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }
  html body .doc-paper .signoff .sigbox.client .sig-img,
  html body .doc-paper .signoff > .sigbox:first-child .sig-img {
    display: block !important;
    max-width: 100% !important;
    max-height: 60px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: left center !important;
    align-self: flex-start !important;
    margin: 2px 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* === v2.31 列印分頁 — 主報價第 1 頁 + 合約附件強制開新頁（image #66）===
 * 用戶反饋（image #66）：
 *   1. 列印下載時主報價優先放第 1 頁
 *   2. 第 1 頁不可因縮排放入第 2 頁的資訊（best-effort）
 *   3. 第 2 頁絕對不能溢出第 1 頁（硬要求 — 合約附件「注意事項」絕對不在第 1 頁）
 *   4. 合約附件目前沒一起列入列印（v2.6 D-115 把 .terms-fulltext-page 在 print 時 display:none，需撤回）
 *
 * 技術決策：
 *   - @page A4 + 16mm margin（標準辦公文件格式）
 *   - 主報價（.doc-paper:not(.terms-fulltext-page)）強制 page-break-after: always
 *   - 合約附件（.doc-paper.terms-fulltext-page）撤回 v2.6 D-115 display:none → 顯示 + page-break-before: always
 *   - 合約附件內每段 (terms_blocks v-for div) break-inside: avoid 不段中分頁
 *   - 主報價 fit 第 1 頁 best-effort：把既有 zoom 0.9 改成 0.78，line-height/padding 微縮
 *     （量測：主報價 bcr=1524px，A4 印區 ≈ 1059px → 0.78 視覺 ≈ 1188px，仍略超但減少跨頁量；
 *     如客戶真的塞滿無法 fit，第 2 頁會出現主報價尾巴幾行，合約附件則跳到第 3 頁開始 — 仍滿足硬要求）
 *
 * 不影響：
 *   - v2.22 對稱 31/31 / v2.23 cleanup / v2.24 12px 間距 / v2.25 dashboard / v2.26 navbar
 *   - v2.27 sigbox 等高 / v2.28 stamp horizontal / v2.29 sticky / v2.30 簽名 autofill
 *   - 非 print 模式（screen）行為 100% 不變
 */
@media print {
  /* (1) A4 page + 標準 margin */
  @page {
    size: A4;
    margin: 16mm;
  }

  /* (2) 撤回 v2.6 D-115：合約附件 print 時要顯示（用戶反饋 #4） */
  html body .terms-fulltext-page,
  html body .doc-paper.terms-fulltext-page {
    display: block !important;
  }

  /* (3) 主報價強制成為第 1 頁、後接 page-break；fit-to-page best-effort
   * v2.33 OVERRIDE：撤回 page-break-after / break-after（過於 rigid，造成主頁短時留白、
   *   長時切到不該的點）。zoom/padding/line-height 保留（best-effort fit 仍合理 — §1.4 量測
   *   主頁 print 高度 768~916px，A4 印區 ~1132px@16mm margin，zoom 0.78 讓主頁 best-effort 縮入）。
   * 撤掉的 2 條被 v2.33 末尾 `break-after: auto` 蓋掉雙保險。 */
  html body .doc-paper:not(.terms-fulltext-page) {
    /* v2.33 撤回：page-break-after: always !important; */
    /* v2.33 撤回：break-after: page !important; */
    /* fit-to-page best-effort：縮 zoom + line-height + padding（保留） */
    zoom: 0.78 !important;
    padding: 18px 28px !important;
  }
  html body .doc-paper:not(.terms-fulltext-page) .terms ol,
  html body .doc-paper:not(.terms-fulltext-page) .terms ol li,
  html body .doc-paper:not(.terms-fulltext-page) table.items tbody td {
    line-height: 1.4 !important;
  }

  /* (4) 合約附件強制開新頁（硬要求：絕不溢出第 1 頁）
   * v2.33 OVERRIDE：撤回 page-break-before / break-before（用戶 image #69/#70 反饋：
   *   合約附件應「直接接連」呈現，不強制分頁）。margin-top / zoom 保留（visual 一致）。
   * 撤掉的 2 條被 v2.33 末尾 `break-before: auto` 蓋掉雙保險。 */
  html body .doc-paper.terms-fulltext-page {
    /* v2.33 撤回：page-break-before: always !important; */
    /* v2.33 撤回：break-before: page !important; */
    margin-top: 0 !important;
    /* 合約附件保持與主報價相同 zoom 視覺一致 */
    zoom: 0.85 !important;
  }

  /* (5) v2.37 r4 撤回 break-inside avoid (用戶 2026-05-12 反饋:「合約附件 不管有幾項 都自然放在一起 不需要一頁一類」)
   * 原 v2.33 §4 規則:每個 v-for term block 視為「不可被分頁切斷的整體」→ 大 block 強制換頁
   * → 結果:網站轉移服務條款 / 網站代建置服務條款 / 通用免責 各自佔多頁,使用者不要這樣
   * → 改 auto:讓 term block 自然 flow,需要時可在頁中被切斷 */
  html body .doc-paper.terms-fulltext-page > div {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }
  /* h3.section 仍 break-after avoid (避免標題孤立在頁底) */
  html body .doc-paper.terms-fulltext-page > h3.section {
    break-after: avoid !important;
    page-break-after: avoid !important;
  }
}

/* ============== v2.32 spacing tighten round 2 ============== */
/* === v2.32 doc-paper 內部垂直間距收斂 round 2 — head↔meta + bank top（image #67/#68）===
 * v2.24 已套 三處 horizontal gap 24/20/18 → 12px，用戶仍嫌「再小一點點」兩處：
 *   (a) image #68：抬頭 .head（驛上創能 logo + 地址）↔ .meta（QUOTE NO.）
 *       v2.24 12px → 本次 6px
 *   (b) image #67：.terms-grid 內 .bank 框（匯款資訊 REMITTANCE）上方留白
 *       目前 .bank padding-top 8px (computed) → 6px
 *
 * §1 量測證據（_temp-cwd/v232-s1-baseline.json，admin SPA + sign.html）：
 *   - .head margin-bottom (computed) = "12px"（v2.24 套用後）
 *   - .head ↔ .meta gap = 12.00px (admin) / 12.00px (sign)
 *   - .bank padding-top (computed) = "8px"，inline attr 有 "padding: 10px 12px"，
 *     表示某條 8px 規則勝出（base 10 + Cement Studio inline 10 + v2.20-final 6/16 補丁互拼）
 *   - bank.firstChild(H4).top - bank.top = 8px ← 證實上方留白 = padding-top
 *   - .terms-grid rowGap=0 / columnGap=16px（不是 grid gap 來源）
 *   - bank 在 terms-grid 第 2 column（grid-column:2），與 terms 並排但因 terms 較高，
 *     bank 看起來在 terms 中段右側，其「上方留白」即 bank 自身 padding-top
 *
 * 修法：
 *   (1) .doc-paper > .head margin-bottom: 6px !important（覆蓋 v2.24 的 12px，
 *       靠書寫順序在後 + 相同 specificity 後寫者勝）
 *   (2) .doc-paper .terms-grid .bank padding-top: 6px !important（蓋過 base 10、
 *       Cement Studio inline 10、vue.html inner 各補丁 6/8/16）
 *
 * 不動（v2.24 保留）：
 *   - .parties margin-bottom 12px（v2.24 第 2 處未受用戶質疑）
 *   - .terms-grid margin-bottom 12px（v2.24 第 3 處未受用戶質疑）
 *   - .meta/.items/.signoff margin-top:0（v2.24 配套）
 *   - .bank padding-left/right/bottom（base 12/10/12，只動 top）
 *
 * 0 回歸保護：v2.22 對稱 31/31、v2.23 cleanup、v2.25 dashboard 1400、v2.26 navbar、
 *   v2.27 sigbox 等高、v2.28 stamp horizontal、v2.29 sticky header、
 *   v2.30 signature autofill + ROC date、v2.31 列印分頁 — 全保持。
 *
 * 同步：vue.html inner style + sign.html inline style + cache buster v=283→v=284。 */
html body .doc-paper > .head { margin-bottom: 6px !important; }
html body .doc-paper .terms-grid .bank { padding-top: 6px !important; }

@media print {
  html body .doc-paper > .head { margin-bottom: 6px !important; }
  html body .doc-paper .terms-grid .bank { padding-top: 6px !important; }
}

/* ============== v2.33 print pinned-tail + 自由 flow + 連續 group ============== */
/* === v2.33 列印分頁重設計 — pinned tail + 自由 flow + 連續 group（image #69/#70）===
 * 用戶反饋（image #69 顯示 2 頁、image #70）需重設計 v2.31 策略：
 *   1. 「主頁尾巴釘著不上 page 2」— .signoff/.foot 視為 pinned-tail，跟前面元素綁定
 *   2. 「簽名記錄不可印出」— admin SPA `.a4-block.q-mb-md`（v-if=signatures.length）print hidden
 *      （v2.6 line 2779 既有 `.signature-history { display: none }` 是 dead rule — vue.html line 500
 *       實際 class 為 `.a4-block.q-mb-md`，本次補上正確 selector）
 *   3. 「合約附件直接接連呈現」— 撤回 v2.31 page-break-before
 *   4. 「注意事項跟服務條款視同一個東西」— 多段附件視同一連續 group
 *
 * §1.4 量測（_temp-cwd/v233-s14-baseline-v284.json）：
 *   - EL2026050803 (1 signature, no annex)：main print height=768.06px @ zoom 0.78
 *     screen sigHistory bcr.height=207.39px（class="a4-block q-mb-md"）
 *   - EL2026050802 (signed, annex 5 children: H3.section + 4 DIV)：
 *     main print height=916.48px @ zoom 0.78、annex print height=4025.08px @ zoom 0.85
 *     annex pageBreakBefore=always、display=block — v2.31 強制分頁生效中
 *     signoff print breakInside=avoid（v2.6 既有）、breakBefore=auto（v2.33 改 avoid）
 *
 * §2 撤回 v2.31 rigid 規則（精準註解 4 條）：
 *   - .doc-paper:not(.terms-fulltext-page) page-break-after/break-after — line ~4196-4198
 *   - .doc-paper.terms-fulltext-page page-break-before/break-before — line ~4210-4212
 *   - 保留 zoom 0.78/line-height 1.4/padding 18px 28px（best-effort fit 合理）
 *   - 保留 zoom 0.85 on annex（visual 一致）
 *
 * §3 pinned-tail：
 *   - .signoff: break-before/break-inside avoid（黏緊前面 + 段中不分頁）
 *   - .foot: break-before/break-inside avoid（黏 .signoff）
 *   - .items tr: break-inside avoid（row 不切斷）
 *   - service-details/terms-grid 子元素 break-inside avoid（自由 flow + 子段不切斷）
 *
 * §4 合約附件連續 group（強化 v2.31 (5)）：
 *   - .doc-paper.terms-fulltext-page > * (含 h3.section + v-for div) break-inside avoid
 *   - h3.section / h4 (terms title) break-after avoid（標題不單獨在頁尾）
 *
 * §5 簽名記錄 print 隱藏：
 *   - .a4-block.q-mb-md { display: none } — 補正 v2.6 dead rule
 *
 * 雙保險 reset（撤 v2.31 rigid 規則）：
 *   - .doc-paper:not(.terms-fulltext-page) { break-after: auto; page-break-after: auto; }
 *   - .doc-paper.terms-fulltext-page { break-before: auto; page-break-before: auto; }
 *
 * 0 回歸保護（v2.22~v2.32 既有規則全保留）：
 *   - v2.22 對稱 31/31、v2.23 cleanup、v2.24 12px 間距、v2.25 dashboard 1400、v2.26 navbar
 *   - v2.27 sigbox 等高、v2.28 stamp horizontal、v2.29 sticky/submitted、v2.30 signature autofill+ROC
 *   - v2.31 @page A4 16mm / display:block annex / zoom 0.78+0.85 / line-height 1.4 / padding 18px 28px（全保留）
 *   - v2.32 .head margin-bottom 6px / .bank padding-top 6px（全保留）
 *
 * 同步：vue.html inner style + sign.html inline style + cache buster v=284→v=285。 */
@media print {
  /* (1) 雙保險 reset — 撤回 v2.31 強制 page-break 規則 */
  html body .doc-paper:not(.terms-fulltext-page) {
    break-after: auto !important;
    page-break-after: auto !important;
  }
  html body .doc-paper.terms-fulltext-page {
    break-before: auto !important;
    page-break-before: auto !important;
  }

  /* (2) §3 pinned-tail — .signoff 釘著前面元素，段中不切斷 */
  html body .doc-paper .signoff {
    break-before: avoid !important;
    page-break-before: avoid !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  /* .foot 沿用 pinned-tail 策略（若 layout 存在 .foot 元素） */
  html body .doc-paper .foot {
    break-before: avoid !important;
    page-break-before: avoid !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  /* (3) §3 服務項目自由 flow — items tr 不切斷在 row 中間 */
  html body .doc-paper table.items tr,
  html body .doc-paper .items tr {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  /* (4) §3 service-details + terms-grid 子元素自由 flow + 子段不切斷 */
  html body .doc-paper .service-details-block > *,
  html body .doc-paper .terms-grid > * {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  /* (5) v2.37 r4 撤回 break-inside avoid (用戶 2026-05-12: 「合約附件不管有幾項都自然放在一起 不需要一頁一類」)
   * 原 v2.33 §4 全 group break-inside avoid → 每個 block 自成一頁,用戶不要
   * → 改 auto:term block 可在頁中被分頁切斷,自然 flow 接連 */
  html body .doc-paper.terms-fulltext-page > *,
  html body .doc-paper.terms-fulltext-page .terms-clause {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }
  /* h3/h4 仍 break-after avoid (標題不孤立在頁底) */
  html body .doc-paper.terms-fulltext-page h3,
  html body .doc-paper.terms-fulltext-page h4 {
    break-after: avoid !important;
    page-break-after: avoid !important;
  }

  /* (6) §5 簽名記錄區 print 隱藏（補正 v2.6 dead rule .signature-history） */
  html body .a4-block.q-mb-md {
    display: none !important;
  }
}

/* ============== v2.34 rich-text-editor code block + OL continuation ============== */
/* === v2.34 code block 渲染樣式（image #71）===
 * 三處 q-editor 新增「插入原始碼」按鈕，插入 <pre><code>...</code></pre>。
 * 渲染規則覆蓋 q-editor 編輯區、doc-paper 預覽/列印、rich-text preview dialog。
 * 後端 bleach ALLOWED_TAGS 已同步加入 pre/code。
 *
 * D2 決議：方案 A 極簡 — 等寬字 SFMono/Consolas + 淺灰底 #f5f5f5 + radius 4px +
 *   padding 12px + word-wrap + pre-wrap + font-size 0.9em + line-height 1.5。
 *
 * 0 回歸保護：v2.22~v2.33 既有規則全保留，本次僅新增 CSS class，不碰既有規則。
 *
 * 同步：vue.html <component is="style"> + sign.html <style> + cache buster v=285→v=286。 */

/* screen + print 共用 code block 樣式 */
.q-editor pre,
.doc-paper pre,
.rich-text pre {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Monaco, monospace;
  background-color: #f5f5f5;
  border-radius: 4px;
  padding: 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  font-size: 0.9em;
  line-height: 1.5;
  margin: 8px 0;
}
.q-editor pre code,
.doc-paper pre code,
.rich-text pre code {
  background: transparent;
  padding: 0;
  font-family: inherit;
}

@media print {
  /* 列印模式 code block 確保不溢出紙面 */
  .doc-paper pre {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: pre-wrap !important;
    max-width: 100% !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}

/* ============== v2.35 print natural A4 pagination ============== */
/* === v2.35 列印 1:1 自然 A4 分頁（image #73 / user Q1~Q5 決議）===
 * 用戶反饋（2026-05-11）：zoom 0.78 把內容縮 22%，客戶印出來看到縮過的字不可接受。
 * 合約附件應固定從新頁開始。每頁要有正確頁碼。Chrome Print 和 Playwright PDF 一致。
 *
 * §2.1 撤回 v2.31 zoom 0.78（主報價）— 蓋過 line ~4203 + base line ~2768
 * §2.2 撤回 v2.31 zoom 0.85（合約附件）— 蓋過 line ~4221 + base line ~2768
 * §2.3 恢復合約附件 page-break-before: always — 蓋過 v2.33 的 auto (line ~4333-4335)
 * §2.4 @page CSS 頁碼 — Chrome 不支援 @page @bottom-center counter(pages)（§1.4 實測確認），
 *      改用 JS onbeforeprint DOM 注入方案 C（見 theme.css 末尾 script 區塊說明）
 * §2.5 隱藏 hardcode PAGE 01/01 span — print 模式 display:none
 *
 * 0 回歸保護：
 *   - v2.22~v2.34 既有規則全保留（spacing/layout/dashboard/navbar/stamp/sticky/signature/ROC/code-block/OL）
 *   - v2.33 pinned-tail (.signoff/.foot break avoid)、合約附件內各段 break-inside avoid、
 *     簽名記錄 print hidden — 全保留
 *   - screen 模式 0 變動（本次所有改動只在 @media print 內生效）
 *
 * 同步：vue.html <component is="style"> + sign.html <style> + cache buster v=286→v=287。 */
@media print {
  /* §2.1 撤回 v2.31 zoom 0.78（主報價）— 蓋 line ~4203 + base line ~2768 的 zoom: 0.85 */
  html body .doc-paper:not(.terms-fulltext-page) {
    zoom: normal !important;
  }

  /* §2.2 撤回 v2.31 zoom 0.85（合約附件）— 蓋 line ~4221 + base line ~2768 */
  html body .doc-paper.terms-fulltext-page {
    zoom: normal !important;
  }

  /* §2.3 [v2.37 §2.3.1 部分撤回 — 2026-05-11 21:53]
   *
   * 撤回理由 (PDM 親驗 PDF)：v2.35 全套用造成附件每段獨佔整頁、剩下 70% 空白，
   *   違反 v2.37 鐵律 #2「合約附件視同一個文件、內部段落自然 flow」。
   *
   * D5-B 決議：只有合約附件 wrapper 的 :first-of-type 強制 page-break，
   *   附件內部 v-for 渲染的多 term 自然 flow + break-inside avoid (v2.33 group 規則保留)。
   *
   * 目前 vue.html / sign.html 把所有 terms_blocks 包在「1 個」.terms-fulltext-page
   *   wrapper 內 (v-for 在內部產生多個 term div)，故 :first-of-type 即等同於它本身。
   *   未來若改為「每段 terms 1 個 .terms-fulltext-page」(spec 4.1)，邏輯仍正確。 */
  html body .doc-paper.terms-fulltext-page {
    page-break-before: auto !important;
    break-before: auto !important;
  }
  html body .doc-paper.terms-fulltext-page:first-of-type {
    page-break-before: always !important;
    break-before: page !important;
  }

  /* §2.5 隱藏 Cement Studio 範本帶過來的 hardcode "Page 01 / 01" span
   * vue.html line ~479 / sign.html line ~1248 的 data-om-id="4366136e:139"
   * screen 模式不動（避免影響既有排版），由 JS onbeforeprint footer 接管頁碼 */
  .doc-paper .foot [data-om-id="4366136e:139"] {
    display: none !important;
  }
  /* §2.5b v2.37.2 — 補蓋 sibling :138 "EASYLIST · QUOTATION · ...":
   * QA 2026-05-12 診斷 Bug 2 發現 v2.34 §2.5 只蓋 :139 (PAGE 01/01) 漏蓋 :138,
   * 導致 PDF 多頁時 :138 跟著 .doc-paper 結尾漂浮到 page 2 中間。對稱補蓋。 */
  .doc-paper .foot [data-om-id="4366136e:138"] {
    display: none !important;
  }
}

/* ============================================================================
 *  v2.37 preview-as-pdf-mirror — 條件式所見即所得 (2026-05-11)
 * ============================================================================
 *  為什麼：用戶逐字確認「我要的是有條件式的所見即所得」(2026-05-11)。
 *    preview 與 PDF 必須在分頁/zoom/頁碼上 100% 對齊。
 *
 *  D1-A：auto-fit zoom 0.7~1.0 只套在 .zoom-target (.items + .service-details-block)
 *  D2-A：前端 JS 算 zoom 寫 dataset.fitZoom，後端 read 不重算
 *  D3-A：preview 包成 A4 紙堆疊 (白底+雙層陰影+灰底 canvas)
 *  D4：footer JetBrains Mono 9px #6B5D51 letter-spacing 1.08px uppercase
 *  D5-B：撤 v2.35 §2.3 全套用，改 :first-of-type (見上方 §2.3 區段)
 *  D8-D：響應式 breakpoint (≥1440px 1:1 / 768~1439 縮 90% / <768 fit)
 *
 *  保留：v2.31 主報價 .doc-paper zoom: 0.78 base (line ~4203/2768) — screen mode
 *    現在仍生效，但 .preview-canvas .doc-paper 覆寫為 zoom: normal (1:1) 才能
 *    讓條件式 zoom 限縮在 .zoom-target 生效。
 * ============================================================================ */

/* ---- §3.1 D3-A：preview 包 A4 紙視覺 (screen mode 限定) ---- */
@media screen {
  .preview-canvas {
    background: #f0f0f0;
    padding: 24px 0;
    min-height: 100vh;
  }
  .preview-canvas .doc-paper {
    width: 210mm;
    min-height: 297mm;
    max-width: none;          /* 蓋 line ~1991 max-width: 794px */
    background: #fff;
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.08),
      0 8px 24px rgba(0, 0, 0, 0.06);
    margin: 0 auto 24px;
    padding: 16mm;
    box-sizing: border-box;
    border-radius: 0;         /* 蓋 line ~1996 border-radius: 4px (A4 紙感不要圓角) */
    zoom: normal;             /* 蓋 base zoom: 0.85，由 .zoom-target 自己算 fit-zoom */
    position: relative;       /* 給 .page-footer position: absolute 用 */
  }
}

/* ---- §3.2 D1-A：條件式 auto-fit zoom (.zoom-target wrapper) ---- */
.zoom-target {
  /* JS 直接寫 style.zoom，CSS 不指定值，但給防呆變數 fallback */
  zoom: var(--fit-zoom, 1);
  /* R2 閃爍處理：初始隱藏，auto-fit-zoom.js 算完 RAF 移除 */
  visibility: hidden;
}
/* 防呆：附件內 .zoom-target 強制 1:1 (附件不參與 auto-fit zoom) */
.doc-paper.terms-fulltext-page .zoom-target {
  zoom: 1 !important;
  visibility: visible !important;
}

/* ---- §3.3 D4：page-footer (PAGE X / N) ---- */
.preview-canvas .doc-paper .page-footer {
  position: absolute;
  bottom: 16mm;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px;
  color: #6B5D51;
  letter-spacing: 1.08px;
  text-transform: uppercase;
  pointer-events: none;
}
@media print {
  /* PDF 走 Playwright displayHeaderFooter，preview 的 .page-footer 不印 */
  .preview-canvas .doc-paper .page-footer {
    display: none !important;
  }
}

/* ---- §3.4 D8-D：響應式 preview (screen mode 限定，print 強制 transform: none) ---- */
@media screen and (min-width: 1440px) {
  .preview-canvas .doc-paper {
    transform: none;
  }
}
/* v2.37 WYSIWYG 強化 (2026-05-11):撤響應式 scale,讓所有螢幕都 1:1 與 PDF 對齊。
 * 原 D8-D 響應式違反「所見即所得」承諾,改為固定 1:1 + 水平 scroll (容器自然撐開)。
 * 小螢幕用戶若不便,可瀏覽器自身縮放 (Ctrl+/-)。 */
@media screen and (max-width: 1439px) {
  .preview-canvas .doc-paper {
    transform: none;
  }
}
@media print {
  /* R7 風險防護：print mode 強制 transform: none，避免響應式樣式滲入 PDF */
  .preview-canvas .doc-paper {
    transform: none !important;
  }
}

/* ---- §3.5 D6：preview 唯讀防護 ---- */
.preview-canvas[data-readonly="true"] {
  /* 整個 canvas pointer-events 關閉，但允許 .page-footer 與分頁線可被選文字 */
  pointer-events: none;
}
.preview-canvas[data-readonly="true"] .page-footer {
  pointer-events: auto;
}

/* ---- §3.11 v2.37 列印多頁邊界 (用戶 image #21 反饋:列印第 2 頁開始沒邊界) ----
 * 原本 .doc-paper padding 16mm 只在「元素邊界」生效,單一 .doc-paper 跨頁時 page 2+ 沒 padding。
 * 改用 @page CSS 設「頁面層級」margin,每頁 (page 1/2/3...) 都有 16mm 物理邊距,
 * 同時撤回 print 模式的 .doc-paper padding (避免雙重邊距)。 */
@media print {
  @page {
    margin: 16mm;
  }
  html body .doc-paper {
    padding: 0 !important;
  }
}

/* ---- §3.8 v2.37 WYSIWYG: 統一 preview / browser print / Playwright PDF padding ----
 * v2.37 D6 撤回清單漏掉一條:print 還有 v2.31 fit-to-page padding squeeze (18px 28px 主頁 / 24px 32px 附件)。
 * 用戶反饋「預覽 列印 PDF都長的不一樣」就是 padding mismatch (preview 16mm vs print 18-32px)。
 * 統一改 16mm 對齊 A4 標準 margin,三者所見即所得。 */
@media print {
  html body .doc-paper {
    padding: 16mm !important;            /* 蓋 base print line 2776 的 24px 32px */
  }
  html body .doc-paper:not(.terms-fulltext-page) {
    padding: 16mm !important;            /* 蓋 v2.31 Block A line 4210 的 18px 28px */
  }
  html body .doc-paper.terms-fulltext-page {
    padding: 16mm !important;            /* 附件也對齊 */
  }
}

/* ---- §3.9 v2.37 WYSIWYG: 撤回 base print zoom 0.85,讓 PDF/列印與 preview 都 1:1 ----
 * v2.31 fit-to-page 策略中 base print 把 .doc-paper zoom 縮到 0.85 (line 2770),
 * 但 v2.37 條件式 WYSIWYG 要求 preview/print/PDF 三模式都 1:1,只有 .zoom-target 才
 * 可能套 auto-fit zoom (目前 JS 強制 = 1)。
 * preview 已用 §3.1 .preview-canvas .doc-paper { zoom: normal } 蓋掉,但 @media print
 * 無 .preview-canvas (DOM 結構在),所以還是吃到 base 0.85 → PDF/列印整頁縮小。 */
@media print {
  html body .doc-paper {
    zoom: normal !important;
  }
  html body .doc-paper.terms-fulltext-page {
    zoom: normal !important;
  }
}

/* ---- §3.10 v2.37 路線 4 (接受多頁 PDF) 修補 ----
 * 用戶 2026-05-11 決策路線 4:放棄「主頁 1 頁」鐵律 #1,保 WYSIWYG + items 字級不縮 + no redesign。
 * 1. DOM .page-footer 在多頁 PDF 漂浮到 page 2 中間 (absolute 定位 relative .doc-paper 跨頁時黏內容後);
 *    Playwright displayHeaderFooter 已注入「PAGE X / N」每頁底,DOM .page-footer 改 print 隱藏避免衝突
 * 2. .terms-grid / .signoff / .sigbox 加 page-break-inside avoid:盡量保持同頁並排不切斷 */
@media print {
  html body .doc-paper .page-footer {
    display: none !important;
  }
  html body .doc-paper .terms-grid,
  html body .doc-paper .signoff,
  html body .doc-paper .sigbox {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

/* ---- §3.7 v2.37 Cement 鎖死 CSS 備胎 (cleanup.js 跑慢時保底) ---- */
/* Cement Studio inline dump 把 block-size / height 用「測量時的浮點 px」鎖死,
 * 即使 inline-style-cleanup.js 會在 Vue.onMounted 後 strip 掉,初始渲染那一瞬間
 * 還是會鎖死導致 .head-address 撞 .meta / .sumbox 留白 / .items 撐太高。
 * 這裡 CSS !important 直接蓋過,雙保險。
 * 對應 design.md §D6 + cleanup.js §3.7。 */
html body .doc-paper .head,
html body .doc-paper .parties,
html body .doc-paper .parties > div,
html body .doc-paper .parties .role,
html body .doc-paper .sumbox,
html body .doc-paper > .sumbox,
html body .doc-paper .terms-grid .right-stack .sumbox,
html body .doc-paper table.items,
html body .doc-paper .signoff,
html body .doc-paper .sigbox,
html body .doc-paper .service-details-block,
html body .doc-paper .terms-grid,
html body .doc-paper .terms-grid .terms,
html body .doc-paper .terms-grid .bank,
html body .doc-paper .meta,
html body .doc-paper .meta .cell {
  block-size: auto !important;
  height: auto !important;
  min-block-size: auto !important;
  min-height: auto !important;
}

/* ---- quote-preview-parties-and-sticky-fixes（2026-09-12）：Cement 鎖死 grid 軌道尺寸 CSS 備胎 ----
 * root-cause-parties-grid-lock.md：`.doc-paper .parties` 的 inline
 * `grid-template-rows: 142.375px` 把軌道鎖在 Cement 測量當下的高度，內容實際需要
 * 174.74px 卻被鎖住 → 垂直溢出 2px、地址壓在框線上（老闆截圖「超醜」的真因，不是
 * padding 太多）。`.parties` 內的 `dl` 更被鎖成 `grid-template-columns: 64px 244px`
 * （CSS 設計值是 `48px 1fr`），長內容（32 字元 email）會右溢。
 * inline-style-cleanup.js 已把 grid-template-* 納入 strip，但 cleanup 是
 * onMounted 後才跑，初始渲染那一瞬間仍需要 CSS !important 直接蓋過 —— 雙保險，
 * 同上面 §3.7 的既有做法，不另開一套機制。
 * 範圍刻意只鎖定本次改動觸及的 `.parties`／`.parties dl`：同一批 Cement 鎖死問題
 * 還有 `.head`／`.meta`／terms 區 `dl`／`.signoff` 共 5 個元素（見
 * root-cause-parties-grid-lock.md 對照表），它們目前未溢出，CSS 保底留給後續
 * 視情況另開 change 評估，不在本次範圍內擴大處理。 */
html body .doc-paper .parties {
  grid-template-rows: auto !important;
}
html body .doc-paper .parties dl {
  grid-template-columns: 48px 1fr !important;
}

/* ============================================================================
 *  v2.37 END
 * ============================================================================ */

/* ============================================================================
 *  稽核紀錄 popup timeline
 * ============================================================================ */
.audit-event-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-primary);
}

/* =====================================================================
 *  全站統一篩選列 (unified-filter-standardization, 2026-05-30)
 *  五頁共用版型:[搜尋框] [Tab 狀態] [下拉細部...] | NN筆 [清除篩選] [重新整理]
 *  方案 C:主分類 Tab(帶計數) + 細部下拉。配色對齊品牌 flame palette。
 * ===================================================================== */

/* === 統一狀態 Tab 列 === */
.unified-tab-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 0;
}
.unified-tab-item {
  /* 2026-09-08 tab-a11y-regression：customer-detail／customers-list／
     payment-management／line-message-center／projects-center 五頁改掛
     <button type="button" role="tab">（同 quote-order-list 既有寫法）——
     customer-detail 改前是 <q-btn :disabled>，鍵盤可達，Batch 2/4 換成純
     <div> 後鍵盤到不了，是回歸（UX 稽核抓到，PR #82）。
     ⚠️ 尚未收斂的 <div> 版仍有 3 處：documents-list／orders-list（已停用、
     不在 pageScripts 路由內，見 §8.2 死碼清單）、partners-list（**仍在線上
     使用中**，本次盤點發現但不在本輪指定範圍內，同型鍵盤不可達問題還在，
     待後續排入）。這組重置對 <div> 是 no-op、對 <button> 才是必要——否則會
     落回瀏覽器預設外觀（灰底 ButtonFace／浮雕外框 ButtonBorder／Roboto
     字型），2026-09-06 老闆實測回報「醜」的根因。 */
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  margin: 0;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  /* 與 .unified-tab-bar 自己的 border-bottom: 1px 重合（原本是相鄰的兩條線，
     選中時形成「2px 紅 + 1px 灰」的 3px 堆疊，紅線浮在基準線上方 1px）。 */
  margin-bottom: -1px;
  transition: all var(--transition-fast);
  user-select: none;
}
.unified-tab-item:hover {
  color: var(--brand-accent);
}
/* 鍵盤 focus 指示器（WCAG 2.2 SC 2.4.11，2026-09-08 tab-a11y-regression）。
   合成後對比：對 --bg-card(#FFFFFF) 5.33:1、對 --bg-page(#F9F8F4) 5.01:1、
   對 --border-default(#E8E2D6) 4.13:1，三者皆 ≥ 3:1 門檻（Python 實算，非宣告值）。
   寫法沿用既有 .preview-toc-item:focus-visible 的同款慣例（quote-order-list.vue.html）。 */
.unified-tab-item:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: -2px;
}
/* 鎖定分頁：真 disabled，不只是視覺變淡（customer-detail 的「BV 後台」鎖定 tab
   原本只有 .is-locked 的 opacity:.5，滑鼠可點、鍵盤也到得了，只是看起來灰——
   改用原生 disabled 屬性後瀏覽器會擋掉 click／focus／tab 順序，這條只負責視覺。 */
.unified-tab-item:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.unified-tab-item.active {
  color: var(--brand-accent);
  /* 頁面字型（Noto Sans TC，frontend/index.html）只載入 400/500/700 三個字重，
     600 會依 CSS 字型匹配規則就近取到 700，導致切分頁時選中項寬度變化、
     右側分頁跟著水平位移。改用已載入的 500（與基態相同字重，位移歸零）。 */
  font-weight: 500;
  border-bottom-color: var(--brand-accent);
}
.unified-tab-item .count {
  background: var(--neutral-100);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}
.unified-tab-item.active .count {
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

/* === 統一篩選列 === */
.unified-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 0 14px 0;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 14px;
}
.unified-filter-bar .search-input {
  min-width: 200px;
  flex: 1 1 220px;
}
.unified-filter-bar .field {
  min-width: 128px;
  flex: 0 1 150px;
}
.unified-filter-bar .field-wide {
  min-width: 180px;
  flex: 0 1 200px;
}
.unified-filter-bar .filter-spacer {
  flex: 1 1 auto;
}
.unified-filter-bar .count-chip,
.unified-filter-bar .clear-btn,
.unified-filter-bar .refresh-btn {
  flex: 0 0 auto;
}

/* === 統一空狀態 === */
.unified-empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-secondary);
}
.unified-empty-state .icon {
  font-size: 48px;
  color: var(--neutral-300);
  margin-bottom: 12px;
}
.unified-empty-state .msg {
  font-size: var(--fs-base);
  margin-bottom: 14px;
}


/* ============================================================
 * 老闆／夥伴雙視角（dev-center-v2-report-tab）
 * ------------------------------------------------------------
 * body 依登入者 role 掛上 as-boss（admin）或 as-partner（basic），
 * .boss-only 的管理控件於夥伴視角不渲染（能力移除勝於 disabled）。
 *
 * ⚠️ 這**不是授權邊界**：後端維持不分權限，懂技術的夥伴直接呼叫 API
 * 仍可排程／結案／刪除。此為明知的取捨（內部工具、團隊小）。
 * 若日後需要真正的授權邊界，須在後端補 role gate（行為 BREAKING）。
 *
 * 註：已核可 mockup 全檔缺這條規則（只 scope 了 .page-head 與 tab），
 * 導致夥伴看得到所有老闆按鈕——而 mockup 有三處文案宣稱「已隱藏」。
 * 於此補齊，讓文案與實作對齊。
 * ============================================================ */
body.as-partner .boss-only { display: none !important; }

/* 夥伴限定內容（預設隱藏，只在夥伴視角出現） */
.partner-only { display: none; }
body.as-partner .partner-only { display: block; }

/* 夥伴能力宣告條：講清楚「你能做什麼」，而不是只讓按鈕消失
   底/框原為冷紫 #EFEAF5/#DED3EC（與 dev-center 的 --c-review-soft 同一組），
   ui-consistency-sweep Batch 4 隨 dev-center 一起換暖色（老闆核可 mockup）。 */
.partner-cap {
  display: none;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-secondary);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-default);
  margin-bottom: 11px;
}
body.as-partner .partner-cap { display: block; }
.partner-cap b { color: #4a4036; }

/* =====================================================================
 * .sr-only 全站工具類（2026-09-06 QA A18 修復）
 * ---------------------------------------------------------------------
 * `quote-order-list.vue.html` 用了 `.sr-only`（<caption> 表格說明、展開
 * 按鈕欄頭文字），但這條 class 全站從未定義過——只存在於 mockup 自己的
 * `<style>`，導致這些「應該只給螢幕閱讀器讀」的文字直接印在畫面上
 * （實測 <caption> 1166×21px、<span>展開</span> 24×17px，皆 visibility:visible）。
 * 這是全站級缺口：往後任何頁面若沿用 `.sr-only` 慣例都會重蹈覆轍，因此
 * 補在共用 theme.css，不在單一頁面內另寫一份。
 * 手法：標準的「1px 定位 + clip」視覺隱藏（非 display:none／visibility:
 * hidden，那樣螢幕閱讀器也讀不到，等於白隱藏），與 mockup 原始定義同一套。
 * UI-GUIDELINES.md §5 已登記此工具類。
 * ===================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ============================================================
 * 資料表格標準 .data-table（ui-component-standard-layer，2026-09-06）
 * ------------------------------------------------------------
 * 老闆拍板：以 partner-cases 的 .pc-table 為骨架（對照 mockup
 * mockups/table-standard-comparison-mockup-2026-09-06.html，候選 A-1）。
 * 全站資料表格一律用這組，各頁不得自訂表格樣式。
 *
 * ⚠️ 選擇器刻意「不」以頁面根 class 為祖先。Quasar 的 q-dialog 會 teleport 到
 *    <body>，脫離頁面根 class 的 DOM 範圍——若寫成 `.xxx-page .data-table`，
 *    compact 變體在彈窗裡會完全不生效（不是被覆蓋，是選擇器匹配不到）。
 *    這個坑在 partners-list.vue.html:189 附近的註解裡已咬過一次。
 *
 * ⚠️ 內距 11/18、13/18、6/10 不在 --space-* 的 8pt grid 上。這是刻意的：
 *    核可 mockup 的數值即 1:1 規格（UI-GUIDELINES §0 鐵律 2），
 *    改成 8/16 會偏離老闆看過並拍板的那個畫面。
 * ============================================================ */

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  background: var(--bg-surface-alt);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: left;
  padding: 11px 18px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-default);
}
.data-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-soft);
  font-size: var(--fs-sm);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--brand-primary-100); }
.data-table tbody tr[data-clickable] { cursor: pointer; }

/* 數字欄：等寬 tnum ＋ 右對齊。
   `.data-table th.num`（1 type + 2 class）特異度高於基底 `.data-table th`
   （1 type + 1 class），欄頭的右對齊贏得過基底的 text-align:left——
   2026-08-31 partner-cases 就是敗在這一點，欄值右對齊但欄頭從未生效。 */
.data-table .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  text-align: right;
  white-space: nowrap;
}
.data-table th.num { text-align: right; }

/* 外框卡片（可選）：需要把表格包成有邊框圓角的卡片時掛在 wrapper 上 */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

/* ── 進階變體：分組表頭＋凍結欄（欄位多到需要橫捲的頁面才用）──
   列高刻意比骨架緊（8/12）：會用到分組表頭的表格依定義就是欄位多，
   維持 13/18 會讓橫向捲動距離失控。這是變體的一部分，不是另一套標準。 */
.data-table--grouped {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
}
.data-table--grouped th,
.data-table--grouped td { padding: 8px 12px; white-space: nowrap; }
/* 第一層：分組帶（深棕實底） */
.data-table--grouped thead tr.grp-row th {
  background: var(--brand-primary);
  color: var(--text-on-brand);
  font-size: 11.5px;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid var(--brand-primary-dark);
}
/* 第二層：欄名列（沿用骨架表頭外觀） */
.data-table--grouped thead tr.col-row th {
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-default);
}
/* 凍結首欄／末欄 */
.data-table--grouped .pin-left {
  position: sticky; left: 0; z-index: 2; background: var(--bg-card);
}
.data-table--grouped thead .pin-left { z-index: 3; }
.data-table--grouped .pin-right {
  position: sticky; right: 0; z-index: 2; background: var(--bg-card);
}
.data-table--grouped thead .pin-right { z-index: 3; }
.data-table-wrap.is-scrolled .pin-left { box-shadow: 2px 0 6px rgba(44, 38, 32, .08); }
.data-table-wrap.is-scrolled .pin-right { box-shadow: -2px 0 6px rgba(44, 38, 32, .08); }

/* ── compact 變體：彈窗與詳情頁內嵌小表（內距約為骨架一半）──
   除內距外的一切（色彩來源、字重、對齊規則、數字欄處理）與骨架完全相同。 */
.data-table--compact th { padding: 6px 10px; }
.data-table--compact td { padding: 6px 10px; }


/* ============================================================
 * 空狀態變體（ui-component-standard-layer，2026-09-06）
 * ------------------------------------------------------------
 * .unified-empty-state 已存在（上方）。本次新增的是「為什麼是空的」這個區分：
 * 「本來就沒資料」要引導去建立；「篩選後沒結果」要提供清除篩選。
 * 兩者混用會讓使用者以為系統漏資料——2026-08-31 已有「空白被讀成系統漏了」
 * 的實例（見 UI-GUIDELINES 變更紀錄）。
 * ============================================================ */
.unified-empty-state .sub {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.7;
}
.unified-empty-state .clear-link {
  display: inline-block;
  margin-left: 6px;
  color: var(--brand-accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.unified-empty-state .clear-link:hover { color: var(--brand-accent-dark); }


/* ═══ AI 任務側欄（openspec change ai-ops-management；核可 mockup v3 收編）═══
   .cx-* 對話訊息／工具動作列／提問選項／輸入框／斜線清單、.ao-thumb 圖片縮圖、.ao-side 側欄、
   .tx-seg 對話／終端機切換、.tx-* 終端機畫面、.ao-ai-row AI 任務列。全部只用 token，
   唯一例外是下方標註「終端機配色例外」的區塊。 */
.ao-pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ao-side-title { font-family: var(--font-sans); }
.cx-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.cx-scroll:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }

/* 使用者訊息：右側淺底圓角氣泡 */
.cx-u { align-self: flex-end; max-width: 85%; background: var(--bg-surface-alt); color: var(--text-primary); border-radius: var(--radius-lg); padding: 10px 14px; font-size: var(--fs-base); line-height: 1.7; }
.cx-u-t { white-space: pre-wrap; overflow-wrap: anywhere; }
.cx-u-t.is-cmd { font-family: var(--font-mono); }
.cx-u-imgs { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-u-imgs + .cx-u-t { margin-top: var(--space-2); }

/* AI 回覆：左側、無氣泡 */
.cx-a { color: var(--text-primary); font-size: var(--fs-base); line-height: 1.75; overflow-wrap: anywhere; }
.cx-a p { margin: 0 0 var(--space-2); }
.cx-a > :last-child { margin-bottom: 0; }
.cx-a ul, .cx-a ol { margin: 0 0 var(--space-2); padding-left: 22px; }
.cx-a li { margin: 2px 0; }
.cx-a b, .cx-a strong { font-weight: 700; }
.cx-a code { font-family: var(--font-mono); font-size: 0.9em; background: var(--bg-surface-alt); border-radius: var(--radius-sm); padding: 1px 5px; }
/* AI 回覆的表格：表格本身當捲動容器（renderMarkdownSafe 不輸出外層 class），過寬時只在表格內橫捲 */
.cx-a table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 var(--space-2); font-size: var(--fs-sm); line-height: 1.6; }
.cx-a th, .cx-a td { border: 1px solid var(--border-default); padding: 4px 10px; text-align: left; vertical-align: top; }
.cx-a th { background: var(--bg-surface-alt); font-weight: 700; white-space: nowrap; }

/* 工具動作：可展開的小列，預設收合 */
.cx-tool-b { appearance: none; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: var(--fs-sm); color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 2px; padding: 3px 8px 3px 2px; border-radius: var(--radius-sm); }
.cx-tool-b:hover { background: var(--neutral-100); color: var(--text-primary); }
.cx-tool-b:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.cx-tool-b .material-icons { font-size: 18px; transition: transform .15s; }
.cx-tool-b[aria-expanded="true"] .material-icons { transform: rotate(90deg); }
.cx-tool-list { margin: var(--space-1) 0 0 20px; padding: var(--space-2) var(--space-3); background: var(--bg-surface-alt); border-radius: var(--radius-md);
  font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.7; color: var(--text-secondary); }
.cx-tool-list div { white-space: pre-wrap; overflow-wrap: anywhere; }

/* AI 發問：選擇題 */
.cx-ask { border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-card); padding: var(--space-3) var(--space-4) var(--space-4); }
.cx-ask-q { font-size: var(--fs-base); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-2); }
.cx-ask-opts { display: flex; flex-direction: column; gap: var(--space-2); }
.cx-opt { appearance: none; font: inherit; font-size: var(--fs-base); text-align: left; display: flex; align-items: center; gap: var(--space-2); padding: 10px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text-primary); cursor: pointer; }
.cx-opt span { flex: 1; min-width: 0; }
.cx-opt .material-icons { font-size: 18px; color: var(--brand-accent); }
.cx-opt:hover:not(:disabled) { border-color: var(--brand-accent); background: var(--brand-accent-soft); }
.cx-opt:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.cx-opt.is-picked { border-color: var(--brand-accent); background: var(--brand-accent-soft); font-weight: 600; }
.cx-opt:disabled { cursor: default; }
.cx-opt:disabled:not(.is-picked) { background: var(--bg-surface-alt); color: var(--text-secondary); }

/* 問題卡：在網頁直接回答（change ai-question-answer-in-web，核可 mockup 1:1；一張卡放全部題目） */
.aq-sum { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: var(--space-3); }
.aq-q + .aq-q { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border-default); }
.aq-q .cx-ask-q { margin-bottom: var(--space-1); overflow-wrap: anywhere; }
.aq-hint { font-size: var(--fs-xs); color: var(--text-secondary); margin-bottom: var(--space-2); }
/* 選項：外觀最小 36px，命中範圍用 ::after 補到 44px；長文字折行不截斷 */
.aq-q .cx-opt { position: relative; min-height: 36px; padding: 6px 12px; width: 100%; }
.aq-q .cx-opt::after { content: ''; position: absolute; inset: -4px 0; }
.aq-q .cx-opt span { overflow-wrap: anywhere; line-height: 1.5; }
.aq-q .cx-opt .box { color: var(--text-secondary); }
.aq-q .cx-opt.is-picked .box { color: var(--brand-accent); }
.aq-other { margin-top: var(--space-2); }
.aq-other .cx-comp { padding: var(--space-2) var(--space-3); }
.aq-other .cx-ta { min-height: 48px; }
.aq-ans { margin-top: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--bg-surface-alt); font-size: var(--fs-base); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
/* 卡片底部：缺什麼＋送出。卡片比可視區高時，這一列黏在捲動區底部 */
.aq-foot { position: sticky; bottom: calc(-1 * var(--space-4) + 1px); display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) calc(-1 * var(--space-4)) calc(-1 * var(--space-4)); padding: var(--space-3) var(--space-4);
  background: var(--bg-card); border-top: 1px solid var(--border-default); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.aq-need { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.5; }
.aq-need .material-icons { font-size: 16px; vertical-align: -3px; margin-right: 2px; }
.aq-go { appearance: none; border: 0; cursor: pointer; position: relative; flex: none; height: 36px; padding: 0 20px; border-radius: var(--radius-pill);
  background: var(--brand-accent); color: var(--text-on-accent); font: inherit; font-size: var(--fs-base); font-weight: 700; }
.aq-go::after { content: ''; position: absolute; inset: -4px; }
.aq-go:hover:not(:disabled) { background: var(--brand-accent-dark); }
.aq-go:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.aq-go:disabled { background: var(--neutral-200); color: var(--text-secondary); cursor: not-allowed; }
.aq-done { color: var(--color-success-text); }

/* 進行中與狀態註記 */
.cx-think { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); color: var(--text-secondary); }
.cx-think .material-icons { font-size: 18px; color: var(--brand-accent); animation: cx-pulse 1.2s ease-in-out infinite; }
.cx-think .sec { font-variant-numeric: tabular-nums; }
@keyframes cx-pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .cx-think .material-icons { animation: none; } .cx-tool-b .material-icons { transition: none; } }
/* 待送出訊息：「傳送中」小字貼在使用者泡泡下方右側 */
.cx-sending { align-self: flex-end; margin-top: calc(-1 * var(--space-3)); font-size: var(--fs-xs); color: var(--text-secondary); opacity: .8; }
/* 叫醒失敗的訊息（ai-wake-undelivered-bubble，核可 mockup mockups/2026-11-09-ai-wake-undelivered.html 方案 A）：
   泡泡外框與位置不變（用 outline 不佔版面），「傳送中」原地換成「沒有送達 · 動作」，字級行高與 .cx-sending 相同 */
.cx-u.is-failed { color: var(--text-secondary); outline: 1px dashed var(--border-strong); outline-offset: -1px; }
.cx-fail { align-self: flex-end; margin-top: calc(-1 * var(--space-3)); display: flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--text-secondary); }
.cx-fail .material-icons { font-size: 14px; color: var(--color-danger); }
.cx-fail-sep { color: var(--text-muted); }
.cx-fail-b { appearance: none; position: relative; border: 0; background: transparent; padding: 0; font: inherit; line-height: inherit; font-weight: 600; color: var(--brand-accent); text-decoration: underline; cursor: pointer; }
.cx-fail-b::after { content: ''; position: absolute; inset: -8px -6px; } /* 命中範圍補到 >= 32px，手機端同 .cx-send 作法 */
.cx-fail-b:hover { color: var(--brand-accent-dark); }
.cx-fail-b:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; border-radius: 2px; }
.cx-fail-s { font-weight: 600; color: var(--text-secondary); }
.cx-u.is-failed + .cx-fail { margin-top: calc(-1 * var(--space-3)); }
/* 0.15 秒淡入標記（只動透明度，不動版面）；減少動態偏好時直接切換 */
@keyframes cx-fail-in { from { opacity: .55; } to { opacity: 1; } }
.cx-u.is-failed, .cx-fail { animation: cx-fail-in .15s ease-out; }
@media (prefers-reduced-motion: reduce) { .cx-u.is-failed, .cx-fail { animation: none; } }
.cx-note { align-self: center; font-size: var(--fs-xs); color: var(--text-secondary); }

/* 輸入框（底部固定） */
.cx-foot { position: relative; flex: none; padding: var(--space-2) var(--space-4) var(--space-4); }

/* 斜線指令清單：輸入框上方彈出 */
.cx-slash { position: absolute; left: var(--space-4); right: var(--space-4); bottom: calc(100% - var(--space-2) + var(--space-1)); z-index: 5; max-height: 264px; overflow-y: auto;
  padding: var(--space-1); background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.cx-sl-g { padding: 6px 10px 2px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); }
.cx-sl-o { display: flex; align-items: baseline; gap: var(--space-3); padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: var(--fs-base); }
.cx-sl-o .n { flex: none; min-width: 130px; font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }
.cx-sl-o .d { min-width: 0; font-size: var(--fs-sm); color: var(--text-secondary); }
.cx-sl-o:hover, .cx-sl-o.is-on { background: var(--brand-accent-soft); }
.cx-comp { margin: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--bg-card); box-shadow: var(--shadow-sm); padding: var(--space-3) var(--space-3) var(--space-2) var(--space-4); }
.cx-comp:focus-within { border-color: var(--brand-accent); box-shadow: 0 0 0 3px var(--border-brand); }
.cx-comp.is-locked { background: var(--bg-surface-alt); }
.cx-thumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); padding-bottom: var(--space-2); }
.cx-thumbs:empty { display: none; }
.cx-ta { display: block; width: 100%; box-sizing: border-box; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: var(--fs-base);
  line-height: 24px; min-height: 48px; max-height: 192px; padding: 0; color: var(--text-primary); overflow-y: auto; }
.cx-ta::placeholder { color: var(--text-muted); }
.cx-ta:disabled { cursor: not-allowed; }
.cx-bar { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.cx-slot { margin-left: auto; display: inline-flex; }
.cx-ib, .cx-send { appearance: none; border: 0; cursor: pointer; width: 36px; height: 36px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.cx-ib { background: transparent; color: var(--text-secondary); }
.cx-ib:hover:not(:disabled) { background: var(--neutral-100); color: var(--text-primary); }
.cx-ib:disabled { cursor: not-allowed; opacity: .4; }
.cx-ib:focus-visible, .cx-send:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.cx-send { background: var(--brand-accent); color: var(--text-on-accent); }
.cx-send:hover:not(:disabled) { background: var(--brand-accent-dark); }
.cx-send:disabled { background: var(--neutral-200); color: var(--text-secondary); cursor: not-allowed; }
.cx-send--stop { background: var(--brand-primary); }
.cx-send--stop:hover:not(:disabled) { background: var(--brand-primary-dark); }
.cx-send .material-icons, .cx-ib .material-icons { font-size: 20px; }

/* 附加圖片縮圖（輸入框內與訊息氣泡內共用） */
.ao-thumb { position: relative; width: 56px; height: 56px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); overflow: hidden;
  background: linear-gradient(135deg, var(--brand-accent-soft), var(--neutral-200)); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; }
.ao-thumb--lg { width: 72px; height: 72px; }
.ao-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ao-thumb .rm { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--brand-primary); color: var(--text-on-brand); display: inline-flex; align-items: center; justify-content: center; }
.ao-thumb .rm .material-icons { font-size: 14px; }
.ao-thumb .rm:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }

/* 附加檔案小卡與拖拉提示（change ai-chat-files；輸入框內可移除、訊息氣泡內唯讀） */
.ao-file { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); max-width: 220px; min-height: 40px; padding: 4px 30px 4px 8px; box-sizing: border-box;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-surface-alt); color: var(--text-primary); font-size: var(--fs-xs); }
.ao-file--sent { padding-right: 8px; }
.ao-file > .material-icons { flex: none; font-size: 20px; color: var(--text-secondary); }
.ao-file-b { min-width: 0; display: flex; flex-direction: column; }
.ao-file-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ao-file-s { color: var(--text-secondary); }
.ao-file .rm { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--brand-primary); color: var(--text-on-brand); display: inline-flex; align-items: center; justify-content: center; }
.ao-file .rm .material-icons { font-size: 14px; }
.ao-file .rm:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.cx-comp.is-drop { position: relative; border-color: var(--brand-accent); box-shadow: 0 0 0 3px var(--border-brand); }
.cx-drop { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: var(--space-2); border-radius: inherit; pointer-events: none;
  background: var(--brand-accent-soft); color: var(--text-primary); font-size: var(--fs-sm); font-weight: 600; }

/* 側欄外框與標題列 */
.ao-side[hidden], .ao-pane[hidden], .tx-term[hidden], .cx-slash[hidden], .cx-tool-list[hidden] { display: none !important; }

.ao-side { position: fixed; top: var(--app-header-bottom, 58px); bottom: 42px; right: 0; width: 600px; max-width: 100vw; z-index: 1900; display: flex; flex-direction: column;
  background: var(--bg-card); border-left: 1px solid var(--border-default); box-shadow: var(--shadow-lg); }
.ao-side { container-type: inline-size; }
/* header 單行：行高基準 32px；放不下時「狀態＋已執行」整組換第二行，⋮／✕ 留第一行右側 */
.ao-side-hd { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--border-default); }
.ao-side-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-2); }
.ao-side-title { flex: 999 1 96px; min-width: 0; margin: 0; line-height: 32px; font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ao-side-status { flex: 1 0 auto; display: flex; align-items: center; flex-wrap: wrap; column-gap: var(--space-2); min-height: 32px; max-width: 100%; row-gap: var(--space-1); }
.ao-side-status .tx-seg { margin-left: auto; }
.ao-side-act { flex: none; display: flex; align-items: center; gap: 0; }
.ao-side-act .q-btn { width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 0; }
/* 窄版（面板 ≤ 440px）：狀態群組改占滿第二行 */
@container (max-width: 440px) {
  .ao-side-hd { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-2); }
  .ao-side-main { display: contents; }
  .ao-side-title { grid-column: 1; grid-row: 1; }
  .ao-side-act { grid-column: 2; grid-row: 1; }
  .ao-side-status { grid-column: 1 / -1; grid-row: 2; }
}
.ao-side-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; }
.ao-x { appearance: none; border: 0; background: transparent; cursor: pointer; width: 32px; height: 32px; border-radius: var(--radius-sm); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; }
.ao-x:hover { background: var(--neutral-100); color: var(--text-primary); }
.ao-x:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }

/* ═══ 側欄「對話／終端機」切換（tx- 前綴；theme.css 沒有 segmented，需收編 .tx-seg；終端機畫面 .tx-term 配色是例外） ═══ */
.tx-seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface-alt); }
.tx-seg button { appearance: none; border: 0; cursor: pointer; font: inherit; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); white-space: nowrap; }
.tx-seg button .material-icons { font-size: 16px; }
.tx-seg button:not([aria-pressed="true"]):hover { color: var(--text-primary); background: var(--neutral-100); }
.tx-seg button[aria-pressed="true"] { background: var(--brand-primary); color: var(--text-on-brand); font-weight: 700; }
.tx-seg button:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }

/* 終端機：深色底、等寬字，換行不出橫向捲軸 */
/* 終端機配色例外 開始：刻意模擬真實終端機的深色底與灰階，不進 token（UI-GUIDELINES 登記例外） */
.tx-term { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: #1e1e1e; color: #d4d4d4; cursor: text;
  font-family: "Cascadia Mono", Consolas, "Microsoft JhengHei", monospace; font-size: 13px; line-height: 1.6; }
.tx-term:focus-within { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.tx-out { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 10px; scrollbar-color: #4a4a4a #1e1e1e; }
.tx-l { display: grid; grid-template-columns: 2ch minmax(0, 1fr); }
.tx-t { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tx-or { color: #d97757; }
.tx-dim { color: #8c8c8c; }
.tx-foot { flex: none; padding: 0 16px 12px; }
.tx-rule { height: 1px; background: #4a4a4a; }
.tx-in { display: grid; grid-template-columns: 2ch minmax(0, 1fr); padding: 6px 0; max-height: 30vh; overflow-y: auto; scrollbar-color: #4a4a4a #1e1e1e; }
.tx-typed { white-space: pre-wrap; overflow-wrap: anywhere; }
.tx-cur { display: inline-block; width: 0.6em; height: 1.2em; vertical-align: text-bottom; background: #d4d4d4; animation: tx-blink 1.06s steps(1) infinite; }
.tx-term:not(:focus-within) .tx-cur { background: transparent; outline: 1px solid #8c8c8c; outline-offset: -1px; animation: none; }
.tx-term.is-locked .tx-cur { display: none; }
.tx-cap { position: absolute; left: 0; top: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; resize: none; overflow: hidden; }
@keyframes tx-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tx-cur { animation: none; } }
/* 終端機配色例外 結束 */

/* 第 N 次啟動與歷次紀錄（change ai-run-ledger-view；核可 mockup mockups/ai-run-ledger-2026-11-13.html） */
.ao-run-chip { display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 6px 0 10px; font-size: 12px; font-weight: 700; font-family: var(--font-sans); color: var(--text-secondary); background: var(--neutral-100); border: 1px solid var(--border-default); border-radius: var(--radius-pill); cursor: pointer; white-space: nowrap; }
.ao-run-chip .material-icons { font-size: 16px; transition: transform .15s; }
.ao-run-chip[aria-expanded="true"] .material-icons { transform: rotate(180deg); }
.ao-run-chip:focus-visible { outline: 2px solid var(--text-secondary); outline-offset: 2px; }
.ao-runs { flex: none; max-height: 40%; overflow-y: auto; border-bottom: 1px solid var(--border-default); background: var(--neutral-50); }
.ao-runs-hd { padding: var(--space-2) var(--space-4) 0; font-size: var(--fs-xs); color: var(--text-secondary); }
.ao-run-row { display: grid; grid-template-columns: minmax(7.5em, auto) 1fr auto 16px; align-items: baseline; column-gap: var(--space-3); padding: var(--space-2) var(--space-4); border-top: 1px solid var(--border-soft); font-size: var(--fs-sm); }
.ao-run-row.is-current { background: var(--neutral-100); }
.ao-run-no { font-weight: 700; white-space: nowrap; }
.ao-run-meta { min-width: 0; color: var(--text-secondary); overflow-wrap: anywhere; }
.ao-run-stage { display: block; color: var(--text-primary); }
.ao-run-st { font-size: var(--fs-xs); color: var(--text-secondary); white-space: nowrap; }
.ao-run-st.is-taken_over { font-weight: 700; }
.ao-runs .cw-skel { padding: 0; border-bottom: 0; }
/* 可點的列：在側欄開那個任務（「正在看」與已刪除的列不加 .is-link） */
button.ao-run-row { appearance: none; width: 100%; border: 0; border-top: 1px solid var(--border-soft); background: transparent; font: inherit; font-size: var(--fs-sm); color: inherit; text-align: left; cursor: pointer; }
.ao-run-row.is-link:hover { background: var(--neutral-100); }
.ao-run-row.is-link:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.ao-run-go { font-size: 16px; color: var(--text-secondary); align-self: center; }
.ao-run-row.is-deleted { color: var(--text-secondary); }
.ao-run-row.is-deleted .ao-run-no { font-weight: 500; }
.ao-run-when { white-space: nowrap; }
/* 讀不到時的「再試一次」 */
.ao-runs-err { padding: var(--space-2) var(--space-4); font-size: var(--fs-xs); color: var(--text-secondary); border-top: 1px solid var(--border-soft); }
.ao-runs-err button { appearance: none; border: 0; background: transparent; padding: 0 2px; font: inherit; color: var(--brand-primary); font-weight: 700; text-decoration: underline; cursor: pointer; }
.ao-runs-err button:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
/* 被接手的鎖頭行裡的「查看第 N 次啟動」（放在 .hp-lock 裡） */
.hp-lock .hp-go { appearance: none; border: 0; background: transparent; padding: 0; margin-left: 4px; font: inherit; color: var(--brand-primary); font-weight: 700; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.hp-lock .hp-go:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
/* 窄版（面板 ≤ 440px，同標題列斷點）：歷次啟動紀錄的列改兩行，第一行「第 N 次啟動＋狀態」，第二行人名、日期、做到哪。須放在 .ao-run-row 基本規則之後 */
@container (max-width: 440px) {
  /* 歷次啟動紀錄的列改兩行：第一行「第 N 次啟動＋狀態」，第二行人名、日期、做到哪 */
  .ao-run-row { grid-template-columns: minmax(7.5em, auto) 1fr 16px; row-gap: 2px; }
  .ao-run-no { grid-column: 1; grid-row: 1; }
  .ao-run-st { grid-column: 2; grid-row: 1; justify-self: end; }
  .ao-run-meta { grid-column: 1 / 3; grid-row: 2; }
  .ao-run-row > :nth-child(4) { grid-column: 3; grid-row: 1 / 3; }
}
/* 接手確認框「先不要」的鍵盤焦點：mockup 的中性灰外框，不用 Quasar 的灰底 */
.confirm-dialog__actions .q-btn.ao-tk-cancel:focus-visible { outline: 2px solid var(--text-secondary) !important; outline-offset: 2px; } /* Quasar 的 .no-outline 是 outline: 0 !important，只能用 !important 蓋 */
.confirm-dialog__actions .q-btn.ao-tk-cancel:focus-visible .q-focus-helper { display: none; }
/* 上線前補記的任務：徽章旁的補註（不進徽章） */
.ao-run-legacy { font-size: var(--fs-xs); color: var(--text-secondary); white-space: nowrap; }
/* 從歷次紀錄點進來、整筆任務還沒載入：算不出來的狀態先用骨架，不猜 */
.ao-run-skel { display: inline-block; width: 72px; height: 22px; border-radius: var(--radius-pill); background: var(--neutral-100); animation: cwSkel 1.2s ease-in-out infinite; }

.ao-dur { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--text-secondary); white-space: nowrap; }
.ao-dur .material-icons { font-size: 16px; }

.ao-ai-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-2); border-top: 1px solid var(--border-soft); border-radius: var(--radius-sm); cursor: pointer; }
.ao-ai-list .ao-ai-row:first-child { border-top: 0; }
.ao-ai-row:hover { background: var(--bg-paper); }
.ao-ai-row.is-sel { background: var(--brand-accent-soft); }
.ao-ai-row:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.ao-ai-i { flex: none; font-size: 18px; color: var(--brand-accent); }

.ao-ai-main { flex: 1; min-width: 0; }
.ao-ai-name { display: flex; align-items: center; gap: var(--space-2); }
.ao-ai-name .nm { min-width: 0; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ao-ai-name .status-chip { flex: none; }
.ao-ai-meta { margin-top: 2px; font-size: var(--fs-xs); color: var(--text-secondary); }


/* 待核准的外部訊息卡片（openspec change held-peer-message；核可原型 mockups/2026-10-10-held-peer-message-prototype.html 收編）
   hp-*：任務 AI 側欄（ai-job-panel）與專案 AI 面板（project-ai-panel）共用，元件為 components/held-peer-card.vue.html。
   .hp-act 內的按鈕樣式限定在卡片內，不新增全域 .btn。 */
.hp-act .btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid transparent; font-family: inherit; font-size: var(--fs-base); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background var(--transition-fast), border-color var(--transition-fast); }
.hp-act .btn .material-icons { font-size: 18px; }
.hp-act .btn:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.hp-act .btn--pri { background: var(--brand-primary); color: var(--text-on-brand); }
.hp-act .btn--pri:hover:not(:disabled) { background: var(--brand-primary-dark); }
.hp-act .btn--out { background: var(--bg-card); border-color: var(--brand-primary); color: var(--brand-primary); }
.hp-act .btn--out:hover:not(:disabled) { background: var(--bg-surface-alt); }
.hp-act .btn:disabled { opacity: .5; cursor: not-allowed; }
.hp-card { flex: none; overflow: hidden; border: 1px solid var(--border-strong); border-left: 4px solid var(--brand-accent); border-radius: var(--radius-md); background: var(--bg-card); }
.hp-card.is-closed { border-left-color: var(--border-strong); background: var(--bg-surface-alt); }
.hp-hd { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: 10px var(--space-4); background: var(--bg-paper); border-bottom: 1px solid var(--border-default); }
.hp-hd h3 { margin: 0; margin-right: auto; flex: 1 1 200px; min-width: 0; display: flex; align-items: flex-start; gap: var(--space-2); font-size: 14px; font-weight: 700; line-height: 1.5; color: var(--brand-primary); }
.hp-hd h3 .material-icons { flex: none; margin-top: 1px; font-size: 18px; color: var(--brand-accent); }
.hp-card.is-closed .hp-hd h3 .material-icons { color: var(--text-secondary); }
.hp-cd { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--bg-card); font-size: var(--fs-xs); color: var(--text-primary); white-space: nowrap; }
.hp-cd .material-icons { font-size: 14px; }
.hp-cd b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.hp-cd.is-urgent { border-color: var(--color-danger); color: var(--color-danger); background: var(--color-danger-soft); font-weight: 700; }
.hp-warn { display: flex; gap: var(--space-2); margin: var(--space-3) var(--space-4) 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--color-warning-soft); color: var(--color-warning-text); font-size: var(--fs-sm); line-height: 1.65; }
.hp-warn .material-icons { flex: none; font-size: 18px; margin-top: 1px; }
.hp-warn b { font-weight: 700; }
.hp-meta { display: grid; gap: 6px; margin: var(--space-3) var(--space-4) 0; font-size: var(--fs-sm); }
.hp-meta > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--space-2); }
.hp-meta dt { color: var(--text-secondary); }
.hp-meta dd { margin: 0; min-width: 0; color: var(--text-primary); overflow-wrap: anywhere; }
.hp-meta .sub { display: block; font-size: var(--fs-xs); color: var(--text-secondary); }
.hp-tag { display: inline-flex; align-items: center; margin-left: 6px; padding: 0 8px; height: 20px; border-radius: var(--radius-pill); background: var(--color-warning-soft); color: var(--color-warning-text); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; vertical-align: 1px; }
.hp-prev { margin: var(--space-3) var(--space-4) 0; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface-alt); }
.hp-prev-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px var(--space-3); padding: 8px 12px 0; font-size: var(--fs-xs); color: var(--text-secondary); }
.hp-prev-h b { font-size: var(--fs-sm); color: var(--text-primary); }
.hp-prev-b { padding: 6px 12px 10px; font-size: var(--fs-sm); line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-primary); }
.hp-card.is-closed .hp-prev-b { color: var(--text-secondary); }
.hp-mask { font-family: var(--font-mono); background: var(--neutral-200); border-radius: var(--radius-sm); padding: 0 4px; letter-spacing: .05em; }
.hp-prev-f { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px dashed var(--border-strong); font-size: var(--fs-xs); line-height: 1.6; color: var(--text-secondary); }
.hp-prev-f .material-icons { flex: none; font-size: 16px; }
.hp-prev-f b { color: var(--text-primary); font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.hp-act { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-4); }
.hp-act .btn { flex: 0 1 auto; }
.hp-act .btn .hp-spin { margin-right: 2px; }
.hp-hint { flex-basis: 100%; margin: 2px 0 0; font-size: var(--fs-xs); line-height: 1.6; color: var(--text-secondary); }
.hp-perm { flex-basis: 100%; display: flex; gap: 6px; margin: 0; padding: 8px 12px; border-radius: var(--radius-md); background: var(--bg-surface-alt); font-size: var(--fs-sm); color: var(--text-primary); line-height: 1.6; }
.hp-perm .material-icons { flex: none; font-size: 18px; color: var(--text-secondary); }
.hp-res { display: flex; gap: var(--space-2); margin: 0 var(--space-4) var(--space-4); padding: 10px 12px; border-radius: var(--radius-md); font-size: var(--fs-sm); line-height: 1.65; }
.hp-res .material-icons { flex: none; font-size: 18px; margin-top: 1px; }
.hp-res b { font-weight: 700; }
.hp-res--solo { margin: 0; }
.hp-res--ok { background: var(--color-success-soft); color: var(--color-success-text); }
.hp-res--warn { background: var(--color-warning-soft); color: var(--color-warning-text); }
.hp-res--bad { background: var(--color-danger-soft); color: var(--color-danger); }
.hp-res--info, .hp-res--busy { background: var(--bg-surface-alt); color: var(--text-primary); }
.hp-spin { display: inline-block; flex: none; width: 16px; height: 16px; margin-top: 2px; border: 2px solid var(--neutral-200); border-top-color: var(--brand-accent); border-radius: 50%; animation: hp-rot .8s linear infinite; }
.btn--out .hp-spin, .btn--pri .hp-spin { margin-top: 0; }
.btn--pri .hp-spin { border-color: rgba(250, 246, 241, .35); border-top-color: var(--text-on-brand); }
@keyframes hp-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hp-spin { animation: none; border-top-color: var(--brand-accent); border-right-color: var(--brand-accent); } }
.hp-lock { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 var(--space-2); padding: 0 4px; font-size: var(--fs-xs); line-height: 1.6; color: var(--text-secondary); }
.hp-lock .material-icons { flex: none; font-size: 16px; }
/* Claude 選單卡（change ai-claude-menu-card；核可 mockup mockups/ai-job-menu-card-2026-11-04.html）：外殼沿用 .hp-*、選項沿用 .aq-q .cx-opt */
.mc-body { padding: var(--space-3) var(--space-4) var(--space-4); }
.mc-body .aq-sum { margin-bottom: var(--space-1); }
.mc-body .cx-ask-q { font-family: var(--font-mono); font-weight: 500; }
.cx-opt .mc-no { flex: none; width: 1.2em; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.cx-opt.is-picked .mc-no { color: var(--brand-accent); font-weight: 700; }
.mc-lb { flex: 1; min-width: 0; overflow-wrap: anywhere; text-align: left; }
.mc-hint { display: block; font-size: var(--fs-xs); color: var(--text-secondary); }
.hp-card > .hp-res.mc-res { margin-top: 0; }
.mc-body > .hp-res { margin: 0; }
.hp-card > .hp-perm.mc-perm { margin: 0 var(--space-4) var(--space-4); }
.ag-group.is-held .ao-ai-row { background: var(--brand-accent-soft); }
.ao-ai-name .status-chip.hp-chip, .ao-side-status .status-chip.hp-chip { height: auto; min-height: 22px; padding: 2px 10px; white-space: normal; line-height: 1.4; text-align: left; }
.ao-ai-name .status-chip.hp-chip { flex: 0 1 auto; min-width: 0; }
.hp-chip .material-icons { font-size: 14px; flex: none; }
.hp-rowcd { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
@container (max-width: 440px) {
  .hp-meta > div { grid-template-columns: 56px minmax(0, 1fr); }
  .hp-act .btn { flex: 1 1 0; padding: 0 12px; }
}
/* ecs 核准上架卡與候選清單卡（openspec change ecs-approval-card；核可 mockup openspec/changes/ecs-approval-card/mockup/approval-card.html 收編）
   ac-*：補 .hp-* 決策卡的「內容區」（一句結果、區塊標題、清單列、還原計畫、勾選列），元件為 components/ai-approval-card.vue.html。
   卡片外框、標頭、按鈕列、結果條全部重用上面的 .hp-*，沒有新 token、沒有裸 hex。產品沒有深色模式，mockup 的深色示意區塊不收編。 */
.ac-lead { margin: var(--space-3) var(--space-4) 0; font-size: var(--fs-md); line-height: 1.7; font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.ac-top.hp-res { margin: var(--space-3) var(--space-4) 0; }
.ac-sec { margin: var(--space-4) var(--space-4) 0; }
.ac-h { display: flex; align-items: baseline; gap: 6px; margin: 0 0 var(--space-2); font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); }
.ac-n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.ac-sub { margin: var(--space-3) 0 var(--space-1); font-size: var(--fs-xs); font-weight: 700; color: var(--text-primary); }
.ac-sub:first-of-type { margin-top: 0; }
.ac-none { margin: 0; font-size: var(--fs-sm); color: var(--text-secondary); }
.ac-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-card); }
.ac-li { padding: 10px 12px; border-top: 1px solid var(--border-soft); font-size: var(--fs-sm); line-height: 1.6; overflow-wrap: anywhere; }
.ac-li:first-child { border-top: 0; }
.ac-li b { font-weight: 700; color: var(--text-primary); }
.ac-li .status-chip { margin-left: 6px; vertical-align: 1px; }
.ac-li .hp-tag { vertical-align: 1px; }
.ac-m { color: var(--text-secondary); font-size: var(--fs-xs); }
.ac-do { display: flex; gap: 6px; margin-top: 4px; color: var(--text-primary); }
.ac-do .material-icons, .ac-restore .material-icons { flex: none; font-size: 16px; margin-top: 2px; }
.ac-do .material-icons { color: var(--text-secondary); }
.ac-restore { display: flex; gap: 6px; margin-top: 6px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--color-warning-soft); color: var(--color-warning-text); }
.ac-id, .ac-hash { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ac-more { margin-top: 4px; font-size: var(--fs-xs); color: var(--text-secondary); }
.ac-more summary { cursor: pointer; display: flex; align-items: center; gap: 2px; list-style: none; min-height: 44px; font-size: var(--fs-sm); font-weight: 600; color: var(--brand-accent); }
.ac-more summary::-webkit-details-marker { display: none; }
.ac-more summary::before { content: "chevron_right"; font-family: "Material Icons"; font-size: 20px; font-weight: 400; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; font-feature-settings: "liga"; -webkit-font-feature-settings: "liga"; }
.ac-more[open] summary::before { content: "expand_more"; }
.ac-upd { margin-left: 6px; vertical-align: 1px; }
.ac-h .ac-upd { margin-left: 0; }
.ac-more summary:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.ac-ids { margin-top: 4px; font-family: var(--font-mono); overflow-wrap: anywhere; }
.ac-prev { margin: 0; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface-alt); padding: 8px 12px; font-size: var(--fs-sm); color: var(--text-secondary); }
.ac-prev summary { cursor: pointer; min-height: 28px; color: var(--text-primary); }
.ac-prev summary:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
/* 已核准卡的收合列（change ai-jobs-stale-approval）：按鈕外觀沿用 .ac-prev，展開後完整卡片接在下方 */
.ac-fold { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 44px; text-align: left; font: inherit; font-size: var(--fs-sm); color: var(--text-primary); cursor: pointer; }
.ac-fold .grow { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ac-fold .material-icons { flex: none; font-size: 20px; color: var(--text-secondary); }
.ac-fold:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.ac-fold + .ac-unfold { margin-top: var(--space-2); }
/* s6 勾選 */
.ac-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 0 var(--space-3); margin: var(--space-3) var(--space-4) 0; font-size: var(--fs-sm); color: var(--text-secondary); }
.ac-bar .grow { flex: 1 1 auto; }
.ac-lnk { appearance: none; border: 0; background: none; padding: 0 8px; min-height: 44px; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--brand-accent); text-decoration: underline; cursor: pointer; }
.ac-lnk:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.ac-lnk:disabled { color: var(--text-secondary); cursor: not-allowed; text-decoration: none; }
.ac-grp { border: 0; margin: var(--space-4) var(--space-4) 0; padding: 0; min-width: 0; }
.ac-grp legend { padding: 0; margin-bottom: var(--space-2); font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); }
.ac-pick { display: flex; gap: var(--space-3); align-items: flex-start; min-height: 44px; padding: 10px 12px; border-top: 1px solid var(--border-soft); cursor: pointer; }
.ac-pick:first-child { border-top: 0; }
.ac-pick input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand-accent); }
.ac-pick input:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.ac-pick.is-on { background: var(--brand-accent-soft); }
.ac-pick.is-lock { cursor: default; }
.ac-pick .t { flex: 1; min-width: 0; font-size: var(--fs-sm); line-height: 1.6; font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.ac-pick .m { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--text-secondary); }
.ac-pick .status-chip { flex: none; }
/* ≤768px 的按鈕命中範圍（外觀 36、外擴到 44）由上面既有的 :where(html.app-shell) .hp-act .btn 規則提供，
   本卡不另寫（mockup 的 .ac-card .hp-act .btn::after 補丁沒有 app-shell 前綴，會被手機段守門擋下，且與既有規則重複） */
/* 以下四個 class 是 mockup 的 inline style 收編：.ac-note0／.ac-after／.ac-intro／.ac-list--in／.ac-tag0 */
.ac-note0 { margin: 6px 0 0; } /* space-exempt: 照 mockup inline style 1:1 */
.ac-after { margin: 6px 0 0; } /* space-exempt: 照 mockup inline style 1:1 */
.ac-intro { margin: var(--space-1) var(--space-4) 0; font-size: var(--fs-sm); }
.ac-list--in { margin-top: 6px; } /* space-exempt: 照 mockup inline style 1:1 */
.ac-tag0 { margin-left: 0; }
/* 登入接力卡的驗證碼輸入（change remote-login-relay-20261113；核可 mockup mockups/remote-login-relay-2026-11-13.html 1:1）
   系統原本沒有驗證碼輸入元件，只用既有 token。真正的輸入框只有一個，透明地蓋在格子上（一次貼上整串、手機叫出數字鍵盤、
   螢幕閱讀器只聽到一個欄位）；格子只是顯示。mockup 的 .lc-code.is-focus 只是靜態圖模擬焦點，不收編。 */
.lc-field { margin: var(--space-3) var(--space-4) 0; }
.lc-lab { display: flex; align-items: baseline; gap: 6px; margin: 0 0 var(--space-2); font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); } /* space-exempt: 照 mockup 1:1 */
.lc-lab .ac-n { color: var(--text-secondary); font-size: var(--fs-xs); }
.lc-code { position: relative; display: flex; gap: var(--space-2); }
.lc-slot { flex: 1 1 0; min-width: 0; max-width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--text-secondary); border-radius: var(--radius-md); background: var(--bg-card); font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 500; color: var(--text-primary); }
.lc-code:focus-within .lc-slot.is-on { outline: 2px solid var(--brand-accent); outline-offset: -1px; }
.lc-slot.is-mask { color: var(--text-secondary); }
.lc-code.is-off .lc-slot { background: var(--bg-surface-alt); border-style: dashed; color: var(--text-secondary); }
.lc-code.is-bad .lc-slot { border-color: var(--color-danger); }
.lc-in { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; color: transparent; caret-color: transparent; font-size: 16px; cursor: text; } /* 16px：iOS 聚焦不放大 */
.lc-in::selection { background: transparent; }
.lc-in:focus, .lc-in:focus-visible { outline: none; } /* 焦點改由 .lc-code:focus-within 的格子外框表示 */
.lc-in:disabled { cursor: not-allowed; }
.lc-err { margin: 6px 0 0; font-size: var(--fs-xs); line-height: 1.6; color: var(--color-danger); } /* space-exempt: 與 .ac-note0 同值 */
.lc-err:empty { display: none; }
.lc-tail { padding-bottom: var(--space-4); } /* 收起的卡沒有按鈕列，結果條下方補卡片底部內距 */
.hp-card .hp-hd h3[tabindex]:focus { outline: none; } /* 送出後按鈕消失，焦點移到卡片標題 */
.hp-card .hp-hd h3[tabindex]:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
/* AI營運列表：專案分組列（change ai-jobs-grouped；來源 mockups/2026-10-08-ai-jobs-grouped.html）
   窄版（390）原 mockup 用 .frame--narrow 示意，正式版改為 max-width: 600px 媒體查詢 */
.ag-group { border-top: 1px solid var(--border-default); }
.ag-group:first-child { border-top: 0; }
.ag-head { appearance: none; border: 0; background: transparent; width: 100%; font-family: inherit; text-align: left; color: inherit; cursor: pointer; display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-3); padding: var(--space-3) var(--space-3); min-height: 52px; box-sizing: border-box; }
.ag-head:hover { background: var(--bg-paper); }
.ag-head:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.ag-group.is-open > .ag-head { background: var(--bg-paper); }
.ag-chev { flex: none; font-size: 22px; color: var(--text-secondary); transition: transform var(--transition-fast); }
.ag-group.is-open > .ag-head .ag-chev { transform: rotate(90deg); }
.ag-name { min-width: 0; font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-kind { flex: none; display: inline-block; padding: 0 var(--space-2); border-radius: var(--radius-pill); background: var(--neutral-100); color: var(--text-secondary); font-size: var(--fs-xs); line-height: 20px; white-space: nowrap; }
.ag-total { margin-left: auto; font-size: var(--fs-xs); color: var(--text-secondary); white-space: nowrap; }
.ag-counts { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; min-width: 332px; }
.ag-body { padding: 0 var(--space-3) var(--space-3) var(--space-10); background: var(--bg-paper); border-top: 1px solid var(--border-soft); }
.ag-body .ao-ai-list { border-left: 2px solid var(--border-strong); padding-left: var(--space-2); }
.ag-group:not(.is-open) > .ag-body { display: none; }
.ag-group.is-done > .ag-head .ag-name { color: var(--text-secondary); font-weight: 400; }
.ao-ai-row.is-archived .nm { font-weight: 400; color: var(--text-secondary); }
.ao-ai-row.is-archived .ao-ai-i { color: var(--text-secondary); }
.ag-more { flex: none; appearance: none; border: 0; background: transparent; width: 32px; height: 32px; border-radius: var(--radius-pill); color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ag-more:hover { background: var(--neutral-100); }
.ag-more:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.ag-more[disabled] { opacity: .4; cursor: not-allowed; }
.ag-short { display: none; }
@media (prefers-reduced-motion: reduce) { .ag-chev { transition: none; } }
@media (max-width: 768px) {
  .ag-long { display: none; }
  .ag-short { display: inline; }
  .ag-counts { min-width: 0; flex-basis: 100%; justify-content: flex-start; padding-left: calc(22px + var(--space-3)); order: 4; }
  .ag-total { margin-left: 0; flex-basis: 100%; padding-left: calc(22px + var(--space-3)); order: 3; }
  .ag-name { flex: 1; }
  .ag-body { padding-left: var(--space-4); padding-right: var(--space-2); }
  .ag-body .ao-ai-row { padding-left: var(--space-1); padding-right: 0; }
  .ag-body .ao-ai-name { flex-wrap: wrap; row-gap: var(--space-1); }
  .ag-body .ao-ai-name .nm { flex-basis: 100%; }
}

/* ============================================================
   AI營運列表改版（openspec change ai-ops-list-ux）
   來源：docs/ai-ops-list-ux/mockup/ai-jobs-mockup-2026-10-10.html（核可 1:1 規格；mockup 內 .nh- 前綴改為 .aj-）
   會改到共用元件（.unified-filter-bar／.unified-tab-item／.ag-more／.ao-ai-row）的規則一律掛在 .aj-page 底下，
   不影響其他頁。全部只用 token。
   ============================================================ */

/* 專案列：整列切換展開、專案名是連結（隱形的展開按鈕鋪滿整列，專案名連結浮在上面；避免 button 裡包 a） */
.aj-head { position: relative; cursor: pointer; }
.aj-toggle { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; appearance: none; cursor: pointer; }
.aj-toggle:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.aj-head > *:not(.aj-toggle) { position: relative; pointer-events: none; }
.aj-head > .aj-pj { pointer-events: auto; }
.aj-pj { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; cursor: pointer; padding: var(--space-3) 0; margin: calc(-1 * var(--space-3)) 0; }
.aj-pj:hover { color: var(--brand-accent); text-decoration-color: var(--brand-accent); }
.aj-pj:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; border-radius: 2px; }
.aj-page .ag-more { position: relative; }
.aj-page .ag-more::after { content: ""; position: absolute; inset: -6px; }

/* 列內 meta 帶圖示（啟動人／電腦／最近互動），並排元素同結構同字級 */
.aj-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; }
.aj-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.aj-meta .material-icons { font-size: 14px; color: var(--text-secondary); }
.aj-meta .aj-full { flex-basis: 100%; }

/* 區塊標題、「有 N 筆更新」 */
.aj-gap { margin-top: var(--space-3); }
.aj-sec-h { display: flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-2); }
.aj-sec-t { margin: 0; font-family: var(--font-sans); font-size: var(--fs-md); font-weight: 700; line-height: 1.4; color: var(--text-primary); letter-spacing: normal; }
.aj-upd { margin-left: auto; appearance: none; font: inherit; font-size: var(--fs-xs); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 var(--space-3); border: 1px solid var(--border-brand); border-radius: var(--radius-pill); background: var(--brand-accent-soft); color: var(--brand-accent-dark); cursor: pointer; position: relative; }
.aj-upd::after { content: ""; position: absolute; inset: -8px -4px; }
.aj-upd .material-icons { font-size: 14px; }
.aj-upd:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.aj-att .ao-ai-row.is-held { background: var(--brand-accent-soft); }
.aj-att .ao-ai-row.is-held:hover { background: var(--brand-accent-soft); }
.aj-att .ao-ai-row.is-sel, .aj-all .ao-ai-row.is-sel { background: var(--brand-accent-soft); }
.aj-att .ao-ai-row.is-held.is-sel { box-shadow: inset 3px 0 0 var(--brand-accent); }
.aj-page .ao-ai-row.is-sel { box-shadow: inset 3px 0 0 var(--brand-accent); }

/* 篩選列：搜尋框、電腦／啟動人多選、已選值小標籤 */
.aj-page .unified-filter-bar { flex-wrap: nowrap; gap: var(--space-3); }
.aj-page .unified-filter-bar > * { flex: 0 0 auto; min-height: 36px; box-sizing: border-box; }
.aj-page .unified-filter-bar > .aj-search { flex: 1 1 200px; min-width: 160px; }
.aj-page .unified-tab-item { position: relative; }
.aj-page .unified-tab-item::after { content: ""; position: absolute; inset: -4px 0; }
.unified-filter-bar .aj-search { position: relative; }
.aj-search .material-icons { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--text-secondary); pointer-events: none; }
.aj-in { width: 100%; height: 36px; box-sizing: border-box; padding: 0 10px 0 34px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-card); font: inherit; font-size: var(--fs-sm); color: var(--text-primary); }
.aj-in:focus { outline: 2px solid var(--brand-accent); outline-offset: -1px; border-color: var(--brand-accent); }
.aj-in::placeholder { color: var(--text-secondary); }
.aj-sel { appearance: none; font: inherit; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 var(--space-2) 0 var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); cursor: pointer; position: relative; }
.aj-sel::after { content: ""; position: absolute; inset: -4px 0; }
.aj-sel.is-on { border-color: var(--brand-accent); }
.aj-sel:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.aj-sel .material-icons { font-size: 20px; color: var(--text-secondary); }
.aj-sel-n { padding: 0 7px; border-radius: var(--radius-pill); background: var(--brand-accent-soft); color: var(--brand-accent); font-size: var(--fs-xs); font-weight: 700; line-height: 18px; }
.aj-pop { min-width: 268px; padding: 6px; }
.aj-opt { display: flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-2); border-radius: var(--radius-sm); font-size: var(--fs-sm); cursor: pointer; }
.aj-opt:hover { background: var(--bg-paper); }
.aj-opt input { width: 16px; height: 16px; accent-color: var(--brand-accent); }
.aj-opt-s { margin-left: auto; font-size: var(--fs-xs); color: var(--text-secondary); }
.aj-link { appearance: none; background: none; border: 0; padding: 0; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--brand-accent); text-decoration: underline; cursor: pointer; position: relative; }
.aj-link::after { content: ""; position: absolute; inset: -12px -8px; }
.aj-link:hover { color: var(--brand-accent-dark); }
.aj-link:disabled { color: var(--text-secondary); cursor: default; text-decoration: none; }
.aj-link:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; border-radius: 2px; }
.aj-chk { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; font-size: var(--fs-sm); color: var(--text-body); cursor: pointer; position: relative; }
.aj-chk::after { content: ""; position: absolute; inset: -4px; }
.aj-chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand-accent); }
.aj-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 10px 0 2px; }
.aj-clear { white-space: nowrap; }
.aj-fchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 var(--space-1) 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--bg-card); font-size: var(--fs-xs); color: var(--text-primary); }
.aj-fchip-s { color: var(--text-secondary); }
.aj-fchip-x { appearance: none; border: 0; background: transparent; width: 20px; height: 20px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); cursor: pointer; position: relative; }
.aj-fchip-x::after { content: ""; position: absolute; inset: -12px; }
.aj-fchip-x:hover { background: var(--neutral-100); color: var(--text-primary); }
.aj-fchip-x:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.aj-fchip-x .material-icons { font-size: 14px; }
@media (max-width: 768px) {
  .aj-in { font-size: 16px; }
}
@media (max-width: 768px) {
  .aj-page .unified-filter-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .aj-page .unified-filter-bar > .aj-search { grid-column: 1 / -1; flex-basis: 100%; }
  .aj-page .unified-filter-bar .aj-sel { justify-content: space-between; width: 100%; }
  .aj-clear { justify-self: end; }
  .aj-page .aj-sel::after { inset: -5px 0; }
  .aj-page .unified-filter-bar > .aj-search { min-height: 44px; }
  .aj-in { height: 44px; }
  .aj-opt { min-height: 44px; }
  .aj-page .unified-empty-state .clear-link { position: relative; }
  .aj-page .unified-empty-state .clear-link::after { content: ""; position: absolute; inset: -10px -8px; }
  .aj-menu .q-item { min-height: 44px; }
  .aj-pj { position: relative; z-index: 1; }
  .aj-att .ao-ai-name { flex-wrap: wrap; row-gap: var(--space-1); }
  .aj-att .ao-ai-name .nm { flex-basis: 100%; }
  .aj-sec-h { padding-left: 0; }
}

/* ============================================================
   AI營運列表「中斷紀錄」分頁（openspec change ai-disconnect-alert-ui）
   來源：docs/ai-disconnect-alert-ui/mockup/incidents-tab.html（老闆核可，1:1 規格）的 .inc-*，
   列骨架全是 .ao-ai-row／.aj-*／.status-chip，這裡只補差異。
   ============================================================ */
.inc-row .ao-ai-name .ag-kind { margin-left: 0; }
.inc-row.inc-open { background: var(--brand-accent-soft); box-shadow: inset 3px 0 0 var(--brand-accent); }  /* 進行中：沿用「需要處理」is-held 的淡紅底＋左緣紅條 */
.inc-row.inc-open:hover { background: var(--brand-accent-soft); }
.inc-row.inc-done .nm { font-weight: 400; color: var(--text-secondary); }  /* 已恢復／已結束：沿用已歸檔列的降調 */
.inc-row.inc-done .ao-ai-i { color: var(--text-secondary); }
.inc-go { flex: none; font-size: 22px; color: var(--text-secondary); }
.inc-scope { margin: 0; padding: 0 var(--space-2) var(--space-2); font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.7; }
.inc-fresh { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-3); font-size: var(--fs-xs); color: var(--text-secondary); }
.aj-opt input[type="radio"] { width: 16px; height: 16px; accent-color: var(--brand-accent); }

/* 分頁器（customers-list 的 .pager 是頁面內自己寫的，沒有共用版；文字與位置照它，按鈕補 44 命中） */
.inc-pager { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-3); margin-top: var(--space-3); font-size: var(--fs-xs); color: var(--text-secondary); }
.inc-pg { appearance: none; border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text-primary); width: 36px; height: 36px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; padding: 0; }
.inc-pg::after { content: ""; position: absolute; inset: -6px; }
.inc-pg:hover:not(:disabled) { background: var(--bg-paper); }
.inc-pg:disabled { opacity: .4; cursor: not-allowed; }
.inc-pg:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

/* 右側詳情面板內容（外框 .ao-side／.ao-side-hd／.ao-x 是 AI 對話面板現成的） */
.inc-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-4); }
.inc-sec { margin-bottom: var(--space-5); }
.inc-sec > .aj-sec-t { margin-bottom: var(--space-2); }
.inc-cause { padding: var(--space-3); border: 1px solid var(--border-soft); border-left: 3px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-paper); font-size: var(--fs-sm); line-height: 1.7; color: var(--text-body); }
.inc-cause.is-open { border-left-color: var(--color-danger); }
.inc-cause p { margin: 0; }
.inc-cause p + p { margin-top: var(--space-1); }
.inc-tl { list-style: none; margin: 0; padding: 0; }
.inc-tl > li { position: relative; padding: 0 0 var(--space-4) 28px; }
.inc-tl > li:last-child { padding-bottom: 0; }
.inc-tl > li::before { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; box-sizing: border-box; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--border-strong); }
.inc-tl > li::after { content: ""; position: absolute; left: 5px; top: 18px; bottom: -2px; border-left: 2px solid var(--border-default); }
.inc-tl > li:last-child::after { display: none; }
.inc-tl > li.t-bad::before { border-color: var(--color-danger); background: var(--color-danger); }
.inc-tl > li.t-ok::before { border-color: var(--color-success); background: var(--color-success); }
.inc-tl > li.t-wait::before { border-color: var(--color-danger); }
.inc-tl > li.t-ghost::before { border-style: dashed; }
.inc-t-time { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-secondary); }
.inc-t-title { font-size: var(--fs-base); font-weight: 700; color: var(--text-primary); line-height: 1.5; }
.inc-t-note { margin-top: 2px; font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.7; }
.inc-kv { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: var(--space-2) var(--space-3); margin: 0; font-size: var(--fs-sm); }
.inc-kv dt { color: var(--text-secondary); }
.inc-kv dd { margin: 0; color: var(--text-primary); overflow-wrap: anywhere; }
.inc-kv dd.mono { font-family: var(--font-mono); }
.inc-sub { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-secondary); }  /* 電腦欄 label 下方的 hostname（次要） */
.inc-jobs { list-style: none; margin: 0; padding: 0; }
.inc-job { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border-soft); }
.inc-job:first-child { border-top: 0; }
.inc-job-main { flex: 1; min-width: 0; }
.inc-job-name { font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.inc-job-links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin-top: 2px; }
@media (max-width: 768px) {
  :where(html.app-shell) .inc-pager { flex-wrap: wrap; justify-content: center; text-align: center; }
  :where(html.app-shell) .inc-sec-h { flex-wrap: wrap; row-gap: var(--space-1); }
  :where(html.app-shell) .inc-sec-h .aj-sec-t { white-space: nowrap; }
  :where(html.app-shell) .inc-fresh { margin-left: 0; width: 100%; justify-content: space-between; padding-left: 0; }
  :where(html.app-shell) .inc-kv { grid-template-columns: 6em minmax(0, 1fr); }
  :where(html.app-shell) .inc-row .ao-ai-name { flex-wrap: wrap; row-gap: var(--space-1); }
  :where(html.app-shell) .inc-job { align-items: flex-start; }
  :where(html.app-shell) .inc-job .aj-link { min-height: 20px; }
  /* 外觀小的連結與關閉鈕：命中範圍用透明 ::after 補到 ≥44（視覺不變） */
  :where(html.app-shell) .inc-fresh .aj-link, :where(html.app-shell) .inc-job .aj-link, :where(html.app-shell) .ao-side .ao-x { position: relative; }
  :where(html.app-shell) .inc-fresh .aj-link::after, :where(html.app-shell) .inc-job .aj-link::after { content: ''; position: absolute; inset: -12px -8px; }
  :where(html.app-shell) .ao-side .ao-x::after { content: ''; position: absolute; inset: -6px; }
}

/* ============================================================
   合作管理（服務商／轉介案件）＋勞務報酬單 共用元件
   openspec change referral-vendor-labor-20260930 task 9.1 收編
   來源：mockups/referral-labor-mockup-2026-09-30.html 檔頭「需收編」1–5、10–12
   （對應 UI-GUIDELINES.md §5.14–5.21；§8.2 存量登記）
   ============================================================ */

/* 需收編 #1：p-rule-attn「尚未填完，暫無法自動計算」（原 .partners-list-page 前綴移除；
   文字色由 --color-warning 改 --color-warning-text——原值白底 2.88:1 不合格） */
.p-rule-attn {
  font-size: var(--fs-xs);
  color: var(--color-warning-text);
  background: var(--color-warning-soft);
  padding: 1px 7px;
  border-radius: var(--radius-sm);
}

/* 需收編 #2：級距編輯器（原 .partners-list-page .tier-editor 全組，前綴移除）。
   .te-rate 改名 .te-val（泛化：夥伴端仍是比例，服務商端新增「每階固定金額」用同一欄位骨架）；
   .te-flag--ok／--warn 與 .te-try-out 文字色由 --color-success／--color-warning 改
   --color-success-text／--color-warning-text；第 5 欄軌寬 96px→120px、
   .te-val .te-num 寬 60px→84px（容納固定金額較長數字，改用描述子選擇器取代舊
   .te-num--rate 修飾 class，該 class 已從 partners-list.vue.html 移除）。 */
.tier-editor {
  border: 1px solid var(--border-default);
  background: var(--bg-page);
}
.tier-editor .te-hd {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.6;
}
.te-table {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
}
.te-hrow,
.te-row {
  display: grid;
  grid-template-columns: 108px 12px 108px 1fr 120px 28px;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
}
.te-hrow {
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-default);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: 600;
}
.te-hrow .rr { text-align: right; }
.te-row { border-bottom: 1px solid var(--border-soft); }
.te-row:last-of-type { border-bottom: none; }
.te-dash { text-align: center; color: var(--text-muted); }
.te-unit { font-size: var(--fs-sm); color: var(--text-secondary); white-space: nowrap; }
.te-val { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }

.tier-editor .te-num { min-width: 0; }
.tier-editor .te-num .q-field__control,
.tier-editor .te-num .q-field__native { min-width: 0; }
.tier-editor .te-val .te-num { width: 84px; }
.tier-editor .te-input-num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.tier-editor .te-num--auto .q-field__control { background: var(--bg-surface-alt); }
.tier-editor .te-row--bad .te-num .q-field__control { border-color: var(--color-danger) !important; }

.te-x.q-btn {
  width: 28px; height: 28px; min-width: 28px; min-height: 28px;
  padding: 0; color: var(--text-muted);
}
.te-x .q-icon { font-size: 16px; }
.te-x:hover { background: var(--color-danger-soft); color: var(--color-danger); }

.te-addbar {
  padding: 6px 10px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-card);
}

.te-flag {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); font-size: var(--fs-sm); line-height: 1.6;
}
.te-flag .te-ic { line-height: 1.4; }
.te-flag--ok { background: var(--color-success-soft); color: var(--color-success-text); border: 1px solid var(--border-default); }
.te-flag--warn { background: var(--color-warning-soft); color: var(--color-warning-text); border: 1px solid var(--border-default); }
.te-flag--err { background: var(--color-danger-soft); color: var(--color-danger); border: 1px solid var(--border-default); }
.te-flag b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.te-try {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 12px;
  background: var(--brand-primary-100); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); font-size: var(--fs-sm);
}
.te-try .te-try-in { width: 120px; min-width: 0; }
.te-try-out { color: var(--color-success-text); font-weight: 600; }
.te-try-out b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.te-try-out.te-try-out--gap { color: var(--color-warning-text); }

/* 批 D 例外 B-8／B-9(mobile-full-system):唯二不在 media 內的新規則,兩條都讓桌面 computed 值與原本逐項相同。
   B-8:分潤條件對話框(partners-list／vendors-list)原本的內聯 width／max-height 搬進 class,手機版才能覆寫;
       對話框 teleport 到 body,要比 Quasar .q-dialog__inner--minimized > div 強,所以帶 .q-dialog__inner > .q-card。
   B-9:階梯編輯器的輸入外包一層 .te-cell(為了手機版能加欄位標籤),桌面用 display:contents 讓它不產生盒子,grid 子項不變。 */
.q-dialog__inner > .q-card.rule-dlg { width: 620px; max-width: 96vw; }
.rule-dlg-body { max-height: 74vh; }
.te-cell { display: contents; }

/* 需收編 #5：階段選擇器＋暫停／失敗列（原 project-detail.vue.html:19-34，數值 1:1 搬移）。
   .pd-seg:focus-visible 與 .pd-pipe.is-readonly 為本次新增：前者供鍵盤操作（搭配
   template 補上的 tabindex／keydown），後者供轉介案件「收款結案」後唯讀態使用。 */
.pd-pipe { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; background: var(--bg-surface-alt); margin: 10px 0; }
.pd-seg { padding: 8px 16px; font-size: 13px; color: var(--text-secondary); cursor: pointer; border-right: 1px solid var(--border-default); white-space: nowrap; }
.pd-seg:last-child { border-right: none; }
.pd-seg.done { color: var(--brand-accent-dark); }
.pd-seg.cur { background: var(--bg-deep); color: var(--text-on-brand); font-weight: 700; }
.pd-seg.cur.pause { background: var(--color-warning); color: var(--text-on-brand); }
.pd-seg.cur.fail { background: var(--color-danger); color: var(--text-on-brand); }
.pd-seg:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.pd-pipe.is-readonly .pd-seg { cursor: default; }
.pd-exit-compact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0; }
.pd-exit-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; white-space: nowrap; flex-shrink: 0; }
.pd-exit-badge.pause { background: var(--color-warning-soft); color: var(--color-warning-text); }
.pd-exit-badge.fail { background: var(--brand-accent-soft); color: var(--brand-accent); }
.pd-exit-reason { font-size: 12.5px; color: var(--text-secondary); font-style: italic; }
.pd-exit-reason.empty { color: var(--text-secondary); }
.pd-exit-meta-mini { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.pd-exit-mini { padding: 4px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-strong); background: var(--bg-card); white-space: nowrap; font-family: inherit; }

/* 需收編 #10：內頁填入欄位格線（原 .rd-grid／.rd-ro／.rd-note，實作改名 .field-grid／
   .field-ro／.field-note。欄位本身不新增：label 沿用既有 .p-fg／.p-fl，本組只管排列，
   四欄等寬、每格最寬 280px，欄距 18px 照 project-detail .login-grid） */
.field-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 280px)); gap: 14px 18px; align-items: start; margin-bottom: 20px; }
.field-grid:last-child { margin-bottom: 0; }
.field-grid--2 { grid-template-columns: repeat(2, minmax(0, 280px)); }
.field-grid .p-fg { margin-bottom: 0; min-width: 0; }
.field-span3 { grid-column: span 3; }
.field-ro { min-height: 40px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-base); color: var(--text-primary); }
.field-note { margin-top: 4px; font-size: var(--fs-xs); color: var(--text-secondary); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field-note .warn { color: var(--color-warning-text); }
.field-note .err { color: var(--color-danger); }
.field-note .p-link { font-size: var(--fs-xs); }

/* 需收編 #11：主色「儲存」鈕停用態改灰底灰字（Quasar 預設只把火焰紅淡化 60%，
   停用時看起來仍像可按；所有「沒改就不能存」的儲存鈕共用） */
.q-btn.btn-accent.disabled, .q-btn.btn-accent[disabled] { background: var(--bg-surface-alt) !important; color: var(--text-secondary) !important; box-shadow: none; opacity: 1 !important; }

/* 需收編 #12：「有未儲存的變更」，放在頁頭「儲存」鈕左邊 */
.save-state { align-self: center; display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--color-warning-text); white-space: nowrap; }
.save-state .material-icons { font-size: 18px; }

/* 需收編 #3：勞務報酬單紙本（版面照 SWAP 勞報：左欄灰底段落標籤、右欄內容；配色全用
   theme token，不照抄 SWAP 顏色）。後台編輯頁右欄預覽與夥伴端手機頁顯示同一張單，
   兩邊必須長一樣。--narrow＝手機直排：段落標籤改在上方、左右兩格改上下。 */
.labor-paper { background: var(--bg-card); padding: 0; font-size: 13px; color: var(--text-primary); line-height: 1.6; }
.labor-paper .lp-note { font-weight: 400; color: var(--text-secondary); }
.labor-paper .lp-seal { height: 72px; width: auto; display: block; }
.labor-paper .lp-table { border: 1px solid var(--text-secondary); }
.labor-paper .lp-head { padding: 8px 10px 6px; border-bottom: 1px solid var(--text-secondary); }
.labor-paper .lp-title { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.labor-paper .lp-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; font-weight: 700; font-size: 12.5px; }
.labor-paper .lp-meta .lp-date { margin-left: auto; }
.labor-paper .lp-sec { display: grid; grid-template-columns: 96px minmax(0, 1fr); border-top: 1px solid var(--text-secondary); }
.labor-paper .lp-head + .lp-sec { border-top: 0; }
.labor-paper .lp-lab { border-right: 1px solid var(--text-secondary); padding: 8px 10px; display: flex; align-items: center; }
.labor-paper .lp-body { min-width: 0; }
.labor-paper .lp-body > * + * { border-top: 1px solid var(--text-secondary); }
.labor-paper .lp-row { padding: 8px 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; }
.labor-paper .lp-row.is-stack { flex-direction: column; align-items: stretch; gap: 6px; }
.labor-paper .lp-k { color: var(--text-primary); }
.labor-paper .lp-v { color: var(--text-primary); word-break: break-word; border-bottom: 1px solid var(--text-secondary); padding: 0 2px; }
.labor-paper .lp-num { font-variant-numeric: tabular-nums; }
.labor-paper .lp-blank { display: inline-block; min-width: 96px; height: 1.2em; border-bottom: 1px solid var(--text-secondary); }
.labor-paper .lp-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.labor-paper .lp-split > * + * { border-left: 1px solid var(--text-secondary); }
.labor-paper .lp-check { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--text-primary); }
.labor-paper .lp-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand-primary); }
.labor-paper .lp-box { height: 110px; border: 1px dashed var(--border-strong); display: flex; align-items: center; justify-content: center; }
.labor-paper .lp-box svg { width: 140px; height: 52px; }
.labor-paper .id-card-slot.is-none { gap: 2px; font-size: var(--fs-xs); }
.labor-paper .lp-canvas { display: block; width: 100%; height: 150px; border: 1px dashed var(--border-strong); background: var(--bg-card); touch-action: none; }
.labor-paper .lp-sig-tools { display: flex; justify-content: flex-end; }
.labor-paper--narrow .lp-sec { grid-template-columns: minmax(0, 1fr); }
.labor-paper--narrow .lp-lab { border-right: 0; border-bottom: 1px solid var(--text-secondary); padding: 6px 10px; }
.labor-paper--narrow .lp-split:not(.keep2) { grid-template-columns: minmax(0, 1fr); }
.labor-paper--narrow .lp-split:not(.keep2) > * + * { border-left: 0; border-top: 1px solid var(--text-secondary); }
.labor-paper--narrow .lp-meta .lp-date { margin-left: 0; }

/* 已收編（payroll-management 7.2）：工資條紙本 .payslip-paper。後台預覽對話框與 PDF 渲染頁
   （payroll-print.html）是兩個使用者、必須長一樣，比照 .labor-paper 收編。線條 1px --text-secondary。
   --narrow＝手機直排：實發列放在資訊格之後、應發項目之前。 */
.payslip-paper {
  background: var(--bg-card); color: var(--text-primary); font-family: var(--font-sans); font-size: 13px; line-height: 1.6;
  width: 210mm; max-width: 100%; box-sizing: border-box; padding: var(--space-5) 15mm 15mm; margin: 0 auto;
  border: 1px solid var(--border-default); position: relative;
}
.payslip-paper .ps-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-1); }
.payslip-paper .ps-co { font-size: var(--fs-md); font-weight: 700; }
.payslip-paper .ps-date { font-size: var(--fs-sm); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.payslip-paper .ps-date-l { font-family: var(--font-sans); }
.payslip-paper .ps-title { font-size: var(--fs-lg); font-weight: 700; margin: 0 0 var(--space-2); display: flex; align-items: center; gap: var(--space-2); }
.payslip-paper .ps-draft { margin-left: auto; }
.payslip-paper .ps-who { font-size: var(--fs-md); font-weight: 700; margin-bottom: var(--space-2); }
.payslip-paper .ps-info { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.payslip-paper .ps-info-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2) var(--space-4); }
.payslip-paper--narrow .ps-info-row { column-gap: var(--space-2); }
.payslip-paper--narrow .ps-info-row--a { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.payslip-paper .ps-info-c { display: flex; flex-direction: column; min-width: 0; }
.payslip-paper .ps-info-k { font-size: var(--fs-xs); color: var(--text-secondary); white-space: nowrap; }
.payslip-paper .ps-info-v { font-size: var(--fs-sm); font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.payslip-paper .ps-cols { display: flex; gap: var(--space-5); align-items: stretch; }
.payslip-paper .ps-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.payslip-paper .ps-col-h { font-weight: 700; padding-bottom: var(--space-2); border-bottom: 1px solid var(--text-secondary); margin-bottom: var(--space-2); }
.payslip-paper .ps-col-body { display: flex; flex-direction: column; gap: var(--space-2); }
.payslip-paper .ps-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3); align-items: baseline; }
.payslip-paper .ps-item-v, .payslip-paper .ps-colsum .ps-item-v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.payslip-paper .ps-item-note { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--text-secondary); }
.payslip-paper .ps-colsum { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--text-secondary); display: flex; justify-content: space-between; font-weight: 700; }
.payslip-paper .ps-net { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--text-secondary); padding: var(--space-3) 0; margin-top: var(--space-4); }
.payslip-paper .ps-net-k { font-size: var(--fs-md); font-weight: 700; }
.payslip-paper .ps-net-u { font-family: var(--font-sans); }
.payslip-paper .ps-net-v { font-size: var(--fs-xl); font-weight: 800; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.payslip-paper--narrow { width: 100%; padding: var(--space-4); }
.payslip-paper--narrow .ps-net { margin-top: var(--space-2); margin-bottom: var(--space-4); }
.payslip-paper--narrow .ps-cols { flex-direction: column; gap: var(--space-4); }

/* 需收編 #4：身分證正反面雙格（遮蔽縮圖／上傳格；.is-empty.is-error＝未上傳紅框） */
.id-card-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 460px; }
.id-card-slot {
  position: relative; aspect-ratio: 85.6 / 54; border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--bg-surface-alt); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-secondary); font-size: var(--fs-sm); font-family: inherit; cursor: pointer; overflow: hidden; padding: 0; width: 100%;
}
.id-card-slot .material-icons { font-size: 22px; }
.id-card-slot:hover { border-color: var(--border-strong); }
.id-card-slot:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.id-card-slot.is-empty { border: 1.5px dashed var(--border-strong); background: var(--bg-card); }
.id-card-slot.is-empty.is-error { border-color: var(--color-danger); color: var(--color-danger); }
.id-card-slot.is-none { cursor: default; }
.id-card-slot.is-filled { background: var(--bg-card); padding: 0; }
.id-card-slot.is-filled svg { width: 100%; height: 100%; display: block; }
.id-card-slot .retake { position: absolute; right: 6px; bottom: 6px; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-pill); padding: 1px 8px; font-size: 11px; color: var(--text-secondary); }

/* ═══ 我的工作台改版（workbench-v2-calendar-timeline）：專案色盤＋狀態選單共用樣式 ═══
   專案識別色 10 色（資料視覺用，暖色系；火焰紅保留給 CTA/active 不佔用）。slot 由
   shared/workbench-core.js 的 pjClass(pid) 以雜湊決定（與舊工作台同公式），元素掛 .wb-pj-N 即得 --pj／--pjs。
   --pjt／--pjt-hv／--pjd 由 --pj 推導：淡底（26%／36% 混卡片底）與深一階的實心色塊（65% 混主文字色，白字對比 ≥ 4.5:1）。
   名稱用 wb- 前綴，避開 Quasar 九個保留名（row／column／flex／col-*／xs／sm／md／lg／xl）。 */
.wb-pj-0 { --pj: #C28F3C; --pjs: #F8EFD9; }
.wb-pj-1 { --pj: #5C7A4D; --pjs: #EAEFE2; }
.wb-pj-2 { --pj: #9C5B68; --pjs: #F5E9EC; }
.wb-pj-3 { --pj: #4A6D8C; --pjs: #E4ECF2; }
.wb-pj-4 { --pj: #A6603A; --pjs: #F3E6DD; }
.wb-pj-5 { --pj: #6B5B95; --pjs: #EAE6F1; }
.wb-pj-6 { --pj: #3F7A6D; --pjs: #E1EEEA; }
.wb-pj-7 { --pj: #557089; --pjs: #E6ECF1; }
.wb-pj-8 { --pj: #8C4A5E; --pjs: #F2E4E8; }
.wb-pj-9 { --pj: #7A7340; --pjs: #EFEDDD; }
.wb-pj-0, .wb-pj-1, .wb-pj-2, .wb-pj-3, .wb-pj-4, .wb-pj-5, .wb-pj-6, .wb-pj-7, .wb-pj-8, .wb-pj-9 {
  --pjt: color-mix(in srgb, var(--pj) 26%, var(--bg-card));
  --pjt-hv: color-mix(in srgb, var(--pj) 36%, var(--bg-card));
  --pjd: color-mix(in srgb, var(--pj) 65%, var(--text-primary));
}
/* 不綁專案的個人任務（workbench-add-task）：中性色，與沒綁專案的活動 .act-card.np 同一組 token（品牌色邊條＋灰底），不佔用 10 色盤 */
.wb-pj-none { --pj: var(--brand-primary); --pjs: var(--bg-card); --pjt: var(--bg-card); --pjt-hv: var(--bg-surface-alt); --pjd: color-mix(in srgb, var(--brand-primary) 65%, var(--text-primary)); }
/* 工程任務（dev-center-into-tasks）：獨立鍵 __eng__，淡紙底＋深棕邊條，不佔 10 色盤，也不混進無專案 */
.wb-pj-eng { --pj: var(--brand-primary); --pjs: var(--bg-paper); --pjt: var(--bg-paper); --pjt-hv: var(--neutral-100); --pjd: color-mix(in srgb, var(--brand-primary) 65%, var(--text-primary)); }
:root { --late-bg: color-mix(in srgb, var(--color-danger) 28%, var(--bg-card)); }

/* 任務狀態圈圈與選單（數值逐項抄 project-detail 的 .pd-ck／.pd-menu-list／.pd-mit：20px 圓、熱區外擴 9px、選單項 34px、最小寬 180px） */
.wb-ck { appearance: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--bg-card); padding: 0; cursor: pointer; position: relative; flex: none; }
.wb-ck::before { content: ""; position: absolute; inset: -9px; }
.wb-ck:hover { border-color: var(--color-success); }
.wb-ck:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.wb-ck.doing { border-color: var(--brand-primary); background: linear-gradient(90deg, var(--brand-primary) 50%, var(--bg-card) 50%); }
.wb-ck.done { background: var(--color-success); border-color: var(--color-success); }
.wb-ck.done::after { content: ""; position: absolute; left: 4px; top: 0; width: 5px; height: 9px; border: solid var(--text-on-brand); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.wb-ck:disabled { cursor: not-allowed; opacity: .45; }
.wb-ck:disabled:not(.doing):not(.done):hover { border-color: var(--border-strong); }
/* goal-planning-20261111：手機任務列的狀態圓圈點擊範圍補到 44（20px 圓＋外擴；::before 從 padding box 起算故 -14） */
@media (max-width: 768px) { :where(html.app-shell) .wb-ck::before { inset: -14px; } } /* space-exempt: 點擊範圍 44px 換算 */
/* goal-planning-20261111：點擊範圍補到 44（外觀不變）；不能用在原生 select 與 overflow:hidden 的元素 */
.hit { position: relative; }
.hit::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
/* goal-planning-20261111：計畫任務來源標記（旗子），工作台、日曆、公司工作台、公司日曆共用 */
.src-ic { font-size: 14px; line-height: 1; vertical-align: -3px; margin-right: 2px; color: var(--pjd, var(--text-secondary)); } /* space-exempt: 圖示對齊小字基線 */
.pcal .pcal-tpj .src-ic { font-size: 13px; vertical-align: -2px; } /* space-exempt: 日曆晶片小字 */
.cwi-pj .src-ic.lk { color: var(--text-secondary); margin-right: 1px; }
.wb-menu { min-width: 180px; padding: 4px; display: grid; }
.wb-mit { appearance: none; border: 0; background: none; height: 34px; padding: 0 10px; display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; border-radius: var(--radius-sm); white-space: nowrap; width: 100%; font-family: inherit; font-size: 13px; color: var(--text-primary); }
.wb-mit:hover { background: var(--brand-primary-100); }
.wb-mit.on { font-weight: 700; }
.wb-mit .tail { margin-left: auto; font-size: 18px; }

/* 工作台共用小件：專案色點、截止日文字、小按鈕、分段切換、空狀態、復原提示條 */
.wb-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--pj); }
.wb-due { flex: none; font-size: var(--fs-xs); color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wb-due.late { color: var(--color-danger); font-weight: 700; }
.wb-due.today { color: var(--color-warning-text); font-weight: 700; }
.wb-act { appearance: none; flex: none; height: 26px; padding: 0 10px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-secondary); font-family: inherit; font-size: var(--fs-xs); font-weight: 700; cursor: pointer; white-space: nowrap; }
.wb-act:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.wb-act:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.wb-act:disabled { opacity: .5; cursor: not-allowed; }
.wb-seg { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-card); }
.wb-seg button { appearance: none; border: 0; background: var(--bg-card); padding: 6px 16px; font-family: inherit; font-size: var(--fs-sm); cursor: pointer; color: var(--text-secondary); }
.wb-seg .on { background: var(--brand-accent-soft); color: var(--brand-accent); font-weight: 800; }
.wb-seg button:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.wb-empty { padding: 28px 16px; text-align: center; font-size: var(--fs-sm); color: var(--text-secondary); }
.wb-toast { position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); background: var(--brand-primary-dark); color: var(--text-on-accent); font-size: var(--fs-sm); border-radius: var(--radius-pill); padding: 9px 20px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 2300; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.wb-toast.show { opacity: 1; }
.wb-toast.act.show { pointer-events: auto; }
.wb-toast-undo { appearance: none; margin-left: 14px; border: 0; background: none; padding: 0; font-family: inherit; font-size: inherit; font-weight: 700; color: var(--brand-accent-pale); text-decoration: underline; cursor: pointer; }
.wb-toast-undo:focus-visible { outline: 2px solid var(--brand-accent-pale); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .wb-toast { transition: none; } }

/* 人員標記（工作台頁首頭像下拉、專案 PM 標籤；數值抄自核可 mockup workbench-month-done-2026-10-07 的 C 版）。
   .pc-rt-pm（projects-center 頁內）保持原樣，兩者互不影響 */
.user-ava { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-primary); color: var(--text-on-accent); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pm-tag { flex: none; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; letter-spacing: .3px; background: var(--brand-accent-soft); color: var(--brand-accent-dark); }

/* ═══ 活動（personal-calendar-activities）：我的工作台週格、我的日曆頁共用的活動卡、新增／編輯視窗、側板 ═══
   核可 mockup：mockups/personal-calendar-2026-10-08/proto/act-shared.js（數值 1:1 搬入，全部取自上面的 token，沒有新 token）。
   專案色 --pj／--pjt／--pjt-hv 由元素或祖先的 wb-pj-N class 提供；沒綁專案的活動走 .np（品牌色邊條＋灰底）。
   側板沿用工作台側板外殼 .wbB-dr（定義在 personal-home 頁內），只在 .wbB 頁面內使用。 */
.act-wrap { container-type: inline-size; min-width: 0; }
.act-card { box-sizing: border-box; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 4px 6px; background: var(--pjt); border-left: 4px solid var(--pj); border-radius: var(--radius-sm); color: var(--text-primary); cursor: pointer; text-align: left; }
.act-card.np { --pj: var(--brand-primary); --pjt: var(--bg-card); --pjt-hv: var(--bg-surface-alt); }
/* cal-wb-polish-g-peer-cards：我的、沒綁專案的活動離開灰底（灰底只留給夥伴 .pv-peer），改白底＋細實線外框＋4px 品牌色左條。Google 行程（.gg）與夥伴（.pv-peer）不套用；「有空」維持虛線左框 */
.act-card.np:not(.pv-peer):not(.gg) { background-color: var(--bg-card); border: 1px solid var(--border-strong); border-left: 4px solid var(--brand-primary); }
.act-card.np.free:not(.pv-peer):not(.gg) { border-left-style: dashed; }
.act-card:hover { background: var(--pjt-hv); }
.act-card:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.act-card.on { box-shadow: inset 0 0 0 2px var(--brand-accent); }
/* booking-links 批 1：「有空」活動卡——虛線左邊框＋「有空」小標（灰階下仍可辨）；忙碌的卡不套用，畫面與原本相同 */
.act-card.free { border-left-style: dashed; }
.act-fr { flex: none; display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--bg-card); color: var(--text-secondary); font-family: var(--font-sans); font-size: 11px; font-weight: 700; line-height: 16px; letter-spacing: 0; }
.act-tm .act-fr { margin-left: 4px; }
.act-card.landed { animation: actLand .18s ease-out; }
@keyframes actLand { from { transform: scale(.94); box-shadow: var(--shadow-md); } to { transform: none; } }
.act-tm { display: flex; align-items: center; gap: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-xs); line-height: 1.4; color: var(--text-secondary); white-space: nowrap; min-width: 0; }
.act-tm i.ic, .act-ti i.ic, .act-card.v-month i.ic { font-size: 14px; flex: none; color: var(--text-secondary); }
.act-tm i.ic { margin-left: 4px; }
.act-tm i.ic:first-of-type { margin-left: auto; padding-left: 4px; }
.act-ti i.ic { margin-left: 4px; vertical-align: -2px; }
.act-bd { min-width: 0; }
.act-ti { font-size: var(--fs-sm); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.act-pj { display: flex; align-items: center; gap: 6px; margin-top: 1px; font-size: var(--fs-xs); line-height: 1.4; color: var(--text-secondary); min-width: 0; }
.act-pj .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container (max-width: 104px) { .act-tm { font-size: 11px; } .act-tm i.ic.vc { display: none; } }
@container (max-width: 76px) { .act-tm .te { display: none; } }
@container (min-width: 220px) { .act-card.v-cell { flex-direction: row; align-items: baseline; gap: 10px; } .act-card.v-cell .act-tm { flex: 0 0 auto; min-width: 108px; max-width: 60%; } .act-card.v-cell .act-bd { flex: 1 1 0; } }
.act-card.v-month { flex-direction: row; align-items: center; gap: 6px; height: 22px; padding: 0 6px 0 4px; border-left-width: 3px; white-space: nowrap; }
.act-card.v-month .ts { flex: none; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-xs); color: var(--text-secondary); }
.act-card.v-month .act-ti { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -webkit-line-clamp: unset; font-size: var(--fs-xs); font-weight: 700; }
/* Meet 的攝影機只留在週檢視的大張活動卡；月格、全天列、手機清單不放（點開側板有「加入會議」） */
.act-card.v-month i.ic.vc, .act-card.v-cell .act-tm i.ic.vc { display: none; }
/* 工作台週格：單日任務下方的活動區（只看不能拖） */
.act-zone { display: grid; gap: 4px; padding: 6px 4px 6px 5px; min-width: 0; }
.act-zone.sep { border-top: 1px solid var(--border-default); margin-top: 4px; }
.act-more { appearance: none; border: 0; background: none; font-family: inherit; font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); text-align: left; padding: 2px 4px; cursor: pointer; border-radius: var(--radius-sm); }
.act-more:hover { color: var(--brand-accent); text-decoration: underline; }
.act-more:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.act-plus { appearance: none; border: 0; background: transparent; color: inherit; width: 20px; height: 20px; padding: 0; border-radius: var(--radius-sm); display: inline-grid; place-items: center; cursor: pointer; opacity: .7; flex: none; }
.act-plus:hover { opacity: 1; background: color-mix(in srgb, currentColor 18%, transparent); }
.act-plus:focus-visible { opacity: 1; outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.act-plus .material-icons { font-size: 16px; }
.wbB .wbB-dh.act-h { padding: 0 8px; gap: 4px; }
/* 新增／編輯視窗 */
.act-dlg { width: 420px; max-width: 92vw; border-radius: var(--radius-md); }
.act-dlg .hd { display: flex; align-items: center; padding: 14px 20px 4px; }
.act-dlg .hd .tt { font-size: var(--fs-md); font-weight: 800; flex: 1; }
.act-dlg .bd { padding: 8px 20px 4px; display: grid; gap: 14px; }
.act-dlg .ft { display: flex; align-items: center; gap: 8px; padding: 12px 20px 16px; }
.act-dlg .ft .sp, .act-drf .sp { flex: 1 1 auto; }
.act-dlg .lb { display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }
.act-dlg .fl.dis .lb { opacity: .7; }
.act-in { box-sizing: border-box; width: 100%; height: 38px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 10px; background: var(--bg-card); color: var(--text-primary); font-family: inherit; font-size: var(--fs-base); }
.act-in:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.act-in.bad { border-color: var(--color-danger); }
.act-in:disabled { background: var(--bg-surface-alt); cursor: not-allowed; }
.act-err { margin-top: 4px; font-size: var(--fs-xs); color: var(--color-danger); }
.act-dlg .dw { position: relative; flex: 1 1 auto; }
.act-dlg .dw .act-ib { position: absolute; right: 4px; top: 5px; }
/* notification-center:日期改用任務的日期元件(維持「日期＋全天」一列)、提醒區、備註 */
.act-dlg .act-rem .act-remrow { display: grid; grid-template-columns: minmax(0, 1fr) 28px; gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); }
.act-dlg .act-remft { display: flex; align-items: center; gap: var(--space-3); }
.act-remadd { appearance: none; border: 0; background: transparent; display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-2) var(--space-1) 0; font-family: inherit; font-size: var(--fs-sm); font-weight: 700; color: var(--brand-accent-dark); cursor: pointer; }
.act-remadd .material-icons { font-size: 18px; }
.act-remadd:hover:not(:disabled) { text-decoration: underline; }
.act-remadd:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.act-remadd:disabled { color: var(--text-secondary); cursor: not-allowed; }
.act-dlg .act-note { display: block; width: 100%; box-sizing: border-box; min-height: 76px; max-height: 190px; padding: var(--space-2) var(--space-3); resize: vertical; font-family: inherit; line-height: 1.5; }
.act-dlg .act-cnt { margin-top: var(--space-1); text-align: right; }
/* 視窗內的日期欄（輸入框＋月曆鈕）與兩欄並排；原本只在 line-conversation 的 .lmx-dlg 底下，改為 .act-dlg 通用（workbench-add-task） */
.act-dlg .pd-datew { display: inline-flex; align-items: center; gap: 4px; width: 100%; }
.act-dlg .pd-datew .act-in { flex: 1 1 auto; min-width: 0; }
.act-dlg .pd-calbtn { cursor: pointer; font-size: 14px; opacity: .7; user-select: none; }
.act-dlg .pd-calbtn:hover { opacity: 1; }
.act-dlg .pd-calbtn .material-icons { font-size: 20px; vertical-align: middle; }
.act-dlg .act-2c { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.act-note-v { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 200px; overflow-y: auto; }
.act-ib { appearance: none; border: 0; background: transparent; cursor: pointer; width: 28px; height: 28px; border-radius: var(--radius-sm); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.act-ib:hover { background: var(--neutral-100); color: var(--text-primary); }
.act-ib:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.act-ib .material-icons { font-size: 20px; }
.act-sw { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-base); color: var(--text-primary); cursor: pointer; white-space: nowrap; }
.act-sw input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand-primary); }
.act-sw input:disabled + span { color: var(--text-secondary); }
.act-dlg .mt { display: flex; align-items: center; justify-content: space-between; min-height: 38px; }
.act-dlg .fl.dis .mt { opacity: .6; }
/* 已有會議連結：連結一行（過長截斷）＋下方兩顆鈕 */
.act-meet-url { display: block; font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-primary); text-decoration: underline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-meet-url:hover { color: var(--brand-accent); }
.act-meet-url:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.act-meet-row { display: flex; align-items: center; gap: var(--space-1); }
.act-meet-row .act-meet-url { flex: 1 1 auto; min-width: 0; }
.act-meet-row .act-ib { flex: none; }
/* 日期＋開始→結束＋全天 收成一行；點任一格開同一個合併挑選面板(月曆＋小時欄＋分鐘欄) */
.act-dt { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-2); row-gap: var(--space-2); }
.act-dtb { appearance: none; box-sizing: border-box; height: 38px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); font-family: var(--font-mono); font-size: var(--fs-sm); padding: 0 var(--space-2); cursor: pointer; white-space: nowrap; }
.act-dtb:hover { border-color: var(--brand-primary); }
.act-dtb:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.act-dtb.bad { border-color: var(--color-danger); }
.act-dtb.d { flex: 1 1 108px; min-width: 108px; }
.act-dtb.t { width: 62px; }
.act-dt .tg { display: inline-flex; align-items: center; gap: var(--space-2); flex: none; }
.act-dt .arr { font-size: 16px; color: var(--text-secondary); margin: 0 -2px; }
.act-dur { margin-top: var(--space-1); }
.act-dtp-bg { position: fixed; inset: 0; z-index: 6190; background: transparent; }
.act-dtp { position: fixed; z-index: 6200; box-sizing: border-box; width: 372px; max-width: calc(100vw - 16px); background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) 112px; column-gap: 12px; row-gap: 8px; outline: none; }
.act-dtp.day { grid-template-columns: minmax(0, 1fr); width: 248px; }
.act-dtp .cal { display: grid; gap: 8px; align-content: start; min-width: 0; }
.act-dtp .hd2 { display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.act-dtp .ym { font-family: var(--font-mono); }
.act-dtp .nav { appearance: none; border: 0; background: transparent; cursor: pointer; width: 28px; height: 28px; border-radius: var(--radius-sm); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.act-dtp .nav:hover { background: var(--neutral-100); color: var(--text-primary); }
.act-dtp .nav .material-icons { font-size: 20px; }
.act-dtp .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.act-dtp .dow { font-size: var(--fs-xs); color: var(--text-secondary); text-align: center; }
.act-dtp .dy { appearance: none; border: 0; background: none; height: 28px; padding: 0; border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-primary); }
.act-dtp .dy:hover { background: var(--brand-primary-100); }
.act-dtp .dy.today { box-shadow: inset 0 0 0 1px var(--brand-primary); }
.act-dtp .dy.sel { background: var(--brand-primary); color: var(--text-on-brand); }
.act-dtp .dy.blank { visibility: hidden; }
.act-dtp .tm { position: relative; min-height: 0; }
.act-dtp .tabs { display: grid; grid-template-columns: 1fr 1fr; height: 28px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.act-dtp .tabs button { appearance: none; border: 0; background: var(--bg-card); color: var(--text-secondary); font-family: inherit; font-size: var(--fs-xs); font-weight: 700; cursor: pointer; padding: 0; }
.act-dtp .tabs button.on { background: var(--brand-primary); color: var(--text-on-brand); }
.act-dtp .cols { position: absolute; inset: 36px 0 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.act-dtp .col { overflow-y: auto; display: grid; align-content: start; gap: 2px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 2px; scrollbar-width: thin; }
.act-dtp .col button { appearance: none; border: 0; background: none; height: 28px; flex: none; border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-primary); }
.act-dtp .col button:hover:not(:disabled) { background: var(--brand-primary-100); }
.act-dtp .col button.on { background: var(--brand-primary); color: var(--text-on-brand); }
.act-dtp .col button:disabled { color: var(--text-secondary); opacity: .45; cursor: not-allowed; }
.act-dtp button:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.act-dtp .ft2 { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.act-dtp .ft2 .sp { flex: 1 1 auto; }
.act-dtp .ft2 .lnk { appearance: none; border: 0; background: transparent; font-family: inherit; font-size: var(--fs-sm); font-weight: 700; color: var(--brand-accent-dark); cursor: pointer; padding: 4px 0; }
.act-dtp .ft2 .lnk:hover { text-decoration: underline; }
.act-dtp .ft2 .go { appearance: none; height: 28px; padding: 0 16px; border: 1px solid var(--brand-primary); border-radius: var(--radius-sm); background: var(--brand-primary); color: var(--text-on-brand); font-family: inherit; font-size: var(--fs-xs); cursor: pointer; }
/* ═══ 我的日曆:多天活動(my-calendar-multiday) ═══ */
/* 多天橫條(週全天列、月格):活動卡的變體;被週界切掉的一端直角＋箭頭 */
.act-card.v-bar { width: 100%; }
.act-card.v-bar.cutl { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.act-card.v-bar.cutr { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.act-card .bar-arr { font-size: 16px; flex: none; color: var(--text-secondary); margin: 0 -2px; }
.act-card.v-bar .ts { margin-right: 0; }
.act-card.hl { background: var(--pjt-hv); }
.act-card.gg.hl { background: var(--bg-page); }
.act-card.pv-peer.hl { background: var(--neutral-100); }
.act-card.fo { box-shadow: inset 0 0 0 2px var(--brand-accent); }
/* 「連續 N 天・第 k 天」小標籤(活動卡 cell 變體、側板、工作台週格共用) */
.act-sp { font-size: var(--fs-xs); line-height: 1.4; color: var(--text-secondary); }
/* 新增視窗:日期與時間區間框(單一滿寬外框＋內部細分隔線) */
.act-dth { display: flex; align-items: center; gap: var(--space-3); margin-bottom: 4px; min-height: 22px; }
.act-dth .lb { margin: 0; flex: 1 1 auto; }
.act-dth .act-sw { font-size: var(--fs-sm); gap: 6px; }
.act-dth .act-sw input { width: 16px; height: 16px; }
.act-rng { box-sizing: border-box; width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-card); overflow: hidden; }
.act-rrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 76px; height: 36px; cursor: pointer; }
.act-rrow.day { grid-template-columns: 44px minmax(0, 1fr); }
.act-rrow.one { grid-template-columns: minmax(0, 1fr) 76px 28px 76px; }
.act-rrow.one.day { grid-template-columns: minmax(0, 1fr); }
.act-rrow + .act-rrow { border-top: 1px solid var(--border-soft); }
.act-rrow .rk { display: flex; align-items: center; padding-left: 10px; font-size: var(--fs-sm); color: var(--text-secondary); white-space: nowrap; }
.act-rrow .arr { display: flex; align-items: center; justify-content: center; color: var(--text-secondary); border-left: 1px solid var(--border-soft); }
.act-rrow .arr .material-icons { font-size: 16px; }
.act-rng .act-dtb { height: 36px; width: auto; min-width: 0; flex: none; border: 0; border-radius: 0; background: transparent; }
.act-rng .act-dtb.d { text-align: left; padding: 0 10px; }
.act-rng .act-dtb.t { text-align: center; padding: 0; border-left: 1px solid var(--border-soft); }
.act-rrow:hover { background: var(--brand-primary-100); }
.act-rng .act-dtb:hover { background: transparent; }
.act-rng .act-dtb:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.act-rng .act-dtb.bad { color: var(--color-danger); box-shadow: inset 0 0 0 1px var(--color-danger); }
.act-dlg .act-dur { margin-top: 4px; }
.act-dlg .act-sub { margin: -2px 0 var(--space-1); }
.act-dlg .act-remnote { margin-bottom: 6px; /* space-exempt: 與下方提醒列的 6px 間距,核可 mockup 1:1 */ }
@media (max-width: 480px) {
  :where(html.app-shell) .act-rrow { grid-template-columns: 40px minmax(0, 1fr) 64px; }
  :where(html.app-shell) .act-rrow.day { grid-template-columns: 40px minmax(0, 1fr); }
  :where(html.app-shell) .act-rrow.one { grid-template-columns: minmax(0, 1fr) 64px 24px 64px; }
  :where(html.app-shell) .act-rrow.one.day { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  :where(html.app-shell) .act-dlg .act-sw, :where(html.app-shell) .act-dlg .act-remadd { position: relative; }
  :where(html.app-shell) .act-dlg .act-sw::after, :where(html.app-shell) .act-dlg .act-remadd::after { content: ""; position: absolute; inset: -8px -2px; }
}
/* 日期挑選面板 v2:頂端「開始｜結束」分頁、區間淡底、不可選的日子 */
.act-dtp.v2 > .tabs { grid-column: 1 / -1; height: 32px; }
.act-dtp.v2 .tm .cols { inset: 0; }
.act-dtp.v2 .grid { column-gap: 0; row-gap: 2px; }
.act-dtp.v2 .dy { border-radius: 0; }
.act-dtp.v2 .dy.rng { background: var(--brand-accent-soft); }
.act-dtp.v2 .dy.sel { border-radius: var(--radius-sm); }
.act-dtp.v2 .dy.sel.rs { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.act-dtp.v2 .dy.sel.re { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.act-dtp.v2 .dy.today:not(.sel) { border-radius: var(--radius-sm); }
.act-dtp.v2 .dy[aria-disabled="true"] { color: var(--text-secondary); opacity: .45; cursor: not-allowed; }
.act-dtp.v2 .dy[aria-disabled="true"]:hover { background: none; }
.act-dtp.v2 .dy.rs, .act-dtp.v2 .dy.re { background-clip: padding-box; }
.act-dtp.v2.day .tm { display: none; }
.act-dtp .ft2 .why { font-size: var(--fs-xs); color: var(--text-secondary); }
.act-dtp .ft2 .lnk[aria-disabled="true"] { opacity: .45; cursor: not-allowed; text-decoration: none; }
.act-pjbtn { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; padding: 0 4px 0 10px; }
.act-pjbtn .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-pjbtn .nm.ph { color: var(--text-secondary); }
.act-pjbtn .material-icons { font-size: 20px; color: var(--text-secondary); }
/* 選單高度限制在 240px：它從表單上半部往下開，不會蓋到底部的取消／儲存 */
.act-pjmenu { max-height: 240px; overflow-y: auto; }
.act-pjmenu .wb-mit .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.act-dlg .att { position: relative; }
.act-dlg .att.dis { opacity: .6; pointer-events: none; }
.act-dlg .att .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 38px; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 4px 6px; background: var(--bg-card); }
.act-dlg .att.dis .chips { background: var(--bg-surface-alt); }
.act-dlg .att .chips:focus-within { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.act-dlg .att input { flex: 1 1 120px; min-width: 80px; border: 0; outline: 0; background: transparent; font-family: inherit; font-size: var(--fs-base); color: var(--text-primary); height: 28px; }
.act-dlg .chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 2px 0 4px; border: 1px solid var(--border-default); border-radius: var(--radius-pill); background: var(--bg-surface-alt); font-size: var(--fs-sm); max-width: 100%; }
.act-dlg .chip .user-ava { width: 20px; height: 20px; font-size: 11px; }
.act-dlg .chip .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-dlg .chip em, .act-dlg .sug em, .act-att-row em { font-style: normal; font-size: var(--fs-xs); color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); padding: 0 6px; line-height: 16px; flex: none; }
.act-dlg .chip button { appearance: none; border: 0; background: transparent; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; color: var(--text-secondary); display: inline-grid; place-items: center; padding: 0; }
.act-dlg .chip button:hover { background: var(--neutral-100); }
.act-dlg .chip .material-icons { font-size: 14px; }
.act-dlg .sug { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 4px; display: grid; }
.act-dlg .sug button { appearance: none; border: 0; background: none; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 8px; border-radius: var(--radius-sm); font-family: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; color: var(--text-primary); }
.act-dlg .sug button:hover { background: var(--brand-primary-100); }
.act-dlg .sug .material-icons { font-size: 20px; color: var(--text-secondary); }
.act-bind { font-size: var(--fs-sm); font-weight: 700; color: var(--brand-accent); text-decoration: none; width: max-content; }
.act-bind:hover { text-decoration: underline; }
.act-bind:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.act-maplink { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; }
.act-maplink .material-icons { font-size: 16px; }
.wbB-kv dd .wbB-mono + .act-fr { margin-left: 0; }
/* cal-wb-polish-k1（核可 mockup company-wide-2026-11-09）：可見範圍切換、唯讀說明列、月格「全公司」小圖示 */
.act-vis .wb-seg button { min-height: 36px; position: relative; }
.act-vis .wb-seg button::after { content: ""; position: absolute; inset: -4px 0; } /* 外觀 36px，點擊範圍 44px */
.act-ti > .pv-co { margin-left: 6px; }
.pcal .pcal-mcc .act-wrap { container-type: inline-size; }
.act-card.v-month .pv-co-i { display: none; flex: none; font-size: 14px; line-height: 1; color: var(--brand-accent); }
@container (max-width: 199px) {
  .act-card.v-month .pv-co { display: none; }
  .act-card.v-month .pv-co-i { display: inline-block; }
}
.ro-note { margin: 0; font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.5; display: flex; gap: 6px; align-items: flex-start; }
.ro-note .material-icons { font-size: 18px; color: var(--text-secondary); flex: none; margin-top: 1px; }
/* 全員任務(批 K2):公司工作台／公司日曆的「全公司」區塊(.cwa)、任務側板鎖頭列、新增全員任務的指派預覽。照核可 mockup company-wide-2026-11-09 */
.cwa .cwb-h { flex-wrap: wrap; }
.cwa .cwb-n { flex: 1 1 auto; }
.cwa .cw-lrow { appearance: none; display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 12px; border: 0; border-top: 1px solid var(--border-soft); border-left: 3px solid var(--pj, var(--brand-primary)); background: var(--bg-card); font-family: inherit; font-size: var(--fs-base); color: var(--text-primary); text-align: left; cursor: pointer; }
.cwa .cw-lrow:hover { background: var(--pjt-hv, var(--brand-primary-100)); }
.cwa .cw-lrow.nopen { cursor: default; }
.cwa .cw-lrow.nopen:hover { background: var(--bg-card); }
.cwa .cw-lrow .bd { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.cwa .cw-lrow .tt { font-weight: 700; overflow-wrap: anywhere; }
.cwa .cw-lrow .pjn { font-size: var(--fs-xs); color: var(--text-secondary); overflow-wrap: anywhere; }
.cwa .cw-lrow .du { flex: none; font-size: var(--fs-sm); color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cwa-gh { padding: 8px 12px 4px; font-size: var(--fs-sm); font-weight: 800; color: var(--text-secondary); border-top: 1px solid var(--border-soft); }
.cwa-gh:first-child { border-top: 0; }
.cwa-pg { display: inline-flex; align-items: center; gap: 4px; }
.cwa-pg b { font-weight: 700; color: var(--text-primary); }
.cwa-pg .material-icons { font-size: 20px; color: var(--text-secondary); }
.cwa-pend { padding: 8px 12px 12px 15px; background: var(--bg-surface-alt); border-top: 1px solid var(--border-soft); display: grid; gap: 8px; }
.cwa-pk { font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); }
.cwa-pl { display: flex; flex-wrap: wrap; gap: 6px; }
.cwa-p { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 3px; border: 1px solid var(--border-default); border-radius: var(--radius-pill); background: var(--bg-card); font-size: var(--fs-sm); }
.cwa-p .user-ava { width: 20px; height: 20px; font-size: 11px; }
.cwa-pa { display: flex; gap: 8px; flex-wrap: wrap; }
.cwa-ac { padding: 4px 12px 10px; display: grid; gap: 4px; }
.cwa-ac .cwi .cwi-tm { min-width: 52px; }
.cwa .wb-act, .cwa-pa .wb-act { position: relative; }
.cwa .wb-act::after { content: ""; position: absolute; inset: -9px -4px; }
.cwa-empty { padding: 10px 12px; font-size: var(--fs-sm); color: var(--text-secondary); }
.cwa-desc { margin: 0; padding: 8px 12px 0; }
.cwa-tg, .cwa-sum { display: none; }
@media (max-width: 600px) {
  :where(html.app-shell) .cwa-tg { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-top: 1px solid var(--border-default); background: none; font-family: inherit; text-align: left; cursor: pointer; }
  :where(html.app-shell) .cwa-sum { display: block; flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  :where(html.app-shell) .cwa-tg .material-icons { flex: none; color: var(--text-secondary); }
  :where(html.app-shell) .cwa:not(.open) .cwa-body { display: none; }
  :where(html.app-shell) .cwa .cw-lrow { flex-wrap: wrap; }
  :where(html.app-shell) .cwa .cw-lrow .du { flex: 1 1 100%; }
  :where(html.app-shell) .cwa .cwb-h .wb-act { margin-left: auto; }
}
.act-lock { font-size: 16px !important; color: var(--text-secondary); vertical-align: -3px; margin-right: 2px; }
.act-lkrow { display: flex; align-items: flex-start; gap: 8px; }
.act-lkrow > span { flex: 1; min-width: 0; }
.act-lkrow .act-lock { flex: none; margin-left: auto; margin-top: 2px; }
.cwa-pre { display: grid; gap: 8px; }
.cwa-pre .n { font-size: var(--fs-md); font-weight: 800; }
.cwa-pre .n b { font-family: var(--font-mono); }
.tp-skip { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; column-gap: 12px; row-gap: 8px; }
.tp-skip .q-btn { position: relative; }
.tp-skip .q-btn::after { content: ""; position: absolute; inset: -4px 0; }
.tp-skip .msg { font-size: var(--fs-sm); color: var(--text-secondary); }
.act-hint { font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.5; }
.act-sync { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-primary); padding: 8px 10px; background: var(--color-warning-soft); border: 1px solid var(--color-warning); border-radius: var(--radius-sm); }
.act-sync .material-icons { font-size: 18px; color: var(--color-warning-text); flex: none; }
/* 「來自 LINE」來源列：專案詳情任務側欄／留言、活動檢視抽屜、工作台任務側板共用 */
.pd-src { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-secondary); }
.pd-src .material-icons { font-size: 16px; }
.pd-src-back { color: var(--brand-accent-dark); text-decoration: underline; }
.pd-src-back:hover { color: var(--brand-accent); }
/* 側板（外殼是工作台的 .wbB-dr） */
.wbB .act-dr { z-index: 2100; }
.wbB .act-dr.npa { --pj: var(--brand-primary); }
.wbB .act-drh.np { background: var(--bg-surface-alt); border-left: 4px solid var(--brand-primary); }
.wbB .act-drf { display: grid; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--border-default); background: var(--bg-card); }
.wbB .act-drf .rw { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wbB .act-dr .wbB-kv { align-items: start; }
.wbB .act-dr .wbB-kv dt { padding-top: 7px; }
.wbB .act-url { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-xs); color: var(--text-secondary); }
.wbB .act-att-row { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); min-height: 28px; }
.wbB .act-att-row .material-icons { font-size: 20px; color: var(--text-secondary); }
.wbB .act-daylist { display: grid; gap: 6px; }
/* cal-wb-polish-i：≤1099（含 iPad 直立）側板改全螢幕板，取代原本 ≤768 的底部抽屜；軟鍵盤開著時貼合可視區（VIEWPORT_KEYBOARD 只在 ≤768 作用） */
@media (max-width: 1099.98px) {
  .wbB aside.act-dr { top: 0; left: 0; right: 0; bottom: 0; width: 100vw; height: auto; border-left: 0; border-top: 0; border-radius: 0; animation: none; z-index: 2400; }
  .wbB aside.act-dr.is-kb-open { top: var(--vv-top, 0); bottom: auto; height: var(--vv-h); }
  .wbB .act-drf { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}

/* ── cal-wb-polish-i：活動側板行內編輯 .apn-*（來源＝核可 mockup 第四輪 .bi-*；密度比照任務側板 .wbB-kv：標籤小字、列間不畫線、列高 30） ── */
.apn-rows { margin: 0; }
.apn-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; gap: 2px 8px; align-items: center; padding: 3px 6px; margin: 0 -6px; border-radius: var(--radius-sm); min-height: 30px; box-sizing: border-box; }
.apn-row dt { font-size: var(--fs-xs); font-weight: 500; color: var(--text-secondary); align-self: start; padding-top: 6px; }
.apn-row dd { margin: 0; min-width: 0; word-break: break-word; font-size: var(--fs-sm); line-height: 1.5; }
.apn-row .pen { font-size: 16px; color: var(--text-secondary); opacity: 0; }
.apn-row.ed { cursor: pointer; }
.apn-row.ed:hover { background: var(--brand-primary-100); }
.apn-row.ed:hover .pen, .apn-row.ed:focus-visible .pen { opacity: 1; }
.apn-row.ed:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: -2px; }
.apn-row.open { background: transparent; }
.apn-row .lock, .apn-tlk .lock { font-size: 16px; color: var(--text-secondary); }
.apn-tlk { display: grid; grid-template-columns: minmax(0, 1fr) 20px; gap: 8px; align-items: start; }
.apn-tlk .lock { padding-top: 5px; }
@media (hover: none), (max-width: 1099.98px) {
  .apn-row { min-height: 48px; }
  .apn-row .pen { opacity: .7; }
}
.apn-chg { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--brand-accent-soft); color: var(--brand-accent-dark); font-size: 11px; font-weight: 700; line-height: 18px; }
.apn-old { display: block; font-size: var(--fs-xs); color: var(--text-secondary); }
.apn-ctl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.apn-in, .apn-sel, .apn-ta { box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-card); padding: 3px 8px; min-height: 30px; font: var(--fs-sm) var(--font-sans); color: var(--text-primary); }
.apn-in, .apn-ta { width: 100%; }
.apn-sel { max-width: 100%; }
.apn-ta { min-height: 56px; resize: vertical; display: block; }
.apn-in:focus, .apn-sel:focus, .apn-ta:focus { outline: 2px solid var(--brand-primary); outline-offset: -1px; }
.apn-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-pill); padding: 0 2px 0 10px; line-height: 26px; font-size: var(--fs-xs); margin: 0 4px 4px 0; max-width: 100%; }
.apn-chip button { appearance: none; border: 0; background: none; cursor: pointer; width: 22px; height: 22px; display: grid; place-items: center; color: var(--text-secondary); position: relative; padding: 0; }
.apn-chip button::before { content: ""; position: absolute; inset: -10px; }
.apn-chip .material-icons { font-size: 14px; }
.apn-att { display: flex; align-items: center; gap: 8px; min-height: 26px; font-size: var(--fs-sm); }
.apn-att .material-icons { font-size: 18px; color: var(--text-secondary); }
.apn-att em { flex: none; white-space: nowrap; font-style: normal; font-size: 11px; color: var(--text-secondary); border: 1px solid var(--border-default); border-radius: var(--radius-pill); padding: 0 6px; line-height: 16px; }
.apn-sugw { position: relative; }
.apn-sug { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 4px; display: grid; }
.apn-sug button { appearance: none; border: 0; background: none; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 8px; border-radius: var(--radius-sm); font-family: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; color: var(--text-primary); }
.apn-sug button:hover { background: var(--brand-primary-100); }
.apn-sug .material-icons { font-size: 20px; color: var(--text-secondary); }
.apn-meet { color: var(--brand-accent-dark); font-weight: 700; text-decoration: underline; }
.apn-err { margin-top: 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--color-danger); }
.apn-hint { font-size: var(--fs-xs); line-height: 1.5; color: var(--text-secondary); }
.apn-new-ti { padding: 10px 0 4px; }
.apn-note-v { white-space: pre-wrap; }
.apn-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.apn-tel { font-weight: 700; font-variant-numeric: tabular-nums; }
.apn-done { display: grid; gap: 8px; padding: 10px 12px; background: var(--brand-accent-soft); border: 1px solid var(--brand-accent); border-radius: var(--radius-md); }
.apn-done p { margin: 0; font-size: var(--fs-sm); line-height: 1.5; }
.apn-done .rw { justify-content: flex-end; }
.apn-b { appearance: none; height: 36px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text-primary); font: 700 var(--fs-sm) var(--font-sans); cursor: pointer; position: relative; display: inline-flex; align-items: center; gap: 4px; }
.apn-b:hover { background: var(--brand-primary-100); }
.apn-b.acc { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--text-on-accent); }
.apn-b.acc:hover { background: var(--brand-accent-dark); }
.apn-b.del { border-color: var(--color-danger); color: var(--color-danger); }
.apn-b.del:hover { background: var(--color-danger-soft); }
.apn-b:disabled { opacity: .6; cursor: not-allowed; }
.apn-b .material-icons { font-size: 18px; }
.apn-b:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.apn-alert { display: grid; gap: 8px; margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--color-danger); border-radius: var(--radius-md); background: var(--color-danger-soft); font-size: var(--fs-sm); line-height: 1.5; }
.apn-alert b { display: block; }
.apn-copyurl { user-select: all; word-break: break-all; font-size: var(--fs-xs); }
.apn-mt { margin-top: 8px; }
.apn-mt2, .apn-src { margin-top: 6px; }
.apn-why { margin-top: 2px; }
.apn-ttl { font-weight: 400; margin-top: 2px; }
.apn-ttl-ed { cursor: text; }
.apn-old-t { font-weight: 500; }
.apn-sync { margin-bottom: 10px; }
.apn-alert .rw { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.apn-full { display: none; }
@media (max-width: 1099.98px) { .apn-full { display: inline-flex; } .apn-desk { display: none; } }
/* 側板標題列(只限 .act-drh)：personal-home 的 `.wbB .wbB-drtop .wbB-ib{margin-left:auto}` 會讓每個圖示鈕都吃掉一半空間，
   `.wbB .wbB-ib{display:inline-flex}` 又蓋過 .apn-full／.apn-desk。這裡用更高權重改成「膠囊 margin-right:auto、圖示鈕不自帶 auto」，
   不動工作台任務／專案側板的標題列。 */
.wbB .act-drh .wbB-drtop .wbB-ib { margin-left: 0; }
.wbB .act-drh .wbB-drtop .stg { margin-right: auto; }
.wbB .act-drh .wbB-ib.apn-full { display: none; }
@media (max-width: 1099.98px) {
  .wbB .act-drh .wbB-ib.apn-full { display: inline-flex; }
  .wbB .act-drh .wbB-ib.apn-desk { display: none; }
}
/* 側板開著時的 toast：桌面放頂部品牌列正中間（不蓋側板內容與主區的卡）；≤1099 浮在操作列上方（操作列高度由側板寫進 --apn-foot） */
html.apn-open .wb-toast { z-index: 2500; white-space: normal; width: max-content; text-align: center; border-radius: var(--radius-md); }
@media (min-width: 1100px) { html.apn-open .wb-toast { top: 11px; bottom: auto; max-width: min(420px, calc(100vw - 420px)); } }
@media (max-width: 1099.98px) { html.apn-open .wb-toast { bottom: calc(var(--apn-foot, 64px) + 12px); } }
@media (prefers-reduced-motion: reduce) { .act-card.landed { animation: none; } .wbB .act-dr { animation: none; } }

/* ── gcal-multi-account：Google 行程(唯讀圖層)與日曆色。色票只當色點／虛線框／邊線，不當文字色。 ── */
.gc-blue { --gc: var(--cal-blue); }
.gc-green { --gc: var(--cal-green); }
.gc-purple { --gc: var(--cal-purple); }
.gc-orange { --gc: var(--cal-orange); }
.gc-pink { --gc: var(--cal-pink); }
.gc-slate { --gc: var(--cal-slate); }
.gdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gc, var(--text-secondary)); flex: none; margin-right: 5px; }
.gdot.hol { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-secondary); }
.act-card.gg { background: var(--bg-card); border: 1px dashed color-mix(in srgb, var(--gc, var(--text-secondary)) 70%, var(--bg-card)); border-left-width: 1px; color: var(--text-primary); padding: 3px 6px; }
.act-card.gg:hover { background: var(--bg-page); }
.act-card.gg .act-ti { font-weight: 500; color: var(--text-primary); }
.act-card.gg.v-month { border-left-width: 1px; padding: 0 6px; }
.act-card.gg.mk { border-color: var(--border-strong); background-image: repeating-linear-gradient(135deg, transparent 0, transparent 5px, color-mix(in srgb, var(--border-strong) 55%, transparent) 5px, color-mix(in srgb, var(--border-strong) 55%, transparent) 6px); }
.act-card.gg.mk .act-ti { color: var(--text-secondary); }
.act-card.gg.mk .gdot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-secondary); }
.act-pjbtn .gdot { margin-right: 0; }
.act-calrow { display: inline-flex; align-items: center; }
.act-calro { cursor: default; background: var(--bg-surface-alt); color: var(--text-primary); }
.act-calmenu { min-width: 240px; }
.act-calmenu .wb-mit .gdot { margin-right: 0; }
.act-calmenu .wb-mit.off { color: var(--text-secondary); cursor: not-allowed; }
.act-calnote { font-weight: 400; margin-left: 6px; }
.act-calgrp { padding: 8px 12px 2px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-calgrp:not(:first-child) { border-top: 1px solid var(--border-default); margin-top: 4px; }
.act-calgrp:empty { padding: 0; height: 0; }
.act-calwhy { font-size: var(--fs-xs); color: var(--text-secondary); margin-left: auto; padding-left: 8px; white-space: nowrap; }
.wbB .act-drh.gg { background: var(--bg-card); border-left: 4px solid var(--border-strong); border-bottom: 1px solid var(--border-default); }
.wbB .act-ggnote { margin: 16px 0 12px; font-size: var(--fs-sm); line-height: 1.6; color: var(--text-secondary); }
.wbB .act-ggbtn { color: var(--text-primary); }
.wbB .act-gdesc { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-sm); line-height: 1.5; }


/* ═══ 專案 AI（openspec change project-ai-frontend；來源＝核可 mockup docs/ai-intervention/mockup/project-ai-panel.vue.html） ═══
   區塊外框 .pai-panel（page／dock／embed 三種版面）、標題 .pai-title、對話 .pai-remote／.pai-act、等確定 .pai-prop／.pai-row／.pai-kv、
   任務列小標 .pai-chip、側欄 .pai-strip／.is-drawer。骨架沿用上方 .cx-*、.ao-side-*、.tx-seg。
   示範切換列 .pai-mock 不進正式版。 */
/* 區塊外框 */
.pai-panel { display: flex; flex-direction: column; min-height: 0; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; container-type: inline-size; }
/* 專案 AI 分頁：高度填滿視窗剩餘空間，不封頂；--pai-pt 是面板上緣在整頁的位置，由專案詳情頁 JS 量測 */
.pai-panel.is-page { height: max(360px, calc(100vh - var(--pai-pt, 260px) - 42px - 40px)); min-height: 360px; max-height: none; }
/* 滾輪只捲滑鼠所在的那一欄：對話、等確定各自捲動，捲到底不帶動整頁 */
.pai-panel .cx-scroll, .pai-panel .pai-scroll { overscroll-behavior: contain; }
/* 裝置那一行與「專案 AI 啟動」小標可 hover／聚焦看說明 */
.pai-dev { cursor: help; }
.pai-dev:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.pai-dev .pai-dev-i { font-size: 14px; color: var(--text-secondary); }
/* 說明氣泡：Quasar 預設 10px、灰底，中文太小太淡；改 13px、深棕底米白字 */
.q-tooltip { font-size: var(--fs-sm, 13px); line-height: 1.5; max-width: 300px; background: var(--brand-primary-dark); color: var(--text-on-brand); padding: var(--space-2) var(--space-3); }
/* 標題：專案 AI · 專案名。只有專案名會被截斷 */
.pai-title { display: flex; align-items: center; }
.pai-title .pai-tl { flex: none; }
.pai-title .pai-sep { flex: none; margin: 0 6px; font-weight: 400; color: var(--text-secondary); }
.pai-title .pai-tn { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 嵌入卡片（工作台抽屜、訊息中心第三欄）：收合時只有標題列＋一行摘要；展開後固定高度 */
.pai-panel.is-embed { flex: none; }
.pai-panel.is-embed.is-open { height: min(520px, calc(100vh - var(--app-header-bottom, 58px) - 200px)); min-height: 340px; }
.pai-sum { display: flex; align-items: center; gap: var(--space-2); width: 100%; box-sizing: border-box; margin: 0; padding: var(--space-3) var(--space-4); border: 0; background: transparent; font-family: inherit; font-size: var(--fs-sm); line-height: 1.5; text-align: left; color: var(--text-primary); }
button.pai-sum { cursor: pointer; }
button.pai-sum:hover { background: var(--brand-accent-soft); }
button.pai-sum:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.pai-sum b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 700; }
.pai-sum .pai-sum-go { margin-left: auto; font-size: 20px; color: var(--text-secondary); }
.pai-sum .q-btn { margin-left: auto; }
.pai-sum-sub { color: var(--text-secondary); }
.pai-panel .ao-side-hd { flex: none; }
.pai-body { flex: 1; min-height: 0; display: flex; }
.pai-pane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pai-pane.is-off { display: none; }
.pai-pane-h { display: none; align-items: center; gap: var(--space-2); flex: none; padding: var(--space-2) var(--space-5); border-bottom: 1px solid var(--border-soft); font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); }
.pai-n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.pai-seg .pai-n { margin-left: 2px; color: inherit; }
/* ai-project-log-ui：頁面版加了第三個分頁「專案記錄」後，所有寬度都用切換列、一次顯示一個分頁（原本 ≥1100px 對話與等確定並排的規則已取消；.pai-pane-h 因此不再顯示） */
.pai-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.pai-scroll:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.pai-empty { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.pai-empty > div + div { margin-top: var(--space-2); }

/* 對話 */
.pai-who { font-size: var(--fs-xs); color: var(--text-secondary); margin-bottom: 2px; }
.pai-remote { align-self: flex-start; max-width: 85%; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-card); padding: 10px 14px; font-size: var(--fs-base); line-height: 1.7; }
.pai-act { align-self: flex-start; max-width: 100%; display: flex; align-items: flex-start; gap: var(--space-2); padding: 6px 10px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface-alt); font-size: var(--fs-sm); line-height: 1.6; color: var(--text-secondary); }
.pai-act .material-icons { font-size: 16px; margin-top: 2px; flex: none; }
.pai-act .pai-t { margin-left: auto; padding-left: var(--space-2); flex: none; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
/* 備註卡片（project-ai-usage-feedback）：內文前 2 行、可展開；整張卡片可點（stretched link）開任務側板。 */
.pai-act.is-link { position: relative; }
.pai-act-b { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.pai-act-go { appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.pai-act-go::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius-md); }
.pai-act.is-link:hover { border-color: var(--border-strong); }
.pai-act-go:hover { color: var(--text-primary); text-decoration: underline; }
.pai-act-go:focus-visible { outline: none; }
.pai-act-go:focus-visible::after { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.pai-act-note { max-width: 100%; margin: 0; color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.pai-act-note.is-open { display: block; -webkit-line-clamp: unset; overflow: visible; }
/* 連續操作紀錄的摘要列（pai-collapse-acts）：整列可點，展開後明細縮排 */
.pai-acts { appearance: none; font: inherit; text-align: left; cursor: pointer; }
.pai-acts:hover { border-color: var(--border-strong); color: var(--text-primary); }
.pai-acts:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.pai-acts .pai-acts-chev { margin-left: var(--space-1); }
.pai-act.is-sub { margin-left: var(--space-4); }
.pai-act-more { position: relative; z-index: 1; appearance: none; background: none; border: 0; padding: 0; font: inherit; font-size: var(--fs-xs); color: var(--text-secondary); text-decoration: underline; cursor: pointer; }
.pai-act-more:hover { color: var(--text-primary); }
.pai-act-more:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.pai-sleep { display: flex; align-items: center; gap: var(--space-3); }
.pai-sleep .cx-ask-q { margin: 0; flex: 1; min-width: 0; }

/* 等確定 */
.pai-prop { display: grid; gap: var(--space-3); }
.pai-prop-hd { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); }
.pai-prop-hd .material-icons { font-size: 18px; color: var(--brand-accent); }
.pai-prop-hd .status-chip { margin-left: auto; }
.pai-src { font-size: var(--fs-sm); color: var(--text-secondary); }
.pai-plan { display: grid; gap: var(--space-2); }
.pai-row { display: grid; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-card); }
.pai-row-hd { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); }
.pai-row-hd .pd-btn-mini { margin-left: auto; }
.pai-row.is-off { background: var(--bg-surface-alt); }
.pai-row.is-off .pai-row-hd, .pai-row.is-off .pai-kv dd { color: var(--text-secondary); }
.pai-row.is-off .pai-kv .mono { text-decoration: line-through; }
.pai-kv { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px var(--space-3); margin: 0; font-size: var(--fs-sm); }
.pai-kv dt { color: var(--text-secondary); }
.pai-kv dd { margin: 0; color: var(--text-primary); overflow-wrap: anywhere; }
.pai-kv .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pai-kv .mono b { font-weight: 700; }
/* 專案 AI 等確定卡(openspec change project-ai-pending-kinds;核可 mockup 2026-10-28 區塊 B) */
/* 列標題:佔滿剩餘寬度、可換行,剔除鈕固定留在右邊 */
.pai-row-t { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
/* 標籤列:chip 一行排,窄了自動換行 */
.pai-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* 舊值 → 新值:寬時同一行;窄時新值整段(含箭頭)掉到下一行 */
.pai-chg { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); min-width: 0; }
.pai-old { font-weight: 400; color: var(--text-secondary); text-decoration: line-through; overflow-wrap: anywhere; }
.pai-to { display: flex; gap: var(--space-1); min-width: 0; overflow-wrap: anywhere; }
.pai-to > :first-child { flex: none; }
/* 這一列執行失敗:框線改紅(另有 chip 與文字,不只靠顏色) */
.pai-row.is-bad { border-color: var(--color-danger); }
/* 剔除／復原鈕、通知內容引文:原只定義在專案詳情頁,面板嵌到別頁會沒有樣式,收編於此(數值逐字照原頁) */
.pd-btn-mini { appearance: none; height: 28px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text-primary); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-family: inherit; font-size: var(--fs-xs); } /* space-exempt: 核可 mockup 1:1 規格(projects-center-and-detail-overhaul) */
.pd-btn-mini:hover { border-color: var(--brand-primary); }
.pd-btn-mini:disabled { opacity: .5; cursor: not-allowed; }
.pd-btn-mini:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.pd-btn-mini .material-icons { font-size: 16px; }
.pd-notify-quote { background: var(--bg-paper); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 10px 12px; color: var(--text-primary); line-height: 1.7; white-space: pre-wrap; } /* space-exempt: 核可 mockup 1:1 規格(projects-center-and-detail-overhaul) */
.pai-prop-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.pai-prop-actions .pai-rej-hint { flex: 1 1 100%; text-align: right; }

/* 任務列上的小標、AI 欄執行中 */
.status-chip.pai-chip { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.pd-tk .pai-chip { padding: 0 8px; }
.pai-chip .material-icons { font-size: 14px; }
.pd-page .pd-tk-h, .pd-page .pd-tk { grid-template-columns: 18px 24px minmax(300px, 1fr) 104px 150px 120px 64px 40px 28px; }
.pd-page .pd-tk-h.no-ai, .pd-page .pd-tk.no-ai { grid-template-columns: 18px 24px minmax(300px, 1fr) 104px 150px 120px 64px 28px; }
.pd-tk .ao-launch.run { background: var(--brand-accent-soft); position: relative; }
.pd-tk .ao-launch.run::after { content: ''; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--color-success); border: 1px solid var(--bg-card); }
.pd-tl .pai-ai { margin-right: var(--space-2); }

/* 專案詳情頁的專案 AI 改為標題列按鈕開的右側抽屜（project-detail-header-v2），不再有常駐並排面板／收合條（.pai-docked／.pai-pad 已移除） */
.pai-panel.is-drawer { position: fixed; z-index: 100; top: var(--app-header-bottom, 58px); right: 0; width: min(400px, 94vw); height: calc(100vh - var(--app-header-bottom, 58px) - 42px); border-right: 0; border-radius: var(--radius-lg) 0 0 var(--radius-lg); box-shadow: var(--shadow-lg); }
.pai-close { flex: none; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); cursor: pointer; }
.pai-close:hover { background: var(--bg-surface-alt); color: var(--text-primary); }
.pai-close:focus-visible, .pai-strip:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.pai-strip { width: 36px; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-3) 0; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: var(--shadow-sm); color: var(--text-primary); font-family: inherit; cursor: pointer; }
.pai-strip:hover { background: var(--brand-accent-soft); }
.pai-strip .material-icons { font-size: 20px; color: var(--brand-accent); }
.pai-strip-t { writing-mode: vertical-rl; font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.1em; }

/* ═══ 專案記錄 plg-*（openspec change ai-project-log-ui；來源＝核可原型 mockups/2026-10-09-ai-project-log-prototype.html）
   用在專案 AI 面板的「專案記錄」分頁（頁面版 is-page、側欄 dock）與任務側板的「相關待追蹤」。
   收編進 theme.css 的理由：同一組樣式用在兩處，且 q-dialog 內容會 teleport 到 body，頁面範圍選擇器對它無效。
   全部只用 token；不使用 Quasar 保留字（row／col／flex／xs／sm／md／lg／xl）當 class。 ═══ */
.pai-seg .pai-n.is-new { color: var(--brand-accent); font-weight: 700; }
.pai-seg [aria-pressed="true"] .pai-n.is-new { color: var(--brand-accent-pale); }
/* pending-count-push：專案頁頁首「專案 AI」鈕的等確定件數徽章（UI-GUIDELINES 計數徽章，選中態色）、等確定卡「已更新」標示 */
.pd-pai-n { position: absolute; top: -8px; right: -8px; z-index: 1; pointer-events: none; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--brand-accent-soft); color: var(--brand-accent); font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-xs); font-weight: 700; line-height: 1.4; } /* space-exempt: 計數徽章 padding 1px 8px，逐字照 UI-GUIDELINES 計數徽章規格 */
.pai-upd { display: inline-flex; align-items: center; gap: var(--space-1); padding: 1px 8px; border-radius: var(--radius-pill); background: var(--brand-accent); color: var(--bg-card); font-size: var(--fs-xs); font-weight: 700; line-height: 1.4; } /* space-exempt: 同計數徽章 */
.pai-prop-hd .pai-upd .material-icons { font-size: 14px; color: inherit; }
.pai-seg .pai-upd-s { margin-left: var(--space-1); }
/* project-header-merge 批 5:面板只有對話／等確定，右邊一個「前往專案記錄」連結(核可 mockup 狀態 8b、9、10) */
.ao-side-status .pai-seg { margin-left: 0; }
.pai-log { appearance: none; border: 0; background: none; min-height: 28px; margin-left: auto; padding: 0 var(--space-1); font: inherit; font-size: var(--fs-sm); color: var(--brand-accent-dark); cursor: pointer; position: relative; }
.pai-log::after { content: ''; position: absolute; inset: -8px 0; }
.pai-log:hover { text-decoration: underline; }
.pai-prop.is-updated { border-color: var(--brand-accent); box-shadow: 0 0 0 2px var(--brand-accent-soft); }
@media (prefers-reduced-motion: no-preference) { .pai-prop.is-updated { animation: pai-upd-pulse 1.2s ease-out 1; } }
@keyframes pai-upd-pulse { from { box-shadow: 0 0 0 8px var(--brand-accent-soft); } to { box-shadow: 0 0 0 2px var(--brand-accent-soft); } }
.pai-upd-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--brand-accent-soft); color: var(--text-primary); font-size: var(--fs-sm); }
.pai-upd-row .pai-seen { position: relative; flex: none; }
@media (max-width: 768px) {
  /* 手機：外觀 36、點擊範圍 44（§7A 第 3 條） */
  :where(html.app-shell) .pai-upd-row .pai-seen { height: 36px; padding: 0 var(--space-3); }
  :where(html.app-shell) .pai-upd-row .pai-seen::after { content: ''; position: absolute; inset: -4px; } /* space-exempt: 命中外擴量，36+4+4=44 */
}
/* 確定鈕因「已更新」失效（M2）：按鈕上方固定一行說明＋「回到更新處」；失效鈕用虛線外框，跟一般停用（半透明實心）看起來不同 */
.pai-hold { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); border: 1px dashed var(--brand-accent); color: var(--text-primary); font-size: var(--fs-sm); }
.pai-hold .material-icons { font-size: 18px; color: var(--brand-accent); flex: none; }
.pai-hold-t { flex: 1 1 auto; min-width: 0; font-weight: 700; }
.pai-hold-go { position: relative; flex: none; appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; font-weight: 700; color: var(--brand-accent); text-decoration: underline; cursor: pointer; }
.pai-hold-go:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.pai-prop-actions .q-btn.pai-approve-hold { background: transparent !important; color: var(--text-secondary) !important; border: 1px dashed var(--text-secondary); opacity: 1 !important; box-shadow: none; }
@media (max-width: 768px) {
  :where(html.app-shell) .pai-hold-go { min-height: 36px; padding: 0 var(--space-2); }
  :where(html.app-shell) .pai-hold-go::after { content: ''; position: absolute; inset: -4px; } /* space-exempt: 命中外擴量，36+4+4=44 */
  /* 「不採用」「確定」：外觀 36 高、命中範圍外擴成 44 高；兩顆間距 12，外擴 4 後命中範圍之間仍有 4 的空隙，不重疊（M3） */
  :where(html.app-shell) .pai-prop-actions { column-gap: var(--space-3); }
  :where(html.app-shell) .pai-prop-actions .q-btn { min-height: 36px; position: relative; }
  :where(html.app-shell) .pai-prop-actions .q-btn::after { content: ''; position: absolute; inset: -4px; } /* space-exempt: 命中外擴量，36+4+4=44 */
}
.pai-pane.pai-rec { position: relative; }
.plg-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.plg-scroll:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
/* ai-project-log-ui-polish：頁面版的專案記錄分頁不設固定高度，隨內容增高、由整頁捲動（原型即 height:auto）；側欄 dock 不受影響 */
.pai-panel.is-page.is-log { height: auto; }
.pai-panel.is-page.is-log .plg-scroll { overflow: visible; flex: 0 0 auto; }
.unified-empty-state button.clear-link { appearance: none; background: none; border: 0; padding: 0; font-family: inherit; font-size: inherit; }
.unified-empty-state button.clear-link:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.plg { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4) var(--space-5) var(--space-5); }
.plg-root { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.plg-cmp-hd { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.plg-cmp-t { font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); }

/* 目前狀況 */
.plg-now { border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-card); }
.plg-now-hd { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); padding: 10px var(--space-4); background: var(--bg-paper); border-bottom: 1px solid var(--border-default); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.plg-now-hd h3 { margin: 0; font-size: var(--fs-base); font-weight: 700; color: var(--brand-primary); display: flex; align-items: center; gap: var(--space-2); margin-right: auto; flex-wrap: wrap; }
.plg-now-hd h3 .material-icons { font-size: 18px; color: var(--brand-accent); }
.plg-now-sub { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 400; color: var(--text-secondary); }
.plg-now-btns { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.plg-now-body { padding: var(--space-4); }
.plg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plg-blk { padding: var(--space-3) var(--space-4); min-width: 0; border-top: 1px solid var(--border-soft); }
.plg-blk:nth-child(-n+2) { border-top: 0; }
.plg-blk:nth-child(even) { border-left: 1px solid var(--border-soft); }
.plg-blk h4 { margin: 0 0 var(--space-2); display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); }
.plg-blk h4 .material-icons { font-size: 16px; color: var(--text-secondary); }
.plg-cnt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; color: var(--text-secondary); }
.plg-ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.plg-li { appearance: none; display: grid; gap: 1px; text-align: left; border: 0; background: transparent; border-radius: var(--radius-sm); padding: 5px 6px; margin: 0 -6px; width: calc(100% + 12px); cursor: pointer; color: var(--text-primary); font-family: inherit; font-size: var(--fs-sm); line-height: 1.5; }
.plg-li:hover { background: var(--bg-surface-alt); }
.plg-li:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.plg-li-t { overflow-wrap: anywhere; }
.plg-li-m { font-size: var(--fs-xs); color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.plg-none { font-size: var(--fs-sm); color: var(--text-secondary); padding: 2px 0; }
.plg-skel { height: 240px; } /* 專案記錄時間線第一次載入的骨架(高度接近完成後常見高度);.pd-skel 的樣式在 project-detail 頁內 */
.plg-more { appearance: none; background: none; border: 0; padding: 4px 0 0; font: inherit; font-size: var(--fs-xs); color: var(--text-secondary); text-decoration: underline; cursor: pointer; }
.plg-more:hover { color: var(--text-primary); }
.plg-more:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.plg-omit { padding: var(--space-2) var(--space-4) var(--space-3); border-top: 1px solid var(--border-soft); font-size: var(--fs-xs); color: var(--text-secondary); }
.plg-pin { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-xs); font-weight: 700; color: var(--brand-accent); }
.plg-pin .material-icons { font-size: 14px; }
.plg-late { color: var(--color-danger); font-weight: 700; }
.plg-pins { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default); background: var(--bg-paper); }
.plg-pins h4 { margin: 0 0 var(--space-2); display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); }
.plg-pins h4 .material-icons { font-size: 16px; color: var(--brand-accent); }
.plg-pins .plg-li:hover { background: var(--bg-card); }
.plg-note-warn { margin: var(--space-3) var(--space-4) 0; }

/* 提示列 */
.plg-ro { font-size: var(--fs-sm); color: var(--text-secondary); display: flex; align-items: center; gap: 6px; padding: 8px var(--space-3); background: var(--bg-surface-alt); border-radius: var(--radius-md); }
.plg-ro .material-icons { font-size: 18px; flex: none; }
.plg-warn { font-size: var(--fs-sm); color: var(--color-warning-text); background: var(--color-warning-soft); border-radius: var(--radius-md); padding: 8px var(--space-3); }
.plg-err { font-size: var(--fs-sm); color: var(--color-danger); font-weight: 700; }

/* 篩選列與搜尋 */
.plg-bar { display: grid; gap: var(--space-2); }
.plg-fs { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.plg-f { appearance: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--bg-card); color: var(--text-secondary); font-family: inherit; font-size: var(--fs-sm); cursor: pointer; }
.plg-f:hover { border-color: var(--brand-primary); color: var(--text-primary); }
.plg-f:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.plg-f[aria-pressed="true"] { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--text-on-brand); font-weight: 700; }
.plg-q { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.plg-search { position: relative; flex: 1 1 200px; min-width: 0; }
.plg-search .material-icons { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--text-secondary); pointer-events: none; }
.plg-in, .plg-sel, .plg-ta { width: 100%; box-sizing: border-box; height: 36px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); font-family: inherit; font-size: var(--fs-base); padding: 0 10px; }
.plg-search .plg-in { padding-left: 32px; padding-right: 32px; }
.plg-in:focus, .plg-sel:focus, .plg-ta:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 3px var(--border-brand); }
.plg-ta { height: auto; min-height: 84px; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.plg-clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); appearance: none; border: 0; background: transparent; width: 32px; height: 32px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); display: inline-grid; place-items: center; }
.plg-clear:hover { background: var(--bg-surface-alt); }
.plg-clear:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.plg-clear .material-icons { position: static; transform: none; pointer-events: none; font-size: 18px; }
.plg-sel { width: auto; min-width: 130px; cursor: pointer; }
.plg-ck { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-primary); cursor: pointer; min-height: 36px; }
.plg-ck input { width: 16px; height: 16px; accent-color: var(--brand-accent); }
.plg-sum { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); font-size: var(--fs-xs); color: var(--text-secondary); }
.plg-sum b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-primary); }
.plg-link { appearance: none; background: none; border: 0; padding: 0; font: inherit; font-size: var(--fs-xs); color: var(--brand-accent); text-decoration: underline; cursor: pointer; }
.plg-link:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

/* 時間線 */
.plg-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-card); overflow: hidden; }
.plg-item + .plg-item { border-top: 1px solid var(--border-soft); }
.plg-item { transition: background var(--transition-slow); }
.plg-item.is-fresh { background: var(--brand-accent-soft); box-shadow: inset 3px 0 0 var(--brand-accent); }
.plg-item.is-flash { background: var(--bg-paper); box-shadow: inset 3px 0 0 var(--brand-primary); }
.plg-item-row { appearance: none; width: 100%; border: 0; background: transparent; display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2) var(--space-3); padding: 10px var(--space-4); text-align: left; cursor: pointer; color: var(--text-primary); font-family: inherit; font-size: var(--fs-base); }
.plg-item-row:hover { background: var(--bg-surface-alt); }
.plg-item-row:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.plg-item-row .status-chip { flex: none; margin-top: 1px; display: inline-flex; align-items: center; gap: 3px; }
.plg-item-row .status-chip .material-icons { font-size: 14px; }
.plg-item-row > .status-chip:first-child { min-width: 68px; justify-content: center; }
.plg-main { flex: 1 1 180px; min-width: 0; display: grid; gap: 2px; }
.plg-title { font-size: var(--fs-base); line-height: 1.55; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.plg-item.is-open .plg-title { display: block; -webkit-line-clamp: unset; overflow: visible; }
.plg-meta { font-size: var(--fs-xs); color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; }
.plg-meta .t { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.plg-meta .src { display: inline-flex; align-items: center; gap: 3px; }
.plg-meta .material-icons { font-size: 14px; }
.plg-tail { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); margin-left: auto; flex: none; max-width: 260px; }
.plg-tail .plg-chev { font-size: 20px; color: var(--text-secondary); transition: transform var(--transition-fast); }
.plg-item.is-open .plg-tail .plg-chev { transform: rotate(180deg); }
.plg-mchips { display: none; }
.plg-item.is-sys .plg-item-row { padding-top: 6px; padding-bottom: 6px; }
.plg-item.is-sys .plg-title { font-size: var(--fs-sm); color: var(--text-secondary); -webkit-line-clamp: 1; }
.plg-item.is-sys .status-chip { background: transparent; border: 1px solid var(--border-default); color: var(--text-secondary); font-weight: 500; }
.plg-item.is-void .plg-title, .plg-item.is-void .plg-meta .t { text-decoration: line-through; color: var(--text-secondary); }
.plg-item.is-void .plg-item-row > .status-chip:first-child { opacity: .7; }
.plg-item.is-corrected .plg-title { color: var(--text-secondary); }
.plg-item.is-corrected .plg-item-row > .status-chip:first-child { opacity: .6; }
.plg-detail { padding: 0 var(--space-4) var(--space-3); display: grid; gap: var(--space-3); }
.plg-kv { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 4px var(--space-3); margin: 0; font-size: var(--fs-sm); }
.plg-kv dt { color: var(--text-secondary); }
.plg-kv dd { margin: 0; color: var(--text-primary); overflow-wrap: anywhere; white-space: pre-wrap; }
.plg-ev-note { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-secondary); }
.plg-lk { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: var(--brand-accent); text-decoration: underline; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.plg-lk:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.plg-act { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.plg-mini { appearance: none; height: 28px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text-primary); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-family: inherit; font-size: var(--fs-xs); }
.plg-mini:hover:not(:disabled) { border-color: var(--brand-primary); }
.plg-mini:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.plg-mini:disabled { opacity: .5; cursor: not-allowed; }
.plg-mini .material-icons { font-size: 16px; }
.plg-mini--danger { color: var(--color-danger); }
.unified-empty-state.plg-empty { padding: var(--space-6) var(--space-4); }
.plg-more-row { display: flex; justify-content: center; }

/* 階段標籤 */
.plg-stg { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text-secondary); font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; }
.plg-stg--paused { background: var(--color-warning-soft); border-color: var(--color-warning); color: var(--color-warning-text); }
.plg-stg--failed { background: var(--color-danger-soft); border-color: var(--color-danger); color: var(--color-danger); }
.plg-stg--closed { background: var(--color-success-soft); border-color: var(--color-success); color: var(--color-success-text); }

/* AI 備註總覽 */
.plg-ovh { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px var(--space-2); margin: var(--space-2) 0 var(--space-2); }
.plg-ovh h3 { margin: 0; font-size: var(--fs-base); font-weight: 700; color: var(--brand-primary); display: flex; align-items: center; gap: var(--space-2); }
.plg-ovh h3 .material-icons { font-size: 18px; color: var(--brand-accent); }
.plg-ovh .plg-sub { font-size: var(--fs-xs); color: var(--text-secondary); }
.plg-ovl { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-card); overflow: hidden; }
.plg-ovl li + li { border-top: 1px solid var(--border-soft); }
.plg-ovr { appearance: none; width: 100%; border: 0; background: transparent; display: grid; grid-template-columns: 150px minmax(0, 1fr) 118px; gap: var(--space-3); align-items: start; padding: 10px var(--space-4); text-align: left; cursor: pointer; font-family: inherit; font-size: var(--fs-sm); color: var(--text-primary); }
.plg-ovr:hover { background: var(--bg-surface-alt); }
.plg-ovr:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.plg-ovr .tk { font-weight: 700; overflow-wrap: anywhere; }
.plg-ovr .tx { overflow-wrap: anywhere; line-height: 1.55; }
.plg-ovr .tm { font-family: var(--font-mono); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.plg-ovm { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); font-size: var(--fs-xs); color: var(--text-secondary); }

/* 新記錄提示：浮在專案記錄分頁頂端中間（定位在 .pai-pane.pai-rec 內），點了才重載 */
.plg-new { position: absolute; z-index: 5; top: var(--space-2); left: 50%; transform: translateX(-50%); appearance: none; border: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px 0 12px; border-radius: var(--radius-pill); background: var(--brand-primary); color: var(--text-on-brand); font-family: inherit; font-size: var(--fs-sm); font-weight: 700; box-shadow: var(--shadow-md); cursor: pointer; max-width: calc(100vw - 24px); }
.plg-new:hover { background: var(--brand-primary-dark); }
.plg-new:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.plg-new .material-icons { font-size: 18px; color: var(--brand-accent-pale); }

/* 新增／更正／作廢／置頂／接手摘要的對話框（q-dialog 內容，teleport 到 body，所以放全域） */
.plg-dlg { width: min(520px, 94vw); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.plg-dlg--wide { width: min(640px, 94vw); }
.plg-dlg-h { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default); }
.plg-dlg-h h2 { margin: 0; font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); flex: 1; }
.plg-dlg-b { padding: var(--space-4); overflow-y: auto; display: grid; gap: var(--space-4); align-content: start; }
.plg-dlg-f { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border-default); background: var(--bg-page); }
.plg-dlg form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.plg-dlg .tx-seg { display: flex; width: 100%; }
.plg-dlg .tx-seg button { flex: 1; justify-content: center; min-height: 36px; }
.plg-fld { display: grid; gap: 6px; }
.plg-fld-l { display: flex; align-items: baseline; gap: var(--space-2); font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); }
.plg-fld-l .plg-req { color: var(--color-danger); font-weight: 700; }
.plg-fld-l .plg-opt { font-weight: 400; color: var(--text-secondary); font-size: var(--fs-xs); }
.plg-fld-l .plg-fcnt { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 400; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.plg-fld-l .plg-fcnt.is-over { color: var(--color-danger); font-weight: 700; }
.plg-fld-help { font-size: var(--fs-xs); color: var(--text-secondary); }
.plg-fld-err { font-size: var(--fs-xs); color: var(--color-danger); font-weight: 700; }
.plg-fld2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); }
.plg-sum-box { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-sans); font-size: var(--fs-sm); line-height: 1.8; color: var(--text-primary); background: var(--bg-surface-alt); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); max-height: 46vh; overflow-y: auto; }
.plg-sum-meta { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--fs-xs); color: var(--text-secondary); }
.plg-sum-meta .plg-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.plg-swap { display: flex; align-items: center; gap: var(--space-2); justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.plg-swap:first-child { border-top: 0; }
.plg-swap span { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; font-size: var(--fs-sm); }

/* basic 任務側板的「相關待追蹤」 */
.plg-fu-h { font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.plg-fu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.plg-fu-item { display: grid; gap: var(--space-1); padding: var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-card); }
.plg-fu-item.is-done .plg-fu-t { color: var(--text-secondary); text-decoration: line-through; }
.plg-fu-t { font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.plg-fu-c { font-size: var(--fs-sm); color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; }
.plg-fu-m { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); font-size: var(--fs-xs); color: var(--text-secondary); }
.plg-fu-m .status-chip { display: inline-flex; align-items: center; gap: 3px; }

/* 窄螢幕 */
@media (max-width: 768px) {
  .plg { padding: var(--space-3); }
}
@media (max-width: 768px) {
  .plg-item-row { flex-wrap: nowrap; padding: 12px var(--space-3); }
  .plg-main { flex: 1 1 0; }
  .plg-tail { align-self: center; }
  .plg-tail .status-chip, .plg-tail .plg-pin { display: none; }
  .plg-mchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
  .plg-grid { grid-template-columns: minmax(0, 1fr); }
  .plg-blk:nth-child(2) { border-top: 1px solid var(--border-soft); }
  .plg-blk:nth-child(even) { border-left: 0; }
  .plg-now-btns { width: 100%; }
  .plg-now-btns .q-btn { flex: 1; min-height: 36px; }
  .plg-f { min-height: 32px; }
  .plg-in, .plg-sel { height: 36px; }
  .plg-sel { flex: 1 1 140px; }
  .plg-li { min-height: 36px; align-content: center; }
  .plg-mini { height: 28px; padding: 0 12px; }
  .plg-ovr { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .plg-ovr .tm { order: -1; }
  .plg-dlg, .plg-dlg--wide { width: calc(100vw - 16px); }
  .plg-fld2 { grid-template-columns: minmax(0, 1fr); }
  .plg-dlg-f .q-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .plg-item, .plg-tail .plg-chev { transition: none; }
}

/* notification-center:頂部列鈴鐺、通知面板、通知 toast(核可 mockup mockups/notifications-2026-10-08/proto/)。toast 高於對話框(6000)與日期浮窗(6200)、低於發票橫幅(7000)。 */
.nc-wrap { position: relative; display: inline-flex; align-items: center; margin-right: var(--space-2); }
.nc-bell { appearance: none; position: relative; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-on-brand); display: inline-grid; place-items: center; cursor: pointer; }
.nc-bell:hover { background: color-mix(in srgb, var(--text-on-brand) 14%, transparent); }
.nc-bell:focus-visible { outline: 2px solid var(--text-on-brand); outline-offset: 2px; }
.nc-bell .material-icons { font-size: 24px; }
/* 徽章：淺橘底＋深棕字，在深棕 header 上實量過對比（見 handoff）；外圈用 header 底色把它和鈴鐺分開 */
.nc-badge { position: absolute; top: 1px; right: -1px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: var(--radius-pill); background: var(--brand-accent-pale); color: var(--brand-primary-dark); box-shadow: 0 0 0 2px var(--brand-primary); font-size: var(--fs-xs); font-weight: 800; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }

/* ── 通知面板 ── */
.nc-pop { position: fixed; z-index: 2300; width: 360px; box-sizing: border-box; display: flex; flex-direction: column; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); overflow: hidden; }
/* 通知下拉開著時，頁首（自成層級 z-index 2000）要高於右側面板（工作台專案側板／專案頁抽屜／AI 面板皆 2100）：
   否則下拉的列被關在頁首層級裡，被側板蓋住點不到。2200 與 AI 面板開著時頁首抬高的規則一致（ai-inplace-host 內）；低於 Quasar dialog（6000）。只在下拉開著時生效，
   ≤1023 側板貼齊視窗頂端時，下拉關著不蓋側板的關閉鈕。 */
.q-layout > .q-header:has(.nc-pop) { z-index: 2200; }
.nc-pop.mob { left: 0; right: 0; width: auto; top: var(--app-header-bottom, 58px); max-height: calc(100vh - var(--app-header-bottom, 58px)); border-left: 0; border-right: 0; border-radius: 0 0 var(--radius-md) var(--radius-md); }
.nc-hd { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-1); }
.nc-tt { margin: 0; font-size: var(--fs-md); font-weight: 800; }
.nc-all { appearance: none; border: 0; background: transparent; min-height: 32px; padding: 0 var(--space-2); border-radius: var(--radius-sm); font-family: inherit; font-size: var(--fs-sm); font-weight: 700; color: var(--brand-accent-dark); cursor: pointer; }
.nc-all:hover:not(:disabled) { background: var(--brand-accent-soft); }
.nc-all:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.nc-all:disabled { color: var(--text-secondary); cursor: not-allowed; }
.nc-tabs { display: flex; gap: var(--space-1); padding: 0 var(--space-3); border-bottom: 1px solid var(--border-default); }
.nc-tabs button { appearance: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; padding: var(--space-2) var(--space-3); font-family: inherit; font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); cursor: pointer; }
.nc-tabs button:hover { color: var(--text-primary); }
.nc-tabs button.on { color: var(--text-primary); border-bottom-color: var(--brand-accent); }
.nc-tabs button:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
@media (max-width: 768px) {
  .nc-all { position: relative; min-height: 32px; }
  .nc-all::after { content: ''; position: absolute; inset: -6px; }
  .nc-tabs button { position: relative; min-height: 36px; }
  .nc-tabs button::after { content: ''; position: absolute; inset: -4px 0; }
  /* 手機通知面板:標題、全部／未讀、全部標為已讀併成一排 48px;面板下方整片壓 40% 黑,看得出是蓋在頁面上的浮層 */
  .nc-bell::after { content: ''; position: absolute; inset: -4px; }
  .nc-pop.mob { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 48px minmax(0, 1fr); box-shadow: 0 100vh 0 100vh rgba(0, 0, 0, 0.4); }
  .nc-pop.mob .nc-hd { display: contents; }
  .nc-pop.mob .nc-tt { grid-column: 1; grid-row: 1; align-self: center; padding: 0 var(--space-2) 0 var(--space-4); font-size: 15px; font-weight: 600; }
  .nc-pop.mob .nc-tabs { grid-column: 2; grid-row: 1; padding: 0; gap: 0; border-bottom: 0; align-items: stretch; }
  .nc-pop.mob .nc-tabs button { min-height: 48px; padding: 0 var(--space-3); font-weight: 600; margin-bottom: 0; }
  .nc-pop.mob .nc-all { grid-column: 3; grid-row: 1; align-self: center; min-height: 36px; padding: 0 var(--space-4) 0 var(--space-2); font-size: 13px; font-weight: 600; }
  .nc-pop.mob .nc-list, .nc-pop.mob .nc-empty { grid-column: 1 / -1; grid-row: 2; border-top: 1px solid var(--border-default); }
  .nc-pop.mob .nc-row.unread .nc-ti { font-weight: 600; }
  /* notify-split(核可 mockup A 版):手機面板兩列——標題＋全部標為已讀一列,全部／未讀分頁一列;權重高於上面的單排規則 */
  :where(html.app-shell) .nc-pop.mob.nc-two { display: flex; flex-direction: column; }
  :where(html.app-shell) .nc-pop.mob.nc-two .nc-hd { display: flex; padding: var(--space-1) var(--space-2) 0 var(--space-4); min-height: 48px; }
  :where(html.app-shell) .nc-pop.mob.nc-two .nc-tt { padding: 0; font-size: var(--fs-md); font-weight: 800; }
  :where(html.app-shell) .nc-pop.mob.nc-two .nc-tabs { padding: 0 var(--space-3); gap: var(--space-1); border-bottom: 1px solid var(--border-default); }
  :where(html.app-shell) .nc-pop.mob.nc-two .nc-tabs button { min-height: 44px; padding: var(--space-2) var(--space-3); font-weight: 700; margin-bottom: -1px; }
  :where(html.app-shell) .nc-pop.mob.nc-two .nc-list, :where(html.app-shell) .nc-pop.mob.nc-two .nc-empty { border-top: 0; }
  :where(html.app-shell) .nc-pop.mob.nc-two .nc-row.unread .nc-ti { font-weight: 800; }
  :where(html.app-shell) .nc-pop.mob.nc-two .nc-all { padding: 0 var(--space-2); font-size: var(--fs-sm); font-weight: 700; }
}
.nc-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.nc-row { appearance: none; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 8px 32px minmax(0, 1fr) auto; column-gap: var(--space-2); align-items: start; padding: var(--space-3) var(--space-4) var(--space-3) var(--space-2); border: 0; border-bottom: 1px solid var(--border-soft); background: var(--bg-card); color: inherit; font-family: inherit; text-align: left; cursor: pointer; }
.nc-row:hover { background: var(--bg-surface-alt); }
.nc-row:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.nc-dot { width: 8px; height: 8px; margin-top: 12px; border-radius: 50%; background: transparent; }
.nc-row.unread .nc-dot { background: var(--brand-accent); }
.nc-row.unread .nc-ti { font-weight: 800; }
.nc-ic { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--bg-surface-alt); color: var(--text-body); }
.nc-ic .material-icons { font-size: 18px; }
/* notify-overhaul 批 3:紀錄列(task_record,操作者自己的操作)——標題維持主文字色,只靠外框圖示與「你」副標區分;無未讀點(寫入即已讀)。核可 mockup:mockups/notify-overhaul-v2-2026-11-13.html */
.nc-row.rec .nc-ic { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text-secondary); }
.nc-bd { display: grid; gap: 2px; min-width: 0; }
.nc-ti { font-size: var(--fs-base); font-weight: 500; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-su { font-size: var(--fs-sm); color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* notify-overhaul:時間欄兩行(第一行 HH:MM／YYYY/MM/DD,第二行相對時間 .nc-rel)。整格 --font-sans＋tabular-nums;min-width 6em(12px＝72px)放得下 YYYY/MM/DD 與「23 小時前」,各列標題截斷點一致。核可 mockup:mockups/notify-overhaul-v2-2026-11-13.html */
.nc-tm { min-width: 6em; text-align: right; padding-top: 2px; font-family: var(--font-sans); font-size: var(--fs-xs); color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nc-tm .nc-rel { display: block; margin-top: 2px; }
.nc-empty { padding: var(--space-6) var(--space-4); text-align: center; font-size: var(--fs-sm); color: var(--text-secondary); }

/* ── Toast：獨立於 .wb-toast（底部置中的操作回饋）；高於對話框(6000)與日期浮窗(6200) ── */
.nc-toasts { position: fixed; z-index: 6500; top: calc(var(--app-header-bottom, 58px) + var(--space-2)); right: var(--space-4); width: 360px; max-width: calc(100vw - 16px); display: grid; gap: var(--space-2); pointer-events: none; }
.nc-toast { position: relative; pointer-events: auto; box-sizing: border-box; display: grid; grid-template-columns: 32px minmax(0, 1fr) 28px; column-gap: var(--space-3); align-items: start; padding: var(--space-3); background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); cursor: pointer; overflow: hidden; animation: ncIn .16s ease-out; }
.nc-toast:hover, .nc-toast:focus-visible { border-color: var(--brand-accent); }
.nc-toast:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.nc-toast .nc-bd { padding-top: 2px; }
.nc-toast .nc-su { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.nc-x { appearance: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); display: inline-grid; place-items: center; cursor: pointer; }
.nc-x:hover { background: var(--neutral-100); color: var(--text-primary); }
.nc-x:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.nc-x .material-icons { font-size: 18px; }
/* 剩餘時間：底邊一條細線，游標停上去或鍵盤聚焦時暫停（和倒數計時同步） */
.nc-bar { position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: var(--brand-accent); transform-origin: left center; animation: ncBar 6s linear forwards; }
.nc-toast.paused .nc-bar { animation-play-state: paused; }
.nc-more { pointer-events: auto; appearance: none; box-sizing: border-box; width: 100%; min-height: 40px; padding: 0 var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: var(--shadow-md); font-family: inherit; font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); text-align: left; cursor: pointer; }
.nc-more:hover { border-color: var(--brand-accent); }
.nc-more:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
@keyframes ncIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes ncBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 768px) {
  .nc-toasts { left: var(--space-2); right: var(--space-2); width: auto; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nc-toast { animation: none; }
  .nc-bar { display: none; }
}

/* ── notify-unified(UI-GUIDELINES §5.28 全站提示訊息):操作回饋(Quasar Notify)的底部偏移、手機撐滿、「N 則錯誤」合併卡、「全部關閉」小條 ──
   --bottom-bar-h 預設 0px,有固定底部列的頁面用 NotifyInstall.setBottomBar/trackBottomBar 設成列高,卸載時還原;全站只用 --toast-bottom 一個變數,不在各頁各寫 margin。 */
:root { --bottom-bar-h: 0px; --toast-bottom: calc(var(--bottom-bar-h, 0px) + env(safe-area-inset-bottom, 0px) + 8px); }
.q-notifications__list.q-notifications__list--bottom { margin-bottom: var(--toast-bottom); }
.q-notification:focus-visible { outline: 2px solid var(--text-on-brand); outline-offset: 2px; }
/* 提示顯示期間,頁面底部保留和提示等高的空白,讓列表最底下的控制項(分頁鈕、列上的操作)捲得出來、不被提示蓋住。
   --toast-stack-h 由 notify-install.js 的 watchStack() 量底部提示堆疊的高度寫入,沒有提示時是 0px 並拿掉 class;
   和 --toast-bottom(裡面含 --bottom-bar-h)相加,兩個變數各管各的。不加過場、不動捲動位置;只管整頁捲動,頁面內自己捲的區塊不涵蓋。
   離場時保留留白直到人捲出或換頁:提示離場時人還在留白區,watchStack() 把離場前的留白高度記在 --toast-hold-h(平常 0px);
   這裡取「目前提示需要的」與「保留值」較大者,不累加。class 在有提示或有保留值時都掛著。 */
:root { --toast-stack-h: 0px; --toast-hold-h: 0px; }
html.has-toast-stack .q-page-container > .q-page { padding-bottom: max(calc(var(--toast-stack-h, 0px) + var(--toast-bottom)), var(--toast-hold-h, 0px)); }
/* 倒數進度條(呼叫端傳 progress: true,例如報價管理的「復原」):Quasar 收到 timeout 0 會關掉自己的進度條,所以照它的外觀自己畫。
   時間由 notify-core.js 寫在提示根元素的 CSS 變數:--nu-bar-dur 倒數多久、--nu-bar-from 從幾成寬開始、--nu-bar-anim 換名字重跑、--nu-bar-play 暫停。 */
.q-notification.nu-progress > .q-notification__wrapper::after { content: ''; position: absolute; z-index: -1; left: -10px; right: -10px; bottom: 0; height: 3px; border-radius: 4px 4px 0 0; background: currentColor; opacity: 0.3; pointer-events: none; transform-origin: 0 50%; transform: scaleX(0); animation: var(--nu-bar-anim, nuBarA) var(--nu-bar-dur, 10000ms) linear both; animation-play-state: var(--nu-bar-play, running); }
.q-notification--multi-line.nu-progress > .q-notification__wrapper::after { bottom: -8px; }
@keyframes nuBarA { from { transform: scaleX(var(--nu-bar-from, 1)); } to { transform: scaleX(0); } }
@keyframes nuBarB { from { transform: scaleX(var(--nu-bar-from, 1)); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .q-notification.nu-progress > .q-notification__wrapper::after { display: none; } }
.q-notification.nu-card { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.q-notification.nu-card .q-notification__message { flex: 1 1 auto; min-width: 0; padding: 0; }
.nu-card-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; background: var(--q-negative); }
.nu-card-title { flex: 1 1 auto; font-weight: 700; }
.nu-card-btn { appearance: none; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; min-height: 32px; padding: 0 var(--space-2); cursor: pointer; }
.nu-card-btn:focus-visible, .nu-card-x:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.nu-card-list { list-style: none; margin: 0; padding: 0 0 var(--space-2); }
.nu-card-list[hidden] { display: none; }
.nu-card-item { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-1) 0; border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.nu-card-msg { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.nu-card-x { appearance: none; border: 0; background: transparent; color: inherit; width: 28px; height: 28px; flex: none; display: inline-grid; place-items: center; border-radius: var(--radius-sm); cursor: pointer; }
.nu-card-x .material-icons { font-size: 18px; }
.q-notification.nu-closeall { order: -1; }   /* 沒合併時的「全部關閉」小條放堆疊最上方(list 是 flex column) */
.q-notification.nu-closeall .q-notification__message { padding: var(--space-1) 0; }
@media (max-width: 768px) {
  :where(html.app-shell) .q-notifications__list--bottom .q-notification { align-self: stretch; max-width: none; margin-left: var(--space-2); margin-right: var(--space-2); }
  :where(html.app-shell) .q-notification.nu-card { max-height: 40vh; max-height: min(40dvh, 320px); }
  /* 手機:提示裡的按鈕(復原、關閉、合併卡的展開／全部關閉／逐則關閉)與通知中心 toast 的關閉鈕,點擊範圍往外擴 8px,寬高都到 44px 以上。
     只管提示容器裡面的,頁面其他地方的 .nc-x 不動。
     判準是手指(觸控):瀏覽器會把觸控點吸到附近的按鈕,而且是看按鈕「本體」離手指多近,::after 外擴的部分不算本體。所以:
     - 不具破壞性的按鈕(復原、展開／收合)本體做大(高 44px 以上),四邊照樣外擴 8px;
     - 關閉類的按鈕(提示的關閉、合併卡的全部關閉)朝向隔壁按鈕的那一側不外擴,手指落在兩顆中間時歸不具破壞性的那顆;
     - 合併卡逐則的關閉鈕本體直接做成 44×44(用負外距讓排版和 28px 時一樣),不用 ::after,手指點在它的角落不會被吸去「全部關閉」。
     相鄰兩顆按鈕本體之間留 20px。 */
  :where(html.app-shell) .q-notifications__list .q-notification button, :where(html.app-shell) .nc-toasts .nc-x { position: relative; }
  :where(html.app-shell) .q-notifications__list .q-notification button::after, :where(html.app-shell) .nc-toasts .nc-x::after { content: ''; position: absolute; inset: -8px; }
  :where(html.app-shell) .q-notifications__list .q-notification__actions .q-btn + .q-btn { margin-left: 20px; }   /* 復原和關閉 */
  :where(html.app-shell) .q-notifications__list .q-notification__actions .q-btn:not(:last-child) { min-height: 44px; min-width: 72px; }   /* 復原這類動作鈕:本體做大 */
  :where(html.app-shell) .q-notifications__list .q-notification__actions .q-btn + .q-btn:last-child { min-width: 36px; }   /* 動作鈕旁邊的關閉:左邊不外擴,本體加寬到 36px,點擊範圍仍有 44px 寬 */
  :where(html.app-shell) .q-notifications__list .q-notification__actions .q-btn + .q-btn:last-child::after { left: 0; }
  :where(html.app-shell) .q-notification.nu-card .nu-card-head { padding: 2px 0; }   /* 按鈕本體 44px 高,標題列維持 48px */
  :where(html.app-shell) .q-notification.nu-card .nu-card-btn { min-height: 44px; }
  :where(html.app-shell) .q-notification.nu-card .nu-card-btn[data-nu="toggle"] { min-width: 56px; }
  :where(html.app-shell) .q-notification.nu-card .nu-card-btn + .nu-card-btn { margin-left: 12px; }   /* 展開和全部關閉:標題列原本的 gap 8px + 12px = 20px */
  :where(html.app-shell) .q-notification.nu-card .nu-card-btn[data-nu="all"]::after { left: 0; bottom: 0; }   /* 全部關閉:朝展開(左)與第一則關閉鈕(下)的那兩側不外擴 */
  :where(html.app-shell) .q-notification.nu-card .nu-card-list { padding-top: 12px; }   /* 全部關閉本體和第一則關閉鈕本體相距 17px:手指點第一則關閉鈕的角落不會被吸去全部關閉 */
  :where(html.app-shell) .q-notification.nu-card .nu-card-item { padding: 10px 0; }
  :where(html.app-shell) .q-notification.nu-card .nu-card-x { width: 44px; height: 44px; margin: -8px; }
  :where(html.app-shell) .q-notification.nu-card .nu-card-x::after { content: none; }
  /* 手機:合併卡的警告圖示和標題排同一行(不換行到標題上面),展開後也不跟著整張卡垂直置中。12px = (標題列高 48px - 圖示 24px) / 2 */
  :where(html.app-shell) .q-notification.nu-card .q-notification__content { flex-wrap: nowrap; }
  :where(html.app-shell) .q-notification.nu-card .q-notification__icon { align-self: flex-start; margin-top: 12px; }
}

/* ============================================================================
 * 手機版外框改版(mobile-ux mockup 2026/10/09,待老闆核可後 1:1 實作)
 * 規則:除安全區變數與三個預設隱藏的元素外,全部只在 max-width:768px 生效,桌面零變化。
 * 安全區:加到主畫面(standalone)時,頁首吃上方瀏海、輸入區吃下方 home 條。
 *   --sat／--sab 取裝置真值(env(safe-area-inset-*))。
 * ========================================================================== */
:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); }
.mob-fb-item { display: none; }                         /* 頭像選單裡的「系統回報」,只在手機顯示 */
.fb-widget .fb-x { display: none; }                      /* 系統回報面板的關閉鈕,只在手機顯示 */
@media (max-width: 768px) {
  /* App Bar:56 → 48px,上方吃瀏海安全區 */
  html:where(.app-shell) body .q-header.bg-primary { min-height: calc(48px + var(--sat, 0px)) !important; padding-top: var(--sat, 0px); }
  html:where(.app-shell) body .q-header.bg-primary .q-toolbar { min-height: 48px !important; }
  html:where(.app-shell) body .q-header.bg-primary .nav-logo,
  html:where(.app-shell) body .q-header.bg-primary .app-brand-title .nav-logo { height: 30px !important; }
  html:where(.app-shell) body .q-header.bg-primary .nav-tag,
  html:where(.app-shell) body .q-header.bg-primary .app-brand-title .nav-tag { font-size: 14px !important; letter-spacing: 1px !important; }
  html:where(.app-shell) body .q-header.bg-primary .nav-divider,
  html:where(.app-shell) body .q-header.bg-primary .app-brand-title .nav-divider { font-size: 14px !important; margin: 0 8px !important; }

  /* 頁尾不顯示;「系統回報」改放頭像選單,面板的關閉鈕補上 */
  :where(html.app-shell) .q-footer.bg-grey-2 { display: none !important; }
  html body .fb-widget .fb-btn { display: none; }
  .fb-widget .fb-panel { bottom: calc(12px + var(--sab, 0px)); max-height: calc(100% - var(--app-header-bottom, 48px) - 24px); }
  .fb-widget .fb-x { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -11px -8px -11px 0; flex: none; border: 0; background: transparent; color: inherit; font-size: 18px; cursor: pointer; }
  .mob-fb-item { display: flex; }

  /* 日期彈窗裡可打字的 input:16px 防 iOS 放大(全站日期彈窗共用) */
  html body .pd-dp-in { font-size: 16px; }

  /* 停駐大標手機精簡:副標隱藏、h1 18px(只動停駐的那兩種容器,詳情頁不動) */
  :where(html.app-shell) .q-pa-md.page-wrap > .page-head:first-child .page-head-sub,
  .pc-page > .page-head:first-child .page-head-sub { display: none; }
  :where(html.app-shell) .q-pa-md.page-wrap > .page-head:first-child h1,
  .pc-page > .page-head:first-child h1 { font-size: 18px; }

  /* 不出現水平捲動、視窗不被撐破 */
  :where(html.app-shell) .q-page-container { overflow-x: clip; }
  :where(html.app-shell) .q-dialog__inner > .q-card, :where(html.app-shell) .q-dialog__inner--minimized > div > .q-card { min-width: 0; max-width: calc(100vw - 16px); }

  /* 觸控目標 ≥44px:真實尺寸夠大的直接撐高;小圖示鈕用 ::after 擴大點擊範圍(視覺不變) */
  /* 外觀小、點擊範圍用透明 ::after 補到 ≥44(pdm 精緻標準 2026/10/09):外觀 28–32,不再把按鈕撐大 */
  :where(html.app-shell) .q-tab { min-height: 40px; }
  :where(html.app-shell) .q-item { min-height: 44px; }
  :where(html.app-shell) .q-btn.q-btn--round, :where(html.app-shell) .q-btn.q-btn--dense { min-width: 32px; min-height: 32px; position: relative; }
  :where(html.app-shell) .q-btn.q-btn--round::after, :where(html.app-shell) .q-btn.q-btn--dense::after { content: ''; position: absolute; inset: -6px; }
  /* 批 H H-15 b:對話框標題列疊在下一個 section 之上,標題列關閉鈕的 ::after 往下外擴才不會被蓋住(不改版面高度) */
  :where(html.app-shell) .q-dialog .q-card > .q-card__section:first-child { position: relative; z-index: 1; }
  /* 批 H H-11:對話框內容的長字串(檔名、單號、欄位值)強制換行,不出橫向軸 */
  :where(html.app-shell) .q-dialog .q-card__section { overflow-wrap: anywhere; }
  /* 批 H H-15 d:對話框標題列(含副標)關閉鈕留在第一行;帶 60vh 內容區的對話框改成卡片單一縱向軸 */
  :where(html.app-shell) .q-dialog .q-card > .q-card__section.row.items-center:has(> .text-h6 .text-caption) { flex-wrap: nowrap; align-items: flex-start; }
  :where(html.app-shell) .q-dialog .q-card > .q-card__section.row.items-center > .text-h6:has(.text-caption) { min-width: 0; }
  :where(html.app-shell) .q-dialog .q-card:has(> .q-card__section[style*="60vh"]) { display: flex; flex-direction: column; overflow: hidden; }
  :where(html.app-shell) .q-dialog .q-card > .q-card__section[style*="60vh"] { flex: 0 1 auto; min-height: 0; }
  /* 批 H H-07:側欄項目命中高 44(index.html 的 .primary-drawer .q-item 設 min-height:0,38px;加 body 提高權重勝過,不用 !important) */
  html:where(.app-shell) body .primary-drawer .q-item { min-height: 44px; }
  /* 手機版後續 F3:「範本管理」q-expansion-item(expand-separator)收合時,Quasar 的上下 hr.q-expansion-item__border 雖 opacity:0 仍攔點擊,命中高 41.25;分隔線不攔點擊,視覺不變 */
  :where(html.app-shell) .primary-drawer .q-expansion-item__border { pointer-events: none; }
  html:where(.app-shell) body .q-header.bg-primary .q-btn { min-width: 36px; min-height: 36px; position: relative; padding: 0 4px; }
  html:where(.app-shell) body .q-header.bg-primary .q-btn::after { content: ''; position: absolute; inset: -4px -4px; }
  html body .q-header .nc-bell { width: 36px; height: 36px; }
  html:where(.app-shell) body .q-header.bg-primary { min-height: calc(44px + var(--sat, 0px)) !important; }
  html:where(.app-shell) body .q-header.bg-primary .q-toolbar { min-height: 44px !important; }
  /* 頁首主動作:純圖示「＋」32 圓鈕(標籤文字視覺隱藏,朗讀仍讀得到) */
  html body .page-head .page-head-actions > .q-btn.pg-add, html body .pg-add.q-btn { width: 32px; min-width: 32px; height: 32px !important; min-height: 32px !important; padding: 0 !important; border-radius: 50% !important; width: 32px !important; }
  html body .pg-add.q-btn .q-btn__content .block { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html body .pg-add.q-btn .q-icon { margin: 0 !important; font-size: 20px; }
  html body .pg-add.q-btn::after { content: ''; position: absolute; inset: -6px; }
  /* 頭像只留圓形,拿掉 ▾ */
  html:where(.app-shell) body .q-header.bg-primary .q-btn-dropdown__arrow, html:where(.app-shell) body .q-header.bg-primary .q-btn-dropdown .q-icon:last-child { display: none; }
  html:where(.app-shell) body .q-header.bg-primary button[aria-label^="使用者選單"] .q-icon { display: none; }

  /* 側欄浮動時蓋住整個畫面,上下要讓出瀏海與 home 條 */
  html:where(.app-shell) body .q-drawer__content.primary-drawer > .column.fit { padding-top: var(--sat, 0px); padding-bottom: var(--sab, 0px); box-sizing: border-box; }
  /* 手機沒有收合(mini)側欄,只藏「收合側欄」鈕;不可連同 .q-item 一起藏(曾讓手機側欄群組點開是空的) */
  html:where(.app-shell) body .q-drawer__content.primary-drawer .drawer-collapse-toggle { display: none; }
  html:where(.app-shell) body .q-drawer.q-drawer--left { width: min(300px, 78vw) !important; }
  html:where(.app-shell) body .q-drawer__content.primary-drawer .q-item { font-size: 15px; }
  html:where(.app-shell) body .q-drawer__content.primary-drawer .q-item .q-icon { font-size: 22px; }
  html:where(.app-shell) body .q-drawer__content.primary-drawer .drawer-group-head { min-height: 44px; padding-top: 20px; font-size: 12px; font-weight: 600; display: flex; align-items: center; box-sizing: border-box; } /* space-exempt: 命中高 44;多出的 8px 放文字上方,文字到下方項目的距離不變 */
  html:where(.app-shell) body .q-drawer__content.primary-drawer .drawer-group-head.drawer-group-label--first { padding-top: 14px; } /* space-exempt: 第一個群組上方沒有前一群組,少放 6px */
}
/* iOS 輸入框字級 ≥16px,避免點進去畫面被放大 */
@media (max-width: 768px) {
  /* 會打字的輸入框與原生 select 用 16px(iOS 聚焦小於 16px 會放大);篩選欄、排序、唯讀值、q-select 顯示值 13px */
  :where(html.app-shell) textarea, :where(html.app-shell) select, :where(html.app-shell) input:not([type=checkbox]):not([type=radio]):not([type=file]):not([role=combobox]):not([readonly]) { font-size: 16px !important; }
  :where(html.app-shell) input[role=combobox], :where(html.app-shell) input[readonly], :where(html.app-shell) .q-select .q-field__native, :where(html.app-shell) .q-select .q-field__input, :where(html.app-shell) .q-select__selected-value { font-size: 13px !important; }
}
/* 手機版字級系統:只用 20(頁大標)/15(主文)/13(次文)/12(輔助)/11(最小),會打字的輸入框 16。
   寫在 token 上,所有用 --fs-* 的元件一次對齊;寫死 px 的零星例外在下面逐一對齊 */
@media (max-width: 768px) {
  :root:where(.app-shell) { --fs-base: 15px; --fs-lg: 20px; --fs-xl: 20px; }
  :where(html.app-shell) .q-pa-md.page-wrap > .page-head:first-child h1,
  .pc-page > .page-head:first-child h1 { font-size: 20px; }
  html:where(.app-shell) body .q-avatar__content, html:where(.app-shell) body .user-ava { font-size: 13px; }
  /* Quasar 欄位小標籤:不縮小(原本 ×0.75 會掉到 7px),固定 11px */
  html:where(.app-shell) body .q-field--float .q-field__label { font-size: 11px; transform: translateY(-40%) scale(1); }
  /* 空欄位(未浮起)的標籤留在原位:不上移、13px(批 H H-G2;原規則連 labeled 未浮起也上移 40%) */
  html:where(.app-shell) body .q-field--labeled:not(.q-field--float) .q-field__label { font-size: 13px; transform: none; }
  html:where(.app-shell) body .q-field__label { font-size: 13px; }
  /* 批 H H-10:Quasar 預設 14／16 的共用類別對齊字級集合(14→15、16→15);表頭 11.5→12。只在 768 內,不用 !important */
  html:where(.app-shell) body .text-subtitle2, html:where(.app-shell) body .text-subtitle1,
  html:where(.app-shell) body .q-checkbox__label, html:where(.app-shell) body .q-toggle__label, html:where(.app-shell) body .q-radio__label,
  html:where(.app-shell) body .q-banner, html:where(.app-shell) body .q-notification__message { font-size: 15px; }
  html:where(.app-shell) body .data-table th, html:where(.app-shell) body .data-table--grouped thead tr.grp-row th { font-size: 12px; }
  /* 批 H H-10(續):頁內 14 的標題類文字→15;Quasar size=sm／md 在 .q-btn 上寫死 inline font-size,改寫內層 .q-btn__content(10→11、14→15);q-chip size=sm 同理 */
  html body .payroll-page .p-name, html body .fc-page .fc-acct-switch, html body .outsource-people-page .op-item-name { font-size: 15px; }
  html:where(.app-shell) body .q-btn[style*="font-size: 10px"] .q-btn__content, html:where(.app-shell) body .q-chip[style*="font-size: 10px"] .q-chip__content { font-size: 11px; }
  html:where(.app-shell) body .q-btn[style*="font-size: 14px"] .q-btn__content { font-size: 15px; }
  html body .login-foot-note { font-size: 11px; }
  /* AI 對話(project-ai-panel／ai-job-panel 共用 .cx-*):內文與提問 14→15,行內 code 12.6→13 */
  html:where(.app-shell) body .cx-a, html:where(.app-shell) body .cx-u, html:where(.app-shell) body .cx-ask-q, html:where(.app-shell) body .cx-opt { font-size: 15px; }
  html:where(.app-shell) body .cx-a code { font-size: 13px; }
  html body .pc-page .unified-tab-bar .unified-tab-item { font-size: 15px; }
  html body .pc-page .caret, html body .pc-page .pc-ava, html body .wbB .pm-tag { font-size: 11px; }
  html body .pc-page .pc-gsum, html body .pc-page .pc-gsum b { font-size: 12px; }
  html body .wbB-stats b, html body .wbB .st b { font-size: 20px; }
}
/* 手機版:工作台＋日曆共用的工具列(收編自 personal-home.vue.html)。
   工作台工具列只有兩種排法:第一排=檢視分段(＋篩選鈕),第二排=日期導覽;月檢視的 30/60/90 天獨立一排。不切字、不重疊。 */
@media (max-width: 768px) {
  /* 批 H S1:工具列各排的 ::after 外擴(上下各 8)要有地方放——排距 12→16、第一排上緣留 6(大標停駐在上方,2+6=8)。space-exempt: 命中 44 */
  html body .wbB .wbB-tb { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 8px; margin-bottom: 12px; padding-top: 6px; }
  html body .wbB .wbB-vs, html body .wbB .wb-seg:not(.x), html body .wbB-lbar .wb-seg { border: 0; border-radius: 9px; background: var(--bg-surface-alt); padding: 2px; overflow: visible; }
  html body .wbB .wbB-vs button { position: relative; height: 28px; min-width: 44px; padding: 0 12px; justify-content: center; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 400; color: var(--text-secondary); }
  html body .wbB .wbB-vs button + button { border-left: 0; }
  html body .wbB .wbB-vs button .material-icons { display: none; }
  html body .wbB .wbB-vs button[aria-pressed="true"] { background: var(--bg-card); color: var(--text-primary); font-weight: 600; box-shadow: var(--shadow-xs); }
  html body .wbB .wbB-vs button::after { content: ''; position: absolute; inset: -8px 0; }
  html body .wbB .wbB-nav { gap: 2px; flex-wrap: wrap; align-items: center; }
  html body .wbB .wbB-nav .wbB-range { flex: none; min-width: 0; padding: 0 2px; font-size: 13px; font-weight: 400; white-space: nowrap; }
  html body .wbB .wbB-nav .wb-act { position: relative; flex: none; min-width: 0; min-height: 0; height: 28px; border: 0; background: transparent; font-size: 13px; font-weight: 400; color: var(--text-primary); }
  html body .wbB .wbB-nav .wb-act:has(.material-icons) { width: 28px; padding: 0; border-radius: 50%; }
  html body .wbB .wbB-nav .wb-act:not(:has(.material-icons)) { margin-left: 6px; padding: 0 10px; border-radius: 14px; background: var(--bg-surface-alt); }
  /* 批 H S1:日期導覽三顆鈕命中補到 44×44——上一段／下一段(外觀 28)四邊各 8(原左右 3);「本週」(無 aria-label,寬 ≥46)只補上下,把它與下一段之間的 8 讓給下一段 */
  html body .wbB .wbB-nav .wb-act::after { content: ''; position: absolute; inset: -8px; }
  html:where(.app-shell) body .wbB .wbB-nav .wb-act:not([aria-label])::after { inset: -8px 0; }
  html body .wbB .wbB-nav .wb-act.wbB-latejump { margin-left: 0; flex: 1 1 100%; background: transparent; padding: 0; height: 28px; text-align: left; justify-content: flex-start; }
  /* 日期導覽獨立一排;月檢視的 30/60/90 天再獨立一排、三等分 */
  html body .wbB:not(.pcal) .wbB-nav { order: 3; flex: 1 1 100%; }
  html body .wbB:not(.pcal) .wbB-nav .wb-seg { order: 9; flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 10px; }
  html body .wbB .wbB-nav .wb-seg button, html body .wbB-lbar .wb-seg button { height: 28px; padding: 0 10px; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 400; color: var(--text-secondary); white-space: nowrap; }
  html body .wbB .wbB-nav .wb-seg button.on, html body .wbB-lbar .wb-seg button.on { background: var(--bg-card); color: var(--text-primary); font-weight: 600; box-shadow: var(--shadow-xs); }
  /* 篩選:工作台收成一顆「篩選」,在面板裡設定;日曆沿用自己的篩選列 */
  html body .wbB:not(.pcal) .wbB-fgrp { display: none; }
  html body .wbB:not(.pcal) .wbB-mf { display: inline-flex; align-items: center; position: relative; order: 2; margin-left: auto; height: 28px; padding: 0 4px 0 12px; border: 0; border-radius: 14px; background: var(--bg-surface-alt); font-family: inherit; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
  html body .wbB:not(.pcal) .wbB-mf .material-icons { font-size: 18px; }
  html body .wbB:not(.pcal) .wbB-mf::after { content: ''; position: absolute; inset: -8px -2px; }
  html body .wbB:not(.pcal) .wbB-mf.dev { background: var(--brand-accent-soft); color: var(--brand-accent-dark); font-weight: 600; }
  html body .wbB:not(.pcal) .wbB-tb > .wbB-vs { order: 1; }
  /* 清單的「依時間／依專案」:跟上面的分段同款,靠左不浮在右邊 */
  html body .wbB .wbB-lbar { display: flex; justify-content: flex-start; margin: 0 0 10px; padding: 0; }
  /* 篩選面板(teleport 到 body,不在 .wbB 裡) */
  .wbB-mfp { width: calc(100vw - 32px); max-width: none; max-height: 70vh; overflow-y: auto; gap: 12px; padding: 12px; }
  .wbB-mfp .wb-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 0; border-radius: 9px; background: var(--bg-surface-alt); padding: 2px; }
  .wbB-mfp .wb-seg button { height: 32px; padding: 0 6px; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 400; color: var(--text-secondary); white-space: nowrap; }
  /* 看別人時範圍選項寫「{名字} 名下」,名字長時只縮這一格(不把右邊的「含他人」擠出面板) */
  html:where(.app-shell) body .wbB-mfp .wb-seg[aria-label="範圍"] { grid-auto-columns: minmax(0, 1fr); }
  html:where(.app-shell) body .wbB-mfp .wb-seg[aria-label="範圍"] button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .wbB-mfp .wb-seg button.on { background: var(--bg-card); color: var(--text-primary); font-weight: 600; box-shadow: var(--shadow-xs); }
  .wbB-mfp .wb-seg button:disabled { opacity: .45; }
  .wbB-mfp .fs { height: 36px; }
  .wbB-mfp .pr { min-height: 40px; }
  /* 共用:看誰的工作台只留頭像圈、小藥丸、小圖示鈕 */
  html body .wbB .wbB-ft { position: relative; height: 28px; padding: 0 4px 0 12px; border: 0; border-radius: 14px; background: var(--bg-surface-alt); font-size: 13px; color: var(--text-secondary); }
  html body .wbB .wbB-ft .material-icons { font-size: 18px; }
  html body .wbB .wbB-ft::after { content: ''; position: absolute; inset: -8px -2px; }
  html body .wbB .wbB-ft.dev { background: var(--brand-accent-soft); color: var(--brand-accent-dark); font-weight: 600; }
  html body .wbB .wbB-who { gap: 8px; }
  html body .wbB .wb-act { position: relative; height: 28px; }
  html body .wbB .wb-act::after { content: ''; position: absolute; inset: -8px -4px; }
  /* 統計磚:每張一行 ≤64px,左標題右數字;第 5 張跨滿。說明小字視覺隱藏(仍可朗讀) */
  html body .wbB .wbB-hc { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; max-height: 64px; padding: 8px 14px; }
  html body .wbB .wbB-hc .l { font-size: 13px; font-weight: 600; }
  html body .wbB .wbB-hc .v b { font-size: 20px; line-height: 1.2; font-weight: 600; }
  html body .wbB .wbB-hc .v i { font-size: 12px; }
  html body .wbB .wbB-hc .s { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html body .wbB .wbB-hc:last-child:nth-child(odd) { grid-column: 1 / -1; border-left: 0; }
  html body .wbB .wbB-hero.el-card { margin-bottom: 12px; }
  /* 日曆的篩選列(顯示類型＋日曆＋篩選):放不下就換行,不橫向捲動(窄寬度時「篩選」「夥伴」不能被切到畫面外)。
     列距 16:鈕外觀 28、命中靠 ::after 外擴 8 補到 44,上下兩排的命中區剛好相接不重疊。 */
  html body .wbB.pcal .wbB-fgrp { flex-wrap: wrap; gap: 16px 8px; padding: 2px 0; }
  html body .wbB.pcal .wbB-fgrp > * { flex: none; }
}
/* 手機版:專案中心看板(一欄約 80% 寬、露出下一欄邊緣,橫滑切欄)＋留言輸入(同訊息中心輸入框:單行起跳、工具收進＋、送出用圖示) */
@media (max-width: 768px) {
  html body .pc-page .pc-board { overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  html body .pc-page .pc-board::-webkit-scrollbar { display: none; }
  html body .pc-page .pc-bcol { flex: 0 0 80%; min-width: 0; scroll-snap-align: start; }
  html body .pc-page .pc-bcol-head { font-size: 15px; font-weight: 600; }
  html body .pc-page .pc-bt { font-size: 15px; font-weight: 600; word-break: keep-all; overflow-wrap: break-word; }
  html body .pc-page .pc-bpct { font-size: 13px; font-weight: 600; }
  html body .pc-page .pc-bmeta { flex-wrap: nowrap; }
  html body .pc-page .pc-bmeta .pc-dt { white-space: nowrap; font-size: 12px; }
  html body .pc-page .pc-bmeta .pc-amt { white-space: nowrap; font-size: 13px; font-weight: 600; }
  html body .pc-page .pc-bowner2 { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }

  html body .cin { padding: 8px 10px; }
  html body .cin-row { align-items: flex-end; gap: 8px; }
  html body .cin-plus { display: inline-flex; flex: none; position: relative; width: 32px; height: 32px; margin-bottom: 2px; padding: 0; border: 0; border-radius: 50%; background: var(--bg-surface-alt); color: var(--text-secondary); align-items: center; justify-content: center; cursor: pointer; }
  html body .cin-plus::after { content: ''; position: absolute; inset: -6px; }
  html body .cin-plus .material-icons { font-size: 20px; }
  html body .cin-row textarea { min-height: 36px; max-height: 124px; padding: 7px 12px; border-radius: 18px; line-height: 1.5; resize: none; }
  html body .cin-send { flex-direction: row; margin-bottom: 2px; }
  html body .cin-send .cin-btn { position: relative; width: 32px; height: 32px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
  html body .cin-send .cin-btn::after { content: ''; position: absolute; inset: -6px; }
  html body .cin-send .cin-bt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html body .cin-send .cin-ico { display: inline-block; font-size: 20px; }
  html body .cin-hint { display: none; }
  html body .cin-tools { display: none; margin: 0 0 8px; }
  html body .cin-tools.open { display: flex; }
  html body .cin-tools button { font-size: 13px; padding: 6px 12px; }
}
/* 手機版:我的日曆(收編自 calendar.vue.html;外觀小、點擊範圍用 ::after 外擴補到 44px)。
   頁首列與「看誰的」頭像（.page-head／.page-head-actions／.wbB-who／.wbB-wbtn）用 .wbB:not(.co)，我的工作台跟日曆同一份規則（批C第8項）。 */
@media (max-width: 768px) {
  html body .pcal .pcal-h-d { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html body .pcal .pcal-h-m { display: inline; }
  html:where(.app-shell) body .wbB:not(.co) .page-head { flex-wrap: nowrap; align-items: center; gap: 8px; }
  html:where(.app-shell) body .wbB:not(.co) .page-head-text { flex: 1 1 auto; min-width: 0; }
  html:where(.app-shell) body .wbB:not(.co) .page-head-text h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html:where(.app-shell) body .wbB:not(.co) .page-head-actions { flex: 0 0 auto; justify-content: flex-end; align-items: center; flex-wrap: nowrap; gap: 10px; }
  html:where(.app-shell) body .wbB:not(.co) .page-head-actions .wbB-who { order: -1; margin-left: 0; }
  html:where(.app-shell) body .wbB:not(.co) .page-head-actions .wb-act { height: 28px; padding: 0 10px; font-size: var(--fs-sm); }
  /* 看別人時(viewing 時 .page-head 帶 wbB-head-view):標題占第一列(可兩行),「唯讀」「回到我的工作台」移到標題下一列,頭像留在第一列右端。
     不新增元素:actions／who 用 display:contents 讓三個子元素直接進頁首格線。 */
  html:where(.app-shell) body .wbB:not(.co) .page-head.wbB-head-view { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; column-gap: 8px; row-gap: 6px; align-items: center; }
  html:where(.app-shell) body .wbB:not(.co) .page-head.wbB-head-view .page-head-text { grid-column: 1 / 4; grid-row: 1; }
  html:where(.app-shell) body .wbB:not(.co) .page-head.wbB-head-view .page-head-text h1 { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  html:where(.app-shell) body .wbB:not(.co) .page-head.wbB-head-view .page-head-actions, html:where(.app-shell) body .wbB:not(.co) .page-head.wbB-head-view .wbB-who { display: contents; }
  html:where(.app-shell) body .wbB:not(.co) .page-head.wbB-head-view .wbB-wbtn { grid-column: 4; grid-row: 1; }
  html:where(.app-shell) body .wbB:not(.co) .page-head.wbB-head-view .status-chip { grid-column: 1; grid-row: 2; }
  html:where(.app-shell) body .wbB:not(.co) .page-head.wbB-head-view .wb-act { grid-column: 2; grid-row: 2; }
  html:where(.app-shell) body .wbB:not(.co) .page-head.wbB-head-view .wb-act { position: relative; }
  html:where(.app-shell) body .wbB:not(.co) .page-head.wbB-head-view .wb-act::after { content: ""; position: absolute; inset: -9px 0; }
  /* 看誰的日曆:只留 28px 頭像;看別人時加品牌色 2px 外圈 */
  html:where(.app-shell) body .wbB:not(.co) .wbB-wbtn { position: relative; height: 28px; width: 28px; padding: 0; gap: 0; border: 0; background: transparent; border-radius: 50%; justify-content: center; }
  html:where(.app-shell) body .wbB:not(.co) .wbB-wbtn .wbB-wnm, html:where(.app-shell) body .wbB:not(.co) .wbB-wbtn > .material-icons { display: none; }
  html:where(.app-shell) body .wbB:not(.co) .wbB-wbtn .user-ava { width: 28px; height: 28px; font-size: 13px; }
  html:where(.app-shell) body .wbB:not(.co) .wbB-wbtn.vw .user-ava { box-shadow: 0 0 0 2px var(--brand-accent); }
  html:where(.app-shell) body .wbB:not(.co) .wbB-wbtn::after { content: ''; position: absolute; inset: -8px; }
  html body .pcal .page-head-actions .q-btn { position: relative; min-height: 32px; height: 32px; padding: 0 12px; font-size: var(--fs-sm); font-weight: 500; }
  html body .pcal .page-head-actions .q-btn .q-icon { font-size: 18px; }
  html body .pcal .page-head-actions .q-btn .q-btn__content { gap: 4px; }
  /* 顯示類型:28px、不帶勾,開＝淺火焰底、關＝淺灰底 */
  html body .pcal .pcal-tyb .ck { display: none; }
  html body .pcal .pcal-ty { gap: 6px; }
  html body .pcal .pcal-tyb { position: relative; height: 28px; padding: 0 12px; border: 0; background: var(--bg-surface-alt); color: var(--text-secondary); font-weight: 500; }
  html body .pcal .pcal-tyb.on { background: var(--brand-accent-soft); color: var(--brand-accent-dark); }
  html body .pcal .pcal-tyb::after { content: ''; position: absolute; inset: -8px -2px; }
  /* 週日期條:52 高,選中那天是深色圓角塊 */
  html body .pcal .pcal-ds { gap: 2px; margin-bottom: 14px; }
  html body .pcal .pcal-dsb { min-height: 52px; padding: 6px 0; border: 0; border-radius: 12px; background: transparent; gap: 1px; }
  html body .pcal .pcal-dsb .n { font-weight: 600; line-height: 20px; }
  html body .pcal .pcal-dsb .w { line-height: 14px; }
  html body .pcal .pcal-dsb { padding-top: 4px; padding-bottom: 4px; }
  html body .pcal .pcal-dsb.on { background: var(--brand-primary); }
  /* 月格:件數是淡底小徽章,格線只留淡線 */
  html body .pcal .pcal-mo.m { border-color: var(--border-soft); }
  html body .pcal .pcal-mo.m .pcal-mh { background: transparent; border-bottom-color: var(--border-soft); }
  html body .pcal .pcal-mo.m .pcal-mc { border-color: var(--border-soft); }
  html body .pcal .pcal-mcn { gap: 3px; }
  html body .pcal .pcal-mcn .dn { font-weight: 400; }
  html body .pcal .pcal-mc.tod .pcal-mcn .dn { font-weight: 600; text-decoration: none; }
  html body .pcal .pcal-mcn .ct { min-width: 16px; height: 16px; padding: 0 4px; font-size: 11px; font-weight: 400; background: var(--brand-accent-soft); color: var(--brand-accent-dark); }
  /* 當天議程:區段標題列 40px、字 14;0 筆灰色不可點 */
  html body .pcal .pcal-ag { gap: 6px; }
  html body .pcal .pcal-agh { font-size: var(--fs-base); font-weight: 600; margin-bottom: 4px; }
  html body .pcal .pcal-agsec { gap: 4px; }
  html body .pcal .pcal-agt { appearance: none; position: relative; display: flex; align-items: center; gap: 6px; width: 100%; min-height: 40px; padding: 0 2px; border: 0; border-top: 1px solid var(--border-soft); background: transparent; font-family: inherit; font-size: 13px; font-weight: 400; color: var(--text-primary); text-align: left; cursor: pointer; }
  html body .pcal .pcal-agt::after { content: ''; position: absolute; inset: -3px 0; }
  html body .pcal .pcal-agt .ct { min-width: 18px; height: 18px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--bg-surface-alt); color: var(--text-primary); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; display: inline-grid; place-items: center; }
  html body .pcal .pcal-agt .material-icons { margin-left: auto; font-size: 20px; color: var(--text-secondary); }
  html body .pcal .pcal-agt:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
  html body .pcal .pcal-agt.zero, html body .pcal .pcal-agt:disabled { color: var(--text-disabled, var(--text-secondary)); opacity: .55; cursor: default; pointer-events: none; }
  html body .pcal .pcal-agsec .pcal-pj, html body .pcal .pcal-agsec .pcal-chipt { position: relative; min-height: 36px; height: 36px; font-size: 13px; font-weight: 400; }
  html body .pcal .pcal-agsec .pcal-pj::after, html body .pcal .pcal-agsec .pcal-chipt::after { content: ''; position: absolute; inset: -5px 0; }
  html body .pcal .pcal-agsec { gap: 10px; }
  html body .pcal .pcal-agsec .pcal-pj { border-top: 0; border-right: 0; border-bottom: 0; background: color-mix(in srgb, var(--pj) 10%, var(--bg-card)); }
  html body .pcal .pcal-agsec .pcal-pj .pc { font-weight: 400; }
  html body .pcal .act-card { min-height: 0; }
  html body .pcal .act-card.v-cell { min-height: 44px; }
  html body .pcal .q-btn { min-height: 0; }
}
/* 批 Z m1：≤700 放不下「大標＋操作鈕」時，操作鈕整組換到大標下一列靠右，大標保持完整一行（≤768 規則的 nowrap 會把大標擠成省略號／兩行）。放得下時仍是單列，畫面不變；看別人的工作台（.wbB-head-view）有自己的 grid，不套用 */
@media (max-width: 700px) {
  html:where(.app-shell) body .wbB:not(.co) .page-head:not(.wbB-head-view) { flex-wrap: wrap; row-gap: 6px; }
  html:where(.app-shell) body .wbB:not(.co) .page-head:not(.wbB-head-view) .page-head-text { flex: 1 0 auto; }
  html:where(.app-shell) body .wbB:not(.co) .page-head:not(.wbB-head-view) .page-head-actions { margin-left: auto; }
}
/* 手機版:外觀小、點擊範圍補足(r3a 2026/10/09,取代上一輪「把表單欄位／分頁／群組標題／頁首按鈕撐成 44 高」)。
   分頁:外觀 40(含 2px 底線),分頁列上方留 4px 內距,item 的 ::after 往上外擴 4px 補成 44;
   群組標題、表單欄位:恢復原本高度(群組標題為整列可點,算清單列);頁首按鈕:36 + ::after 外擴(見上方 App Bar 區) */
@media (max-width: 768px) {
  html:where(.app-shell) body .unified-tab-bar { padding-top: 6px; row-gap: 7px; }
  html:where(.app-shell) body .unified-tab-bar .unified-tab-item { position: relative; min-height: 0; height: 40px; padding-top: 0; padding-bottom: 0; }
  html:where(.app-shell) body .unified-tab-bar .unified-tab-item::after { content: ''; position: absolute; inset: -6px 0 0 0; }
  /* AI營運列表:分頁 4 個以上塞不下 375 寬(實量 424 對 328),不折行、改一列左右滑。
     overflow 會裁掉 item 的 margin-bottom:-1px,底線改用 inset 陰影畫,選中的 2px 底線蓋在上面,外觀同桌機 */
  html:where(.app-shell) body .aj-page .unified-tab-bar, html:where(.app-shell) body .bg-log .unified-tab-bar { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--border-default); }
  html:where(.app-shell) body .aj-page .unified-tab-bar::-webkit-scrollbar, html:where(.app-shell) body .bg-log .unified-tab-bar::-webkit-scrollbar { display: none; }
  html:where(.app-shell) body .aj-page .unified-tab-bar .unified-tab-item, html:where(.app-shell) body .bg-log .unified-tab-bar .unified-tab-item { flex: 0 0 auto; white-space: nowrap; margin-bottom: 0; }
  html body .pc-page .unified-filter-bar .q-btn:not(.pc-fchip)::after { inset: -11px -4px; }
  /* Quasar 按鈕字級 14 → 13(字級系統);左緣滑動開側欄的 15px 隱形區不要,它會吃掉貼邊元件的點擊範圍(側欄仍由 ☰ 開) */
  html:where(.app-shell) body .q-btn { font-size: 13px; }
  html:where(.app-shell) body .q-drawer__opener { display: none; }
  /* 頂部列按鈕外觀 36、::after 外擴到 44:左邊讓出邊緣滑動區(15px)、相鄰兩顆至少隔 8px,點擊區才不互相重疊 */
  html:where(.app-shell) body .q-header.bg-primary .q-toolbar { padding-left: 20px; }
  html:where(.app-shell) body .q-header.bg-primary .q-toolbar .q-btn + .q-btn, html body .q-header.bg-primary .q-toolbar .nc-bell + .q-btn, html body .q-header.bg-primary .q-toolbar .q-btn + .nc-bell { margin-left: 8px; }
}

/* ═══════════════════════════════════════════════════════════════════════
 * 案件列表共用樣式（.case-*）— openspec change `outsource-cases` design D12 收編。
 * 來源：階段 1 夥伴案件逐筆付款版（commission-split-payment，原 .pc-* / .pcx-*，專屬夥伴案件頁）。
 * 夥伴案件頁與外包案件頁共用同一份；頁面根容器掛 `case-page`（q-menu 也要掛，teleport 到 body）。
 * 純改名搬移，數值一律不變；夥伴案件專用規則（多選篩選、報價單欄、退場標示等）留在該頁。
 * ═══════════════════════════════════════════════════════════════════════ */
  /* 色彩／字體／間距全走 theme.css token；本區只放本頁專屬版面與語意色。 */

  .case-page .case-card { overflow: visible; }
  /* hero：KPI 卡骨架在 theme.css（.kpi-strip／.kpi），本頁只定 2 欄變體（核可 mockup 1:1） */
  .case-page .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 460px; margin: 0 0 var(--space-4); }
  .case-page .kpi { box-shadow: var(--shadow-xs); }

  /* ── 篩選列（取代舊分頁）：四個下拉，各自可多選、可清除 ──
     2026-09-06 ui-component-standard-layer：外層骨架（display/gap/padding/border-bottom/
     flex-wrap）收斂到共用 .unified-filter-bar（theme.css），容器改掛雙 class
     class="case-filters unified-filter-bar"（老闆核可 mockup 第 2 組：「骨架跟報價管理一致」，
     只換間距／邊框，不動搜尋/篩選功能）。這裡只留 unified-filter-bar 沒有、但本頁真的需要的
     一項覆寫：align-items:flex-end——每個 .case-fsel／.case-fsearch 都是「上方 label + 下方輸入框」
     兩層結構，「清除全部篩選」按鈕沒有上方 label；用 unified-filter-bar 預設的 center 對齊，
     按鈕會浮在列中央、與各欄輸入框對不齊，flex-end 才能讓所有輸入框／按鈕底緣切齊——
     這是版面需求，不是隨意偏離標準。 */
  .case-page .case-filters.unified-filter-bar { align-items: flex-end; }
  .case-page .case-fsel { position: relative; min-width: 150px; }
  .case-page .case-fsel > label {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
  }

  .case-page .case-fclear {
    margin-left: auto;
    align-self: flex-end;
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
  }
  .case-page .case-fclear:hover { border-color: var(--brand-accent); color: var(--brand-accent-dark); }

  /* 搜尋（老闆 2026-08-31 裁決加回；核可 mockup .fsearch，範圍＝專案名稱／分潤夥伴，不含客戶。
     2026-09-01 §4f 擴大：分潤夥伴的「推薦人」次要文案（如「Corrina 推薦」）也納入搜尋，
     見下方 JS caseRows 註解） */
  .case-page .case-fsearch { position: relative; flex: 0 1 250px; min-width: 190px; }
  .case-page .case-fsearch > label {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
  }
  .case-page .case-fsearch input {
    width: 100%;
    height: 34px;
    padding: 5px 10px 5px 31px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
  }
  .case-page .case-fsearch .case-search-ico {
    position: absolute;
    left: 10px;
    top: calc(50% + 8px);
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: var(--fs-sm);
    pointer-events: none;
  }

  /* 排序（老闆 2026-08-31 裁決加回；核可 mockup .fsort，前端做，不動後端） */
  .case-page .case-fsort { min-width: auto; }
  .case-page .case-fsort select {
    height: 34px;
    padding: 5px 9px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    font-size: var(--fs-sm);
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
  }

  /* 展開的下拉選單（q-menu teleport → 靠 class="partner-cases-page" 命中） */
  .case-page .case-fmenu { min-width: 210px; }
  .case-page .case-fm-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 12px;
    font-size: var(--fs-sm);
    cursor: pointer;
    color: var(--text-primary);
  }
  .case-page .case-fm-item:hover { background: var(--brand-primary-100); }

  /* ── 表格 ──
     2026-09-06 ui-component-standard-layer 任務組 6：改指向共用 `.data-table`
     （theme.css），骨架／數字欄右對齊（含當年 §4c.2 的特異度修正）已內建於共用標準，
     不再需要本頁自己的 pc-table-wrap／pc-table／pc-num 規則。§4c.2 的歷史脈絡見
     openspec/changes/ui-component-standard-layer/progress.md。 */

  /* §4d.6：業績月欄頭與值都靠左（前一輪改成右對齊，老闆這輪要改回靠左）。
     仍用等寬字體方便掃視「2026/08」這類值，但不套 text-align:right。 */
  .case-page .case-month {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    white-space: nowrap;
  }

  /* 專案名稱即入口（拿掉獨立的「進案件」欄） */
  .case-page .case-pname { font-weight: 700; color: var(--brand-accent-dark); cursor: pointer; }
  .case-page .case-pname:hover { text-decoration: underline; }
  .case-page .case-muted { color: var(--text-secondary); }

  /* chip（沿用 --color-*-soft 底 + 語意色字，不用火焰紅） */
  .case-page .case-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
  }
  .case-page .case-chip-stage { background: var(--bg-surface-alt); color: var(--text-secondary); border: 1px solid var(--border-default); }
  .case-page .case-chip-paid { background: var(--color-success-soft); color: var(--color-success); }
  .case-page .case-chip-none { background: var(--neutral-100); color: var(--text-secondary); border: 1px solid var(--border-default); }

  /* 分潤付款：已付整體單一標籤（不要 chip ＋ 裸日期並排） */
  .case-page .case-paid-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: var(--radius-sm);
    background: var(--color-success-soft);
    color: var(--color-success);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
  }
  .case-page .case-paid-tag time {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    opacity: .85;
  }
  .case-page .case-pay-date {
    width: 118px;
    padding: 4px 7px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    background: var(--bg-card);
  }
  .case-page .case-btn-pay {
    padding: 4px 9px;
    font-size: 11.5px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-success);
    background: var(--bg-card);
    color: var(--color-success);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  .case-page .case-btn-pay:hover { background: var(--color-success-soft); }
  .case-page .case-btn-pay:disabled { border-color: var(--border-default); color: var(--text-muted); cursor: not-allowed; background: var(--bg-card); }

  /* ═══ 分潤逐筆付款 v2（mockup 新增）═══ */
  .case-page .data-table th { padding-left: 14px; padding-right: 14px; } /* space-exempt: 1:1 對齊老闆核可 mockup（2026/10/12 OK 先改這版）的控制項尺寸，見 docs/commission-split-payment/mockup */
  .case-page .data-table td { padding: 8px 14px; } /* space-exempt: 1:1 對齊老闆核可 mockup（2026/10/12 OK 先改這版）的控制項尺寸，見 docs/commission-split-payment/mockup */
  .case-page .case-nw { white-space: nowrap; }
  /* 專案群組標頭列：一個專案一條，底色用既有 --bg-surface-alt，不加框線以外的裝飾 */
  .case-page .data-table tbody tr.case-grp td { padding: 0; background: transparent; border: 0; }
  .case-page .case-gh { padding: 10px 14px; background: var(--bg-surface-alt); border-top: 1px solid var(--border-default); border-bottom: 1px solid var(--border-default); } /* space-exempt: 1:1 對齊老闆核可 mockup（2026/10/12 OK 先改這版）的控制項尺寸，見 docs/commission-split-payment/mockup */
  .case-page .data-table tbody tr.case-grp:first-child .case-gh { border-top: none; }
  .case-page .data-table tbody tr.case-grp, .case-page .data-table tbody tr.case-grp td { border-left: 0; box-shadow: none; outline: 0; }
  .case-page .data-table tbody tr.case-grp td::before, .case-page .data-table tbody tr.case-grp td::after { content: none; }
  .case-page .data-table tbody tr.case-grp:hover td { background: var(--bg-surface-alt); }
  .case-page .case-gh { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
  .case-page .case-gh-r { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
  /* 固定欄寬：夥伴／金額／付款方式各給定寬，剩餘空間全留給最右的分潤付款欄（內容靠左），寬螢幕也緊湊 */
  .case-page .data-table { table-layout: fixed; }
  .case-page .case-btn-link { position: relative; height: 30px; padding: 0 6px; border: none; background: none; color: var(--text-secondary); font-size: 12.5px; font-weight: 600; text-decoration: underline; cursor: pointer; white-space: nowrap; } /* space-exempt: 1:1 對齊老闆核可 mockup（2026/10/12 OK 先改這版）的控制項尺寸，見 docs/commission-split-payment/mockup */
  .case-page .case-btn-link::after { content: ""; position: absolute; inset: -7px -4px; }
  .case-page .case-btn-link:hover { color: var(--brand-accent-dark); }
  /* 分潤列：一筆一行，所有控制項同高 30px，點擊範圍用透明 ::after 延伸到 44px */
  .case-page .data-table tbody tr.case-line td { height: 46px; }
  .case-page .case-pn { font-weight: 600; color: var(--text-primary); white-space: nowrap; } /* space-exempt: 1:1 對齊老闆核可 mockup（2026/10/12 OK 先改這版）的控制項尺寸，見 docs/commission-split-payment/mockup */
  .case-page .case-cell { display: flex; align-items: center; gap: 8px; min-height: 30px; }
  .case-page .case-hit { position: relative; display: block; flex: none; }
  .case-page .case-hit::after { content: ""; position: absolute; inset: -7px -4px; }
  .case-page .case-hit > select { position: relative; z-index: 1; }
  .case-page .case-msel {
    width: 112px; height: 30px; padding: 0 6px; /* space-exempt: 1:1 對齊老闆核可 mockup（2026/10/12 OK 先改這版）的控制項尺寸，見 docs/commission-split-payment/mockup */
    border: 1px solid var(--border-default); border-radius: var(--radius-sm);
    background: var(--bg-card); color: var(--text-primary);
    font-family: inherit; font-size: 13px; cursor: pointer;
  }
  .case-page .case-msel.empty { border-color: var(--color-warning); color: var(--text-secondary); }
  .case-page .case-mtext { font-weight: 600; color: var(--text-primary); white-space: nowrap; }
  /* 付款方式欄放不下（例如多了「金額不一致」提示）時，狀態標籤換到下一行，不擠壞文字 */
  .case-page .case-c-m .case-cell { flex-wrap: wrap; gap: 4px 8px; }
  .case-page .case-btn-pay, .case-page .case-btn-labor, .case-page .case-btn-ok, .case-page .case-btn-x {
    position: relative; height: 30px; padding: 0 12px; font-size: 12.5px; font-weight: 600; line-height: 1; /* space-exempt: 1:1 對齊老闆核可 mockup（2026/10/12 OK 先改這版）的控制項尺寸，見 docs/commission-split-payment/mockup */
    border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
  }
  .case-page .case-btn-pay::after, .case-page .case-btn-labor::after, .case-page .case-btn-ok::after, .case-page .case-btn-x::after { content: ""; position: absolute; inset: -7px -4px; }
  .case-page .case-btn-labor { border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text-primary); }
  .case-page .case-btn-labor:hover { border-color: var(--brand-accent); color: var(--brand-accent-dark); }
  .case-page .case-btn-ok { border: 1px solid var(--color-success); background: var(--color-success); color: var(--bg-card); }
  .case-page .case-btn-x { padding: 0 9px; border: 1px solid var(--border-default); background: var(--bg-card); color: var(--text-secondary); } /* space-exempt: 1:1 對齊老闆核可 mockup（2026/10/12 OK 先改這版）的控制項尺寸，見 docs/commission-split-payment/mockup */
  .case-page .case-pay-date { width: 104px; height: 30px; padding: 0 8px; text-align: center; } /* space-exempt: 1:1 對齊老闆核可 mockup（2026/10/12 OK 先改這版）的控制項尺寸，見 docs/commission-split-payment/mockup */
  .case-page .case-paid-tag { height: 30px; padding: 0 11px; } /* space-exempt: 1:1 對齊老闆核可 mockup（2026/10/12 OK 先改這版）的控制項尺寸，見 docs/commission-split-payment/mockup */
  /* 窄螢幕：分潤列改兩排（上：夥伴＋金額；下：付款方式＋動作），群組標頭自然換行 */
  @media (max-width: 640px) {
    .case-page .data-table thead { display: none; }
    .case-page .data-table, .case-page .data-table tbody, .case-page .data-table tr, .case-page .data-table td { display: block; }
    .case-page .data-table tbody tr.case-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--border-soft); padding: 4px 0; } /* space-exempt: 1:1 對齊老闆核可 mockup（2026/10/12 OK 先改這版）的控制項尺寸，見 docs/commission-split-payment/mockup */
    .case-page .data-table tbody tr.case-line td { height: auto; padding: 4px 14px; border-bottom: none; } /* space-exempt: 1:1 對齊老闆核可 mockup（2026/10/12 OK 先改這版）的控制項尺寸，見 docs/commission-split-payment/mockup */
    .case-page .case-c-m { grid-column: 1; grid-row: 2; min-width: 0; }
    .case-page .case-c-m .case-cell { flex-wrap: wrap; gap: 4px 8px; }
    .case-page .case-mtext { white-space: nowrap; }
    .case-page .case-c-a .case-cell { gap: 2px; }
    .case-page .case-c-a { grid-column: 2; grid-row: 2; }
    .case-page .data-table { table-layout: auto; }
    .case-page .data-table tbody tr.case-grp { border: none; box-shadow: none; border-radius: 0; background: var(--bg-surface-alt); }
    .case-page .data-table tbody tr.case-grp td { border-left: none; border-radius: 0; box-shadow: none; }
    .case-page .case-gh-r { width: 100%; }}
  /* ═══ 開勞報對話框（需收編；q-dialog 會搬到 body 底下，所以不加頁面前綴）═══ */
  .case-dlg .case-dlg-kv { margin: 0 0 var(--space-3); display: grid; gap: var(--space-2); }
  .case-dlg .case-dlg-kv > div { display: flex; gap: var(--space-3); }
  .case-dlg .case-dlg-kv dt { flex: none; width: 56px; color: var(--text-secondary); }
  .case-dlg .case-dlg-kv dd { margin: 0; font-weight: 600; color: var(--text-primary); }
  .case-dlg .case-dlg-list { border: 1px solid var(--border-default); border-radius: var(--radius-sm); }
  .case-dlg .case-dlg-row { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-3); cursor: pointer; }
  .case-dlg .case-dlg-row + .case-dlg-row { border-top: 1px solid var(--border-default); }
  .case-dlg .case-dlg-row input { flex: none; width: 18px; height: 18px; accent-color: var(--brand-accent); }
  .case-dlg .case-dlg-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .case-dlg .case-dlg-amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .case-dlg .case-dlg-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: var(--space-3); }
  .case-dlg .case-dlg-total strong { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-lg); color: var(--text-primary); }

/* 勾選列 .rf-sel-bar（待處理帳務頁收編；UI-GUIDELINES §8.2）：勾選後出現在表格上方，每種動作一顆主按鈕＋清除。
   referrals-list 頁內的同名規則（.referrals-list-page .rf-sel-bar）特異度較高，維持原樣不受影響。手機版規則在各頁自己的 <style>。 */
.rf-sel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); margin-bottom: var(--space-3); background: var(--bg-surface-alt); border: 1px solid var(--border-default); border-radius: var(--radius-md); }
.rf-sel-bar .n { font-weight: 600; color: var(--text-primary); font-size: var(--fs-sm); }
.rf-sel-bar .rf-sel-spacer { flex: 1 1 auto; }
/* 貼底勾選列（ops-finance-split-20261118；核可 mockup mockups/finance-todo-tpp-2026-11-18.html）：待撥款格與財務中心共用一條勾選列時貼視窗底部。
   .sel-why 是停用按鈕旁的原因（跨家金流商不可合開一張撥款單）。 */
.rf-sel-bar.rf-sel-sticky { position: sticky; bottom: var(--space-3); z-index: 5; margin: var(--space-3) 0 0; background: var(--bg-card); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.rf-sel-bar .sel-why { flex-basis: 100%; color: var(--color-danger); font-size: var(--fs-sm); font-weight: 700; }
@media (max-width: 768px) { :where(html.app-shell) .rf-sel-bar.rf-sel-sticky { bottom: var(--space-2); } }

/* 程式代碼標籤（workbench-eng-program-identity）：工作台未排程組標題、月檢視程式列、清單程式欄共用；數值取自工程項目頁 .dpl-x。色由祖先的 wb-pj-N 提供（--pj／--pjt／--pjd） */
.wb-code { display: inline-block; flex: none; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; color: var(--pjd, var(--text-primary)); background: var(--pjt, var(--bg-paper)); border: 1px solid var(--pj, var(--border-strong)); border-radius: var(--radius-sm); padding: 0 6px; line-height: 20px; font-variant-numeric: tabular-nums; } /* space-exempt: 前綴徽章內距對照 dev-projects .dpl-x */

/* ───────── 工程任務（dev-center-into-tasks，tasks 1.15／1.16）：工作台清單列與類型篩選、工程任務詳情側板內容 ───────── */
.wbB .wbB-lrow.eng { background: var(--bg-paper); }
.wbB .wbB-lrow.eng:not(.byprog) { --pj: var(--brand-primary); }   /* 找不到程式的後備；有程式（.byprog）色條依程式色（workbench-eng-program-identity） */
.wbB .wbB-lrow.eng:hover { background: var(--brand-primary-100); }
.wbB .wbB-lrow.eng.on { background: var(--brand-accent-soft); }
.wbB .wbB-lrow.eng .eng-ic { font-size: 18px; vertical-align: -4px; margin-right: 4px; color: var(--brand-primary); } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.wbB .wbB-lrow.eng .lp { flex: 0 0 190px; }
.wbB .wbB-lrow.eng .who { flex: 0 0 112px; }
@media (max-width: 700px) { :where(html.app-shell) .wbB .wbB-lrow.eng .who { flex: 0 1 auto; } }

.dtp { display: grid; gap: 14px; font-size: var(--fs-sm); color: var(--text-primary); min-width: 0; }
.dtp-strow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.dtp-st { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.dtp-st button { appearance: none; border: 0; background: var(--bg-card); height: 34px; padding: 0 14px; cursor: pointer; color: var(--text-secondary); font-family: inherit; font-size: var(--fs-sm); }
.dtp-st button + button { border-left: 1px solid var(--border-strong); }
.dtp-st button:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.dtp-st button:disabled { cursor: not-allowed; opacity: .6; }
.dtp-st button[aria-pressed="true"] { background: var(--brand-primary); color: var(--text-on-brand); font-weight: 700; }
.dtp-st button[aria-pressed="true"][data-s="done"] { background: var(--color-success-soft); color: var(--color-success-text); }
.dtp-kv { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 2px 8px; align-items: center; margin: 0; }
.dtp-kv dt { color: var(--text-secondary); font-size: var(--fs-xs); }
.dtp-kv dd { margin: 0; min-width: 0; min-height: 30px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dtp-sel { height: 30px; min-width: 160px; max-width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 8px; background: var(--bg-card); color: var(--text-primary); font-family: inherit; font-size: var(--fs-sm); cursor: pointer; } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-sel:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.dtp-sel:disabled { cursor: not-allowed; opacity: .6; }
.dtp-pathtx { min-width: 0; overflow-wrap: anywhere; }
.dtp-link { appearance: none; border: 0; background: none; padding: 2px 4px; font-family: inherit; font-size: var(--fs-xs); color: var(--brand-accent); cursor: pointer; text-decoration: underline; border-radius: var(--radius-sm); position: relative; } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-link::after { content: ""; position: absolute; inset: -8px -4px; }
.dtp-link:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.dtp-src-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-paper); font-size: var(--fs-xs); color: var(--text-secondary); } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-k { font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-hint { font-weight: 400; }
.dtp-srcbox { border: 1px solid var(--border-default); border-left: 3px solid var(--brand-primary); background: var(--bg-paper); border-radius: var(--radius-sm); padding: 8px 10px; } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-srctx { margin: 0; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-sm); }
.dtp-ta { width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px; line-height: 1.6; background: var(--bg-card); resize: vertical; min-height: 72px; box-sizing: border-box; font-family: inherit; font-size: var(--fs-sm); } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-ta:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.dtp-logrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.dtp-btn { appearance: none; height: 34px; padding: 0 14px; border: 1px solid var(--brand-primary); border-radius: var(--radius-sm); background: var(--brand-primary); color: var(--text-on-brand); font-family: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-btn:disabled { cursor: not-allowed; opacity: .6; }
.dtp-btn:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.dtp-hist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-xs); } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-hist li { display: flex; flex-wrap: wrap; gap: 2px 8px; color: var(--text-secondary); }
.dtp-hist li.st .dtp-body { font-style: italic; }
.dtp-when { font-family: var(--font-mono); }
.dtp-who { font-weight: 700; }
.dtp-body { color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.dtp-none { margin-top: 8px; font-size: var(--fs-xs); color: var(--text-secondary); } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
/* 活動紀錄時間線＋黏底的工作日誌輸入列（task-drawer-log-timeline／S7-22；核可 mockup docs/dev-as-project/mockup/task-drawer-log-mockup-2026-10-16.html 方案 A）
   日誌與系統記錄合成一條，新的在下；日誌實心圓點＋正常字，系統記錄空心圓點＋斜體小字。輸入列 sticky 黏在側板捲動容器底部，不改兩個外殼的結構。 */
.dtp-chips { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; margin-left: auto; font-weight: 400; }
.dtp-chips button { appearance: none; border: 0; background: var(--bg-card); height: 26px; padding: 0 10px; font-family: inherit; font-size: var(--fs-xs); color: var(--text-secondary); cursor: pointer; } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-chips button + button { border-left: 1px solid var(--border-strong); }
.dtp-chips button[aria-pressed="true"] { background: var(--brand-primary); color: var(--text-on-brand); font-weight: 700; }
.dtp-chips button:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.dtp-tl { list-style: none; margin: var(--space-2) 0 0; padding: 0 0 0 var(--space-4); position: relative; display: grid; gap: var(--space-3); }
.dtp-tl::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--border-default); } /* space-exempt: 時間線豎線對齊圓點中心 */
.dtp-tl li { position: relative; font-size: var(--fs-xs); color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 2px 8px; border-radius: var(--radius-sm); } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-tl li::before { content: ""; position: absolute; left: -16px; top: 4px; width: 9px; height: 9px; box-sizing: border-box; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--border-strong); } /* space-exempt: 時間線圓點 */
.dtp-tl li.log::before { background: var(--brand-primary); border-color: var(--brand-primary); }
.dtp-tl li.sys .dtp-body { font-style: italic; }
.dtp-tl li.log { display: block; }
.dtp-tl .dtp-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-tl li.log .dtp-body { display: block; margin-top: 2px; font-size: var(--fs-sm); line-height: 1.6; } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-tl li.new { animation: dtpTlFlash 1.6s ease-out; }
@keyframes dtpTlFlash { from { background: var(--brand-accent-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .dtp-tl li.new { animation: none; } }
.dtp-compose { position: sticky; bottom: 0; z-index: 1; border-top: 1px solid var(--border-default); background: var(--bg-card); padding: var(--space-3) var(--space-4); box-shadow: 0 -4px 8px rgba(62, 53, 46, .05); }
/* 輸入列吃滿側板寬、貼齊底緣：抵銷外殼捲動容器的左右內距，並拿掉底部內距（程式詳情 .dsp-body 16px；工作台 .wbB-drb 20px） */
.dsp-body:has(> .dtp > .dtp-compose) { padding-bottom: 0; }
.dsp-body .dtp-compose { margin: 0 calc(var(--space-4) * -1); }
.wbB .wbB-drb:has(> .dtp > .dtp-compose) { padding-bottom: 0; }
.wbB .wbB-drb .dtp-compose { margin: 0 -20px; padding-left: 20px; padding-right: 20px; } /* space-exempt: 對齊工作台側板 .wbB-drb 的 20px 內距 */
.dtp-cmp { display: grid; gap: var(--space-2); }
.dtp-cmp textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 6px 10px; font-family: inherit; font-size: var(--fs-sm); line-height: 1.6; background: var(--bg-card); color: var(--text-primary); height: 36px; min-height: 36px; resize: none; overflow: hidden; display: block; } /* space-exempt: 收合態單行高度對齊 .dtp-in 30px＋觸控餘裕 */
.dtp-cmp textarea:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.dtp-cmp:focus-within textarea, .dtp-cmp.has textarea { height: 84px; resize: vertical; overflow: auto; } /* space-exempt: 展開態約三行 */
.dtp-cmp-act { display: none; align-items: center; gap: var(--space-3); }
.dtp-cmp:focus-within .dtp-cmp-act, .dtp-cmp.has .dtp-cmp-act { display: flex; }
.dtp-cmp-hint { flex: 1; min-width: 0; font-size: var(--fs-xs); color: var(--text-secondary); }
.dtp-cmp-hint kbd { font-family: var(--font-mono); font-size: var(--fs-xs); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--radius-sm); padding: 0 4px; background: var(--bg-paper); } /* space-exempt: 按鍵框 */
@media (hover: none) { .dtp-cmp-hint .kb { display: none; } } /* 手機沒有實體鍵盤，不顯示快捷鍵提示 */
/* 工作日誌附檔（dev-task-log-attachments；核可 mockup docs/task-attachments/mockup/index.html，老闆 2026-10-17「OK 上」）。程式詳情與工作台共用 dev-task-panel，樣式同一份。 */
/* 共用：檔案類型標籤 */
.dtp-at-ty{display:inline-flex;align-items:center;height:18px;padding:0 6px;border:1px solid var(--border-default);border-radius:var(--radius-sm);background:var(--bg-paper);font-family:var(--font-mono);font-size:var(--fs-xs);font-weight:700;line-height:1;color:var(--text-secondary);text-transform:uppercase;flex:none;} /* space-exempt: 共用側板元件的緊湊排版 */
.dtp-at-ty.web{border-color:var(--brand-accent);background:var(--brand-accent-soft);color:var(--brand-accent-dark);}
.dtp-at-sz{font-variant-numeric:tabular-nums;}
/* 小按鈕（下載／開啟／取消）：外觀 28px，點擊範圍用 ::after 擴到 44px */
.dtp-at-b{appearance:none;height:28px;padding:0 10px;border-radius:var(--radius-sm);border:1px solid var(--border-strong);background:var(--bg-card);color:var(--text-primary);cursor:pointer;display:inline-flex;align-items:center;gap:4px;white-space:nowrap;font-family:inherit;font-size:var(--fs-xs);position:relative;} /* space-exempt: 同 .pd-btn-mini */
.dtp-at-b::after{content:"";position:absolute;inset:-8px -2px;}
.dtp-at-b:hover{border-color:var(--brand-primary);}
.dtp-at-b:focus-visible{outline:2px solid var(--brand-accent);outline-offset:2px;}
.dtp-at-b .material-icons{font-size:16px;}
.dtp-at-b.dn{background:var(--color-danger);border-color:var(--color-danger);color:var(--text-on-brand);font-weight:700;height:34px;padding:0 14px;font-size:var(--fs-sm);} /* space-exempt: 同 .dtp-btn 34px */
.dtp-at-b.dn:hover{background:var(--brand-accent-dark);border-color:var(--brand-accent-dark);}
.dtp-at-b.keep{height:34px;padding:0 14px;font-size:var(--fs-sm);}
.dtp-at-b.keep::after{inset:-5px -2px;}
.dtp-at-ib{appearance:none;border:0;background:transparent;width:32px;height:32px;border-radius:var(--radius-sm);display:inline-grid;place-items:center;color:var(--text-secondary);cursor:pointer;position:relative;padding:0;flex:none;}
.dtp-at-ib::after{content:"";position:absolute;inset:-6px;}
.dtp-at-ib:hover{background:var(--neutral-100);color:var(--text-primary);}
.dtp-at-ib:focus-visible{outline:2px solid var(--brand-accent);outline-offset:1px;}
.dtp-at-ib:disabled{cursor:not-allowed;opacity:.6;}
.dtp-at-ib .material-icons{font-size:20px;}
/* (1) 活動紀錄裡，日誌下面的附件列 */
.dtp-at-list{list-style:none;margin:var(--space-2) 0 0;padding:0;display:grid;gap:var(--space-2);}
/* 附件列是 .dtp-tl li 的子層 li：選擇器要比 .dtp-tl li（flex、gap、圓點）更具體才蓋得過；時間線圓點只給日誌本身 */
.dtp-tl li.log .dtp-at-list > li::before{display:none;}
.dtp-tl li.log .dtp-at-list > li.dtp-at-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--space-1) var(--space-2);align-items:center;border:1px solid var(--border-default);border-radius:var(--radius-sm);background:var(--bg-card);padding:var(--space-2);} /* space-exempt: 共用側板元件的緊湊排版 */
.dtp-at-main{min-width:0;}
.dtp-at-nm{font-size:var(--fs-sm);font-weight:500;line-height:1.5;overflow-wrap:anywhere;color:var(--text-primary);}
.dtp-at-mt{display:flex;align-items:center;gap:var(--space-2);margin-top:2px;font-size:var(--fs-xs);color:var(--text-secondary);}
.dtp-at-why{display:flex;align-items:flex-start;gap:4px;margin-top:6px;font-size:var(--fs-xs);line-height:1.5;color:var(--text-secondary);}
.dtp-at-why .material-icons{font-size:14px;margin-top:2px;flex:none;}
.dtp-at-ac{display:flex;align-items:center;gap:var(--space-1);}
/* 窄版（手機、375 側板）：按鈕換到檔名下面一行，檔名才有足夠寬度 */
@media (max-width: 480px) { :where(html.app-shell) .dtp-tl li.log .dtp-at-list > li.dtp-at-row{grid-template-columns:minmax(0,1fr);} }
/* 列內確認刪除：整列換成提示，不跳視窗 */
.dtp-tl li.log .dtp-at-list > li.dtp-at-row.cf{grid-template-columns:minmax(0,1fr);border-color:var(--color-danger);background:var(--color-danger-soft);}
.dtp-at-row.cf .q{font-size:var(--fs-sm);font-weight:700;line-height:1.5;overflow-wrap:anywhere;color:var(--text-primary);}
.dtp-at-row.cf .w{font-size:var(--fs-xs);color:var(--text-secondary);line-height:1.6;}
.dtp-at-row.cf .btns{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-top:var(--space-1);}
/* 刪除後留下的一行灰字，讓刪錯可追 */
.dtp-at-gone{margin-top:var(--space-2);font-size:var(--fs-xs);line-height:1.5;color:var(--text-secondary);overflow-wrap:anywhere;border-radius:var(--radius-sm);}
.dtp-at-gone:focus-visible{outline:2px solid var(--brand-accent);outline-offset:2px;}
.dtp-at-gone + .dtp-at-gone{margin-top:var(--space-1);}
.dtp-at-list + .dtp-at-gone{margin-top:var(--space-2);}
/* (2) 底部日誌輸入列：迴紋針、待送檔案小卡、拖放提示 */
.dtp-compose{overflow:visible;}
.dtp-at-row0{display:grid;grid-template-columns:minmax(0,1fr) 36px;gap:var(--space-2);align-items:start;}
.dtp-at-clip{appearance:none;width:36px;height:36px;box-sizing:border-box;border:1px solid var(--border-strong);border-radius:var(--radius-sm);background:var(--bg-card);color:var(--text-secondary);display:inline-grid;place-items:center;cursor:pointer;position:relative;padding:0;} /* space-exempt: 與收合態輸入框同高 36px */
.dtp-at-clip::after{content:"";position:absolute;inset:-4px;}
.dtp-at-clip:hover:not(:disabled){border-color:var(--brand-primary);color:var(--text-primary);}
.dtp-at-clip:focus-visible{outline:2px solid var(--brand-accent);outline-offset:1px;}
.dtp-at-clip:disabled{cursor:not-allowed;opacity:.6;}
.dtp-at-clip .material-icons{font-size:20px;transform:rotate(45deg);}
.dtp-at-pend{list-style:none;margin:0;padding:0;display:grid;gap:var(--space-1);max-height:136px;overflow-y:auto;}
.dtp-at-pend:empty{display:none;}
.dtp-at-pc{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px var(--space-2);align-items:center;border:1px solid var(--border-default);border-radius:var(--radius-sm);background:var(--bg-paper);padding:var(--space-1) var(--space-2);}
.dtp-at-pc .nm{font-size:var(--fs-sm);font-weight:500;line-height:1.5;overflow-wrap:anywhere;color:var(--text-primary);}
.dtp-at-pc .mt{grid-column:1;display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-2);font-size:var(--fs-xs);color:var(--text-secondary);}
.dtp-at-pc .x{grid-column:2;grid-row:1 / span 2;}
.dtp-at-pc.err{border-color:var(--color-danger);background:var(--color-danger-soft);}
.dtp-at-pc .msg{width:100%;line-height:1.6;color:var(--color-danger);overflow-wrap:anywhere;}
.dtp-at-pc .ok{display:inline-flex;align-items:center;gap:2px;color:var(--color-success-text);}
.dtp-at-pc .ok .material-icons{font-size:14px;}
.dtp-at-bar{flex:1;min-width:80px;height:6px;border-radius:var(--radius-pill);background:var(--neutral-100);overflow:hidden;} /* space-exempt: 進度條 */
.dtp-at-bar i{display:block;height:100%;background:var(--brand-primary);transition:width .2s linear;}
@media (prefers-reduced-motion: reduce){ .dtp-at-bar i{transition:none;} }
.dtp-cmp-hint.need{color:var(--text-primary);font-weight:700;}
.dtp-cmp-hint.need .material-icons{font-size:14px;vertical-align:-2px;margin-right:2px;}
.dtp-cmp-hint .dtp-link{margin-left:var(--space-1);}
/* 拖進來時，整個輸入列蓋一層提示 */
.dtp-at-drop{display:none;position:absolute;inset:var(--space-2);z-index:2;align-items:center;justify-content:center;border:2px dashed var(--brand-accent);border-radius:var(--radius-md);background:var(--brand-accent-soft);color:var(--brand-accent-dark);font-weight:700;font-size:var(--fs-sm);text-align:center;pointer-events:none;}
.dtp-compose.drag .dtp-at-drop{display:flex;}
/* 活動紀錄標題列：四顆篩選鈕在 375 寬擠不下時換行 */
.dtp-k.wrap{flex-wrap:wrap;}
/* 上線紀錄、實際工時、「已上線，等你確認」標記（dev-center-into-tasks 階段 3；核可 mockup 畫面 3 的 .ship） */
.dtp-shipbox { border: 1px solid var(--color-success); border-radius: var(--radius-md); background: var(--color-success-soft); padding: 10px var(--space-3); font-size: var(--fs-sm); line-height: 1.6; } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-reledit { margin-top: var(--space-2); }
.dtp-relform { display: grid; gap: var(--space-2); }
.dtp-fl { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; align-items: center; font-size: var(--fs-xs); color: var(--text-secondary); } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-in { height: 30px; min-width: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 8px; background: var(--bg-card); color: var(--text-primary); font-family: inherit; font-size: var(--fs-sm); box-sizing: border-box; } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-in:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.dtp-in:disabled { cursor: not-allowed; opacity: .6; }
.dtp-hours { width: 88px; text-align: right; font-family: var(--font-mono); } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-err { color: var(--color-danger); font-size: var(--fs-xs); }
.dtp-relact { display: flex; align-items: center; gap: var(--space-3); }
.wbB .wbB-lrow .wbB-relflag { margin-left: var(--space-2); vertical-align: 1px; }
.dtp-closebtn { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--space-2); }
/* 與回報人的討論（dev-center-into-tasks 2.17；核可 mockup 畫面 3 的 .dm-blk 留言卡） */
.dtp-msg { border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-card); padding: 10px var(--space-3); margin-bottom: var(--space-2); line-height: 1.6; } /* space-exempt: 共用側板元件的緊湊排版，token 無對應刻度 */
.dtp-msg-k { font-size: var(--fs-xs); color: var(--text-secondary); margin-bottom: 2px; }
.dtp-msg-b { white-space: pre-wrap; overflow-wrap: anywhere; }
.dtp-replyrow { margin-top: var(--space-2); }
.dtp-closebtn .material-icons { font-size: 18px; }
/* 工作台「回報等你看 N 則」提示條(dev-center-into-tasks 階段 2) */
.wbB .wbB-inbox { display: flex; align-items: center; gap: 8px; padding: 8px var(--space-3); margin-bottom: var(--space-3); font-size: 13px; background: var(--color-warning-soft); border: 1px solid var(--color-warning); border-radius: var(--radius-sm); color: var(--color-warning-text); }
.wbB .wbB-inbox .material-icons { font-size: 18px; }
.wbB .wbB-inbox .tx { flex: 1; min-width: 0; }
.wbB .wbB-inbox .go { color: var(--color-warning-text); font-weight: 700; text-decoration: underline; white-space: nowrap; }
.wbB .wbB-inbox .go:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

/* ===== quote-payment-info-custom：報價單紙面「付款資訊」SHOPLINE／自訂文字段落 =====
   預覽頁(document-preview)與簽約頁(sign.html)共用；純文字顯示，換行由 CSS 處理，禁用 v-html／innerHTML。 */
.doc-paper .terms-grid .bank .pay-custom {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 10px;   /* 與銀行帳號 dd 同字級(inline 10px/16px) */
  line-height: 16px;
  letter-spacing: 0.0525px;
  color: var(--paper-ink-1);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
/* 分期：頭款／尾款金額下方接付款說明 */
.doc-paper .terms-grid .bank dl + .pay-custom { margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border-default); }

/* ═══ 對外身分（openspec change lmc-sender-persona；來源＝核可 mockup mockups/lmc-sender-persona-mockup-2026-10-18.html，1:1）═══
   .pa 頭貼、.lnp LINE 手機預覽、.pe-* 對外身分頁的對話框與表單（q-dialog 會 teleport 到 body，所以放全域）。
   訊息中心輸入區的 .psw／.psb／.psend 在 components/line-conversation.vue.html；管理頁清單的 .pe-tbl 等在 pages/sender-personas.vue.html。
   mockup 的 container query 在實作改成 @media (max-width:768px)。 */

/* 頭貼：圓形，文字頭貼底色取自色盤 c1–c5（後端常數表與這裡的 token 由測試比對一致） */
.pa { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; color: var(--text-on-accent); font-weight: 700; line-height: 1; overflow: hidden; }
.pa img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pa-s20 { width: 20px; height: 20px; font-size: 11px; }
.pa-s24 { width: 24px; height: 24px; font-size: 12px; }
.pa-s28 { width: 28px; height: 28px; font-size: 13px; }
.pa-s32 { width: 32px; height: 32px; font-size: 15px; }
.pa-s36 { width: 36px; height: 36px; font-size: 15px; }
.pa-s40 { width: 40px; height: 40px; font-size: 15px; }
.pa-s56 { width: 56px; height: 56px; font-size: 20px; }
.pa-s72 { width: 72px; height: 72px; font-size: 20px; }
.pa-c1 { background: var(--brand-primary); }
.pa-c2 { background: var(--color-success-text); }
.pa-c3 { background: var(--color-warning-text); }
.pa-c4 { background: var(--stage-maintenance); }
.pa-c5 { background: var(--neutral-600); }
.pa-photo { background: var(--neutral-200); color: var(--neutral-500); }
.pa-photo svg { width: 76%; height: 76%; fill: currentColor; }
.pa-cust { background: var(--neutral-300); color: var(--neutral-700); }
.pa-fb { background: var(--neutral-600); color: var(--text-on-accent); }
.pa-fb .material-icons { font-size: 62%; }

/* 文字連結鈕（清單操作、帳號設定頁的「管理對外身分」） */
.pe-lk { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 0 8px; border: 0; background: none; font: inherit; font-size: var(--fs-sm); color: var(--text-secondary); border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; }
.pe-lk:hover { background: var(--bg-surface-alt); color: var(--text-primary); }
.pe-lk:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.pe-lk--del:hover { color: var(--color-danger); background: var(--color-danger-soft); }
.pe-lk--link { color: var(--brand-primary); text-decoration: underline; padding: 0 2px; }

/* LINE 手機預覽：客戶在 LINE 看到的樣子（名稱後 LINE 自動加「from 官方帳號名」） */
.lnp { width: 100%; max-width: 300px; margin: 0 auto; border: 1px solid var(--border-strong); border-radius: 20px; overflow: hidden; background: var(--bg-card); }
.lnp-h { background: var(--bg-card); border-bottom: 1px solid var(--border-default); padding: 8px 12px; font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); text-align: center; }
.lnp-b { background: var(--neutral-100); padding: 12px 10px; min-height: 128px; display: flex; flex-direction: column; gap: 10px; }
.lnp-r { display: flex; gap: 8px; align-items: flex-start; }
.lnp-nm { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; overflow-wrap: anywhere; }
.lnp-nm i { font-style: normal; color: var(--text-secondary); }
.lnp-bub { background: var(--bg-card); border-radius: 4px 14px 14px 14px; padding: 8px 10px; font-size: 13px; line-height: 1.5; color: var(--text-primary); max-width: 210px; border: 1px solid var(--border-default); overflow-wrap: anywhere; }
.lnp-cap { font-size: var(--fs-xs); color: var(--text-secondary); text-align: center; margin-top: 6px; line-height: 1.5; }

/* 新增／編輯對話框 */
/* q-dialog 預設把內容限在 560px；身分對話框要 760 */
.q-dialog__inner > .pe-dlg { max-width: 760px; }
.pe-dlg { background: var(--bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); width: 100%; max-width: 760px; overflow: hidden; }
.pe-dlg-h { padding: var(--space-4) var(--space-5); font-family: var(--font-serif); font-size: var(--fs-lg); font-weight: 700; color: var(--text-primary); border-bottom: 1px solid var(--border-default); }
.pe-dlg-b { padding: var(--space-4) var(--space-5); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--space-5); max-height: calc(100vh - 160px); overflow-y: auto; }
.pe-dlg-b--one { grid-template-columns: minmax(0, 1fr); }
.pe-dlg-f { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-5); background: var(--neutral-50); border-top: 1px solid var(--border-default); }
.pe-fld { margin-bottom: 14px; }
.pe-lb { display: flex; justify-content: space-between; font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }
.pe-in { width: 100%; box-sizing: border-box; height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 12px; font: inherit; font-size: var(--fs-base); color: var(--text-primary); background: var(--bg-card); }
.pe-in:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.pe-in--err { border-color: var(--color-danger); box-shadow: 0 0 0 1px var(--color-danger); }
.pe-in--short { width: 96px; margin-bottom: 10px; }
.pe-err { display: flex; gap: 4px; align-items: center; color: var(--color-danger); font-size: var(--fs-xs); margin-top: 4px; }
.pe-err .material-icons { font-size: 14px; }
.pe-help { font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }
.pe-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); overflow: hidden; margin-bottom: 10px; }
.pe-seg button { border: 0; background: var(--bg-card); color: var(--text-body); font: inherit; font-size: var(--fs-sm); min-height: 36px; padding: 0 16px; cursor: pointer; }
.pe-seg button[aria-checked="true"] { background: var(--brand-primary); color: var(--text-on-brand); font-weight: 700; }
.pe-seg button:disabled { opacity: .5; cursor: not-allowed; }
.pe-seg button:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.pe-sw { display: flex; flex-wrap: wrap; gap: 10px; }
.pe-sw-i { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--text-secondary); width: 52px; }
.pe-sw-b { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-on-accent); background: transparent; }
.pe-sw-b:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.pe-sw-b .pa { pointer-events: none; }
.pe-sw-b[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--text-primary); }
.pe-sw-b .material-icons { font-size: 18px; display: none; position: absolute; }
.pe-sw-b[aria-checked="true"] .material-icons { display: block; }
.pe-up { display: flex; gap: 12px; align-items: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); padding: 10px 12px; background: var(--bg-surface-alt); }
.pe-up-t { font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.5; min-width: 0; }
.pe-up-file { display: none; }
.pe-gr { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-card); }
.pe-gr-s { padding: 6px 8px; border-bottom: 1px solid var(--border-default); }
.pe-gr-s .pe-in { height: 32px; }
.pe-gr-l { max-height: 188px; overflow: auto; }
.pe-gr-r { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; font-size: var(--fs-base); color: var(--text-primary); cursor: pointer; }
.pe-gr-r input { width: 18px; height: 18px; accent-color: var(--brand-primary); flex: none; }
.pe-gr-r small { margin-left: auto; font-size: var(--fs-xs); color: var(--text-secondary); }
.pe-gr-f { padding: 6px 12px; border-top: 1px solid var(--border-default); font-size: var(--fs-xs); color: var(--text-secondary); }

/* ═══ 日期狀態標示（change: leave-days-date-marks；核可 mockup mockups/leave-days-week-calendar-mockup-2026-10-19.html，1:1）═══
   主體（正在看的人）的四種日期狀態：休假／國定假日／補班／我要上班。工作台、我的日曆、專案詳情、帳號設定休假月曆共用這一份，
   頁內不得另定義同款顏色。小標 .lv-tag（k-leave｜k-holiday｜k-makeup｜k-override；.lv-xs＝手機與 30 天月刻度的小尺寸。不叫 .xs:Quasar 的 .xs 是「螢幕 ≥600px 就 display:none !important」的工具 class），
   整欄／整格底色 .lv-c-*（放在 aria-hidden 的底層）。各畫面的版面位置（標頭第二行、清單日期旁等）在頁內。 */
.lv-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--radius-sm); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; line-height: 1; box-sizing: border-box; flex: none; max-width: 100%; } /* space-exempt: 核可 mockup 1:1 的小標尺寸,無對應 token */
.lv-tag.k-leave { background: var(--brand-primary); color: var(--text-on-brand); border: 1px solid var(--brand-primary); }
.lv-tag.k-holiday { background: var(--bg-card); color: var(--color-warning-text); border: 1px solid var(--color-warning); }
.lv-tag.k-makeup { background: var(--bg-card); color: var(--color-success-text); border: 1px solid var(--color-success); }
.lv-tag.k-override { background: var(--bg-card); color: var(--text-primary); border: 1px dashed var(--brand-primary); }
.lv-tag.lv-xs { height: 15px; padding: 0 2px; font-size: 10px; border-radius: var(--radius-xs); letter-spacing: -.02em; } /* space-exempt: 核可 mockup 1:1,手機與 30 天月刻度的 10px 小標 */
.wbB-dh.tod .lv-tag.k-leave, .pcal-dh.tod .lv-tag.k-leave { box-shadow: 0 0 0 1px var(--text-on-brand); } /* 今天標頭是深色底:實心「休」加一圈米白描邊 */
/* 底色用 !important:各頁的欄位／格子基底（.wbB-col、.pcal-col、.pcal-mb 等）選擇器特異度較高且多帶 background 簡寫，
   不用 !important 會讓假日淺黃底與休假斜紋被蓋掉（核可 mockup 的欄底就是因此在部分畫面沒顯示）。 */
:root { --lv-stripe-leave: repeating-linear-gradient(135deg, var(--neutral-100) 0 4px, transparent 4px 8px); --lv-stripe-override: repeating-linear-gradient(135deg, var(--color-warning-soft) 0 8px, var(--bg-card) 8px 16px); }
.lv-c-leave { background-image: var(--lv-stripe-leave) !important; }
.lv-c-holiday { background-color: var(--color-warning-soft) !important; }
.lv-c-makeup { background-color: var(--color-success-soft) !important; }
.lv-c-override { background-image: var(--lv-stripe-override) !important; }

/* ═══ 批 D：週／月格線日期標頭的降級規則（change: cal-wb-d-date-band；判斷程式 shared/date-head-fit.js）═══
   對象：日曆週 .pcal-dh、工作台週 .wbB-dh、日曆月格日期列 .pcal-mhd。標頭由左到右＝週X(.hd-w＞.wz)、假日小標(.lv-tag＞.lv-l／.lv-s)、日期(.d-full／.d-md)、＋。
   預設（程式沒跑）：允許折行、小標只顯示單字，仍不越界。程式跑起來加 .fit-nw（不換行）逐級降級，最後一級才拿掉 .fit-nw 回到折行（最多兩列）。
   小標有全名 .lv-l 與單字 .lv-s；欄頭有 .fit-long 才顯示全名。全名永遠在 title 與 aria-label。 */
.lv-tag > .lv-l { display: none; }
.fit-long .lv-tag > .lv-l { display: inline; }
.fit-long .lv-tag > .lv-s { display: none; }
.d-md { display: none; }
.dm .d-full { display: none; }
.dm .d-md { display: inline; }
.wz-off .wz { display: none; }
:is(.pcal .pcal-dh, .wbB .wbB-dh, .pcal .pcal-mhd).fit-nw { flex-wrap: nowrap; white-space: nowrap; }
:is(.pcal .pcal-dh, .wbB .wbB-dh, .pcal .pcal-mhd).pad-s { padding-left: var(--space-1); padding-right: var(--space-1); column-gap: 0; } /* 第 5 級：內距 4＝--space-1；間距 2px 沒有 token，跳過 */
/* 第 4、6 級：視覺隱藏而不是 display:none，螢幕閱讀器仍讀得到（欄頭另有 title） */
:is(.pcal .pcal-dh, .wbB .wbB-dh).wd-off > .hd-w,
:is(.pcal .pcal-dh, .wbB .wbB-dh, .pcal .pcal-mhd).tag-off > .lv-tag { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* 日期標示說明的小 info 圖示與浮層（change: leave-legend-hint-icon；核可 mockup mockups/leave-legend-hint-button-2026-10-19.html，1:1）。
   圖示沿用各頁 .wbB-info（截止日 ⓘ）的外觀，這裡只補命中範圍與桌面／手機二選一顯示；浮層是 q-tooltip（teleport 到 body），
   版型 .hp-row（色塊＋小標＋說明）與 .sw 色塊掛在 .lv-hint-pop 下，工作台與我的日曆共用。 */
.lv-hint-icon { position: relative; }
.lv-hint-icon::after { content: ''; position: absolute; inset: -10px; } /* 觸控命中外擴,視覺仍是小圖示 */
.lv-hint-m { display: none; }
.q-tooltip.lv-hint-pop { width: 320px; max-width: calc(100vw - 32px); box-sizing: border-box; } /* space-exempt: 核可 mockup 1:1,四列說明浮層寬度 */
.lv-hint-pop .hp-row { display: grid; grid-template-columns: 22px 52px minmax(0, 1fr); align-items: center; gap: var(--space-2); padding: var(--space-1) 0; line-height: 1.5; } /* space-exempt: 核可 mockup 1:1 */
.lv-hint-pop .hp-row + .hp-row { border-top: 1px solid var(--text-secondary); }
.lv-hint-pop .sw { width: 22px; height: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-xs); } /* space-exempt: 核可 mockup 1:1,與帳號設定圖例色塊同尺寸 */
.lv-hint-pop .lv-tag { justify-self: start; }
.lv-hint-pop .lv-tag.k-leave { box-shadow: 0 0 0 1px var(--text-on-brand); } /* 深色浮層上實心「休」加一圈米白描邊 */
@media (max-width: 768px) {
  :where(html.app-shell) .lv-hint-d { display: none; }
  :where(html.app-shell) .lv-hint-m { display: inline-flex; }
  :where(html.app-shell) .wbB-tb > .lv-hint-m { order: 2; } /* 手機工作台:第一排「篩選」鈕旁 */
}

/* ═══ 日期區間按鈕與迷你月曆浮窗（OpenSpec change cal-wb-f-date-popover；核可 mockup mockups/calendar-date-popover-2026-11-07.html，1:1）═══
   我的日曆、我的工作台共用 components/date-range-pop（按鈕 .dpv-trg、浮窗 .dpv、格子 .dpv-d）。規格 docs/calendar-workbench-polish/batch-f-spec.md（§7、§8）。
   觸控以 @media (hover: none) 判斷，不只看寬度。只用既有 token。.selcol＝工作台 30 天時間軸選日後那一欄的靜態外框，保留到下一次導覽動作。 */
.dpv-wrap { position: relative; display: inline-flex; align-items: center; }
.wbB .wbB-nav .dpv-trg { appearance: none; border: 0; background: transparent; font-family: inherit; color: var(--text-primary); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); height: 30px; padding: 0 var(--space-2); border-radius: var(--radius-sm); cursor: pointer; position: relative; } /* space-exempt: 與同列 .wb-act 同高 30 */
.wbB .wbB-nav .dpv-trg .material-icons { font-size: 18px; color: var(--text-secondary); } /* 常駐的小日曆圖示＝「這裡點得開」的線索 */
.wbB .wbB-nav .dpv-trg:hover, .wbB .wbB-nav .dpv-trg[aria-expanded="true"] { background: var(--bg-surface-alt); }
.wbB .wbB-nav .dpv-trg.pin .material-icons { color: var(--brand-accent); } /* 釘住時圖示轉火焰紅（輔助；狀態另由 aria-expanded 與行為表達） */
.wbB .wbB-nav .dpv-trg:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
@media (max-width: 768px) {
  /* 手機：外觀 28 高，命中靠 ::after 補到 44（同工具列其他鈕的做法） */
  :where(html.app-shell) body .wbB .wbB-nav .dpv-trg { height: 28px; padding: 0 var(--space-1); }
  :where(html.app-shell) body .wbB .wbB-nav .dpv-trg::after { content: ''; position: absolute; inset: -8px -2px; }
}
.dpv { --dpv-cell: 36px; --dpv-row: 40px; --dpv-pad: var(--space-3); --dpv-nv: 30px;
  position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; box-sizing: border-box;
  width: calc(var(--dpv-cell) * 7 + var(--dpv-pad) * 2 + 2px); max-width: calc(100vw - 32px);
  padding: var(--dpv-pad); background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); color: var(--text-primary); font-variant-numeric: tabular-nums; outline: none; } /* space-exempt: 核可 mockup 1:1，格寬 36／44 */
.dpv.anim { animation: dpv-in 100ms ease-out; }
@keyframes dpv-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dpv.anim { animation: none; } }
.dpv::before { content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 9px; } /* 8px 透明橋接區（+1 為框線），斜移不閃掉 */
.dpv-hd { display: flex; align-items: center; justify-content: space-between; height: var(--dpv-row); }
.dpv-ttl { font-size: var(--fs-base); font-weight: 700; }
.dpv-nv { appearance: none; border: 0; background: transparent; width: var(--dpv-nv); height: var(--dpv-nv); border-radius: 50%; display: inline-grid; place-items: center; color: var(--text-primary); cursor: pointer; position: relative; }
.dpv-nv:hover { background: var(--bg-surface-alt); }
.dpv-nv:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.dpv-nv .material-icons { font-size: 20px; }
.dpv-wd, .dpv-wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dpv-wd { height: 24px; align-items: center; text-align: center; font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); } /* space-exempt: 核可 mockup 1:1 */
.dpv-wk { height: var(--dpv-row); border-radius: var(--radius-sm); }
.dpv-wk.cur { background: var(--bg-surface-alt); box-shadow: inset 0 0 0 1px var(--border-strong); } /* 週視圖：當週整列淡底＋細框（框是非顏色線索） */
/* 月／30 天：只標範圍內的格子（淡底），範圍外緣加 1px 框線當非顏色線索（批 F §8-1）；邊由元件依「相鄰格是否在範圍內」加 et／eb／el／er */
.dpv-d.inr { background: var(--bg-surface-alt); border-radius: 0; }
.dpv-d.inr::before { content: ''; position: absolute; inset: 0; pointer-events: none; border: 0 solid var(--border-strong); }
.dpv-d.inr.et::before { border-top-width: 1px; } .dpv-d.inr.eb::before { border-bottom-width: 1px; }
.dpv-d.inr.el::before { border-left-width: 1px; } .dpv-d.inr.er::before { border-right-width: 1px; }
.dpv-gc { display: flex; min-width: 0; }
.dpv-d { appearance: none; border: 0; background: transparent; font: inherit; color: inherit; padding: 3px 0 0; margin: 0; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; cursor: pointer; position: relative; border-radius: var(--radius-sm); } /* space-exempt: 核可 mockup 1:1，格內 3px／1px */
.dpv-d .n { min-width: 26px; height: 20px; padding: 0 2px; box-sizing: border-box; display: inline-grid; place-items: center; font-size: var(--fs-sm); font-weight: 500; line-height: 1; border-radius: var(--radius-sm); } /* space-exempt: 核可 mockup 1:1 */
.dpv-d.out { color: var(--text-secondary); }
.dpv-d.out .n { font-weight: 400; }
.dpv-d.tod .n { background: var(--brand-primary); color: var(--text-on-brand); font-weight: 700; } /* 今天＝批 D 的深棕反白 */
.dpv-d:hover { box-shadow: inset 0 0 0 1px var(--brand-primary); }
.dpv-d:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; z-index: 1; }
/* 底部列：釘住時（桌面）或觸控時顯示；放在底部，浮窗變高時上面的格子不會位移（避免 pointerdown 後點擊落空） */
.dpv-ft { display: none; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-1); position: sticky; bottom: 0; background: var(--bg-card); }
.dpv.pin .dpv-ft { display: flex; }
.dpv-note { margin-top: var(--space-1); font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.4; text-align: center; }
.dpv-hint { font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.4; }
.dpv-hint .tc { display: none; }
/* 關閉鈕：主文字色＋1px 框線，命中 ≥44px（批 F §8-3、§8-4）；桌面只有 ✕，觸控加「關閉」二字 */
.dpv-cl { appearance: none; background: var(--bg-card); font: inherit; font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); border: 1px solid var(--text-primary); min-width: 44px; height: 44px; padding: 0 var(--space-2); border-radius: var(--radius-sm); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 2px; flex: none; box-sizing: border-box; } /* space-exempt: 命中 44 */
.dpv-cl .material-icons { font-size: 20px; }
.dpv-cl .t { display: none; }
.dpv-cl:hover { background: var(--bg-surface-alt); }
.dpv-cl:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
/* 觸控：用 @media (hover:none) 判斷，不只看寬度 */
@media (hover: none) {
  .dpv { --dpv-cell: 44px; --dpv-row: 44px; --dpv-pad: var(--space-2); --dpv-nv: 44px; }
  .dpv-ft { display: flex; } .dpv-cl .t { display: inline; } .dpv-hint .dk { display: none; } .dpv-hint .tc { display: inline; }
}
/* v2（批 F §10-5）矮視窗（例如 667×375 橫放）：JS 量到放不下就加 .lim。浮窗本身不捲，只有月曆格區域（.dpv-sc）捲；
   月份鈕、關閉鈕、星期列固定在上方，任何捲動位置都看得到。關閉鈕移到右上角（絕對定位並替它預留位置，釘住前後月份鈕不位移）。 */
.dpv.lim { display: flex; flex-direction: column; overflow: hidden; }
.dpv.lim .dpv-hd { flex: none; padding-right: calc(44px + var(--space-2)); }   /* 預留關閉鈕位置：桌面只有 ✕（44px） */
@media (hover: none) { .dpv.lim .dpv-hd { padding-right: calc(68px + var(--space-2)); } }   /* 觸控的關閉鈕有「關閉」二字，約 66px 寬 */
.dpv.lim .dpv-sc { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.dpv.lim .dpv-wd { position: sticky; top: 0; z-index: 2; background: var(--bg-card); }
.dpv.lim .dpv-ft { flex: none; position: static; }
.dpv.lim .dpv-cl { position: absolute; top: calc(var(--dpv-pad) + (var(--dpv-row) - 44px) / 2); right: var(--dpv-pad); }

/* v2（批 F §10-1、§10-2、§10-8）選定大框 .dpv-frame 與跳轉閃色。核可 mockup calendar-date-popover-2026-11-07-v2.html 1:1，沒有新增 token。
   .dpv-frame：單一元素、pointer-events:none。框線 2px --brand-primary（沿用第一版選定框）；外圈與內圈各加 1px --text-on-brand，讓框落在深色欄頭上仍看得到。
   閃色（.dpv-fl／.dpv-fs）放在文字下方、只染欄底：目標元素加 .dpv-fl，::before（z-index:-1）疊在自己的底色之上、內容之下，所以文字、活動卡、活動條不被染到。
   --brand-accent，不透明度 0 → 峰值（150ms）→ 0（再 750ms），共 900ms，結束後由 JS 移除標記。淺底峰值 30%；深棕欄頭（.dpv-fh，白字）85%；
   今天的欄頭（.dpv-ftd，深棕底白字）80%：峰值只有 4.5:1 上下，餘裕太薄。類別名不可用 .dpv-ft（浮窗底部關閉列已占用）。 */
.dpv-frame { position: absolute; z-index: 0; pointer-events: none; box-sizing: border-box; border: 2px solid var(--brand-primary); box-shadow: 0 0 0 1px var(--text-on-brand), inset 0 0 0 1px var(--text-on-brand); }
.dpv-hr { position: relative; }   /* JS 只在宿主原本是 static 時加，給外框一個定位基準，不影響版面 */
/* 桌機週曆(.pcal-sc):外框要疊在 sticky 欄頭(.pcal-top,z-index 4)之上,捲動時才看得到 */
.pcal .pcal-sc > .dpv-frame { z-index: 5; }
.dpv-fl { isolation: isolate; --dpv-pk: .30; }
.dpv-fl.dpv-rel { position: relative; }   /* JS 只在元素原本是 static 時加，避免蓋掉 sticky／absolute */
.dpv-fl.dpv-fh { --dpv-pk: .85; }
.dpv-fl.dpv-fh.dpv-ftd { --dpv-pk: .80; }
.dpv-fl::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; background: var(--brand-accent); opacity: 0; animation: dpv-flash 900ms linear forwards; }
@keyframes dpv-flash {
  0% { opacity: 0; animation-timing-function: ease-out; }
  16.667% { opacity: var(--dpv-pk); animation-timing-function: ease-in-out; }
  100% { opacity: 0; }
}
/* 30 天欄頭的週末欄（含補班的週六）整格 opacity .7，會把閃色和文字一起打折，峰值幀字會掉到 4.10；
   閃色期間讓這格的 opacity 隨閃色一起 .7 → 1 → .7（同 900ms、150ms 到頂）。今天那格本來就是 opacity 1，不能被拉到 .7 */
.wbB .wbB-tl-days span.we:not(.tod).dpv-fl { animation: dpv-op 900ms linear forwards; }
@keyframes dpv-op {
  0% { opacity: .7; animation-timing-function: ease-out; }
  16.667% { opacity: 1; animation-timing-function: ease-in-out; }
  100% { opacity: .7; }
}
/* 日期欄頭的日期數字平常是 opacity .85（日曆週欄頭 .n、工作台週欄頭 .dn），峰值幀對比會從 5.4 掉到 4.0；閃色期間讓它隨閃色 .85 → 1 → .85 */
.pcal .pcal-dh.dpv-fl .n, .wbB .wbB-dh.dpv-fl .dn { animation: dpv-op85 900ms linear forwards; }
@keyframes dpv-op85 {
  0% { opacity: .85; animation-timing-function: ease-out; }
  16.667% { opacity: 1; animation-timing-function: ease-in-out; }
  100% { opacity: .85; }
}
.dpv-trk { isolation: isolate; }
.dpv-fs { --dpv-pk: .30; position: absolute; top: 0; bottom: 0; left: calc(var(--si) * 100% / var(--n)); width: calc(100% / var(--n)); z-index: -1; pointer-events: none; background: var(--brand-accent); opacity: 0; animation: dpv-flash 900ms linear forwards; }
@media (prefers-reduced-motion: reduce) { .dpv-fl::before, .dpv-fs { display: none; animation: none; } .wbB .wbB-tl-days span.we.dpv-fl, .pcal .pcal-dh.dpv-fl .n, .wbB .wbB-dh.dpv-fl .dn { animation: none; } }
/* 30 天：位置完全由 CSS 變數算（--si＝第幾欄、--n＝總欄數、--nmw＝專案名稱欄寬、--hh＝欄頭高），跟著版面縮放；top/bottom 0＝欄頭上緣到最後一列下緣 */
.wbB .wbB-tl > .dpv-frame { top: 0; bottom: 0; left: calc(var(--nmw) + (100% - var(--nmw)) * var(--si) / var(--n)); width: calc((100% - var(--nmw)) / var(--n)); z-index: 3; box-shadow: none; }   /* 手機專案名稱欄是 sticky z 4，大框橫向捲動時從它底下穿過 */
/* 奶色內外線只畫在深棕欄頭那一段，列區不畫，所以不會切斷活動條；用大框自己的 ::before／::after，不增加元素 */
.wbB .wbB-tl > .dpv-frame::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: var(--hh, 44px); box-shadow: inset 1px 0 0 var(--text-on-brand), inset -1px 0 0 var(--text-on-brand), inset 0 1px 0 var(--text-on-brand); }
.wbB .wbB-tl > .dpv-frame::after { content: ''; position: absolute; left: -2px; right: -2px; top: -2px; height: calc(var(--hh, 44px) + 2px); box-shadow: -1px 0 0 var(--text-on-brand), 1px 0 0 var(--text-on-brand), 0 -1px 0 var(--text-on-brand); }

/* ═══ 公司工作台／公司日曆／夥伴疊加（OpenSpec change company-workbench-calendar，ELOP-71） ═══
   出處：核可 mockup docs/company-workbench-calendar/mockup/mock.css 第 387–707 行，改用 token 並加前綴避免撞到各頁自己的 .pc／.ci／.cm／.sheet 等類名。
   前綴：cw-＝公司頁（根 .co）；pv-＝夥伴疊加與面板（個人頁也用）。字級下限 --fs-xs。登記於 UI-GUIDELINES.md §5.25。 */

/* 夥伴名字前綴：最多 6 字，完整名字放 title／aria-label；不靠顏色分辨 */
.pv-pn { display: inline-flex; align-items: center; max-width: 100%; height: 18px; padding: 0 6px; margin-right: 4px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text-primary); font-size: var(--fs-xs); font-weight: 700; line-height: 16px; white-space: nowrap; vertical-align: 1px; font-family: var(--font-sans); }
/* 夥伴任務／活動：沿用他人唯讀灰化（不新增顏色） */
.wbB-task.pv-peer { background: var(--bg-surface-alt); }
.wbB-task.pv-peer:hover { background: var(--neutral-100); }
.wbB-task.pv-peer .wbB-ct { color: var(--text-secondary); font-weight: 600; }
.wbB-task.pv-peer.fin .wbB-ct { font-weight: 500; }
.act-card.pv-peer { background: var(--bg-surface-alt); }
.act-card.pv-peer:hover { background: var(--neutral-100); }
.act-card.pv-peer .act-ti { color: var(--text-secondary); font-weight: 600; }
/* cal-wb-polish-g-peer-cards（核可 mockup A 版）：夥伴卡＝灰底＋2px 灰條（Google 忙碌 .gg 不套用）；任務卡同；框線仍只表示來源 */
.act-card.pv-peer:not(.gg) { --pj: var(--border-strong); border-left-width: 2px; }
.wbB-task.pv-peer { --pj: var(--border-strong); border-left-width: 2px; }
/* 姓名標籤放第一行時間後面（位置同「有空」「預約」）；卡內的標籤比任務清單裡的小一號；.pv-ini＝窄卡收起標籤時留在標題前的姓名首字 */
.act-card .pv-pn { height: 16px; line-height: 14px; padding: 0 4px; margin-right: 3px; }
.act-tm .pv-tm { margin-left: 6px; flex: none; }
/* 批 Z M5／M6：週格每日卡（v-cell）的時間列放不下「時間＋預約＋姓名」時，姓名標籤縮成省略號、預約換到下一行，不再溢出卡右緣或壓到標題。時間欄寬 ≥220 時以內容撐寬（至少 108、至多 60%），不再固定 108 把內容擠進標題欄 */
.act-card.v-cell .act-tm { flex-wrap: wrap; }
.act-card.v-cell .act-tm .pv-tm { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; margin-left: 4px; }
.act-card .pv-ini { display: none; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 3px; border-radius: var(--radius-sm); background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text-primary); font-size: var(--fs-xs); font-weight: 700; line-height: 14px; vertical-align: 1px; font-family: var(--font-sans); }
/* 批 Y S3 與會夥伴（核可 mockup cal-wb-2026-11-10 NEW S3）：沿用 .pv-pn 外觀，不新增顏色。
   .act-mt＝全天橫條標題後的名字（窄時收成首字）；.act-mtl＝時間軸卡、工作台每天卡最後一行的完整名字標籤；.act-mtc＝放不下整行時的「人形圖示＋首字」；.act-tir＝標題＋圖示同一列。
   日曆時間軸矮卡的取捨（med／half／short 何時顯示哪一種）在 pages/calendar.vue.html 的 .pcal .pcal-col .ev 規則。 */
.act-mt { display: inline-flex; align-items: center; gap: 3px; flex: none; margin-left: auto; padding-left: 4px; }
.act-mt .pv-pn, .act-mt .pv-ini { margin-right: 0; }
@container (max-width: 199px) { .act-card.v-bar .act-mt .pv-pn { display: none; } .act-card.v-bar .act-mt .pv-ini { display: inline-flex; } }
.act-mtl { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.act-mtl .pv-pn { margin-right: 0; }
.act-mtc { display: inline-flex; align-items: center; gap: 0; flex: none; font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: 700; line-height: 15px; color: var(--text-primary); }
.act-mtc .material-icons { font-size: 14px; color: var(--text-secondary); }
.act-tir { display: flex; align-items: center; gap: 4px; min-width: 0; }
.act-tir > .act-ti { flex: 1 1 auto; min-width: 0; }
.act-tir > .act-mtc, .act-tm > .act-mtc { display: none; }
.act-sub .act-mtc { margin-left: auto; padding-left: 2px; }
.act-tm > .act-mtc { margin-left: auto; padding-left: 4px; }
/* 專案色底上的次要字（時間、專案小字、姓名行）改主文字色：--text-secondary 落在專案色淡底實量 4.29:1，未達 4.5；靠字重區分層級 */
.act-card[class*="wb-pj-"]:not(.pv-peer) :is(.ts, .te, .act-pjs, .act-sub, .nm) { color: var(--text-primary); }
.act-card.pv-busy { --pj: var(--text-secondary); background-color: var(--bg-surface-alt); background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--text-muted) 24%, transparent) 6px 7px); cursor: default; }
.act-card.pv-busy:hover { background-color: var(--bg-surface-alt); }
.act-card.pv-busy .act-ti { color: var(--text-secondary); font-weight: 700; }
.wbB-lrow.pv-peer { background: var(--bg-surface-alt); }
.wbB-lrow.pv-peer .tt { color: var(--text-secondary); font-weight: 600; }
.pv-ronote { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; padding: 8px 10px; background: var(--bg-surface-alt); border: 1px solid var(--border-default); border-radius: var(--radius-md); font-size: var(--fs-sm); color: var(--text-primary); line-height: 1.5; }
.pv-ronote .material-icons { font-size: 18px; margin-top: 1px; color: var(--text-secondary); flex: none; }
.pv-subnote { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: var(--fs-sm); color: var(--text-secondary); }
.pv-subnote .material-icons { font-size: 18px; flex: none; }
.pv-grp-h { display: flex; align-items: center; gap: 6px; padding: 8px 12px 4px; font-size: var(--fs-sm); font-weight: 800; color: var(--text-secondary); }

/* 人員／夥伴面板 */
.pv { width: 344px; max-width: calc(100vw - 16px); display: grid; padding: 0; }
.pv-h { padding: 6px 8px 0; display: grid; }
.pv-fs { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); margin: 4px; background: var(--bg-card); }
.pv-fs input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font-family: inherit; font-size: var(--fs-sm); }
.pv-fs:focus-within { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
.pv-fs .material-icons { font-size: 18px; color: var(--text-secondary); }
.pv-note { display: flex; gap: 6px; align-items: flex-start; margin: 4px 4px 2px; padding: 6px 8px; background: var(--color-warning-soft); border: 1px solid var(--color-warning); border-radius: var(--radius-sm); font-size: var(--fs-xs); line-height: 1.5; color: var(--color-warning-text); }
.pv-note .material-icons { font-size: 16px; margin-top: 1px; flex: none; }
.pv-note a { color: var(--brand-accent-dark); font-weight: 700; text-decoration: underline; cursor: pointer; }
.pv-list { max-height: min(340px, 52vh); overflow-y: auto; padding: 0 4px; }
.pv-grp { font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); padding: 8px 8px 2px; }
.pv-r { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: var(--fs-sm); position: relative; }
.pv-r:hover { background: var(--brand-primary-100); }
.pv-r input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--brand-primary); }
.pv-r .nm { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.pv-r.me { cursor: default; background: var(--bg-surface-alt); }
.pv-r.dis { opacity: .5; cursor: not-allowed; }
.pv-r.dis:hover { background: none; }
.pv-none { padding: 16px 8px; text-align: center; font-size: var(--fs-sm); color: var(--text-secondary); }
.pv-f { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border-default); margin-top: 4px; }
.pv-f .sp { flex: 1; }
.pv-f .cn { font-size: var(--fs-sm); color: var(--text-secondary); }
.pv-f .cn b { color: var(--text-primary); }
.pv-rl { flex: none; display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--neutral-100); border: 1px solid var(--border-default); color: var(--text-secondary); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.pv-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 6px 12px; background: var(--color-warning-soft); border: 1px solid var(--color-warning); border-radius: var(--radius-md); font-size: var(--fs-sm); color: var(--color-warning-text); }
.pv-bar .tx { flex: 1; }
/* 手機底部抽屜（q-dialog position=bottom 內的卡） */
.pv-sheet { width: 100vw; max-width: 100vw; max-height: 82vh; display: flex; flex-direction: column; background: var(--bg-card); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.pv-sheet-hd { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--border-default); }
.pv-sheet-hd .tt { flex: 1; font-size: var(--fs-md); font-weight: 800; }
.pv-sheet-hd .done { appearance: none; border: 0; background: transparent; min-height: 44px; min-width: 56px; padding: 0 12px; font-weight: 800; color: var(--brand-accent-dark); font-size: var(--fs-base); cursor: pointer; font-family: inherit; }
.pv-sheet-body { overflow: auto; flex: 1; min-height: 0; padding-bottom: 20px; }
.pv-sheet .pv { width: 100%; max-width: none; }
.pv-sheet .pv-list { max-height: none; overflow: visible; }
.pv-sheet .pv-r { min-height: 48px; }
.pv-sheet .pv-r input { width: 24px; height: 24px; }
.pv-sheet .pv-fs { height: 44px; margin: 8px; }
.pv-sheet .pv-f .wb-act { min-height: 36px; }
.pv-row { appearance: none; width: 100%; min-height: 44px; display: flex; align-items: center; gap: 8px; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent; padding: 0 4px; font-family: inherit; font-size: var(--fs-sm); color: var(--text-primary); cursor: pointer; text-align: left; }
.pv-row .k { font-weight: 700; }
.pv-row .v { margin-left: auto; color: var(--text-secondary); }
.pv-row .v.dev { color: var(--brand-accent-dark); font-weight: 700; }

/* 公司頁共用 */
.co .cw-sub { margin-bottom: 8px; }
.cw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cw-st { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--bg-card); margin-top: 2px; }
.cw-st.doing { border-color: var(--brand-primary); background: linear-gradient(90deg, var(--brand-primary) 50%, var(--bg-card) 50%); }
.cw-st.done { background: var(--color-success); border-color: var(--color-success); }
.cw-chip-w { display: inline-flex; align-items: center; gap: 2px; margin-top: 2px; padding: 0 6px; height: 18px; border-radius: var(--radius-sm); background: var(--color-warning-soft); color: var(--color-warning-text); font-size: var(--fs-xs); font-weight: 700; }
.cw-chip-w .material-icons { font-size: 13px; }
.cw-note { margin: -4px 0 12px; font-size: var(--fs-xs); color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.cw-note .material-icons { font-size: 16px; }
.cw-qf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.cw-hol { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: var(--fs-sm); color: var(--text-secondary); }
.cw-qf .cw-hol { margin: 0 0 0 auto; }
.cw-hol .material-icons { font-size: 18px; }
.cw-mr { display: none; }
.co .filter-chip { cursor: pointer; }
.co .filter-chip.go { border-color: var(--color-danger); color: var(--color-danger); }
/* 顯示：專案／任務／活動（開著有勾，關著灰底） */
.cw-ty { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cw-ty-l { font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); margin-right: 2px; }
.cw-ty-b { appearance: none; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border: 1px solid var(--border-default); border-radius: var(--radius-pill); background: var(--bg-surface-alt); color: var(--text-secondary); font-family: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
.cw-ty-b .ck { font-size: 16px; display: none; }
.cw-ty-b.on { background: var(--brand-primary-100); border-color: var(--brand-primary); color: var(--text-primary); }
.cw-ty-b.on .ck { display: inline-block; color: var(--brand-primary); }
.cw-ty-b:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

/* 項目一行（卡牆、議程、側板共用） */
.cwi { appearance: none; display: flex; align-items: flex-start; gap: 8px; width: 100%; min-width: 0; padding: 6px 8px; border: 0; border-left: 3px solid var(--pj, var(--brand-primary)); background: var(--bg-card); border-radius: var(--radius-sm); text-align: left; cursor: pointer; color: var(--text-primary); font-family: inherit; font-size: var(--fs-base); line-height: 1.45; }
.cwi:hover { background: var(--pjt-hv, var(--brand-primary-100)); }
.cwi.tk, .cwi.ac { box-shadow: inset 0 0 0 1px var(--border-soft); }
.cwi .cw-st { margin-top: 4px; }
.cwi-b { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.cwi-t { font-weight: 700; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cwi.full .cwi-t { display: block; -webkit-line-clamp: unset; overflow: visible; }
.cwi.fin { background: var(--bg-surface-alt); }
.cwi.fin .cwi-t { text-decoration: line-through; color: var(--text-secondary); font-weight: 500; }
.cwi-more { display: none; font-size: var(--fs-xs); font-weight: 700; color: var(--brand-accent-dark); text-decoration: underline; }
.cwi.clamped .cwi-more { display: inline; }
.cwi-od { font-size: var(--fs-xs); font-weight: 700; color: var(--color-danger); }
.cwi-tm { flex: none; min-width: 44px; font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; padding-top: 1px; }
.cwi .wb-code { margin-top: 1px; }
.cwi.busy { --pj: var(--text-secondary); background: var(--bg-surface-alt); }
.cwi-pj { font-size: var(--fs-xs); color: var(--text-secondary); overflow-wrap: anywhere; }
.cwi.busy .cwi-t { color: var(--text-secondary); font-weight: 500; }

/* 人員卡牆：欄數隨寬度增加，卡片寬度不低於 380px */
.cwc-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 12px; align-items: stretch; }
.cwc.el-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; scroll-margin-top: 72px; }
.cwc-h { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-surface-alt); border-bottom: 1px solid var(--border-default); }
.cwc.me .cwc-h { background: var(--brand-primary-100); }
.cwc.idle { align-self: start; }
.cwc.idle .cwc-h { border-bottom: 0; }
.cwc-h .user-ava { flex: none; }
.cwc-who { flex: 1 1 auto; min-width: 0; display: grid; }
.cwc-nm { font-size: var(--fs-md); font-weight: 800; color: var(--text-primary); overflow-wrap: anywhere; line-height: 1.35; }
.cwc-st { font-size: var(--fs-sm); color: var(--text-secondary); }
.cwc-late { appearance: none; flex: none; border: 0; background: transparent; padding: 0 4px; min-height: 32px; font-family: inherit; font-size: var(--fs-md); font-weight: 800; color: var(--color-danger); cursor: pointer; border-radius: var(--radius-sm); }
.cwc-late:hover { text-decoration: underline; }
.cwc-b { padding: 6px 12px 10px; display: grid; gap: 8px; align-content: start; }
.cwc-d { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: start; }
.cwc-dl { display: grid; align-content: start; font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); padding-top: 7px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.cwc-dl small { font-size: var(--fs-xs); font-weight: 800; color: var(--brand-accent-dark); }
.cwc-d.tod .cwc-dl { color: var(--text-primary); font-weight: 800; }
.cwc-d.lt .cwc-dl { color: var(--color-danger); font-weight: 800; }
.cwc-di { display: grid; gap: 4px; min-width: 0; }
.cwc-lv { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--color-warning-soft); color: var(--color-warning-text); font-size: var(--fs-sm); font-weight: 700; }
.cwc-lv .material-icons { font-size: 18px; }
.cwc-more { appearance: none; border: 0; background: transparent; justify-self: start; min-height: 32px; padding: 0 4px; font-family: inherit; font-size: var(--fs-sm); font-weight: 700; color: var(--brand-accent-dark); text-decoration: underline; cursor: pointer; border-radius: var(--radius-sm); }
.cwc-sk { padding: 12px; display: grid; gap: 8px; }
.cwc-sk i { display: block; height: 18px; border-radius: var(--radius-sm); background: var(--neutral-100); animation: cwSkel 1.2s ease-in-out infinite; }
.cwc-sk i:nth-child(2) { width: 80%; }
.cwc-sk i:nth-child(3) { width: 55%; }
@keyframes cwSkel { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.cw-fail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; background: var(--color-warning-soft); border-radius: var(--radius-sm); color: var(--color-warning-text); font-size: var(--fs-sm); font-weight: 700; }
.cwc .cw-fail, .cwb .cw-fail { margin: 10px 12px; }
.cw-strip { display: none; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -2px; scrollbar-width: none; }
.cw-strip::-webkit-scrollbar { display: none; }
.cw-strip button { appearance: none; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--bg-card); color: var(--text-primary); font-family: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
.cw-strip button.late { border-color: var(--color-danger); }
.cw-strip button .lt { color: var(--color-danger); font-size: var(--fs-xs); }

/* 公司清單：依人分組 */
.cw-lh { appearance: none; border: 0; width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; min-height: 48px; background: var(--bg-surface-alt); font-family: inherit; font-size: var(--fs-base); font-weight: 700; color: var(--text-primary); cursor: pointer; text-align: left; }
.cw-lh:hover { background: var(--brand-primary-100); }
.cw-lh .nm { min-width: 0; overflow-wrap: anywhere; }
.cw-lh .sm { margin-left: auto; font-size: var(--fs-xs); font-weight: 500; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cw-lh .sm b { font-weight: 700; }
.cw-lh .sm .late { color: var(--color-danger); font-weight: 700; }
.cw-skel { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.cw-skel .cw-c { padding: 4px; display: grid; gap: 4px; align-content: start; min-width: 0; min-height: 64px; }
.cw-skel i { display: block; height: 22px; border-radius: var(--radius-sm); background: var(--neutral-100); animation: cwSkel 1.2s ease-in-out infinite; }
.cw-skel i + i { height: 14px; width: 70%; }

/* 單日議程（公司日曆） */
.cwd { display: grid; gap: 4px; margin-bottom: 12px; }
.cwd-b { appearance: none; display: grid; align-content: start; gap: 1px; min-height: 76px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text-primary); font-family: inherit; text-align: left; cursor: pointer; min-width: 0; }
.cwd-b:hover { border-color: var(--brand-accent); }
.cwd-b.on { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--text-on-brand); }
.cwd-b.narrow { padding: 8px 4px; text-align: center; background: var(--bg-surface-alt); color: var(--text-secondary); }
.cwd-b.narrow.on { background: var(--brand-primary); color: var(--text-on-brand); }
.cwd-w { font-size: var(--fs-sm); font-weight: 700; }
.cwd-d { font-size: var(--fs-md); font-weight: 800; font-variant-numeric: tabular-nums; }
.cwd-t { font-size: var(--fs-xs); font-weight: 800; color: var(--brand-accent-dark); }
.cwd-b.on .cwd-t { color: var(--text-on-brand); }
.cwd-s { font-size: var(--fs-sm); color: var(--text-secondary); }
.cwd-s.lv { color: var(--color-warning-text); font-weight: 700; }
.cwd-b.on .cwd-s, .cwd-b.on .cwd-s.lv { color: var(--text-on-brand); }
.cwp-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.cwp-t { font-size: var(--fs-lg); font-weight: 800; }
.cwp-s { font-size: var(--fs-sm); color: var(--text-secondary); }
.cwb-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 12px; align-items: start; }
.cwb.el-card { padding: 0; overflow: hidden; }
.cwb-h { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-surface-alt); border-bottom: 1px solid var(--border-default); }
.cwb-nm { flex: 1 1 auto; min-width: 0; font-size: var(--fs-md); font-weight: 800; overflow-wrap: anywhere; line-height: 1.35; }
.cwb-n { flex: none; font-size: var(--fs-sm); color: var(--text-secondary); }
.cwb-b { padding: 8px 12px 10px; display: grid; gap: 4px; }
.cwp-f { margin-top: 12px; display: grid; gap: 4px; font-size: var(--fs-base); line-height: 1.6; overflow-wrap: anywhere; }
.cwp-f p { margin: 0; }
.cw-drwho { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-md); overflow-wrap: anywhere; }
.wbB-drb .cwc-d { grid-template-columns: 64px minmax(0, 1fr); }

/* 公司日曆：月 */
.cwm { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; }
.cwm-h, .cwm-g { display: grid; grid-template-columns: repeat(5, minmax(0, 2fr)) repeat(2, minmax(0, 1fr)); }
.cwm-h { background: var(--bg-surface-alt); border-bottom: 1px solid var(--border-default); }
.cwm-h span { padding: 6px 8px; font-size: var(--fs-sm); font-weight: 700; }
.cwm-d { border-left: 1px solid var(--border-default); border-top: 1px solid var(--border-default); min-height: 124px; padding: 3px 4px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cwm-d:nth-child(7n+1) { border-left: 0; }
.cwm-d:nth-child(-n+7) { border-top: 0; }
.cwm-d.out { background: var(--bg-page); }
.cwm-d.hol { background: var(--bg-surface-alt); }
.cwm-d.tod { background: var(--brand-accent-soft); }
.cwm-dh { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; min-height: 24px; padding-left: 4px; }
.cwm-dh .dn { font-size: var(--fs-sm); font-weight: 700; }
.cwm-d.out .dn { color: var(--text-secondary); font-weight: 500; }
.cwm-td { font-size: var(--fs-xs); font-weight: 800; color: var(--brand-accent-dark); }
.cwm-e { appearance: none; display: block; padding: 3px 6px; border: 0; border-left: 3px solid var(--pj, var(--brand-primary)); background: var(--pjt, var(--bg-surface-alt)); border-radius: var(--radius-sm); font-family: inherit; font-size: var(--fs-xs); line-height: 1.4; color: var(--text-primary); cursor: pointer; text-align: left; width: 100%; min-width: 0; overflow-wrap: anywhere; }
.cwm-e:hover { background: var(--pjt-hv, var(--neutral-100)); }
.cwm-ts { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-secondary); margin-right: 4px; }
.cwm-tx { font-weight: 700; }
.cwm-e.busy { background: var(--bg-surface-alt); --pj: var(--text-secondary); }
.cwm-e.busy .cwm-tx { color: var(--text-secondary); }
.cwm-e.tk { background: var(--bg-card); border: 1px solid var(--border-default); border-left: 3px solid var(--pj); }
.cwm-lv { padding: 3px 6px; border-radius: var(--radius-sm); background: var(--color-warning-soft); color: var(--color-warning-text); font-size: var(--fs-xs); font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.cwm-more { appearance: none; border: 0; background: none; font-family: inherit; font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); text-align: left; padding: 2px 4px; cursor: pointer; border-radius: var(--radius-sm); }
.cwm-more:hover { color: var(--brand-accent); text-decoration: underline; }
.cwm-pj { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cwm-pj .pcal-pj { height: 24px; margin: 0; }
.cwm-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 8px 12px; background: var(--color-warning-soft); border: 1px solid var(--color-warning); border-radius: var(--radius-md); color: var(--color-warning-text); font-size: var(--fs-sm); }
/* 公司日曆手機：日期格＋圓點，下方是當日議程（依人分組） */
.cwm-mo { display: none; }
.cwm-mh { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); padding-bottom: 4px; }
.cwm-mg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin-bottom: 12px; }
.cwm-mc { text-align: center; }
.cwm-mc.out .dn { color: var(--text-secondary); font-weight: 500; }
.cwm-mcn { appearance: none; width: 100%; min-height: 44px; display: grid; justify-items: center; align-content: center; gap: 2px; border: 0; background: transparent; border-radius: var(--radius-sm); font-family: inherit; color: var(--text-primary); cursor: pointer; }
.cwm-mc.on .cwm-mcn { background: var(--brand-primary); color: var(--text-on-brand); }
.cwm-mc.tod .dn { color: var(--brand-accent-dark); text-decoration: underline; }
.cwm-mc.on.tod .dn { color: var(--text-on-brand); }
.cwm-mcn .dn { font-size: var(--fs-sm); font-weight: 700; }
.cwm-mcn .dots { display: inline-flex; gap: 3px; min-height: 6px; }
.cwm-mcn .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-accent); }
.cwm-mc.on .cwm-mcn .dots i { background: var(--text-on-brand); }
.cwg { display: grid; gap: 12px; }
.cwg-p { display: grid; gap: 6px; }
.cwg-ph { display: flex; align-items: center; gap: 8px; min-height: 36px; font-weight: 800; font-size: var(--fs-base); }
.cw-li { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; border-left: 4px solid var(--pj, var(--brand-primary)); background: var(--pjt, var(--bg-surface-alt)); border-radius: var(--radius-sm); font-family: inherit; font-size: var(--fs-sm); min-height: 40px; width: 100%; text-align: left; cursor: pointer; border-top: 0; border-right: 0; border-bottom: 0; color: var(--text-primary); }
.cw-li .ts { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-secondary); min-width: 84px; flex: none; }
.cw-li b { color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; }
.cw-li.busy { background-color: var(--bg-surface-alt); background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--text-muted) 24%, transparent) 6px 7px); --pj: var(--text-secondary); }
.cw-li.tk { background: var(--bg-card); border: 1px solid var(--border-default); border-left: 4px solid var(--pj); }
.cw-grp-h { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; font-size: var(--fs-md); font-weight: 800; }

@media (max-width: 768px) {
  :where(html.app-shell) .pv { width: 100%; }
  :where(html.app-shell) .cw-strip { display: flex; }
  :where(html.app-shell) .cwd { display: flex; overflow-x: auto; scrollbar-width: none; }
  :where(html.app-shell) .cwd::-webkit-scrollbar { display: none; }
  :where(html.app-shell) .cwd-b { flex: 0 0 108px; }
  :where(html.app-shell) .cwd-b.narrow { flex: 0 0 64px; }
  :where(html.app-shell) .co .cwi, :where(html.app-shell) .co .cwc-more, :where(html.app-shell) .co .cwc-late { min-height: 44px; }
  :where(html.app-shell) .co .filter-chip, :where(html.app-shell) .co .wbB-vs button, :where(html.app-shell) .co .wbB-ft, :where(html.app-shell) .co .wb-act, :where(html.app-shell) .co .cwm-more { min-height: 44px; }
  /* 手機：控制列只剩「篩選」鈕＋範圍，其餘收進抽屜，卡片首屏可見 */
  :where(html.app-shell) .co .wbB-tb > .wbB-vs, :where(html.app-shell) .co .wbB-tb > .wbB-nav, :where(html.app-shell) .co .wbB-tb > .wbB-fgrp, :where(html.app-shell) .co > .cw-qf, :where(html.app-shell) .co > .cw-hol { display: none; }
  :where(html.app-shell) .co .wbB-tb { flex-wrap: nowrap; margin-bottom: 8px; }
  :where(html.app-shell) .co .wbB-mf { display: inline-flex; }
  :where(html.app-shell) .cw-mr { display: inline; font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); }
  :where(html.app-shell) .co .wbB-hero.el-card .wbB-hc .s { display: none; }
  :where(html.app-shell) .co .wbB-hc { padding-top: 8px; padding-bottom: 8px; }
  :where(html.app-shell) .pv-sheet .cw-ty-b, :where(html.app-shell) .pv-sheet .cw-qf .filter-chip { min-height: 44px; }
  :where(html.app-shell) .pv-sheet .cw-qf { display: flex; margin-bottom: 8px; }
  :where(html.app-shell) .pv-sheet .cw-hol { margin: 4px 0 8px; }
  :where(html.app-shell) .cwc-d { grid-template-columns: 56px minmax(0, 1fr); }
  :where(html.app-shell) .cwm-d { min-height: 0; }
  :where(html.app-shell) .cw-lh { min-height: 48px; }
  :where(html.app-shell) .cwm-mo { display: block; }
  :where(html.app-shell) .cwm-wide { display: none; }
}
@media (max-width: 480px) {
  :where(html.app-shell) .co .wbB-hc { padding: 8px 14px; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  :where(html.app-shell) .co .wbB-hc .v b { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .cwc-sk i, .cw-skel i { animation: none; }
}

/* ═══ 公司日曆依人分色（2026-11-02，openspec change company-calendar-person-color，ELOP-71；核可 mockup 1:1） ═══
   .who-N 只設變數（--pc 人色、--pct／--pct-hv 淡底），誰掛了才有人色；公司工作台、我的日曆沒有 .who-N，外觀不變。
   --pct 比專案色盤（26%）略濃，同一格裡才分得出人；--pc 只當線／點／框，不當文字色。 */
.who-1 { --pc: var(--person-1); }
.who-2 { --pc: var(--person-2); }
.who-3 { --pc: var(--person-3); }
.who-4 { --pc: var(--person-4); }
.who-5 { --pc: var(--person-5); }
.who-6 { --pc: var(--person-6); }
.who-7 { --pc: var(--person-7); }
.who-1, .who-2, .who-3, .who-4, .who-5, .who-6, .who-7 {
  --pct: color-mix(in srgb, var(--pc) 30%, var(--bg-card));
  --pct-hv: color-mix(in srgb, var(--pc) 40%, var(--bg-card));
}
/* 縮寫徽章：淡底＋人色細框＋深色字；顏色之外的第二條辨識管道 */
.cw-pbd { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 24px; height: 18px; padding: 0 3px; border-radius: var(--radius-sm); background: var(--pct); box-shadow: inset 0 0 0 1px var(--pc); color: var(--text-primary); font-size: var(--fs-xs); font-weight: 800; line-height: 1; letter-spacing: 0; white-space: nowrap; }
.user-ava.cw-pav { width: 30px; height: 30px; background: var(--pct); color: var(--text-primary); box-shadow: inset 0 0 0 2px var(--pc); font-size: var(--fs-xs); font-weight: 800; letter-spacing: -.02em; }
.cw-pdot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--pc); }

/* 月檢視事件條 */
.co .cwm-e[class*="who-"] { --pj: var(--pc); --pjt: var(--pct); --pjt-hv: var(--pct-hv); }
.co .cwm-e.cw-pe { display: flex; align-items: flex-start; gap: 5px; padding: 3px 5px; }
.cwm-e.cw-pe .cw-pbd { margin-top: 1px; }
.cwm-b { flex: 1 1 auto; min-width: 0; display: block; }
.cwm-dots { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; vertical-align: 1px; }
.cwm-dots small { font-size: var(--fs-xs); font-weight: 700; color: var(--text-secondary); margin-left: 2px; }
/* 忙碌：斜線底＝「只知道有事」，人色線＋縮寫＝「是誰」；不帶 Google 日曆色 */
.co .cwm-e.busy[class*="who-"] { background-color: var(--bg-surface-alt); background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--text-muted) 24%, transparent) 6px 7px); }
.co .cwm-e.busy[class*="who-"]:hover { background-color: var(--neutral-100); }
.cwm-lv.cw-lvp { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.cw-lp { display: inline-flex; align-items: center; gap: 4px; }
/* 一個畫面只有一套色語意：公司日曆裡專案標籤的色點改灰，專案色留給我的工作台、我的日曆與公司工作台 */
.co .cwm-pj .cw-pjt { --pj: var(--border-strong); --pjt: var(--bg-card); }

/* 單日議程（週）與手機當日議程：人員區塊帶人色 */
.cwb[class*="who-"].el-card { border-left: 4px solid var(--pc); }
.cwb[class*="who-"] .cwb-h { background: var(--pct); }
.cwb[class*="who-"] .cwi { --pj: var(--pc); --pjt-hv: var(--pct-hv); }
.cwb[class*="who-"] .cwi.ac { background: var(--pct); }
.cwb[class*="who-"] .cwi.ac:hover { background: var(--pct-hv); }
.cwb[class*="who-"] .cwi.busy { --pj: var(--text-secondary); background-color: var(--bg-surface-alt); }
/* 「還有 N 項」對話框與手機當日議程的人員分組 */
.cwg-p[class*="who-"] .cwg-ph { padding-left: 8px; border-left: 4px solid var(--pc); background: var(--pct); border-radius: var(--radius-sm); }
.cwg-p[class*="who-"] .cwi { --pj: var(--pc); --pjt-hv: var(--pct-hv); }
.cwg-p[class*="who-"] .cwi.ac { background: var(--pct); }
.cwg-p[class*="who-"] .cwi.ac:hover { background: var(--pct-hv); }
.cwg-p[class*="who-"] .cwi.busy { --pj: var(--text-secondary); background-color: var(--bg-surface-alt); }

/* 手機月曆：日期下方的小點改成人色，最多 3 顆 */
.cwm-mcn .dots i[class*="who-"] { background: var(--pc); width: 7px; height: 7px; }
.cwm-mc.on .cwm-mcn .dots i[class*="who-"] { background: var(--pc); box-shadow: 0 0 0 1.5px var(--bg-card); } /* 選取日是深底：人色點外加白圈才看得見 */

/* 圖例（同時是人員篩選）。不能叫 .lg：Quasar 保留名（斷點顯示輔助類） */
.cw-lgw { display: grid; gap: 8px; margin: 0 0 12px; }
.cw-lgr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.cw-lg-t { font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); margin-right: 2px; }
.cw-lg-h { font-size: var(--fs-xs); color: var(--text-secondary); margin-left: 4px; }
.cw-lg-c { appearance: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; max-width: 220px; padding: 0 10px 0 5px; border: 1px solid var(--border-default); border-left: 4px solid var(--pc); border-radius: var(--radius-sm); background: var(--pct); color: var(--text-primary); font-family: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
.cw-lg-c:hover { background: var(--pct-hv); }
.cw-lg-c:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.cw-lg-c .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-lg-c[aria-pressed="false"] { background: var(--bg-card); color: var(--text-secondary); border-left-color: color-mix(in srgb, var(--pc) 45%, var(--bg-card)); }
.cw-lg-c[aria-pressed="false"] .cw-pbd { background: var(--bg-card); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc) 55%, var(--bg-card)); color: var(--text-secondary); }
.cw-lg-key { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--fs-xs); color: var(--text-secondary); align-items: center; }
.cw-lg-key > span { display: inline-flex; align-items: center; gap: 6px; }
.cw-ks { display: inline-block; width: 26px; height: 14px; border-radius: var(--radius-sm); border-left: 3px solid var(--text-secondary); }
.cw-ks.ev { background: var(--bg-surface-alt); }
.cw-ks.tk { background: var(--bg-card); box-shadow: inset 0 0 0 1px var(--border-default); }
.cw-ks.bz { background-color: var(--bg-surface-alt); background-image: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--text-muted) 40%, transparent) 4px 5px); }
.cw-ks.lv { background: var(--color-warning-soft); border-left-color: var(--color-warning); }
@media (max-width: 768px) {
  :where(html.app-shell) .co .cw-lgr { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding: 0 16px 2px 0; }
  :where(html.app-shell) .co .cw-lgr::-webkit-scrollbar { display: none; }
  :where(html.app-shell) .co .cw-lgr > * { flex: none; }
  :where(html.app-shell) .co .cw-lg-c { min-height: 44px; }
  :where(html.app-shell) .co .cw-lg-h, :where(html.app-shell) .co .cw-lg-key { display: none; }
  :where(html.app-shell) .co .cw-lgr .wb-act { min-height: 44px; }
}


/* client-link-tabs F1：客戶連結的子頁籤列與「開放給客戶看」開關（核可 mockup staff.html；375 不橫捲，改折行） */
.cl-subtabs { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
/* 可點範圍 ≥44（外觀維持 32）：只在子頁籤內加大，不動共用 .filter-chip::after */
.cl-subtabs .filter-chip::after { inset: -8px -2px; }
.cl-subtabs .filter-chip[aria-selected="true"] { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--text-on-brand); }
/* 角標 1:1 核可 mockup staff.html .cl-subtabs .filter-chip .n：淡色底、深色字、1px 品牌框、高 16px */
.cl-subtabs .filter-chip .n {
  position: absolute; top: -6px; right: -4px; box-sizing: border-box; min-width: 16px; height: 16px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center; margin: 0; font-size: var(--fs-xs); font-weight: 700; line-height: 1;
  border-radius: var(--radius-pill); pointer-events: none;
  background: var(--brand-accent-soft); color: var(--brand-accent-dark); border: 1px solid var(--border-brand);
}
.cl-subtabs .filter-chip[aria-selected="true"] .n { background: var(--brand-accent-soft); color: var(--brand-accent-dark); }
.cl-subtabs .filter-chip .off { display: inline-flex; align-items: center; gap: var(--space-1); margin-left: -2px; font-size: var(--fs-xs); font-weight: 500; } /* chip 的 gap 8px－2px＝與頁名間距 6px（核可 mockup 值） */
.cl-subtabs .filter-chip .off .material-icons { font-size: 14px; }
/* ===== 可選可打字的平台 combobox（原 project-detail 私有，questionnaire-editor-polish 收編；專案「登入資訊」分頁與問卷編輯器共用） ===== */
.ln-combo { position: relative; min-width: 0; }
.ln-sug { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; min-width: 220px; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: var(--space-1); max-height: 280px; overflow-y: auto; }
.ln-sug-hd { font-size: 11px; color: var(--text-secondary); padding: 6px 10px var(--space-1); } /* space-exempt: 與核可 mockup A 逐像素一致 */
.ln-sug-item { display: flex; align-items: center; gap: 8px; padding: var(--space-2) 10px; min-height: 20px; border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--text-body); cursor: pointer; } /* space-exempt: 與核可 mockup A 逐像素一致 */
.ln-sug-item:hover, .ln-sug-item.is-act { background: var(--bg-surface-alt); }
.ln-sug-item mark { background: var(--brand-accent-soft); color: var(--brand-accent-dark); font-weight: 700; border-radius: 2px; }
.ln-sug-item .material-icons { font-size: 16px; color: var(--text-secondary); }
.ln-sug-tag { margin-left: auto; font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.ln-sug-free { border-top: 1px dashed var(--border-strong); margin-top: 3px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); } /* space-exempt: 與核可 mockup A 逐像素一致 */

.cl-sw { padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-paper); font-size: var(--fs-sm); }
.cl-sw label { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; }
.cl-sw input[role="switch"] {
  appearance: none; flex: none; position: relative; width: 36px; height: 20px; margin: 2px 0 0; border-radius: var(--radius-pill);
  background: var(--neutral-500); cursor: pointer; transition: background .15s;
}
.cl-sw input[role="switch"]::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-card); transition: transform .15s;
}
.cl-sw input[role="switch"]:checked { background: var(--brand-accent); }
.cl-sw input[role="switch"]:checked::before { transform: translateX(16px); }
.cl-sw input[role="switch"]:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.cl-sw input[role="switch"]:disabled { opacity: .5; cursor: not-allowed; }
.cl-sw .cons { display: block; font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.6; }
.cl-sw-note { margin-top: var(--space-1); }
@media (prefers-reduced-motion: reduce) {
  .cl-sw input[role="switch"], .cl-sw input[role="switch"]::before { transition: none; }
}
/* 全站 Quasar q-toggle 軌道（client-link-followups 第 2 項，老闆核可 mockup）：關閉態改 --neutral-500（對列底 >= 3:1），開啟態軌道改實色（opacity 1），讓開啟比關閉更深。 */
.q-toggle__inner:not(.q-toggle__inner--truthy):not(.q-toggle__inner--indet) .q-toggle__track { opacity: 1; background: var(--neutral-500); }
.q-toggle__inner--truthy .q-toggle__track { opacity: 1; }

/* 行內訊息條 .inline-note（client-link-followups 第 4 項，收編原 .cl-note／.mc-note／.pq-note；規範見 UI-GUIDELINES §5.26）：一般與 .is-err 兩態，錯誤態 MUST 帶 error_outline 圖示。 */
.inline-note { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-card); font-size: var(--fs-sm); line-height: 1.6; }
.inline-note > .material-icons { color: var(--brand-primary); align-self: flex-start; }
.inline-note.is-err { border-color: var(--color-danger); }
.inline-note.is-err > .material-icons { color: var(--color-danger); }
.inline-note .tx { flex: 1 1 240px; min-width: 0; }
.inline-note input { box-sizing: border-box; width: 100%; min-height: 32px; padding: var(--space-1) var(--space-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-card); font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-primary); }
@media (max-width: 768px) { html:where(.app-shell) body .inline-note[role="alertdialog"] { gap: var(--space-4); } }

/* 橫向捲動提示 .scroll-more（client-link-minors 第 1 項；規範見 UI-GUIDELINES §5.29）：包住 .data-table-wrap 等可橫捲容器，右緣漸層只在「還能往右捲」時出現。
   元件負責在 scrollWidth > clientWidth 且未捲到底時切 .has-more（scroll＋ResizeObserver），並把表頭高度寫進 --sm-head-h；漸層 pointer-events:none、aria-hidden，不擋點擊。 */
.scroll-more { position: relative; --sm-head-h: 39px; }
.scroll-more > .scroll-more-fade { position: absolute; top: 1px; right: 1px; bottom: 1px; width: var(--space-5); border-radius: 0 calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0; background: linear-gradient(to right, transparent, var(--bg-card)); pointer-events: none; opacity: 0; transition: opacity .15s; }
.scroll-more > .scroll-more-fade::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: var(--sm-head-h); background: linear-gradient(to right, transparent, var(--bg-surface-alt)); }
.scroll-more.has-more > .scroll-more-fade { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .scroll-more > .scroll-more-fade { transition: none; } }

/* ============================================================
   待處理帳務連結落地的定位閃色 .fj-hit（finance-todo-actions，shared/focus-jump.js）
   目標列／卡加 data-focus-id；閃一次 900ms。用 inset box-shadow 疊在自身底色上、文字之下，不覆蓋表格 td 的底色。
   「減少動態」改成靜態外框（同 date-jump-flash 的做法），JS 1 秒後移除 class。
   ============================================================ */
.fj-hit, .fj-hit > td { animation: fj-flash 900ms linear 1; }
@keyframes fj-flash {
  0%, 100% { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--brand-accent) 0%, transparent); }
  16.667% { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--brand-accent) 30%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .fj-hit, .fj-hit > td { animation: none; }
  .fj-hit { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
}

/* =====================================================================
 *  專案大框 .pjbox — 專案詳情頁頁首（openspec change project-header-merge 批 2）
 *  核可 mockup（1:1）：docs/project-header-merge/mockup/index.html；字串 strings.md。
 *  專案詳情的 .page-head 放進這張卡片裡，是 UI-GUIDELINES §3 唯一的例外（只限專案詳情頁）。
 *  窄版（視窗 ≤768px，或詳情頁嵌入訊息中心／工作台）由元件加 .pjnar，不用 media query，這樣嵌入時也吃同一套排法。
 *  色彩、字級、間距一律用 token；名稱 pj 開頭，避免撞名。
 * ===================================================================== */
.pjbox { display: flex; flex-direction: column; padding: 0; }
.pjbox .page-head { margin: 0; padding: var(--space-3) var(--space-4) 0; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.pjbox .page-head-text { flex: 1 1 180px; min-width: 0; }
.pjbox .page-head-actions { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pjemb { padding: var(--space-3) var(--space-4) 0; }
.pjexit { padding: var(--space-2) var(--space-4) 0; }

/* 標題區（C 排法：專案名＋鉛筆＋編號一行，階段與任務一行） */
.pjtitle { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); min-width: 0; min-height: 32px; }
.pjnm { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
.pjttl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.pjedit { appearance: none; border: 0; background: transparent; cursor: pointer; width: 28px; height: 28px; border-radius: var(--radius-sm); color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none; position: relative; margin-block: -1px; }
.pjedit::after { content: ''; position: absolute; inset: -8px; }
.pjedit:hover { background: var(--neutral-100); color: var(--text-primary); }
.pjedit .material-icons { font-size: 20px; }
.pjcode { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-secondary); white-space: nowrap; }
.pjnamein { min-width: 0; width: min(100%, 520px); height: 32px; padding: 0 var(--space-2); border: 1px solid var(--brand-accent); border-radius: 6px; font-family: inherit; font-size: 20px; font-weight: 800; color: var(--text-primary); background: var(--bg-card); }
.pjnamein.bad { border-color: var(--color-danger); background: var(--color-danger-soft); }
.pjsub { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); font-size: var(--fs-sm); color: var(--text-secondary); }
.pjstgw { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); }
.pjstg { appearance: none; display: inline-flex; align-items: center; gap: var(--space-1); height: 28px; padding: 0 var(--space-3); border: 1px solid var(--brand-accent); border-radius: var(--radius-md); background: var(--brand-accent-soft); color: var(--brand-accent-dark); font-family: inherit; font-size: var(--fs-base); font-weight: 700; cursor: pointer; position: relative; }
.pjstg::after { content: ''; position: absolute; inset: -8px 0; }
.pjstg .dd-caret { font-size: 12px; color: var(--brand-accent-dark); }
.pjstg:hover { border-color: var(--brand-accent-dark); }
.pjstg:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.pjstg.is-pause { border-color: var(--color-warning); background: var(--color-warning-soft); color: var(--color-warning-text); }
.pjstg.is-pause .dd-caret { color: var(--color-warning-text); }
.pjstg.is-maint { border-color: var(--stage-maintenance); background: var(--stage-maintenance-soft); color: var(--stage-maintenance); }
.pjstg.is-maint .dd-caret { color: var(--stage-maintenance); }
.pjstg[aria-disabled="true"] { cursor: default; }
.pjstg[aria-disabled="true"]:hover { border-color: var(--brand-accent); }
.pjtk { display: inline-flex; align-items: baseline; gap: var(--space-1); }

/* 收合列：九格（建立、啟動、截止、BD、PM／報價、發票、收款、LINE），格外高 44.5px＝標籤 16.5＋值 28 */
.pjbar { display: flex; align-items: flex-end; gap: var(--space-4); padding: var(--space-3) var(--space-4); margin-top: var(--space-3); border-top: 1px solid var(--border-soft); cursor: pointer; /* 空白處點一下＝展開／收合 */ }
/* 前三欄給最小寬(實量最長常見值:日期 77、發票字樣 68、六位數收款 94),別人改值推送進來時右邊各欄不橫移;超過的值照舊撐開 */
.pjgrid { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(78px, max-content) minmax(78px, max-content) minmax(100px, max-content) repeat(2, max-content) minmax(0, 1fr); gap: var(--space-2) var(--space-6); }
.pjgrid > .c-r2 { grid-column: 1; }
.pjgrid > .c-line { grid-column: 4 / -1; }
.pjbox .pd-hi { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.pjbox .pd-hl { font-size: 11px; line-height: 1.5; color: var(--text-secondary); white-space: nowrap; }
.pjbox .pd-hi > .pd-hv { display: inline-flex; align-items: center; min-height: 28px; }
.pjbox .pd-hv.ro { font-weight: 500; color: var(--text-secondary); }
.pjbox .pd-hv.none { color: var(--text-secondary); font-weight: 500; }
.pjnar .pjgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3) var(--space-4); }
.pjnar .pjgrid > .c-r2, .pjnar .pjgrid > .c-line { grid-column: auto; }
.pjnar .pjbar { display: block; }
.pjce { position: relative; display: inline-flex; align-items: center; min-height: 28px; max-width: 100%; }
.pjv { appearance: none; border: 1px solid transparent; border-bottom: 1px dashed var(--border-strong); background: transparent; margin: 0 -7px; /* space-exempt: 值文字與欄名左緣對齊（外框 1px＋內距 6px） */ padding: 0 6px; height: 28px; max-width: 240px; border-radius: var(--radius-sm); font-family: inherit; font-size: var(--fs-base); font-weight: 700; color: var(--pj-tone, var(--brand-primary)); cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-1); position: relative; }
.pjv::after { content: ''; position: absolute; inset: -10px 0; }
.pjv:hover { background: var(--bg-paper); border-color: var(--border-default); }
.pjv.none { color: var(--text-secondary); font-weight: 500; }
.pjv.on { border-color: var(--brand-accent); background: var(--bg-card); }
.pjv.bad { border-color: var(--color-danger); background: var(--color-danger-soft); }
.pjv .pjvt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pjbox .pd-line-val { max-width: 220px; }
.pjbox .none .pd-line-val { color: var(--text-secondary); font-weight: 500; }   /* LINE 未綁定:跟隨空值樣式,壓過頁內 .pd-line-val 的 700／主色 */
.pjsave { display: inline-flex; align-items: center; gap: var(--space-1); height: 28px; font-size: var(--fs-base); font-weight: 700; color: var(--brand-primary); }
.pjbusy { font-size: 11px; font-weight: 400; color: var(--text-secondary); }
.pjtog { appearance: none; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); height: 28px; padding: 0 var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); font-family: inherit; font-size: var(--fs-sm); cursor: pointer; position: relative; }
.pjtog::after { content: ''; position: absolute; inset: -8px 0; }
.pjnar .pjtog { height: 44px; width: 100%; border: 0; border-top: 1px solid var(--border-soft); border-radius: 0 0 var(--radius-md) var(--radius-md); background: var(--bg-paper); }
.pjnar .pjtog::after { display: none; }

/* 儲存失敗浮層：絕對定位、不推動版面；同一時間只開一個 */
.pjerr { position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); width: max-content; max-width: 280px; padding: var(--space-2) var(--space-3); background: var(--bg-card); border: 1px solid var(--color-danger); border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-size: var(--fs-xs); font-weight: 400; color: var(--brand-accent-dark); text-align: left; }
.pjerr .material-icons { font-size: 16px; color: var(--color-danger); }
.pjerr .pjerr-b { appearance: none; height: 32px; padding: 0 var(--space-3); border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--brand-primary); font-family: inherit; font-size: var(--fs-sm); cursor: pointer; position: relative; }
.pjerr .pjerr-b.ol { border-color: var(--brand-primary); }
.pjerr .pjerr-b::after { content: ''; position: absolute; inset: -6px 0; }
.pjnar .pjce.r .pjerr { left: auto; right: 0; }
.pjnar .pjerr { max-width: calc(100vw - 72px); }

/* 展開區：三欄（基本／客戶與發票／人力）＋專案備註 */
.pjopen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); /* 基本／客戶與發票／人力各 1/4，第 4 格留白不撐寬（老闆 2026/11/20） */ gap: 0 var(--space-6); padding: 0 var(--space-4) var(--space-4); border-top: 1px solid var(--border-soft); }
.pjnar .pjopen { grid-template-columns: minmax(0, 1fr); }
.pjnote { grid-column: 1 / -1; }
.pjopen .dpx-field { min-width: 0; max-width: 100%; } /* 欄寬 1/4 時日期鈕不超出欄位 */
.pjnote .vw { display: flex; }
.pjhint { font-size: var(--fs-xs); color: var(--text-secondary); }
.pjbox.pjform .fgrp-h { font-size: 11px; font-weight: 700; color: var(--brand-accent); margin: var(--space-4) 0 6px; padding-bottom: var(--space-1); border-bottom: 1px solid var(--border-soft); }
.pjbox.pjform .frow2 { display: flex; align-items: flex-start; gap: var(--space-2); padding: 2px 0; min-height: 36px; }
.pjbox.pjform .frow2 > .k { width: 96px; color: var(--text-secondary); font-size: 12px; flex-shrink: 0; min-height: 34px; display: flex; align-items: center; }
.pjbox.pjform .frow2 > .vw { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-2); min-height: 34px; }
.pjbox.pjform .frow2 > .vw.col { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
.pjbox.pjform .inl { flex: 1 1 120px; min-width: 0; border: 1px solid transparent; border-bottom-color: var(--border-strong); background: transparent; border-radius: 6px 6px 2px 2px; }
.pjbox.pjform .inl:focus { outline: none; border-color: var(--brand-accent); background: var(--bg-card); }
.pjbox.pjform .inl.bad { border-color: var(--color-danger); background: var(--color-danger-soft); }
.pjbox.pjform .inl.need { border-color: var(--brand-accent); background: var(--brand-accent-soft); color: var(--brand-accent-dark); font-weight: 600; }
.pjbox.pjform .inl-160 { flex: 0 1 160px; max-width: 160px; }
.pjbox.pjform .inl-200 { flex: 1 1 120px; max-width: 200px; }
.pjbox.pjform .pd-ro { padding: 6px 8px; font-size: 13px; }
.pjbox.pjform .lockhint { padding: 6px 8px; }
.pjbox .pjce.fill { display: flex; flex: 1 1 120px; min-width: 0; }
.pjbox .pjce.fill > .inl { flex: 1 1 auto; }
.pjbox .pjce.fill.s160 { flex: 0 1 160px; max-width: 160px; }
.pjbox .pjce.fill.s200 { flex: 1 1 120px; max-width: 200px; }
.pjbox .pjce > .dpx-field { height: 34px; }
.pjbox .pjnote .pjce.fill { flex: 1; }
.pjinv { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-1) 0 0 104px; font-size: var(--fs-xs); color: var(--text-secondary); }
.pjnar .pjinv { padding-left: 0; }
.pjbtn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 32px; padding: 0 var(--space-3); border: 1px solid var(--brand-primary); border-radius: var(--radius-sm); background: transparent; color: var(--brand-primary); font-family: inherit; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; cursor: pointer; position: relative; }
.pjbtn::after { content: ''; position: absolute; inset: -6px 0; }
.pjbtn[aria-disabled="true"] { border-color: var(--border-strong); background: var(--neutral-100); color: var(--text-secondary); cursor: not-allowed; }
.pjflash { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

/* 進頁骨架：與收合列同高，換成真內容時下方頁籤列不位移 */
.pjsk { display: block; height: 28px; border-radius: var(--radius-sm); background: var(--neutral-100); animation: pjsk-pulse 1.2s ease-in-out infinite; }
.pjsk.t { height: 24px; width: min(60%, 320px); }
.pjsk.s { height: 28px; width: 120px; }
.pjsk.c { width: 96px; }
.pd-hl > .pjsk.c { height: 1.5em; }   /* 與欄名同高(11px × 1.5＝16.5px),骨架與真實大框才不差幾像素 */
.pjtog.pjsk { width: 72px; border-color: transparent; }
.pjcode.pjsk { height: auto; width: 140px; color: transparent; }   /* 窄版專案編號那一行:用同一個 .pjcode 的字級量高度 */
@keyframes pjsk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .pjsk { animation: none; } }

/* 窄版（≤768px 或嵌入）：專案名換行不截斷、末字與鉛筆同行；字級 20/15/13/12/11、可打字輸入框 16px、命中範圍 ≥44px 用 ::after 外擴 */
.pjnar .pjtitle { display: block; }
.pjnar .pjnm { display: block; min-height: 28px; }   /* 名稱一行時高度固定,骨架才能與真實大框同高(實際 27.39px) */
.pjnar .pjttl { display: inline; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.pjnar .pjtail { white-space: nowrap; }
.pjnar .pjedit { display: inline-flex; vertical-align: middle; margin: -8px 0 -8px var(--space-1); }
.pjnar .pjcode { display: block; margin-top: 2px; }
.pjnar .pjnamein { width: 100%; height: 44px; font-size: 16px; }
.pjnar .page-head { row-gap: var(--space-4); }
.pjnar .pjv, .pjnar .pjstg, .pjnar .pd-hi > .pd-hv { font-size: 15px; }
.pjnar .dd-caret { font-size: 11px; }
.pjnar .pjstg .dd-caret { font-size: 12px; }
.pjnar .pjv::after { inset: -11px -5px; }
.pjnar .pjstg::after { inset: -9px -2px; }
.pjnar .pjce { min-height: 28px; }
.pjnar .pjce::after { content: ''; position: absolute; inset: -8px 0; pointer-events: none; }
.pjnar .pjfix { position: sticky; top: 0; z-index: 6; margin-top: 0; box-shadow: var(--shadow-md); }
.pjnar.pjform input.inl, .pjnar.pjform textarea.notebox, .pjnar .pjin { font-size: 16px; }
.pjnar.pjform select.inl { font-size: 13px; }
.pjnar.pjform .inl { height: 44px; min-height: 44px; padding: 0 var(--space-2); }
.pjnar.pjform .notebox { min-height: 120px; }
.pjnar .pjbox.pjform .frow2, .pjnar.pjform .frow2 { flex-direction: column; align-items: stretch; gap: 2px; }
.pjnar.pjform .frow2 > .k { width: auto; min-height: 0; }
.pjnar.pjform .frow2 > .vw { min-height: 0; }
.pjnar.pjform .inl-160, .pjnar.pjform .inl-200, .pjnar .pjce.fill.s160, .pjnar .pjce.fill.s200 { flex: 1 1 120px; max-width: none; }
.pjnar .pjbtn { height: 32px; }
.pjnar.pjform .addwk { min-height: 32px; display: inline-flex; align-items: center; position: relative; }
.pjnar.pjform .addwk::after { content: ''; position: absolute; inset: -6px 0; }

.pjin { width: 132px; height: 28px; padding: 0 6px; border: 1px solid var(--brand-accent); border-radius: 6px; font-family: inherit; font-size: var(--fs-base); font-weight: 700; color: var(--brand-primary); background: var(--bg-card); }
.pjin.mono { font-family: var(--font-mono); }
.pjin.bad { border-color: var(--color-danger); background: var(--color-danger-soft); }
.pjce { height: 28px; }
.pjbox .pjnm { max-width: 100%; position: relative; }
.pjbox.pjform .notebox.bad { border-color: var(--color-danger); background: var(--color-danger-soft); }

.pjbox .pjce.fill { height: auto; }
.pjbox .pjce.fill.s120 { flex: 0 1 120px; max-width: 120px; }
.pjrow { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-2); min-width: 0; }
.pjrow .pjce.fill { flex: 0 1 160px; }
.pjemb .pjsub { margin-top: 0; }
.pjbox .pd-hi > .pjce, .pjbox .pd-hi > .pjrow { min-height: 28px; }
.pjerr-b.ol, .pjerr .pjerr-b.ol { border-color: var(--brand-primary); }
.pjnar .pjgrid > .pd-hi:nth-child(even) .pjerr { left: auto; right: 0; }

/* ============================================================
 *  專案大框批 3：補填提示條 .pjfix、自動標籤 .is-auto／.tgw／.pjpop、手動標籤 ✕ .tg-x
 *  openspec change project-header-merge 3.4／3.6；核可 mockup 狀態 6a–6c、7、7p
 * ============================================================ */
/* 提示條：.inline-note（§5.26）的一個用法，在大框展開區上方、大框內 */
.pjbox > .pjfix { margin: var(--space-3) var(--space-4) 0; }
.pjfix-b { appearance: none; display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 var(--space-4); border: 1px solid var(--brand-primary); border-radius: var(--radius-sm); background: transparent; color: var(--brand-primary); font-family: inherit; font-size: var(--fs-base); font-weight: 500; white-space: nowrap; cursor: pointer; position: relative; }
.pjfix-b::after { content: ''; position: absolute; inset: -4px -2px; }
.pjfix-b.pri { background: var(--brand-primary); color: var(--text-on-brand); }
.pjfix-b[aria-disabled="true"] { border-color: var(--border-strong); background: var(--neutral-100); color: var(--text-secondary); cursor: not-allowed; }
.pjfix-b:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
/* 窄版（≤768px 或內嵌）：吸附在可視區上緣（top 接 --app-header-bottom，§4.1.1），填最後一格時「切到…」鈕仍在畫面內；
   欄位聚焦捲動時預留它的高度：html 的 scroll-padding-top 加 --pj-fix-h（由頁面量測寫入），不用 scroll-margin-top（§4.1） */
.pjnar.pjbox > .pjfix { position: sticky; top: var(--app-header-bottom, calc(58px + var(--app-banner-h, 0px))); z-index: 6; margin-top: 0; box-shadow: var(--shadow-md); }
html:has(.pjnar > .pjfix) { scroll-padding-top: calc(var(--app-header-bottom, 58px) + var(--app-sticky-head-h, 0px) + var(--space-3) + var(--pj-fix-h, 0px)); }

/* 標籤：自動（灰底、沒有 ✕）與手動（白底、有 ✕）。標籤區的 button 在窄版被 .pd-tags button 壓成 padding:0，所以選擇器放高一級 */
.tgw { position: relative; display: inline-flex; }
.lmx-tag.is-auto { background: var(--neutral-100); color: var(--text-secondary); border: 1px solid var(--border-default); appearance: none; font-family: inherit; position: relative; margin-left: 0; }
button.lmx-tag.is-auto { cursor: pointer; }
.pjbox .pd-tags .lmx-tag.is-auto { height: 20px; padding: 0 8px; font-size: var(--fs-xs); }
.lmx-tag.is-mine { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-strong); padding-right: 2px; margin-left: 0; }
.pjpop { position: absolute; left: 0; top: calc(100% + 12px); z-index: 30; width: max-content; max-width: 240px; padding: var(--space-2) var(--space-3); background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-size: var(--fs-xs); font-weight: 400; line-height: 1.5; color: var(--text-body); white-space: normal; }
.pjbox .pd-tags .tg-x { appearance: none; border: 0; background: none; width: 16px; height: 16px; min-height: 16px; border-radius: var(--radius-pill); font-size: 10px; line-height: 1; color: var(--text-secondary); cursor: pointer; position: relative; padding: 0; }
.pjbox .pd-tags .tg-x::after { content: ''; position: absolute; inset: -14px -4px; }
.pjbox .pd-tags .tg-x:focus-visible, .pjbox .pd-tags .lmx-tag.is-auto:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }
@media (max-width: 768px) {
  :where(html.app-shell) .pjbox .pd-tags .lmx-tag.is-auto { height: 28px; padding: 0 10px; }
  :where(html.app-shell) .pjbox .pd-tags .lmx-tag.is-auto::after { content: ''; position: absolute; inset: -8px -2px; }
  :where(html.app-shell) .pjbox .pd-tags .tg-x { width: 24px; height: 24px; min-height: 24px; font-size: 11px; }
  :where(html.app-shell) .pjbox .pd-tags .tg-x::after { inset: -10px -2px -10px -18px; }
}

/* ============================================================================
 * 手機版:全站底層(mobile-full-system 批 A)
 * 全部只在 max-width:768px 生效,桌面零變化;選擇器第一行就帶 :where(html.app-shell)
 * (獨立簽署頁沒有 app-shell,不受影響)。不用 mask-image、不用 100vh、字級只用集合內的值。
 * ========================================================================== */
@media (max-width: 768px) {
  /* 對話框:內聯 min-width(≥380)蓋得掉一般 CSS,所以加 !important;maximized 全螢幕對話框不動。
     上面第 6888 行的既有規則保留。 */
  :where(html.app-shell) .q-dialog__inner:not(.q-dialog__inner--maximized) > .q-card,
  :where(html.app-shell) .q-dialog__inner--minimized > div > .q-card { min-width: 0 !important; max-width: calc(100vw - 16px) !important; }
  /* 沒設 width 的一般對話框統一撐到 max-width(視窗減 16);有內聯 width 的卡片因行內樣式優先保留原寬。
     只含 minimized;maximized、fullscreen、q-menu、q-popup 不碰。刻意不加 !important。 */
  :where(html.app-shell) .q-dialog__inner--minimized > .q-card { width: 100%; }
  /* 內容高過卡片時:卡片高度上限用 dvh(視窗減 16 上下邊距),內容在卡片內捲動,操作列(取消／確定)釘在卡片底部不被切。 */
  :where(html.app-shell) .q-dialog__inner--minimized > .q-card { max-height: calc(100dvh - 32px); }
  :where(html.app-shell) .q-dialog__inner--minimized > .q-card > .q-card__actions { position: sticky; bottom: 0; z-index: 1; background: inherit; }

  /* 篩選列:1:1 取自專案中心 .pc-page .unified-filter-bar(projects-center.vue.html 228–246),全站共用;
     原 .pc-page 規則不動。px 的 margin／padding 沿用該頁核可值。 */
  :where(html.app-shell) .unified-filter-bar { flex-wrap: wrap; gap: 8px 6px; align-items: center; }
  :where(html.app-shell) .unified-filter-bar .search-input { flex: 1 1 100%; }
  :where(html.app-shell) .unified-filter-bar .search-input .q-field__control { min-height: 36px; height: 36px; border-radius: 10px; }
  :where(html.app-shell) .unified-filter-bar .field { flex: 1 1 calc(25% - 5px); min-width: 0; }
  :where(html.app-shell) .unified-filter-bar .field .q-field__append { display: none; }
  :where(html.app-shell) .unified-filter-bar .field .q-field__control { padding: 0 8px; } /* space-exempt: 沿用專案中心核可值（mobile-iphone-polish） */
  :where(html.app-shell) .unified-filter-bar .field .q-field__native { padding-right: 0; }
  :where(html.app-shell) .unified-filter-bar .field .q-field__label { font-size: 11px; }
  :where(html.app-shell) .unified-filter-bar .count-chip { border: 0; background: transparent; font-size: 13px; margin: 0 0 0 auto; padding: 0 4px; } /* space-exempt: 沿用專案中心核可值（mobile-iphone-polish） */
  :where(html.app-shell) .unified-filter-bar .q-btn { font-size: 13px; padding: 0 8px; } /* space-exempt: 沿用專案中心核可值（mobile-iphone-polish） */
  :where(html.app-shell) .unified-filter-bar .q-field--dense .q-field__control { min-height: 40px; height: 40px; border-radius: 10px; }
  :where(html.app-shell) .unified-filter-bar .q-btn { min-height: 0; position: relative; }
  :where(html.app-shell) .unified-filter-bar .q-btn::after { content: ''; position: absolute; inset: -8px -4px; }

  /* 專案 AI 面板:高度改 dvh、不再扣已隱藏的頁尾 42px;側板寬不超過視窗 */
  :where(html.app-shell) .pai-panel.is-page { height: max(360px, calc(100dvh - var(--pai-pt, 260px) - 40px)); }
  :where(html.app-shell) .pai-panel.is-drawer { width: min(400px, 100vw); height: calc(100dvh - var(--app-header-bottom, 48px)); }
}

/* 手機版:專案詳情與 AI(mobile-full-system 批 B1)。專案 AI 面板與專案記錄的觸控範圍、對話框單一捲動軸。
   外觀 28–36px,點擊範圍用 ::after 補到 44px;一律在 768 以下生效,桌面不受影響。 */
@media (max-width: 768px) {
  /* 專案 AI 面板 */
  .pai-panel .cx-send, .pai-panel .cx-ib, .pai-close, .pai-dev { position: relative; }
  .pai-panel .cx-send::after, .pai-panel .cx-ib::after { content: ''; position: absolute; inset: -4px; }
  .pai-close::after { content: ''; position: absolute; inset: -6px; }
  .pai-dev::after { content: ''; position: absolute; inset: -12px 0; }
  .pai-panel .ao-side-status { row-gap: 18px; } /* space-exempt: 裝置列上下各外擴 12，與下方切換列（外擴 6）不重疊 */
  .pai-panel .pai-seg button { min-height: 32px; position: relative; }
  .pai-panel .pai-seg button::after { content: ''; position: absolute; inset: -6px 0; }
  /* 專案記錄 */
  .plg-now-btns .q-btn::after { content: ''; position: absolute; inset: -6px; }
  .plg-f, .plg-li, .plg-mini, .plg-ck { position: relative; }
  .plg-f::after { content: ''; position: absolute; inset: -7px 0; } /* 有 1px 框:::after 以 padding box 為準,-7 才是外擴 6 */
  .plg-ck::after { content: ''; position: absolute; inset: -6px 0; }
  .plg-li::after { content: ''; position: absolute; inset: -4px 0; }
  .plg-mini::after { content: ''; position: absolute; inset: -8px; }
  .plg-clear::after { content: ''; position: absolute; inset: -6px; }
  /* 四個專案記錄對話框:外框 hidden、只有 .plg-dlg-b 捲動,頁尾按鈕固定在捲動區外。
     選擇器要比 Quasar 的 .q-dialog__inner > div (max-height: calc(100vh - 48px)) 強 */
  :where(html.app-shell) .q-dialog__inner > .plg-dlg { width: calc(100vw - 16px); max-height: calc(100dvh - 32px); overflow: hidden; }
  .plg-dlg-f { flex: none; }
}

/* 手機版:對話框與周邊元件(mobile-full-system 批 B2)。確認對話框操作列、held-peer-card、活動日期時間浮窗(act-dtp)、專案記錄篩選列距。
   外觀 28–36(清單列 44),點擊範圍用 ::after 補到 44;一律在 768／440 以下生效,桌面零變化;全域選擇器第一行就帶 :where(html.app-shell)。 */
@media (max-width: 768px) {
  /* 專案記錄篩選 chip(B1 延後項 c):32 高 + 外擴 6 = 44,列距 12 讓 pitch = 44,相鄰列的外擴區不互相吃掉 */
  .plg-fs { row-gap: var(--space-3); }
  /* 確認對話框操作列:外觀 36、命中 44(36 + 外擴 4×2),按鈕間距 8 */
  :where(html.app-shell) .confirm-dialog__actions { flex-wrap: wrap; row-gap: var(--space-2); }
  :where(html.app-shell) .confirm-dialog__actions .q-btn:not(.q-btn--round) { min-height: 36px; position: relative; }
  :where(html.app-shell) .confirm-dialog__actions .q-btn:not(.q-btn--round)::after { content: ''; position: absolute; inset: -4px; }
  :where(html.app-shell) .confirm-dialog__actions .q-btn.btn-destructive:not(.q-btn--round)::after, :where(html.app-shell) .confirm-dialog__actions .q-btn--outline:not(.q-btn--round)::after { inset: -5px; } /* 批 D 補:帶 1px 框的按鈕 ::after 以 padding box 為準,-4 只有 42 */
  /* held-peer-card(task AI 側欄共用):按鈕 40 改 36 + 外擴 4;標題 14 改 15 */
  :where(html.app-shell) .hp-act .btn { min-height: 36px; position: relative; }
  :where(html.app-shell) .hp-act .btn::after { content: ''; position: absolute; inset: -5px; }
  :where(html.app-shell) .hp-hd h3 { font-size: var(--fs-base); }
  /* act-dtp:日期格 36(格距 8,外擴 4);導覽、「今天」、「確定」36 + 外擴 4;時間欄的分頁與選項列 44 */
  :where(html.app-shell) .act-dtp .grid { gap: var(--space-2); }
  :where(html.app-shell) .act-dtp .dy { height: 36px; position: relative; }
  :where(html.app-shell) .act-dtp .dy::after { content: ''; position: absolute; inset: -4px; }
  :where(html.app-shell) .act-dtp .nav { width: 36px; height: 36px; position: relative; }
  :where(html.app-shell) .act-dtp .nav::after { content: ''; position: absolute; inset: -4px; }
  :where(html.app-shell) .act-dtp .ft2 .lnk, :where(html.app-shell) .act-dtp .ft2 .go { min-height: 36px; position: relative; }
  :where(html.app-shell) .act-dtp .ft2 .lnk::after { content: ''; position: absolute; inset: -4px; }
  :where(html.app-shell) .act-dtp .ft2 .go::after { content: ''; position: absolute; inset: -5px; } /* 有 1px 框:::after 以 padding box 為準 */
  :where(html.app-shell) .act-dtp .hd2 { font-size: var(--fs-base); }
  :where(html.app-shell) .act-dtp .tabs { height: 46px; }
  :where(html.app-shell) .act-dtp .cols { inset: 54px 0 0 0; }
  :where(html.app-shell) .act-dtp .col { gap: 0; }
  :where(html.app-shell) .act-dtp .col button { height: 44px; }
}
@media (max-width: 440px) {
  /* act-dtp 單欄:日曆在上、時間欄在下(兩欄 372px 在窄視窗放不下);.tm 高度要明確,因為 .cols 是絕對定位 */
  :where(html.app-shell) .act-dtp { grid-template-columns: minmax(0, 1fr); }
  :where(html.app-shell) .act-dtp .tm { height: 176px; }
}

/* 手機版:批 D(mobile-full-system)。階梯編輯器(partners-list／vendors-list 共用)、建立報價單右欄與頂部橫幅。
   一律在 768 內生效,桌面零變化;全域選擇器第一行就帶 :where(html.app-shell)。字級只用 20／15／13／12／11。 */
@media (max-width: 768px) {
  /* 階梯編輯器:第 1 列 從 – 到 + 刪除,第 2 列 比例(或每階金額)。欄位標籤改用 .te-cell 的 data-label,表頭列隱藏 */
  :where(html.app-shell) .te-hrow { display: none; }
  :where(html.app-shell) .te-row { grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr) 36px; gap: var(--space-2); padding: var(--space-3); align-items: end; }
  :where(html.app-shell) .te-row > .te-unit { display: none; }
  :where(html.app-shell) .te-cell { display: block; min-width: 0; }
  :where(html.app-shell) .te-cell[data-label]::before { content: attr(data-label); display: block; font-size: 11px; line-height: 1.2; color: var(--text-secondary); margin-bottom: var(--space-1); }
  :where(html.app-shell) .te-row > .te-dash { align-self: end; line-height: 40px; font-size: 13px; }
  :where(html.app-shell) .q-dialog__inner > .q-card.rule-dlg .q-card__actions .q-btn:not(.q-btn--round) { min-height: 36px; position: relative; }
  :where(html.app-shell) .q-dialog__inner > .q-card.rule-dlg .q-card__actions .q-btn:not(.q-btn--round)::after { content: ''; position: absolute; inset: -4px; }
  :where(html.app-shell) .te-row > .te-cell--val { grid-column: 1 / -1; grid-row: 2; }
  :where(html.app-shell) .te-row > .te-x { grid-column: 4; grid-row: 1; align-self: end; }
  :where(html.app-shell) .tier-editor .te-cell--val .te-val { justify-content: flex-start; }
  :where(html.app-shell) .tier-editor .te-val .te-num { width: auto; flex: 1 1 0; }
  :where(html.app-shell) .tier-editor .te-try .te-try-in { width: auto; flex: 1 1 120px; }
  :where(html.app-shell) .te-x.q-btn { width: 36px; height: 36px; min-width: 36px; min-height: 36px; position: relative; }
  :where(html.app-shell) .te-x.q-btn::after { content: ''; position: absolute; inset: -4px; }
  :where(html.app-shell) .tier-editor .te-hd { font-size: 12px; }
  :where(html.app-shell) .te-flag { font-size: 13px; }
  :where(html.app-shell) .te-try { font-size: 13px; }
  :where(html.app-shell) .te-addbar .q-btn { min-height: 36px; position: relative; }
  :where(html.app-shell) .te-addbar .q-btn::after { content: ''; position: absolute; inset: -4px; }
  :where(html.app-shell) .q-dialog__inner > .q-card.rule-dlg { width: 100%; }
  :where(html.app-shell) .rule-dlg-body { max-height: calc(100dvh - 160px); }

  /* 建立報價單:右欄預覽單欄堆疊,601–768 原本仍 sticky(只解了高度上限),手機版整個回 static */
  :where(html.app-shell) .doc-edit-aside { position: static; max-height: none; overflow-y: visible; }

  /* 未儲存提示(.dirty-banner)維持 fixed 貼底,底部補 safe-area;文字可折行,按鈕外觀 36、命中 44 */
  :where(html.app-shell) .dirty-banner { padding-bottom: calc(var(--space-2) + var(--sab, 0px)); flex-wrap: wrap; }
  :where(html.app-shell) .dirty-banner__text { min-width: 0; overflow-wrap: anywhere; }
  :where(html.app-shell) .dirty-banner__actions .q-btn, :where(html.app-shell) .draft-banner__actions .q-btn { min-height: 36px; position: relative; }
  :where(html.app-shell) .dirty-banner__actions .q-btn::after, :where(html.app-shell) .draft-banner__actions .q-btn::after { content: ''; position: absolute; inset: -4px; }
  /* 草稿提示(.draft-banner):文字與按鈕可折行 */
  :where(html.app-shell) .draft-banner { flex-wrap: wrap; padding: var(--space-3); font-size: 13px; }
  :where(html.app-shell) .draft-banner__text { min-width: 0; overflow-wrap: anywhere; }

  /* Quasar.Dialog.create 動態對話框(.q-dialog-plugin;文件預覽、建立報價單用):訊息字級 13,按鈕外觀 36、命中 44 */
  :where(html.app-shell) .q-dialog-plugin .q-dialog__message { font-size: 13px; overflow-wrap: anywhere; }
  :where(html.app-shell) .q-dialog-plugin .q-card__actions .q-btn:not(.q-btn--round) { min-height: 36px; position: relative; }
  :where(html.app-shell) .q-dialog-plugin .q-card__actions .q-btn:not(.q-btn--round)::after { content: ''; position: absolute; inset: -4px; }

  /* 手機版後續 F4:對話框操作列按鈕全站化,外觀 36(原 Quasar 預設約 33)、命中 44(::after 外擴 4,相鄰間距 8 剛好相接)。
     .btn-destructive 有真實 1px 框,::after 以 padding box 為準,多外擴 1。.plg-dlg-f 是專案記錄對話框的 div 頁尾(非 q-card__actions)。
     dense 與 round 不在範圍;既有各頁較窄的同值規則保留不動;labor-slips 的 .lbm-btn 有自己的置中 ::after,排除以免 inset 覆蓋。 */
  :where(html.app-shell) .q-dialog .q-card__actions .q-btn:not(.q-btn--round):not(.q-btn--dense) { min-height: 36px; position: relative; }
  :where(html.app-shell) .q-dialog .q-card__actions .q-btn:not(.q-btn--round):not(.q-btn--dense):not(.lbm-btn)::after { content: ''; position: absolute; inset: -4px; }
  :where(html.app-shell) .q-dialog .q-card__actions .q-btn.btn-destructive:not(.q-btn--round):not(.q-btn--dense)::after { inset: -5px; }
  :where(html.app-shell) .plg-dlg-f .q-btn { min-height: 36px; position: relative; }
  :where(html.app-shell) .plg-dlg-f .q-btn::after { content: ''; position: absolute; inset: -4px; }
  /* 手機版收尾第 3 項:專案記錄對話框的 4 顆分類鈕(.tx-seg 內)外觀仍 36,命中補到 44。
     只外擴上下:四顆並排滿版,左右外擴會與鄰鈕重疊;上下鄰居(標題列、說明文字)都不是命中目標。限 .plg-dlg,AI 側欄的 .ao-side-status .tx-seg 不受影響。 */
  :where(html.app-shell) .plg-dlg .tx-seg button { position: relative; }
  :where(html.app-shell) .plg-dlg .tx-seg button::after { content: ''; position: absolute; inset: -4px 0; }
}

/* ============================================================================
 * 手機版:批 G(mobile-full-system 7.1 後台七頁 + 7.2 AI 與內部工具)。
 * .adm7 = 後台七頁的頁面根 class、.adm7-dlg = 七頁各 q-dialog 的 class(q-dialog 會搬到 body 底下,頁面根 class 罩不到)。
 * 一律在 768 內生效,桌面零變化;不用 !important、不用 100vh／mask-image;字級只用 20／15／13／12／11。
 * 外觀 28–36,點擊範圍用 ::after 補到 44。
 * ========================================================================== */
@media (max-width: 768px) {
  /* 頁首:標題與操作區放不下就換行;操作區自己也可換行(項目庫有 開關＋下拉＋按鈕) */
  .adm7 .page-head { flex-wrap: wrap; }
  .adm7 .page-head-text { min-width: 0; }
  .adm7 .page-head-actions { flex-shrink: 1; min-width: 0; max-width: 100%; flex-wrap: wrap; align-items: center; }
  /* 返回、頁首動作、對話框操作列的按鈕:外觀 36、命中 44 */
  .adm7 .admin-back-btn, .adm7 .page-head-actions .q-btn, .adm7-dlg .q-card__actions .q-btn:not(.q-btn--round) { min-height: 36px; position: relative; }
  .adm7 .admin-back-btn::after, .adm7 .page-head-actions .q-btn::after, .adm7-dlg .q-card__actions .q-btn:not(.q-btn--round)::after { content: ''; position: absolute; inset: -4px; }
  .adm7 .q-toggle, .adm7-dlg .q-toggle { min-height: 44px; }
  /* 表頭字級 11.5 -> 12(只掛在這七頁,不動全域 q-table) */
  .adm7 .q-table thead th { font-size: var(--fs-xs); }
  /* 表格列操作鈕(P9):外觀 36、命中 44(外擴 4)、相鄰間距 8 */
  .adm7 .q-table td .q-btn { min-height: 36px; min-width: 36px; margin: 0; position: relative; }
  .adm7 .q-table td .q-btn--round { width: 36px; height: 36px; }
  .adm7 .q-table td .q-btn::after { content: ''; position: absolute; inset: -4px; }
  .adm7 .q-table td .q-btn + .q-btn { margin-left: var(--space-2); }
  .adm7 .q-table td .q-btn .q-btn__content .block { font-size: var(--fs-xs); }
  .adm7 .q-table td > a { position: relative; }
  .adm7 .q-table td > a::after { content: ''; position: absolute; inset: -11px 0; }
  /* SortableJS 握把(P8):命中盒 44x44(圖示本身不變,margin -4 不多佔位);只有握把關掉觸控捲動,整列照常可捲 */
  .adm7 .drag-handle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -4px; touch-action: none; }
  /* 條款／子任務 chip 的移除鈕:外觀 28、命中 44 */
  .adm7-dlg .term-chip__remove { position: relative; width: 28px; height: 28px; }
  .adm7-dlg .term-chip__remove::after { content: ''; position: absolute; inset: -8px; }
  .adm7-dlg .term-chip { padding-right: var(--space-1); }
  /* 頁內一般按鈕(儲存設定等):外觀 36、命中 44 */
  .adm7 .q-btn:not(.q-btn--round):not(.q-btn--dense) { min-height: 36px; position: relative; }
  .adm7 .q-btn:not(.q-btn--round):not(.q-btn--dense)::after { content: ''; position: absolute; inset: -4px; }
  /* 表格分頁鈕:外觀 36、命中 44、間距 8 */
  .adm7 .q-table__control .q-btn { min-width: 36px; min-height: 36px; position: relative; }
  .adm7 .q-table__control .q-btn::after { content: ''; position: absolute; inset: -4px; }
  .adm7 .q-table__control .q-btn + .q-btn { margin-left: var(--space-2); }
  /* 富文字編輯器工具列(P7):鈕外觀 36、命中 44、間距 8;上下留 4 讓命中範圍不被捲動容器裁掉 */
  .adm7 .q-editor__toolbar .q-btn, .adm7-dlg .q-editor__toolbar .q-btn { min-width: 36px; min-height: 36px; margin: var(--space-1); position: relative; }
  .adm7 .q-editor__toolbar .q-btn::after, .adm7-dlg .q-editor__toolbar .q-btn::after { content: ''; position: absolute; inset: -4px; }
  /* 加入條款／選擇子任務鈕:外觀 36、命中 44 */
  .adm7-dlg .term-chip-selector__add { min-height: 36px; position: relative; }
  .adm7-dlg .term-chip-selector__add::after { content: ''; position: absolute; inset: -5px; } /* 有 1px 邊框,多外擴 1 */
}

/* 手機版:批 G 7.2 AI 任務側欄(ai-job-panel,根為 .ao-side)與 .ao-x。只在 768 內生效,桌面零變化。 */
@media (max-width: 768px) {
  /* 手機頁尾已隱藏,不再留 42px 空白條;輸入區底部補安全區 */
  .ao-side { bottom: 0; }
  .ao-side .cx-foot { padding-bottom: calc(var(--space-4) + var(--sab, 0px)); }
  .ao-side .cx-scroll { overscroll-behavior: contain; }
  /* 軟鍵盤開啟(shared/viewport-keyboard.js 加 .is-kb-open 並寫 --vv-top／--vv-h):面板貼合 visualViewport。
     iOS 開鍵盤只縮 visual viewport 並可能平移頁面,fixed 面板要自己對齊;上緣補狀態列安全區,底部補白歸零(鍵盤已蓋住 Home 指示條)。 */
  :where(html.app-shell) .ao-side.is-kb-open { top: var(--vv-top, 0px); bottom: auto; height: var(--vv-h, 100%); box-sizing: border-box; padding-top: var(--sat, 0px); }
  :where(html.app-shell) .ao-side.is-kb-open .cx-foot { padding-bottom: var(--space-2); }
  /* 鍵盤開啟時面板上緣貼到 y=0(--vv-top 常為 0),會落在頂端列(.q-header z 2000;面板開著時就地面板抬到 2200)底下,
     標題、more_vert、關閉鈕被蓋住,點關閉會點到頂端列。只在 .is-kb-open 把 z 提到 2300:高於 2200、低於 q-dialog／q-menu 的 6000
     (確認框要留在面板之上)與 index.html 橫幅的 7000。平時 .ao-side 仍是 1900,不動。
     class 寫兩次把權重提到 (0,3,0)(手機段禁用 !important):personal-home／project-detail 頁內的 `.wbB .ao-side`／`.pd-page .ao-side`(z 2100)與就地面板 `.ai-host .ao-side`(z 2100)權重同為 (0,2,0)、又較晚注入,只寫一次會被它們蓋過。 */
  :where(html.app-shell) .ao-side.is-kb-open.is-kb-open { z-index: 2300; }
  /* header 兩鈕:外觀 32、命中 44(外擴 6),間距 12 */
  .ao-side-act { gap: var(--space-3); }
  .ao-side-act .q-btn, .ao-x { position: relative; }
  .ao-side-act .q-btn::after, .ao-x::after { content: ''; position: absolute; inset: -6px; }
  /* 確認對話框帶 1px 框的按鈕(撤銷／刪除等):finance-cost-table 頁的 .q-card.confirm-dialog 規則(inset -4,特異度較高)會蓋掉 B2 的 -5,
     手機上命中只剩 42;這裡用同等特異度補回 -5。 */
  .q-dialog__inner > .q-card.confirm-dialog .confirm-dialog__actions .q-btn.btn-destructive::after,
  .q-dialog__inner > .q-card.confirm-dialog .confirm-dialog__actions .q-btn--outline::after { inset: -5px; }
  /* 輸入區按鈕:外觀 36、命中 44 */
  .ao-side .cx-ib, .ao-side .cx-send, .ao-side .cx-tool-b { position: relative; }
  .ao-side .cx-ib::after, .ao-side .cx-send::after, .ao-side .cx-tool-b::after { content: ''; position: absolute; inset: -4px; }
  .ao-side .cx-tool-b { min-height: 36px; }
  /* 斜線清單列:高 44 */
  .ao-side .cx-sl-o { min-height: 44px; align-items: center; }
  /* 附圖縮圖:外框不再裁切,移除鈕外觀 28、命中 44(外擴 8) */
  .ao-side .ao-thumb { overflow: visible; }
  .ao-side .ao-thumb img { border-radius: inherit; }
  .ao-side .ao-thumb .rm { width: 28px; height: 28px; }
  .ao-side .ao-thumb .rm::after { content: ''; position: absolute; inset: -8px; }
  /* 問題卡選項:選項間距 12、命中外擴 6(上下各半個間距相接),命中高 = 外觀 + 12 */
  .ao-side .cx-ask-opts { gap: var(--space-3); }
  .ao-side .aq-q .cx-opt::after { inset: -6px 0; }
  /* AI 回覆的程式碼區塊:寬度不撐出對話區,過長在區塊內橫捲;程式碼字級對齊字級集合 */
  .ao-side .cx-a pre { max-width: 100%; overflow-x: auto; }
  .ao-side .cx-a code { font-size: var(--fs-sm); }
}

/* 對外身分（lmc-sender-persona）手機規則：768 內，帶 app-shell 前綴；桌面規則在檔案前段 .pa／.pe-* 段 */
@media (max-width: 768px) {
  :where(html.app-shell) .pe-dlg-b { grid-template-columns: minmax(0, 1fr); padding: var(--space-4); }
  :where(html.app-shell) .pe-dlg-h, :where(html.app-shell) .pe-dlg-f { padding-left: var(--space-4); padding-right: var(--space-4); }
  :where(html.app-shell) input.pe-in { font-size: 16px; height: 44px; }
  :where(html.app-shell) .pe-gr-s input.pe-in { height: 40px; }
  :where(html.app-shell) .pe-seg button { min-height: 44px; }
  :where(html.app-shell) .pe-gr-r { min-height: 44px; }
  :where(html.app-shell) .pe-gr-r input { width: 22px; height: 22px; }
  :where(html.app-shell) .pe-lk { min-height: 44px; padding: 0 10px; font-size: 13px; }
}

