/* 客戶專區：明亮、穩重、留白；沿用 /assets/base.css 的設計系統，這裡只補版面與少量元件
   顏色一律用 base.css 的變數（深色模式會自動換一組），需要淡淡的底色時用 color-mix 從變數調出來，不寫死色碼 */
body { background: var(--bg); }
html { -webkit-text-size-adjust: 100%; }

/* ---------- 版面 ---------- */
.c-wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .c-wrap { padding: 0 16px; } }
.c-shell { min-height: 100vh; display: flex; flex-direction: column; }
.c-main { flex: 1; padding: 26px 0 48px; }
.c-main > .c-wrap { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 640px) { .c-main { padding: 18px 0 32px; } .c-main > .c-wrap { gap: 16px; } }

/* 開啟時確認登入狀態：通常一下就好，晚一點才出現轉圈，避免閃一下 */
.c-loading { min-height: 60vh; display: grid; place-items: center; animation: fade-in .25s ease .2s backwards; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand); animation: c-spin .8s linear infinite; }
@keyframes c-spin { to { transform: rotate(360deg); } }

/* ---------- 頁首 ---------- */
.c-top {
  position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top);
  background: var(--card); /* 不支援 color-mix 的舊瀏覽器：不透明底色 */
  background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line);
}
.c-top .c-wrap { display: flex; align-items: center; gap: 12px; height: 62px; }
.c-brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; color: var(--ink); }
.c-brand:hover { color: var(--ink); }
.c-brand .brand-logo { flex: none; } /* 公司標誌 <brand-logo>（高度由元件的 h 決定，頁首 30px） */
.c-brand .nm { min-width: 0; display: flex; align-items: baseline; line-height: 1.3; }
.c-brand .nm b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.c-brand .nm span { font-size: 14px; color: var(--muted); white-space: nowrap; }
.c-brand .nm i { font-style: normal; color: var(--line-strong); margin: 0 3px; }
.c-nav { display: flex; align-items: center; gap: 2px; flex: none; }
.c-nav a, .c-nav button {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; border: 0; background: none;
  font: inherit; font-size: 14.5px; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s;
}
.c-nav a:hover, .c-nav button:hover { background: var(--hover); color: var(--ink); }
.c-nav a.on { color: var(--brand); background: var(--brand-50); font-weight: 600; }
.c-nav .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
@media (max-width: 640px) {
  .c-top .c-wrap { height: 60px; gap: 8px; }
  .c-brand { gap: 10px; }
  .c-brand .brand-logo img { height: 28px; } /* 手機：頁首 60px 內要放得下標誌與兩行文字 */
  .c-brand .nm { display: block; }
  .c-brand .nm b { display: block; font-size: 15.5px; }
  .c-brand .nm span { display: block; font-size: 12.5px; letter-spacing: .04em; }
  .c-brand .nm i { display: none; }
  /* 手機：主要頁面改到底部頁籤，頁首只留公司名稱與登出 */
  .c-nav .sep { display: none; }
  .c-nav button { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; margin-right: -8px; }
  .c-nav .out-text { display: none; }
}

/* ---------- 頁尾 ---------- */
.c-foot { border-top: 1px solid var(--line); padding: 18px 0 calc(18px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 13.5px; background: var(--card); }
.c-foot .c-wrap { display: flex; gap: 6px 16px; justify-content: space-between; align-items: baseline; flex-wrap: wrap; }
.c-foot .who { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.c-foot .who b { color: var(--ink-2); font-weight: 600; }
.c-foot .ct { display: inline-flex; flex-wrap: wrap; gap: 2px 14px; }
.c-foot a { color: var(--ink-2); }
.c-foot a:hover { color: var(--brand); }
@media (max-width: 640px) { .c-foot .c-wrap { flex-direction: column; gap: 6px; } .c-foot .ct a { display: inline-block; padding: 6px 0; } }

/* ---------- 登入（版面沿用共用登入頁 .auth-split；這裡只補客戶專區多的說明與連結） ---------- */
.c-login .ab-logo .brand-logo { flex: none; } /* 深藍底用反白版標誌（元件 theme="dark"，高度 54px，標誌在上、名稱在下；手機由共用樣式縮成 40px） */
.c-login .ab-company { overflow-wrap: anywhere; }
.c-login .af-sub { overflow-wrap: anywhere; }
.c-login .c-forgot { font-size: 14px; }
.c-login .af-foot { gap: 8px; text-align: center; }
.c-login .af-legal { margin: 0; color: var(--muted); line-height: 1.75; }
.c-login .af-home { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 8px; color: var(--muted); }
.c-login .af-home:hover { color: var(--brand); }

/* ---------- 總覽：問候 ---------- */
.c-hero {
  border-radius: 20px; padding: 26px 28px; border: 1px solid var(--brand-100); background: var(--brand-50);
  border-color: color-mix(in srgb, var(--brand) 16%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 9%, var(--card)) 0%, color-mix(in srgb, var(--brand) 4%, var(--card)) 55%, color-mix(in srgb, var(--mint) 8%, var(--card)) 100%);
}
.c-hero .hi { color: var(--ink-2); font-size: 14.5px; }
.c-hero h1 { font-size: 25px; margin: 3px 0 6px; overflow-wrap: anywhere; }
.c-hero p { color: var(--ink-2); margin: 0; font-size: 15px; line-height: 1.75; }
.c-hero-ok {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 4px 12px 4px 10px; border-radius: 999px;
  background: var(--green-bg); color: var(--green-ink); font-size: 13.5px; font-weight: 500;
}
@media (max-width: 640px) { .c-hero { padding: 20px; border-radius: 18px; } .c-hero h1 { font-size: 21px; } .c-hero p { font-size: 14.5px; } }

/* ---------- 總覽：數字卡（共用 .stat：右上角圖示、大數字） ---------- */
.c-kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.c-kpi { gap: 2px; }
.c-kpi .label { margin-bottom: 2px; }
.c-kpi .s { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }
.c-kpi.due .value { color: var(--amber); }
.c-kpi .value.none { font-size: 18px; color: var(--muted); font-weight: 500; padding: 6px 0 3px; }
.c-kpi .s > .av { margin-right: 6px; }
@media (max-width: 640px) {
  .c-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .c-kpi { padding: 14px 15px; }
  .c-kpi .stat-ic { top: 13px; right: 12px; width: 30px; height: 30px; border-radius: 9px; }
  .c-kpi .stat-ic svg { width: 16px; height: 16px; }
  .c-kpi:has(> .stat-ic) > .label { padding-right: 36px; }
  .c-kpi .value { font-size: 23px; }
  .c-kpi.wide { grid-column: 1 / -1; }
}

.c-sec { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin: 8px 2px -6px; }
.c-sec h2 { font-size: 18px; white-space: nowrap; }
.c-sec .small { font-size: 13.5px; }

/* ---------- 專案卡 ---------- */
.pj { display: block; color: inherit; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.pj:hover { color: inherit; border-color: var(--brand-200); box-shadow: var(--shadow-md); transform: translateY(-1px); }
a.pj:focus-visible { outline: none; box-shadow: var(--ring); }
.pj-h { padding: 18px 22px 16px; display: flex; gap: 12px; align-items: flex-start; }
.pj-h .t { flex: 1; min-width: 0; }
.pj-h h3, .pj-h h1 { font-size: 18px; overflow-wrap: anywhere; margin: 4px 0 2px; }
.pj-h h1 { font-size: 22px; }
.pj-h .go { color: var(--icon-muted); align-self: center; flex: none; }
a.pj:hover .pj-h .go { color: var(--brand); }
.pj-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 13.5px; align-items: center; }
.pj-meta > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.pj-meta svg { width: 14px; height: 14px; flex: none; }
.pj-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-top: 1px solid var(--line-2); }
.pj-stats > div { padding: 14px 22px 16px; border-left: 1px solid var(--line-2); min-width: 0; }
.pj-stats > div:first-child { border-left: 0; }
.pj-stats .l { font-size: 13.5px; color: var(--muted); }
.pj-stats .v { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 1px 0 8px; line-height: 1.35; color: var(--ink); }
.pj-stats .v small { font-size: 13.5px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.pj-stats .s { font-size: 13.5px; color: var(--muted); }
@media (max-width: 640px) {
  .pj-h { padding: 16px 16px 14px; }
  .pj-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj-stats > div { padding: 12px 16px 14px; border-left: 0; border-top: 1px solid var(--line-2); }
  .pj-stats > div:first-child { grid-column: 1 / -1; border-top: 0; }
  .pj-stats > div:nth-child(odd):not(:first-child) { border-left: 1px solid var(--line-2); }
}

.pj-next { display: flex; align-items: center; gap: 12px; padding: 12px 22px; background: var(--surface-2); border-top: 1px solid var(--line-2); font-size: 14.5px; color: var(--ink-2); }
.pj-next .ic { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex: none; }
.pj-next .tx { min-width: 0; overflow-wrap: anywhere; }
.pj-next .tx b { color: var(--ink); margin-right: 6px; }
/* 下一次輔導的顧問：電腦上靠右；手機上換到時間下面一行，和文字左緣對齊 */
.pj-next .who { margin-left: auto; flex: none; font-size: 14px; color: var(--ink-2); gap: 7px; }
@media (max-width: 640px) {
  .pj-next { padding: 12px 16px; align-items: flex-start; flex-wrap: wrap; row-gap: 6px; }
  .pj-next .tx { flex: 1 1 calc(100% - 44px); }
  .pj-next .who { margin-left: 44px; }
}

/* 總覽專案卡標題右側：輔導團隊的頭像 */
.pj-h .pj-av { align-self: center; flex: none; }
/* 專案頁標題下方：輔導團隊（頭像＋姓名＋角色） */
.pj-team { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 12px; }
.pj-team > .l { font-size: 13.5px; color: var(--muted); }
.pj-team .with-av { font-size: 14.5px; color: var(--ink); line-height: 1.3; }
.pj-team .with-av b { font-weight: 600; }
.pj-team .with-av small { margin-left: 6px; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .pj-team { gap: 8px 16px; } .pj-team > .l { flex-basis: 100%; margin-bottom: -2px; } }

.pj-ready { display: flex; gap: 24px; align-items: center; padding: 16px 22px 18px; border-top: 1px solid var(--line-2); }
.rd-sum { display: flex; align-items: center; gap: 14px; flex: none; }
.rd-sum .l { font-size: 13.5px; color: var(--muted); }
.rd-sum .lv { margin-top: 4px; }
.rd-sum .d { font-size: 13px; color: var(--muted); margin-top: 4px; }
@media (max-width: 640px) { .pj-ready { flex-direction: column; align-items: stretch; gap: 14px; padding: 14px 16px 16px; } }
.pj-ready-more { display: none; color: var(--brand); align-items: center; gap: 2px; }
@media (max-width: 640px) {
  /* 手機總覽：準備度只留百分比與燈號，各類別細項在專案頁 */
  .pj .pj-ready { flex-direction: row; align-items: center; justify-content: space-between; }
  .pj .pj-ready-bars { display: none; }
  .pj .pj-ready-more { display: inline-flex; }
}

/* 環形百分比 */
.ring { position: relative; flex: none; }
.ring svg { display: block; }
.ring circle.bg { stroke: var(--track); }
.ring circle.fg { transition: stroke-dashoffset .6s ease; }
.ring .n { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: -.02em; }
.ring .n small { font-size: .5em; font-weight: 600; margin-left: 1px; color: var(--muted); }

/* 分項長條 */
.gbars { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 24px; }
.gbar .gt { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 4px; }
.gbar .gt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gbar .gt b { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.gbar .progress { min-width: 0; }
.gbars.lg { gap: 14px 28px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gbars.lg .gt { font-size: 14.5px; }
.gbars.lg .progress { height: 8px; }

/* ---------- 專案詳情 ---------- */
.c-back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; align-self: flex-start; margin-bottom: -6px; position: relative; }
.c-back::after { content: ""; position: absolute; inset: -10px -8px; } /* 手機好點：點擊範圍比文字大一圈 */
.c-back:hover { color: var(--brand); }
.c-back-row { width: 100%; max-width: 860px; margin: 0 auto -6px; }
.c-back-row.sm { max-width: 760px; }
.c-back-row .c-back { margin-bottom: 0; }
.c-tabcard > .tabs { padding: 0 14px; }
.c-tabcard > .tabs button { padding: 13px 12px 12px; }
.c-tabcard > .tab-b { padding: 20px 22px 22px; }
@media (max-width: 640px) {
  /* 手機：頁籤改成可換行的膠囊按鈕，五個頁籤都看得到 */
  .c-tabcard > .tabs { flex-wrap: wrap; gap: 6px 5px; padding: 12px; overflow: visible; }
  .c-tabcard > .tabs button { padding: 7px 12px; min-height: 42px; margin: 0; border: 1px solid var(--line); border-radius: 999px; font-size: 14.5px; background: var(--surface); }
  .c-tabcard > .tabs .count { margin-left: 3px; padding: 0 6px; }
  .c-tabcard > .tabs button.on { border-color: var(--brand); background: var(--brand-50); }
  .c-tabcard > .tab-b { padding: 16px; }
}

.tab-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.tab-bar .tx { flex: 1; min-width: 220px; color: var(--ink-2); font-size: 14.5px; }
.tab-bar .tx b { color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .tab-bar .btn { width: 100%; } }

/* 日期方塊 */
.dtile { width: 60px; border: 1px solid var(--line); border-radius: 12px; text-align: center; overflow: hidden; background: var(--surface); flex: none; align-self: flex-start; }
.dtile .m { background: var(--brand-50); color: var(--brand); font-size: 12.5px; font-weight: 600; padding: 2px 0; }
.dtile .d { font-size: 22px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; color: var(--ink); padding-top: 2px; }
.dtile .w { font-size: 12.5px; color: var(--muted); padding-bottom: 5px; }
.dtile.today { border-color: var(--brand-200); }
.dtile.today .m { background: var(--brand-solid); color: var(--on-brand); }

/* 輔導紀錄 */
.rec-mh { display: flex; align-items: baseline; gap: 10px; padding: 18px 0 4px; }
.rec-mh b { font-size: 15.5px; }
.rec-mh .small { font-size: 13.5px; }
.rec { display: flex; gap: 16px; padding: 14px 0 16px; border-bottom: 1px solid var(--line-2); }
.rec-month:last-child .rec:last-child { border-bottom: 0; padding-bottom: 4px; }
.rec-b { flex: 1; min-width: 0; }
.rec-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.rec-top > b { font-variant-numeric: tabular-nums; font-size: 15.5px; }
.rec-top .small { font-size: 13.5px; }
.rec-top .rec-who { gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.rec-c { margin-top: 6px; color: var(--ink); line-height: 1.75; overflow-wrap: anywhere; }
.rec-c.clamp { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec-next { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; font-size: 14.5px; }
.rec-next .label { display: block; margin-bottom: 2px; font-size: 13px; color: var(--muted); }
.rec-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13.5px; }
.signed { display: inline-flex; align-items: center; gap: 5px; color: var(--green); min-width: 0; }
.signed svg { flex: none; align-self: flex-start; margin-top: 4px; }
.signed .when { color: var(--green); }
.link-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--brand); cursor: pointer; padding: 2px 0; position: relative; }
.link-btn::after { content: ""; position: absolute; inset: -9px -7px; } /* 手機好點：點擊範圍約 44px 高 */
.link-btn:hover { color: var(--brand-600); text-decoration: underline; }

/* 即將進行 */
.up { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.up:first-child { padding-top: 2px; }
.up-task { font-weight: 500; margin: 3px 0 4px; overflow-wrap: anywhere; }

/* 結案文件 */
.dl-sum { display: flex; align-items: center; gap: 22px; padding: 4px 0 16px; flex-wrap: wrap; }
.dl-sum .small { font-size: 13.5px; }
.dl-sum .big { font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.dl-sum .big small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.dl-sum .progress { flex: 1; min-width: 160px; height: 8px; }
.dl-list { list-style: none; margin: 14px 0 0; padding: 0; }
.dl-list > li { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line-2); }
.dl-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--gray-bg); color: var(--gray); }
.dl-ic.green { background: var(--green-bg); color: var(--green); }
.dl-ic.blue { background: var(--blue-bg); color: var(--blue); }
.dl-ic.amber { background: var(--amber-bg); color: var(--amber); }
.dl-b { flex: 1; min-width: 0; }
.dl-t { font-weight: 500; overflow-wrap: anywhere; }
.dl-b > .small { font-size: 13.5px; }
.dl-list .file-list li { align-items: flex-start; }
.dl-list .file-list li svg { margin-top: 3px; }
.dl-list .file-list .fn { min-width: 0; overflow-wrap: anywhere; line-height: 1.55; }
.dl-list > li > .badge { margin-top: 5px; }
/* 結案文件線上簽收（v1.6） */
.dl-sum .dl-print { margin-left: auto; }
.dl-signall { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin: 0 0 12px; padding: 12px 16px; border-radius: 12px; background: var(--amber-bg); color: var(--ink-2); font-size: 14.5px; }
.dl-signall .tx { flex: 1; min-width: 200px; }
.dl-signall .tx b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dl-sign { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dl-sign .signed { font-size: 14px; line-height: 1.6; }
.dl-sign .signed svg { margin-top: 5px; }
.dl-sign .dl-note { display: block; color: var(--muted); font-size: 13.5px; }
@media (max-width: 640px) {
  .dl-sum .dl-print { margin-left: 0; width: 100%; }
  .dl-signall .btn, .dl-sign .btn { min-height: 44px; }
  .dl-signall .btn { width: 100%; }
  .dl-sign .btn { flex: 1; }
}

/* 準備度 */
.rd-hero { display: flex; gap: 28px; align-items: center; padding: 4px 0 20px; border-bottom: 1px solid var(--line-2); margin-bottom: 20px; }
.rd-hero .t { flex: 1; min-width: 0; }
.rd-hero .t > .small { font-size: 13.5px; }
.rd-hero h2 { font-size: 21px; margin: 4px 0 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rd-hero p { color: var(--ink-2); font-size: 15px; margin: 0 0 14px; line-height: 1.75; }
@media (max-width: 640px) { .rd-hero { flex-direction: column; align-items: flex-start; gap: 16px; } .rd-hero .btn { width: 100%; } }

/* 請款 */
.bill-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.bill-stats > div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; min-width: 0; }
.bill-stats .l { font-size: 13.5px; color: var(--muted); }
.bill-stats .v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--ink); }
.bill-stats .due .v { color: var(--amber); }
@media (max-width: 640px) { .bill-stats { grid-template-columns: minmax(0, 1fr); gap: 8px; } .bill-stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; } }
.c-h4 { font-size: 15.5px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.c-tbl { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.c-tbl + .c-h4 { margin-top: 24px; }
.c-tbl .table th { background: var(--surface-2); }
.c-tbl .table td, .c-tbl .table th { padding-left: 14px; padding-right: 14px; }
.c-tbl .sub { font-size: 13px; color: var(--muted); }
.c-tbl .sub.danger-text { color: var(--red); }
.c-tbl .table th.num { text-align: right; }
.c-tbl .inv-t { min-width: 180px; max-width: 280px; }
.c-tbl .inv-t .sub { margin-top: 2px; line-height: 1.5; }
@media (min-width: 641px) { .c-tbl .table-wrap { overflow-x: auto; } }

/* 手機：表格改成一列一張卡（取消共用樣式為了左右捲動加的最小寬度，否則卡片會比螢幕寬、數值被擠到畫面外） */
@media (max-width: 640px) {
  .c-tbl .table-wrap { overflow: visible; background: none; }
  .table-wrap > .table.rtable { min-width: 0 !important; }
  .rtable td, .rtable th { min-width: 0 !important; }
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
  .rtable tr:last-child { border-bottom: 0; }
  .rtable td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 3px 0 !important; border: 0 !important; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  .rtable td::before { content: attr(data-label); color: var(--muted); font-size: 13.5px; text-align: left; flex: none; }
  .rtable td.lead { font-weight: 600; text-align: left; justify-content: flex-start; padding-bottom: 6px !important; }
  .rtable td.lead::before { display: none; }
  .rtable td.inv-t { display: block; max-width: none; }
  .rtable td.lead .sub { font-weight: 400; }
  .rtable td.actions { justify-content: flex-end; padding-top: 8px !important; }
  .rtable td.actions::before { display: none; }
  .rtable td.empty-cell { display: none; }
}

/* ---------- 導入路線圖（roadmap.js）：總覽專案卡的精簡步驟條、專案頁的完整時間軸 ----------
   顏色和證書的稽核時程一致：已完成＝薄荷綠打勾、目前階段＝品牌藍加一圈光暈、還沒開始＝灰框 */
.pj-road { padding: 14px 22px 16px; border-top: 1px solid var(--line-2); }
.rm-mini-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin-bottom: 12px; }
.rm-mini-h .l { font-size: 13.5px; color: var(--muted); }
.rm-mini-h .cur { font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.rm-mini-h .n { margin-left: auto; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rm-mini-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); }
.rm-mini-steps li { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
/* 連到前一步的線：通往已完成、目前階段的那一段是綠色（走過的路） */
.rm-mini-steps li + li::before { content: ""; position: absolute; top: 9px; left: calc(-50% + 15px); right: calc(50% + 15px); height: 2px; border-radius: 2px; background: var(--line); }
.rm-mini-steps li.is-done::before, .rm-mini-steps li.is-now::before { background: var(--mint); }
/* 打勾用卡片底色：淺色模式是白勾、深色模式是深色勾，在綠底上都看得清楚 */
.rm-mini-steps .d { position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; color: var(--card); flex: none; }
.rm-mini-steps .is-done .d { background: var(--mint); border-color: var(--mint); }
.rm-mini-steps .is-now .d { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 4px var(--brand-100); }
.rm-mini-steps .is-done.is-now .d { background: var(--mint); border-color: var(--mint); box-shadow: 0 0 0 4px color-mix(in srgb, var(--mint) 24%, transparent); }
/* 名稱放不下時兩行平均分配（「內部稽核與／管理審查」），不會剩一個字掉到第二行 */
.rm-mini-steps .t { margin-top: 7px; padding: 0 4px; font-size: 13px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; text-wrap: balance; }
.rm-mini-steps .is-done .t { color: var(--ink-2); }
.rm-mini-steps .is-now .t { color: var(--brand); font-weight: 600; }
.rm-mini-steps .is-done.is-now .t { color: var(--green); }
.rm-mini-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 9px 12px; border-radius: 10px; background: var(--brand-50); color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.rm-mini-note:first-child { margin-top: 0; }
.rm-mini-note svg { flex: none; margin-top: 3px; color: var(--brand); }
.rm-mini-note span { min-width: 0; overflow-wrap: anywhere; }
.rm-mini-note b { margin-right: 8px; color: var(--brand); font-weight: 600; }
@media (max-width: 640px) {
  .pj-road { padding: 13px 16px 15px; }
  /* 手機：只留步驟點，目前階段的名稱寫在上面那一行 */
  .rm-mini-h { margin-bottom: 10px; }
  .rm-mini-steps .t { display: none; }
  .rm-mini-steps li + li::before { left: calc(-50% + 13px); right: calc(50% + 13px); }
}

.rm { padding: 20px 22px 22px; }
.rm-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.rm-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand); }
.rm-head .t { min-width: 0; }
.rm-head h2 { font-size: 18px; }
.rm-head p { margin: 2px 0 0; font-size: 14px; line-height: 1.7; color: var(--muted); }
/* 寬螢幕：橫排，點在每一欄左上角，線連到下一欄；文字靠左（每欄要約 150px 才放得下名稱與說明，窄一點就改直排） */
.rm-tl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); }
.rm-tl li { position: relative; min-width: 0; padding-right: 16px; }
.rm-tl li::before { content: ""; position: absolute; top: 13px; left: 34px; right: 6px; height: 2px; border-radius: 2px; background: var(--line); }
.rm-tl li:last-child::before { display: none; }
.rm-tl li.is-done::before { background: var(--mint); }
.rm-dot {
  position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line-strong); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.rm-tl .is-done .rm-dot { background: var(--mint); border-color: var(--mint); color: var(--card); }
.rm-tl .is-now .rm-dot { background: var(--brand-solid); border-color: var(--brand-solid); color: var(--on-brand); box-shadow: 0 0 0 5px var(--brand-100); }
.rm-tl .is-done.is-now .rm-dot { background: var(--mint); border-color: var(--mint); color: var(--card); box-shadow: 0 0 0 5px color-mix(in srgb, var(--mint) 24%, transparent); }
.rm-b { margin-top: 12px; min-width: 0; }
.rm-t { font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; text-wrap: balance; }
.rm-tl .is-done .rm-t { color: var(--ink-2); font-weight: 500; }
.rm-tl .is-todo .rm-t { color: var(--muted); font-weight: 500; }
.rm-tl .is-now .rm-t { color: var(--brand); font-weight: 600; }
.rm-tl .is-done.is-now .rm-t { color: var(--green); }
/* 「目前階段」小標籤：橫排時欄位窄，自成一行放在名稱下面；直排時跟在名稱後面 */
.rm-tag { display: block; width: fit-content; margin-top: 3px; padding: 0 7px; border-radius: 6px; background: var(--brand-50); color: var(--brand); font-size: 12.5px; font-weight: 600; line-height: 1.75; white-space: nowrap; }
.rm-tl .is-done.is-now .rm-tag { background: var(--green-bg); color: var(--green); }
.rm-ok { margin-top: 2px; font-size: 13.5px; color: var(--green); }
.rm-d { margin: 4px 0 0; font-size: 13.5px; line-height: 1.65; color: var(--muted); word-break: keep-all; overflow-wrap: anywhere; }
.rm-tl .is-now .rm-d { color: var(--ink-2); }
/* 顧問寫的下一步 */
.rm-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 22px; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--brand-100); background: var(--brand-50); }
.rm-note:first-child { margin-top: 0; }
.rm-note .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--brand); }
.rm-note .tx { flex: 1; min-width: 0; }
.rm-note .tx b { display: block; font-size: 14px; color: var(--brand); }
.rm-note .tx .pre { margin-top: 1px; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.rm-note .when { flex: none; margin-top: 1px; font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rm-upd { margin: 18px 0 0; font-size: 13.5px; color: var(--muted); }
/* 平板、手機：直排，點在左邊、線往下連；目前階段整段加底色 */
@media (max-width: 999px) {
  .rm-tl { grid-template-columns: minmax(0, 1fr); }
  .rm-tl li { display: flex; gap: 12px; padding: 0 0 14px; }
  .rm-tl li:last-child { padding-bottom: 0; }
  .rm-tl li::before { top: 32px; bottom: 4px; left: 13px; right: auto; width: 2px; height: auto; }
  .rm-b { flex: 1; margin-top: 3px; }
  .rm-tag { display: inline-block; margin: 0 0 0 6px; vertical-align: 1px; }
  .rm-tl .is-now .rm-b { margin-top: -5px; padding: 8px 12px 10px; border-radius: 12px; background: var(--brand-50); }
  .rm-tl .is-done.is-now .rm-b { background: var(--green-bg); }
}
@media (max-width: 640px) {
  .rm { padding: 16px; }
  .rm-head { margin-bottom: 18px; }
  .rm-note { flex-wrap: wrap; row-gap: 4px; padding: 12px 14px; }
  .rm-note .when { flex-basis: 100%; padding-left: 44px; }
}

/* ---------- 帳號 ---------- */
.acct-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
@media (max-width: 820px) { .acct-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.acct-id { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.acct-id b { font-size: 16.5px; display: block; }
/* 畫面與字體：電腦上兩組選項排成一列；手機上下排、選項撐滿整列，按鈕夠大好點 */
.acct-look { display: flex; flex-direction: column; gap: 12px; }
.acct-look p { margin: 0; }
.acct-look .appearance { flex-direction: row; flex-wrap: wrap; gap: 12px 36px; }
.acct-look .seg button { min-height: 38px; }
@media (max-width: 560px) {
  .acct-look .appearance { flex-direction: column; gap: 14px; }
  .acct-look .ap-row { align-items: stretch; flex-direction: column; gap: 6px; }
  .acct-look .seg { display: flex; }
  .acct-look .seg button { flex: 1; justify-content: center; min-height: 42px; padding: 6px 8px; }
}
.c-page-h h1 { font-size: 23px; }
.c-page-h p { color: var(--muted); margin: 4px 0 0; }

/* ---------- 頁首：待辦數字、手機隱藏次要選單 ---------- */
.c-nav .nb { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--danger-fill); color: #fff; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; line-height: 1; margin-left: 1px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .c-nav a.opt { display: none; } }

/* ---------- 總覽：待您處理 ---------- */
.c-todo { overflow: hidden; border-color: color-mix(in srgb, var(--warn-fill) 40%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn-fill) 9%, transparent), var(--shadow); }
.c-todo-h { display: flex; align-items: center; gap: 12px; padding: 16px 22px 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--warn-fill) 8%, var(--card)) 0%, var(--card) 100%); }
.c-todo-h .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--amber-bg); color: var(--amber); display: grid; place-items: center; flex: none; }
.c-todo-h .t { min-width: 0; }
.c-todo-h h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.c-todo-h h2 .n { background: var(--danger-fill); color: #fff; font-size: 12.5px; border-radius: 999px; padding: 0 8px; line-height: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.c-todo-h p { margin: 1px 0 0; font-size: 14px; color: var(--muted); }
.todo { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line-2); }
.todo .ti { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand); }
.todo .ti.quote { background: var(--purple-bg); color: var(--purple); }
.todo .ti.survey { background: var(--green-bg); color: var(--green); }
.todo .ti.docs { background: var(--amber-bg); color: var(--amber); } /* 結案文件待簽收 */
.todo .ti.off { background: var(--gray-bg); color: var(--gray); }
.todo .tx { flex: 1; min-width: 0; }
.todo .tx b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.todo .tx .s { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.todo.off .tx b { color: var(--ink-2); font-weight: 500; }
.todo .btn { flex: none; min-width: 128px; }
.todo .btn svg { width: 15px; height: 15px; margin-right: -3px; }
.todo-more {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 4px; border: 0; border-top: 1px solid var(--line-2);
  background: var(--surface-2); font: inherit; font-size: 14px; color: var(--brand); padding: 12px; cursor: pointer;
}
.todo-more:hover { background: var(--brand-50); }
@media (max-width: 640px) {
  .c-todo-h { padding: 14px 16px 12px; }
  .todo { flex-wrap: wrap; padding: 13px 16px; gap: 10px 12px; }
  .todo .tx { flex-basis: calc(100% - 52px); }
  .todo .btn { width: 100%; min-height: 44px; }
}

/* ---------- 總覽：報價單入口 ---------- */
.c-linkcard { display: flex; align-items: center; gap: 14px; padding: 14px 20px; color: inherit; transition: border-color .15s, box-shadow .15s; }
.c-linkcard:hover { color: inherit; border-color: var(--brand-200); box-shadow: var(--shadow-md); }
.c-linkcard:focus-visible { outline: none; box-shadow: var(--ring); }
.c-linkcard .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--purple-bg); color: var(--purple); display: grid; place-items: center; flex: none; }
.c-linkcard .tx { flex: 1; min-width: 0; }
.c-linkcard .tx .s { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.c-linkcard .go { color: var(--icon-muted); flex: none; }
@media (max-width: 640px) { .c-linkcard { padding: 13px 16px; } }

/* ---------- 證書 ---------- */
.warn-text { color: var(--amber); }
.days { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; font-size: 13px; line-height: 1.7; font-weight: 500; white-space: nowrap; background: var(--green-bg); color: var(--green); font-variant-numeric: tabular-nums; }
.days.warn { background: var(--amber-bg); color: var(--amber); }
.days.bad { background: var(--red-bg); color: var(--red); }

.cert-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
@media (max-width: 640px) { .cert-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.cert-mini { display: block; color: inherit; padding: 16px 18px; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.cert-mini:hover { color: inherit; border-color: var(--brand-200); box-shadow: var(--shadow-md); transform: translateY(-1px); }
a.cert-mini:focus-visible { outline: none; box-shadow: var(--ring); }
.cert-mini .h { display: flex; align-items: flex-start; gap: 12px; }
.cert-mini .h .ic, .cert-h .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--green-bg); color: var(--green); display: grid; place-items: center; flex: none; }
.cert-mini .h .t { flex: 1; min-width: 0; }
.cert-mini h3 { font-size: 16px; overflow-wrap: anywhere; }
.cert-mini .no { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.cert-mini dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 14.5px; }
.cert-mini dt { color: var(--muted); }
.cert-mini dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.cert { overflow: hidden; }
.cert-h { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px 16px; }
.cert-h .ic { width: 44px; height: 44px; border-radius: 13px; }
.cert-h .t { flex: 1; min-width: 0; }
.cert-h h2 { font-size: 20px; overflow-wrap: anywhere; margin-bottom: 3px; }
.cert-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.cert-info > div { padding: 12px 22px 14px; border-left: 1px solid var(--line-2); min-width: 0; }
.cert-info > div:first-child { border-left: 0; }
.cert-info .l, .cert-scope .l { font-size: 13.5px; color: var(--muted); }
.cert-info .v { font-size: 16.5px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.5; color: var(--ink); }
.cert-info .v.warn-text { color: var(--amber); }
.cert-info .v small { font-size: 13.5px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.cert-info .days { margin: 3px 0 0; }
.cert-scope { padding: 12px 22px 14px; border-top: 1px solid var(--line-2); font-size: 14.5px; color: var(--ink-2); }
.cert-b { padding: 18px 22px 20px; border-top: 1px solid var(--line-2); }
.cert-b .c-h4 { flex-wrap: wrap; margin-bottom: 14px; }
.cert-b .c-h4 .badge { font-weight: 500; }
.cert-b > p.small { font-size: 14px; }
@media (max-width: 640px) {
  .cert-h { padding: 16px 16px 14px; gap: 12px; }
  .cert-h h2 { font-size: 18px; }
  .cert-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cert-info > div { padding: 11px 16px 12px; border-top: 1px solid var(--line-2); }
  .cert-info > div:nth-child(-n+2) { border-top: 0; }
  .cert-info > div:nth-child(odd) { border-left: 0; }
  .cert-scope, .cert-b { padding-left: 16px; padding-right: 16px; }
}

/* 稽核時程：桌機橫向，手機（或項目多時）直向 */
.tl { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.tl li { position: relative; padding-right: 12px; min-width: 0; }
.tl li::before { content: ""; position: absolute; top: 11px; left: 24px; right: 0; height: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl li.st-done::before { background: var(--mint); }
/* 已完成的勾勾用卡片底色：淺色模式是白勾、深色模式是深色勾，在綠底上都看得清楚 */
.tl .dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; color: var(--card); flex: none; }
.tl .st-done .dot { background: var(--mint); border-color: var(--mint); }
.tl .st-sched .dot { border-color: var(--brand); box-shadow: inset 0 0 0 4px var(--surface); background: var(--brand); }
.tl .next .dot { box-shadow: 0 0 0 4px var(--brand-100); }
.tl .st-sched.next .dot { box-shadow: inset 0 0 0 4px var(--surface), 0 0 0 4px var(--brand-100); }
.tl .tb { margin-top: 10px; min-width: 0; }
.tl .tb b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.tl .tb .d { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.tl .tb .r { font-size: 13.5px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.tl .nx { display: inline-block; vertical-align: 1px; font-size: 12.5px; font-weight: 600; color: var(--brand); background: var(--brand-50); border-radius: 6px; padding: 0 6px; margin-left: 6px; line-height: 1.6; }
.tl.vert { grid-auto-flow: row; }
.tl.vert li { display: flex; gap: 12px; padding: 0 0 18px; }
.tl.vert li:last-child { padding-bottom: 0; }
.tl.vert li::before { top: 24px; bottom: 0; left: 11px; right: auto; width: 2px; height: auto; }
.tl.vert .tb { margin-top: 1px; }
@media (max-width: 720px) {
  .tl { grid-auto-flow: row; }
  .tl li { display: flex; gap: 12px; padding: 0 0 18px; }
  .tl li:last-child { padding-bottom: 0; }
  .tl li::before { top: 24px; bottom: 0; left: 11px; right: auto; width: 2px; height: auto; }
  .tl .tb { margin-top: 1px; }
}

/* 缺失表 */
.f-tbl .f-desc { min-width: 220px; max-width: 420px; line-height: 1.65; }
.f-tbl tr.closed td { color: var(--muted); }
.f-tbl .od { display: block; font-size: 13px; color: var(--red); font-weight: 500; }
@media (max-width: 640px) {
  .f-tbl tr { display: flex; flex-direction: column; }
  .f-tbl td.lead { order: -1; max-width: none; min-width: 0; font-weight: 500; }
}

/* ---------- 報價單列表 ---------- */
.q-list { overflow: hidden; }
.q-row { display: flex; align-items: center; gap: 14px; padding: 15px 20px; color: inherit; border-top: 1px solid var(--line-2); transition: background .12s; }
.q-row:first-child { border-top: 0; }
.q-row:hover { background: var(--hover); color: inherit; }
.q-row:focus-visible { outline: none; box-shadow: inset var(--ring); }
.q-row .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--gray-bg); color: var(--gray); display: grid; place-items: center; flex: none; }
.q-row .ic.open { background: var(--purple-bg); color: var(--purple); }
.q-row .ic.accepted { background: var(--green-bg); color: var(--green); }
.q-row .tx { flex: 1; min-width: 0; }
.q-row .tx b { display: block; overflow-wrap: anywhere; }
.q-row .tx .s { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.q-row .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; color: var(--ink); }
.q-row .amt small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.q-row .go { color: var(--icon-muted); flex: none; }
@media (max-width: 640px) {
  .q-row { flex-wrap: wrap; padding: 13px 16px; gap: 8px 12px; }
  .q-row .tx { flex-basis: calc(100% - 52px); }
  .q-row .amt { order: 3; margin-left: 50px; text-align: left; }
  .q-row .amt small { display: inline; margin-left: 4px; }
  .q-row .badge { order: 4; margin-left: auto; }
  .q-row .go { display: none; }
}

/* ---------- 請款：匯款資訊 ---------- */
.bank { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin: -8px 0 22px; border: 1px solid var(--line); background: var(--amber-bg); border-radius: 12px; }
.bank { border-color: color-mix(in srgb, var(--warn-fill) 40%, var(--line)); background: color-mix(in srgb, var(--warn-fill) 7%, var(--card)); }
.bank .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--amber-bg); color: var(--amber); }
.bank .tx { min-width: 0; flex: 1; }
.bank .tx b { display: block; margin-bottom: 2px; }
.bank .pre { font-variant-numeric: tabular-nums; line-height: 1.75; overflow-wrap: anywhere; }
.bank .small { margin-top: 6px; font-size: 13.5px; }
@media (max-width: 640px) { .bank { margin-top: -12px; padding: 12px 14px; } }

/* ---------- 沒有資料：說明文字下方的附註（例如聯絡方式） ---------- */
.empty .empty-note { margin: 0; max-width: 440px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.empty .empty-note a { font-weight: 500; }

/* ---------- 載入中的版面輪廓 ---------- */
.c-skel { display: flex; flex-direction: column; gap: 16px; animation: fade-in .25s ease .1s backwards; }
.c-skel .c-kpi { gap: 12px; }
.c-skel .c-kpi .skeleton + .skeleton { margin-top: 0; }
.c-skel-card { padding: 20px 22px; display: flex; flex-direction: column; }
.c-skel-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.c-skel-cols > div { display: flex; flex-direction: column; }
.c-skel-tabs { display: flex; gap: 18px; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.c-skel-tabs .skeleton { width: 72px; margin: 0 !important; }
@media (max-width: 640px) {
  .c-skel-card { padding: 16px; }
  .c-skel-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .c-skel-cols > div:first-child { grid-column: 1 / -1; }
  .c-skel-tabs { padding: 14px 16px; gap: 10px; flex-wrap: wrap; }
}

/* ---------- 手機底部頁籤 ---------- */
.c-tabbar { display: none; }
@media (max-width: 640px) {
  .c-shell { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .c-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex;
    padding: 0 6px env(safe-area-inset-bottom); background: var(--card);
    background: color-mix(in srgb, var(--card) 95%, transparent);
    backdrop-filter: saturate(1.4) blur(12px); border-top: 1px solid var(--line);
  }
  .c-tabbar a {
    flex: 1; min-width: 0; height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--muted); font-size: 12.5px; font-weight: 500; -webkit-tap-highlight-color: transparent;
  }
  .c-tabbar a.on { color: var(--brand); font-weight: 600; }
  .c-tabbar .ti { position: relative; display: grid; place-items: center; width: 46px; height: 28px; border-radius: 999px; transition: background .15s; }
  .c-tabbar a.on .ti { background: var(--brand-50); }
  .c-tabbar .nb { position: absolute; top: -3px; left: 28px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger-fill); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; line-height: 1; border: 2px solid var(--card); box-sizing: content-box; font-variant-numeric: tabular-nums; }
  /* 提示訊息放在底部頁籤上方 */
  body:has(.c-tabbar) #toast-box { bottom: calc(env(safe-area-inset-bottom) + 78px); }
}

/* ---------- 每週進度報告（v1.5）：專案頁的週報清單、週報頁的標題與前後週；週報內容本身的樣式在 /client/weekly-doc.css ---------- */
.wk { overflow: hidden; }
.wk-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 14px; }
.wk-h .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand); }
.wk-h .t { min-width: 0; }
.wk-h h2 { font-size: 18px; }
.wk-h p { margin: 2px 0 0; font-size: 14px; line-height: 1.7; color: var(--muted); }
/* 最新一份：整塊可以點 */
.wk-latest { display: block; margin: 0 22px 18px; padding: 14px 16px; border-radius: 14px; color: inherit;
  border: 1px solid var(--brand-100); background: color-mix(in srgb, var(--brand-50) 70%, var(--card)); transition: border-color .15s, box-shadow .15s; }
.wk-latest:hover { color: inherit; border-color: var(--brand-200); box-shadow: var(--shadow-md); }
.wk-latest:focus-visible { outline: none; box-shadow: var(--ring); }
.wk-l-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.wk-l-top b { font-size: 16.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.wk-tag { font-size: 12.5px; font-weight: 600; line-height: 1.75; padding: 0 9px; border-radius: 999px; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.wk-tag.wk-fresh { background: var(--brand-solid); border-color: var(--brand-solid); color: var(--on-brand); }
.wk-ex { margin: 8px 0 0; font-size: 14.5px; line-height: 1.75; color: var(--ink); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wk-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.wk-go { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: var(--brand); }
.wk-latest:hover .wk-go { color: var(--brand-600); }
/* 之前的週報 */
.wk-older { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.wk-older li + li { border-top: 1px solid var(--line-2); }
.wk-older a { display: flex; align-items: center; gap: 12px; padding: 12px 22px; color: inherit; transition: background .12s; }
.wk-older a:hover { background: var(--hover); color: inherit; }
.wk-older a:focus-visible { outline: none; box-shadow: inset var(--ring); }
.wk-older .t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.wk-older .t b { font-weight: 600; font-variant-numeric: tabular-nums; }
.wk-older .t small { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.wk-older a > svg { flex: none; color: var(--icon-muted); }
/* 總覽專案卡：最近分享的週報 */
.pj-wk .ic { background: var(--purple-bg); color: var(--purple); }
/* 總覽專案卡：「結案文件待簽收」提示（在整張卡的連結裡，自己可以點） */
.pj-sign { cursor: pointer; }
.pj-sign .ic { background: var(--amber-bg); color: var(--amber); }
.pj-sign .who { display: inline-flex; align-items: center; color: var(--brand); font-weight: 600; }
.pj-sign:hover .who, .pj-sign:focus-visible .who { text-decoration: underline; }
.pj-sign:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.pj-wk .wk-new { display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 999px; vertical-align: 1px;
  font-size: 12px; font-weight: 600; line-height: 1.7; background: var(--brand-solid); color: var(--on-brand); }

/* 週報頁 */
.wk-page { width: 100%; max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.wk-hero { padding: 20px 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.wk-hero .k { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--brand); }
.wk-hero h1 { font-size: 22px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wk-hero .pj-meta { margin-bottom: 6px; }
.wk-hero .pj-meta .with-av { gap: 6px; }
.wk-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wk-pager a { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: inherit; transition: border-color .15s, box-shadow .15s; }
.wk-pager a:hover { color: inherit; border-color: var(--brand-200); box-shadow: var(--shadow-md); }
.wk-pager a:focus-visible { outline: none; box-shadow: var(--ring); }
.wk-pager a.nx { grid-column: 2; justify-content: flex-end; text-align: right; }
.wk-pager a > svg { flex: none; color: var(--brand); }
.wk-pager span { min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.wk-pager small { font-size: 12.5px; color: var(--muted); }
.wk-pager b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wk-foot { margin: 0; text-align: center; }
@media (max-width: 640px) {
  .wk-h { padding: 16px 16px 12px; }
  .wk-latest { margin: 0 16px 16px; padding: 13px 14px; }
  .wk-older a { padding: 12px 16px; min-height: 52px; }
  .wk-hero { padding: 16px; }
  .wk-hero h1 { font-size: 19px; }
  .wk-hero .btn { width: 100%; min-height: 44px; }
  .wk-pager { grid-template-columns: minmax(0, 1fr); }
  .wk-pager a.nx { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .wk-latest, .wk-older a, .wk-pager a { transition: none; }
}

/* ---------- 大字模式（帳號設定 → 畫面與字體，只記在這台裝置）：整個專區等比例放大字與間距（同顧問專區的做法）
   簽名板本身不放大，手指和筆跡的位置才會對得準 ---------- */
html.fs-l { --c-zoom: 1.12; }
html.fs-xl { --c-zoom: 1.25; }
html.fs-l .c-shell, html.fs-xl .c-shell { zoom: var(--c-zoom); min-height: calc(100vh / var(--c-zoom)); }
html.fs-l .c-shell .sigpad, html.fs-xl .c-shell .sigpad { zoom: calc(1 / var(--c-zoom)); }
html.fs-l #toast-box, html.fs-xl #toast-box { zoom: var(--c-zoom); }
/* 特大：窄螢幕上兩欄排不下的改成一欄（標題在上、內容在下），外觀選項只留文字 */
@media (max-width: 640px) {
  html.fs-xl .c-kpis { grid-template-columns: minmax(0, 1fr); }
  html.fs-xl .pj-stats { grid-template-columns: minmax(0, 1fr); }
  html.fs-xl .pj-stats > div { border-left: 0 !important; }
  html.fs-xl .c-shell .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  html.fs-xl .c-shell .kv > dd { margin-bottom: 8px; }
  html.fs-xl .acct-look .seg svg { display: none; }
  html.fs-xl .c-tabbar a { font-size: 11.5px; }
}

/* ---------- 中文換行：說明列、標題只在標點與空白處換行（同 respond.css 的 .phr），不把「工作坊」「有效期限」拆成兩行 ---------- */
.pj-next .tx, .c-kpi .s, .todo .tx .s, .q-row .tx .s, .q-row .tx b, .dl-t, .c-linkcard .s, .c-sec .small,
.up-task, .tab-bar .tx, .c-page-h p, .cert-mini .no, .tl .tb .r, .empty > div, .empty-note, .wk-h p, .wk-older .t small {
  word-break: keep-all; overflow-wrap: anywhere;
}

/* ---------- 使用者設定「減少動態效果」 ---------- */
@media (prefers-reduced-motion: reduce) {
  .c-loading, .c-skel { animation: none; }
  .spinner { animation-duration: 1.6s; }
  .pj, .cert-mini, .c-linkcard, .q-row, .ring circle.fg { transition: none; }
  a.pj:hover, a.cert-mini:hover { transform: none; }
}

/* 資料提供（v1.13，requests-view.js）：顧問請貴公司提供的資料 */
.rq-h { font-size: 15px; margin: 14px 0 0; }
.rq-list > li > .badge { white-space: nowrap; }
.dl-ic.red { background: var(--red-bg); color: var(--red); }
.rq-desc { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; line-height: 1.65; }
.rq-late { color: var(--red); }
.rq-back { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--red-bg); color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.rq-back svg { color: var(--red); margin-top: 3px; flex: none; }
.rq-list .file-drop { margin-top: 10px; }
.rq-reply { display: grid; gap: 4px; margin-top: 10px; }
.rq-reply textarea.input { min-height: 64px; }
.rq-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.rq-del { margin-left: auto; padding: 4px 6px; color: var(--muted); }
.rq-more { margin-top: 12px; }
