/* 清爽總覽（modes/clean.mjs）：暖白紙面、白卡片、圓角、淡陰影；無襯線字。
   顏色分兩組：資料色（琥珀＝ATLAS、青藍＝USDC）只用在金額與長條；狀態色（綠／靛／紫紅／紅／灰）只用在撥款狀態，一律配文字或形狀。
   閒置時不動：只有 hover、展開與換月有短過場，body[data-motion="off"] 時全部拿掉。 */

.mode-clean {
  --cl-bg: #F5F3EE;
  --cl-card: #FFFFFF;
  --cl-line: #E9E4DA;
  --cl-soft: #FAF8F4;
  --cl-soft-line: #EFEAE1;
  --cl-ink: #1F1B16;
  --cl-ink2: #554D43;
  --cl-ink3: #6A6258;
  --cl-dash: #ADA393;
  --cl-focus: #2457C5;
  --cl-link: #1F4FB4;
  --cl-shadow: 0 1px 2px rgba(64, 48, 24, .05), 0 8px 22px -12px rgba(64, 48, 24, .18);
  /* 資料色：條的填色（圖形對比 ≥ 3:1）、深色（流出）、文字色（≥ 4.5:1）、淡底 */
  --cl-atlas-bar: #D4840A;
  --cl-atlas-out: #8E5200;
  --cl-atlas-ink: #8A5000;
  --cl-atlas-soft: #FDF1DC;
  --cl-usdc-bar: #1E95B5;
  --cl-usdc-out: #0D5F77;
  --cl-usdc-ink: #0B5C73;
  --cl-usdc-soft: #E0F2F7;
  /* 狀態色 */
  --cl-ok: #1D7349; --cl-ok-soft: #E3F3EA;
  --cl-act: #3B44B8; --cl-act-soft: #E9EAFB;
  --cl-rec: #8F2A76; --cl-rec-soft: #F8E7F3;
  --cl-bad: #AF2A22; --cl-bad-soft: #FBE8E6;
  --cl-wd: #66615A; --cl-wd-soft: #EFEDE9;
  --cl-unrep: #625A50;
  background: var(--cl-bg);
  color: var(--cl-ink);
  color-scheme: light;
  font: 400 15.5px/1.5 ui-sans-serif, system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Hiragino Sans", "Microsoft JhengHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.mode-clean :focus-visible { outline: 3px solid var(--cl-focus); outline-offset: 2px; }
.mode-clean .num, .mode-clean .cl-big, .mode-clean .ev { font-variant-numeric: tabular-nums; }
.mode-clean h2, .mode-clean h3, .mode-clean h4, .mode-clean h5 { font-family: inherit; }
.cl-wrap { max-width: 1200px; margin: 0 auto; padding: 22px 24px 64px; display: grid; gap: 18px; }

/* ── 證據按鈕與「未回報」：重設成這一頁的樣子（虛線底線＝可以點）── */
.mode-clean .ev.hit {
  display: inline-block; margin: 0; padding: 0 1px; border: 0; border-radius: 3px 3px 0 0; background: none;
  border-bottom: 2px dashed color-mix(in srgb, currentColor 40%, transparent);
  font: inherit; font-weight: 800; color: inherit; line-height: inherit; text-align: left; white-space: nowrap; cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.mode-clean .ev.hit:hover { background: color-mix(in srgb, currentColor 10%, transparent); border-bottom-color: currentColor; filter: none; }
.mode-clean .ev.hit:focus-visible { outline: 3px solid var(--cl-focus); outline-offset: 2px; border-bottom-color: currentColor; }
.mode-clean .ev.hit.cl-none-ev { font-size: 14px; font-weight: 700; color: var(--cl-ink3); white-space: normal; line-height: 1.35; }
.mode-clean .ev.hit.cl-warn { color: var(--cl-rec); }
.mode-clean .socket {
  display: inline-block; padding: 0 7px; border-radius: 6px; background: transparent; box-shadow: none;
  border: 1.5px dashed var(--cl-dash); color: var(--cl-unrep); font-size: 14px; font-weight: 700; line-height: 1.6; white-space: nowrap;
}

/* ── 1. 標題與資料時間 ── */
.cl-head { display: grid; gap: 10px; }
.cl-title { margin: 0; font-size: 27px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; color: var(--cl-ink); }
.cl-stamp { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 14px; line-height: 1.4; color: var(--cl-ink2); }
.cl-stamp-i { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 14px; background: #fff; border: 1px solid var(--cl-line); min-width: 0; }
.cl-stamp-i.is-time { color: var(--cl-ink); font-weight: 700; }
.cl-stamp-i.is-time::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cl-ok); box-shadow: 0 0 0 3px var(--cl-ok-soft); }
.cl-stamp-i.is-hint { background: transparent; border-style: dashed; border-color: #D5CDBF; }
.cl-stamp-i.is-time.is-stale { color: #8A2A12; border-color: #E2A48C; background: #FFF4EE; }
.cl-stamp-i.is-time.is-stale::before { background: #C2410C; box-shadow: 0 0 0 3px rgba(194, 65, 12, .18); }
.cl-stamp-i.is-open { font: inherit; font-weight: 700; color: #7A4210; background: #FFF7EC; border-color: #E9C9A0; cursor: pointer; }
.cl-stamp-i.is-open:hover { background: #FFEFD9; }
.cl-stamp-i.is-open:focus-visible { outline: 2px solid #7A4210; outline-offset: 2px; }

/* ── 2. 指標卡 ── */
.cl-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.cl-kpi {
  container-type: inline-size; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 15px;
  background: var(--cl-card); border: 1px solid var(--cl-line); border-radius: 12px; box-shadow: var(--cl-shadow);
}
.cl-kpi-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; min-width: 0; }
.cl-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; background: #F4EEE3; color: #6A5536; }
.k-treasury .cl-ico, .k-fund .cl-ico { background: var(--cl-atlas-soft); color: var(--cl-atlas-ink); }
.k-run .cl-ico { background: var(--cl-usdc-soft); color: var(--cl-usdc-ink); }
.cl-kpi-label { margin: 0; font-size: 15px; font-weight: 750; line-height: 1.25; color: var(--cl-ink2); min-width: 0; }
.cl-kpi-when { margin: -2px 0 0; font-size: 14px; font-weight: 750; color: var(--cl-ink); }
.cl-amt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.mode-clean .cl-big, .mode-clean .ev.hit.cl-big { font-size: clamp(20px, 1.75vw, 26px); font-weight: 800; line-height: 1.18; letter-spacing: -.012em; }
.cl-plus { font-size: 15px; font-weight: 700; color: var(--cl-ink3); }
.cl-after { font-size: 14px; font-weight: 700; color: var(--cl-ink3); }
.cl-kpi-basis { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 14px; color: var(--cl-ink2); }
.cl-kpi-basis .cl-after { margin-right: 6px; }
.cl-kpi-basis .ev { color: var(--cl-usdc-ink); }
.cl-kpi-foot { margin: auto 0 0; padding-top: 6px; font-size: 13.5px; line-height: 1.45; color: var(--cl-ink3); }
.cl-kpi-foot .cl-link { min-height: 26px; font-size: 13.5px; }
.cl-kpi-alt { margin: 0; padding: 4px 9px; border-radius: 8px; background: #F4F1EB; font-size: 13.5px; font-weight: 650; line-height: 1.4; color: var(--cl-ink2); }
.cl-ink-atlas { color: var(--cl-atlas-ink); }
.cl-ink-usdc { color: var(--cl-usdc-ink); }
.cl-ink-gbp, .cl-ink-eur { color: var(--cl-ink); }
.cl-none { font-size: 14px; font-weight: 700; color: var(--cl-ink3); }
/* 5% 上限：兩個數字並列，各帶出處；卡片窄（德文「13,99 Mio.」）就上下排。 */
.cl-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cl-pair-i { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 8px 10px; border-radius: 9px; background: var(--cl-atlas-soft); color: var(--cl-atlas-ink); }
.mode-clean .cl-pair .ev.hit.cl-big { font-size: clamp(19px, 1.55vw, 23px); }
.cl-src { display: grid; gap: 1px; font-size: 13px; font-weight: 750; line-height: 1.3; color: var(--cl-ink2); }
.cl-src-how { font-size: 12.5px; font-weight: 600; color: var(--cl-ink3); }
@container (max-width: 250px) {
  .cl-pair { grid-template-columns: 1fr; gap: 6px; }
  .cl-pair-i { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 8px; padding: 6px 9px; }
}

/* 資產小牌：一顆錢幣色的點＋代號 */
.cl-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; border-radius: 999px; border: 1px solid;
  font-size: 12.5px; font-weight: 800; letter-spacing: .02em; line-height: 1.35; white-space: nowrap; flex: none;
}
.cl-tag::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cl-tag.cl-atlas { color: var(--cl-atlas-ink); background: var(--cl-atlas-soft); border-color: #F0D29E; }
.cl-tag.cl-atlas::before { background: var(--cl-atlas-bar); }
.cl-tag.cl-usdc { color: var(--cl-usdc-ink); background: var(--cl-usdc-soft); border-color: #A9D8E6; }
.cl-tag.cl-usdc::before { background: var(--cl-usdc-bar); }
.cl-tag.cl-gbp, .cl-tag.cl-eur { color: #4B453D; background: #F1EEE8; border-color: #DCD5C8; }
.cl-tag.cl-gbp::before, .cl-tag.cl-eur::before { background: #8D8577; }

/* ── 卡片共用 ── */
.cl-card { min-width: 0; padding: 18px 20px 20px; background: var(--cl-card); border: 1px solid var(--cl-line); border-radius: 12px; box-shadow: var(--cl-shadow); scroll-margin-top: 12px; }
.cl-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.cl-card-txt { flex: 1 1 380px; min-width: 0; }
.cl-card-title { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.25; }
.cl-sub { margin: 4px 0 0; max-width: 78ch; font-size: 14.5px; line-height: 1.5; color: var(--cl-ink2); }
.cl-link {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; min-height: 32px; padding: 0 2px; cursor: pointer;
  color: var(--cl-link); font-size: 14.5px; font-weight: 750; line-height: 1.3; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.cl-link:hover { text-decoration-thickness: 2.5px; }
.cl-link:focus-visible { outline: 3px solid var(--cl-focus); outline-offset: 2px; border-radius: 4px; }

/* ── 3. 每月進出 ── */
.cl-flows.asset-atlas { --in: var(--cl-atlas-bar); --out: var(--cl-atlas-out); }
.cl-flows.asset-usdc { --in: var(--cl-usdc-bar); --out: var(--cl-usdc-out); }
.cl-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: #F0ECE4; }
.cl-seg-btn {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 13px; border-radius: 8px; cursor: pointer;
  font-size: 14.5px; font-weight: 750; color: var(--cl-ink2); white-space: nowrap; transition: background-color .12s, box-shadow .12s;
}
.cl-seg-btn:hover { color: var(--cl-ink); }
.cl-seg-btn[aria-pressed="true"] { background: #fff; color: var(--cl-ink); box-shadow: 0 1px 2px rgba(50, 40, 20, .14), 0 0 0 1px rgba(50, 40, 20, .06); }
.cl-seg-btn:focus-visible { outline: 3px solid var(--cl-focus); outline-offset: 1px; }
.cl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cl-dot.cl-atlas { background: var(--cl-atlas-bar); }
.cl-dot.cl-usdc { background: var(--cl-usdc-bar); }
.cl-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 14px 0 2px; font-size: 13.5px; line-height: 1.4; color: var(--cl-ink2); }
.cl-key { display: inline-flex; align-items: center; gap: 7px; }
.cl-sw { width: 14px; height: 12px; border-radius: 3px; flex: none; }
.cl-sw.in { background: var(--in); }
.cl-sw.out { background: var(--out); }
.cl-sw.hatch { background: repeating-linear-gradient(135deg, #C2B8A8 0 2px, #F4F1EB 2px 5px); box-shadow: inset 0 0 0 1px #CFC6B7; }
.cl-plot { margin-top: 8px; min-height: 236px; }
.cl-svg { display: block; max-width: 100%; border-radius: 8px; }
.cl-svg:focus-visible { outline: 3px solid var(--cl-focus); outline-offset: 3px; }
.cl-grid { stroke: #EEEAE2; stroke-width: 1; }
.cl-yr { stroke: #E0D9CC; stroke-width: 1; stroke-dasharray: 3 3; }
.cl-base { stroke: #8F8577; stroke-width: 1.2; }
.cl-ax { font-size: 12.5px; fill: #6A6258; }
.cl-in { fill: var(--in); }
.cl-out { fill: var(--out); }
.cl-in.sel, .cl-out.sel { stroke: var(--cl-ink); stroke-width: 1.6; }
.cl-selcol { fill: rgba(31, 27, 22, .075); }
.cl-hatch-bg { fill: #F4F1EB; }
.cl-hatch-line { stroke: #CBC1B1; stroke-width: 2; }
.cl-nopub { stroke: #B3A999; stroke-width: 1; stroke-dasharray: 2 2; }
.cl-note-bg { fill: #fff; stroke: #E0D9CC; }
.cl-note-t { font-size: 13px; font-weight: 700; fill: #554D43; }
.cl-hit { fill: transparent; cursor: pointer; }
.cl-hit:hover { fill: rgba(31, 27, 22, .045); }

/* 圖下的月份明細 */
.cl-md { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--cl-line); }
.cl-md-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cl-md-title { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.25; }
.cl-md-nav { display: flex; gap: 6px; flex: none; }
.cl-navbtn { width: 40px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 1px solid #DDD6CA; background: #fff; color: var(--cl-ink); font: 700 21px/1 ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.cl-navbtn:hover:not(:disabled) { border-color: #B9AF9F; background: var(--cl-soft); }
.cl-navbtn:disabled { opacity: .35; cursor: default; }
.cl-md-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.cl-md-box { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 10px 12px 11px; border-radius: 10px; background: var(--cl-soft); border: 1px solid var(--cl-soft-line); }
.cl-md-label { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 800; line-height: 1.3; color: var(--cl-ink2); }
.cl-md-label::before { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; font-size: 13px; font-weight: 900; }
.cl-md-box.is-in .cl-md-label::before { content: '↑'; background: #E6F1E9; color: var(--cl-ok); }
.cl-md-box.is-out .cl-md-label::before { content: '↓'; background: #F6E9DD; color: #8A4A12; }
.cl-md-box.is-int .cl-md-label::before { content: '⇄'; background: #ECE9E3; color: var(--cl-ink2); }
.cl-md-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: 17px; font-weight: 800; line-height: 1.35; }
.cl-md-note { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--cl-ink3); }
.cl-md-empty { margin: 14px 0 0; padding: 10px 12px; border-radius: 9px; border: 1.5px dashed #D9D1C3; font-size: 14.5px; color: var(--cl-ink2); }
.cl-md-sub, .cl-psec-title { margin: 16px 0 6px; font-size: 14.5px; font-weight: 800; color: var(--cl-ink); }
.cl-psec-title { margin-top: 0; }

/* 轉帳列：日期｜金額｜（路徑＋依據、說明） */
.cl-txlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: auto auto minmax(0, 1fr); column-gap: 16px; border-top: 1px solid var(--cl-soft-line); }
.cl-tx { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: 3px; align-items: baseline; padding: 8px 2px; border-bottom: 1px solid var(--cl-soft-line); font-size: 14.5px; }
.cl-tx-date { grid-row: span 2; font-weight: 700; color: var(--cl-ink2); white-space: nowrap; }
.cl-tx-amt { grid-row: span 2; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; font-size: 15.5px; }
.cl-tx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.cl-tx-route { font-size: 13.5px; font-weight: 700; color: var(--cl-ink2); }
.cl-tx-desc { grid-column: 3; min-width: 0; font-size: 13.5px; line-height: 1.45; color: var(--cl-ink2); overflow-wrap: anywhere; }
.cl-chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 800; line-height: 1.45; border: 1px solid transparent; }
.cl-basis-ok { background: var(--cl-ok-soft); color: var(--cl-ok); border-color: #B9DEC8; }
.cl-basis-maybe { background: #F3E9FA; color: #6E3592; border-color: #D9C2EA; border-style: dashed; }
.cl-basis-plain { background: #F1EEE8; color: #554D43; border-color: #DCD5C8; }
.cl-basis-muted { background: transparent; color: var(--cl-ink3); border-color: #DCD5C8; }

/* ── 4. 撥款清單 ── */
.cl-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 16px; }
.cl-filters { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.cl-fbtn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 8px 0 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid #DDD6CA; background: #fff; color: var(--cl-ink); font-family: inherit; font-size: 14.5px; font-weight: 750; line-height: 1.2; white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.cl-fbtn::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--fdot, transparent); }
.cl-fbtn.f-all::before { display: none; }
.cl-fbtn.f-active { --fdot: var(--cl-act); }
.cl-fbtn.f-done { --fdot: var(--cl-ok); }
.cl-fbtn.f-unrep { --fdot: transparent; }
.cl-fbtn.f-unrep::before { border: 1.5px dashed var(--cl-unrep); width: 6px; height: 6px; }
.cl-fbtn.f-ended { --fdot: var(--cl-bad); }
.cl-fbtn:hover { border-color: #B9AF9F; }
.cl-fbtn[aria-pressed="true"] { background: var(--cl-ink); border-color: var(--cl-ink); color: #fff; }
.cl-fbtn[aria-pressed="true"].f-unrep::before { border-color: #fff; }
.cl-fcount { min-width: 24px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 11px; background: #F1EDE5; color: var(--cl-ink2); font-size: 13px; font-weight: 800; }
.cl-fbtn[aria-pressed="true"] .cl-fcount { background: rgba(255, 255, 255, .2); color: #fff; }
.cl-search { position: relative; flex: 0 1 300px; min-width: min(100%, 220px); }
.cl-search-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); display: grid; color: var(--cl-ink3); pointer-events: none; }
.cl-search-in {
  width: 100%; min-height: 40px; padding: 0 12px 0 38px; border-radius: 10px; border: 1px solid #D6CFC2; background: #fff;
  color: var(--cl-ink); font: inherit; font-size: 15px;
}
.cl-search-in::placeholder { color: #857D71; }
.cl-search-in:focus-visible { outline: 3px solid var(--cl-focus); outline-offset: 1px; }
.cl-count { margin: 12px 0 6px; font-size: 13.5px; color: var(--cl-ink3); }
.cl-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px; padding: 14px 16px; border-radius: 10px; border: 1.5px dashed #D9D1C3; color: var(--cl-ink2); }
.cl-empty[hidden] { display: none; }
.cl-empty p { margin: 0; }

.cl-plist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--cl-line); }
.cl-prow { border-bottom: 1px solid var(--cl-line); }
.cl-prow[hidden] { display: none; }
/* 狀態色：一列帶一組變數，進度格、狀態牌、說明框都讀它。 */
.st-complete { --st: var(--cl-ok); --st-soft: var(--cl-ok-soft); }
.st-in-progress { --st: var(--cl-act); --st-soft: var(--cl-act-soft); }
.st-reconcile { --st: var(--cl-rec); --st-soft: var(--cl-rec-soft); }
.st-attention { --st: var(--cl-bad); --st-soft: var(--cl-bad-soft); }
.st-withdrawn { --st: var(--cl-wd); --st-soft: var(--cl-wd-soft); }
.st-unreported { --st: var(--cl-unrep); --st-soft: #F3F0EA; }
.cl-ptoggle {
  all: unset; box-sizing: border-box; width: 100%; cursor: pointer;
  display: grid; grid-template-columns: 4.8em minmax(0, 1fr) 150px minmax(0, 1.15fr) 10.5em 16px; grid-template-areas: "id title prog nums state chev";
  align-items: center; gap: 6px 16px; padding: 14px 10px; border-radius: 10px; transition: background-color .12s;
}
.cl-ptoggle:hover { background: #FBF9F5; }
.cl-ptoggle:focus-visible { outline: 3px solid var(--cl-focus); outline-offset: -3px; }
.cl-prow.open .cl-ptoggle { background: var(--cl-soft); }
.cl-pid { grid-area: id; font-size: 15px; font-weight: 800; color: var(--cl-ink); white-space: nowrap; }
.cl-ptitle { grid-area: title; min-width: 0; font-size: 15.5px; font-weight: 650; line-height: 1.38; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-prog { grid-area: prog; display: grid; gap: 5px; min-width: 0; }
.cl-bar { display: flex; gap: 3px; height: 11px; }
.cl-ms { flex: 1; border-radius: 3px; background: #E9E3D8; }
.cl-ms.is-done { background: var(--st); }
.cl-ms.is-unrep { background: transparent; border: 1.5px dashed var(--cl-dash); }
.cl-bar.is-unrep { border: 1.5px dashed var(--cl-dash); border-radius: 4px; }
.cl-bar.is-na { border: 1.5px dotted #CFC8BC; border-radius: 4px; }
.cl-prog-cap { font-size: 13px; line-height: 1.3; color: var(--cl-ink3); }
.cl-pnums { grid-area: nums; display: grid; gap: 3px; min-width: 0; }
.cl-pn { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; }
.cl-pn-main .cl-v b { font-size: 17.5px; }
.cl-pn-sub { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 14.5px; }
.cl-k { font-size: 13px; font-weight: 750; color: var(--cl-ink3); }
.cl-v { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.cl-v b { font-weight: 800; }
.cl-unit { font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.cl-sep { color: #B6AD9F; }
.cl-unrep { padding: 0 6px; border-radius: 5px; border: 1.5px dashed var(--cl-dash); font-size: 13px; font-weight: 750; line-height: 1.5; color: var(--cl-unrep); }
.cl-na { font-size: 13.5px; font-style: italic; color: var(--cl-ink3); }
.cl-warn { font-size: 13.5px; font-weight: 800; color: var(--cl-rec); }
.cl-state {
  grid-area: state; justify-self: start; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px 3px 4px; border-radius: 999px;
  background: var(--st-soft); color: var(--st); font-size: 13.5px; font-weight: 800; line-height: 1.25;
}
.cl-state-mark { flex: none; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--st); color: #fff; font-size: 11px; font-weight: 900; line-height: 1; }
.cl-state.st-unreported { background: transparent; box-shadow: inset 0 0 0 1.5px var(--cl-dash); padding-left: 5px; }
.cl-state.st-unreported .cl-state-mark { background: transparent; color: var(--cl-unrep); border: 1.5px dashed var(--cl-unrep); width: 17px; height: 17px; }
.cl-chev { grid-area: chev; font-size: 14px; color: var(--cl-ink3); transition: transform .18s; }
.cl-prow.open .cl-chev { transform: rotate(180deg); }
/* 撤回的 PIP-31：整列灰掉（字仍夠深可讀），金額不帶資料色 */
.cl-prow.st-withdrawn { --cl-ink: #6F6960; --cl-atlas-ink: #6F6960; --cl-usdc-ink: #6F6960; }
.cl-prow.st-withdrawn .cl-ptitle { text-decoration: line-through; text-decoration-color: rgba(111, 105, 96, .55); text-decoration-thickness: 1.5px; }
.cl-prow.st-withdrawn .cl-ptoggle { background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(111, 105, 96, .045) 10px 20px); }

/* 展開的細節 */
.cl-pdetail { display: grid; gap: 14px; padding: 6px 10px 20px calc(4.8em + 26px); }
.cl-pdetail[hidden] { display: none; }
.cl-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 8px; }
.cl-fact { min-width: 0; padding: 9px 12px; border-radius: 9px; background: var(--cl-soft); border: 1px solid var(--cl-soft-line); }
.cl-fact dt { font-size: 13px; font-weight: 750; color: var(--cl-ink3); }
.cl-fact dd { margin: 3px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 16px; font-weight: 800; line-height: 1.35; min-width: 0; }
.cl-fact dd > span { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.cl-fact dd > .cl-fact-sub { flex-basis: 100%; font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--cl-ink2); }
.cl-state-text { font-size: 14.5px; font-weight: 800; color: var(--st); }
.cl-pnote { margin: 0; padding: 10px 14px; border-radius: 9px; border-left: 4px solid var(--st); background: var(--st-soft); color: var(--cl-ink); font-size: 14.5px; line-height: 1.5; }
.cl-psec { min-width: 0; }
.cl-quote { margin: 0 0 6px; padding: 8px 12px; border-left: 3px solid #E2DACB; border-radius: 0 8px 8px 0; background: #FCFBF8; font-size: 14.5px; line-height: 1.5; color: var(--cl-ink2); overflow-wrap: anywhere; }
.cl-dim { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--cl-ink3); }
.cl-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-acts .cl-link { min-height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid #CBD6EE; background: #F1F5FD; text-decoration: none; }
.cl-acts .cl-link:hover { background: #E6EDFB; }

/* ── 5. 各屆 Council ── */
.cl-council {
  display: grid; grid-template-columns: minmax(170px, auto) minmax(0, 1fr) auto; grid-template-areas: "head terms link"; align-items: center; gap: 12px 22px;
  padding: 14px 18px; background: var(--cl-card); border: 1px solid var(--cl-line); border-radius: 12px; box-shadow: var(--cl-shadow);
}
.cl-council-head { grid-area: head; display: grid; gap: 2px; min-width: 0; }
.cl-council-title { margin: 0; font-size: 17px; font-weight: 800; }
.cl-council-head .cl-dim { max-width: 26ch; }
.cl-terms { grid-area: terms; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cl-term { display: grid; gap: 5px; min-width: 0; padding: 9px 12px 10px; border-radius: 10px; background: var(--cl-soft); border: 1px solid var(--cl-soft-line); }
.cl-term-name { font-size: 14.5px; font-weight: 800; line-height: 1.25; }
.cl-term-stats { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.cl-term-stat { display: inline-flex; align-items: baseline; gap: 6px; font-size: 17px; }
.cl-term-stat b { font-weight: 800; }
.cl-term-bar { display: flex; gap: 2px; height: 6px; }
.cl-term-bar i { flex: 1; border-radius: 2px; background: #E2DCD1; }
.cl-term-bar i.on { background: var(--cl-ok); }
.cl-council-link { grid-area: link; white-space: nowrap; }

/* ── 平板 ── */
body[data-mode="tab"] .cl-wrap { padding: 18px 16px 56px; gap: 16px; }
body[data-mode="tab"] .cl-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
body[data-mode="tab"] .cl-kpi { grid-column: span 2; }
body[data-mode="tab"] .cl-kpi.k-cap, body[data-mode="tab"] .cl-kpi.k-run { grid-column: span 3; }
body[data-mode="tab"] .cl-md-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-mode="tab"] .cl-ptoggle { grid-template-columns: 4.8em 150px minmax(0, 1fr) auto 16px; grid-template-areas: "id title title state chev" ". prog nums nums nums"; row-gap: 10px; }
body[data-mode="tab"] .cl-council { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head link" "terms terms"; }
body[data-mode="tab"] .cl-council-head .cl-dim { max-width: none; }

/* ── 手機 ── */
body[data-mode="phone"] .cl-wrap { padding: 14px 16px 48px; gap: 14px; }
body[data-mode="phone"] .cl-title { font-size: 22px; }
body[data-mode="phone"] .cl-stamp { font-size: 13.5px; }
body[data-mode="phone"] .cl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body[data-mode="phone"] .cl-kpi { padding: 12px 12px 13px; }
body[data-mode="phone"] .cl-kpi.k-run { grid-column: span 2; }
body[data-mode="phone"] .cl-kpi-head { gap: 8px; }
body[data-mode="phone"] .cl-ico { width: 28px; height: 28px; border-radius: 8px; }
body[data-mode="phone"] .cl-kpi-label { font-size: 14px; }
body[data-mode="phone"] .cl-card { padding: 14px 14px 16px; }
body[data-mode="phone"] .cl-card-title { font-size: 18px; }
body[data-mode="phone"] .cl-controls { width: 100%; }
body[data-mode="phone"] .cl-md-grid { grid-template-columns: 1fr; }
body[data-mode="phone"] .cl-md-box { grid-template-columns: minmax(0, 1fr); }
body[data-mode="phone"] .cl-txlist { grid-template-columns: auto minmax(0, 1fr); }
body[data-mode="phone"] .cl-tx-date, body[data-mode="phone"] .cl-tx-amt { grid-row: auto; }
body[data-mode="phone"] .cl-tx-meta, body[data-mode="phone"] .cl-tx-desc { grid-column: 1 / -1; }
body[data-mode="phone"] .cl-search { flex: 1 1 100%; }
body[data-mode="phone"] .cl-ptoggle { grid-template-columns: auto minmax(0, 1fr) auto 14px; grid-template-areas: "id . state chev" "title title title title" "prog prog prog prog" "nums nums nums nums"; gap: 7px 10px; padding: 12px 4px; }
body[data-mode="phone"] .cl-prog { grid-template-columns: minmax(80px, 140px) minmax(0, 1fr); align-items: center; column-gap: 10px; }
body[data-mode="phone"] .cl-pdetail { padding: 2px 4px 18px; }
body[data-mode="phone"] .cl-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-mode="phone"] .cl-council { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "terms" "link"; padding: 14px; }
body[data-mode="phone"] .cl-terms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-mode="phone"] .cl-council-head .cl-dim { max-width: none; }

/* 動態關閉：不留任何過場 */
body[data-motion="off"] .mode-clean *, body[data-motion="off"] .mode-clean *::before { transition: none !important; animation: none !important; }

/* ── 刊頭：淺色版（只換配色，不動高度與排版）── */
body[data-view="clean"] .ld-mast { background: #FFFDF9; border-bottom: 1px solid #E4DDD0; box-shadow: 0 6px 18px -10px rgba(64, 48, 24, .22); }
body[data-view="clean"] .mast-title, body[data-view="clean"] .mast-sa { color: #1F1B16; }
body[data-view="clean"] .mast-db { color: #9A5A00; }
body[data-view="clean"] .mast-sub { color: #5D564C; }
body[data-view="clean"] .mast-btn { color: #2B2620; background: #FFFFFF; border-color: #D6CEC0; box-shadow: 0 1px 2px rgba(50, 40, 20, .06); }
body[data-view="clean"] .mast-btn:hover { border-color: #B08A4C; background: #FBF8F2; }
body[data-view="clean"] .mast-tables { color: #5A3600; background: #FFF3DC; border-color: #E5BC72; }
body[data-view="clean"] .mast-tables:hover { background: #FDEBCB; }
body[data-view="clean"] .mast-modes { color: #0B4F61; background: #E5F3F7; border-color: #93CADA; }
body[data-view="clean"] .mast-modes:hover { background: #D8EDF3; border-color: #5FAFC6; }
body[data-view="clean"] .mast-select {
  color: #2B2620; border-color: #D6CEC0;
  background-image: linear-gradient(45deg, transparent 50%, #6A5D4C 50%), linear-gradient(135deg, #6A5D4C 50%, transparent 50%), linear-gradient(180deg, #FFFFFF, #FFFFFF);
}
body[data-view="clean"] .ld-mast :focus-visible { outline-color: var(--cl-focus, #2457C5); }

/* 金庫卡：多簽鑰匙；基金卡：餘額小階梯線 */
.cl-sig { display: inline-flex; align-items: center; gap: 9px; }
.cl-sig-keys { display: inline-flex; gap: 3px; }
.cl-sig-keys i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #B9AF9F; background: #fff; }
.cl-sig-keys i.on { border-color: var(--cl-atlas-ink); background: var(--cl-atlas-bar); }
.cl-spark { display: grid; gap: 3px; margin-top: 4px; }
.cl-spark-svg { display: block; width: 100%; height: 46px; }
.cl-spark-line { fill: none; stroke: var(--cl-atlas-ink); stroke-width: 2; stroke-linejoin: round; }
.cl-spark-area { fill: var(--cl-atlas-soft); }
.cl-spark-cap { font-size: 12.5px; font-weight: 650; color: var(--cl-ink3); line-height: 1.35; }

/* 中文：短的日期行不要從中間折（「2027年2」／「月」），只在空格與標點換行；放不下時才硬折。長段落照常折。 */
html:lang(zh) .cl-kpi-alt, html:lang(zh) .cl-src-how, html:lang(zh) .cl-stamp-i { word-break: keep-all; overflow-wrap: anywhere; }

/* 三方比對：核准 → 驗收 → 付款，三格並排（手機改直排）。狀態用邊框色＋文字，不靠顏色單獨表達。 */
.cl-3way { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cl-3w { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 9px 12px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--cl-line); border-top-width: 3px; min-width: 0; }
.cl-3w.is-ok { border-top-color: var(--cl-ok); }
.cl-3w.is-warn { border-top-color: #C97D3D; }
.cl-3w.is-bad { border-top-color: #B4232C; background: #FFF6F5; }
.cl-3w.is-muted { border-top-color: #C9C2B6; }
.cl-3w-n { position: absolute; top: 8px; right: 10px; font-size: 12px; font-weight: 800; color: var(--cl-ink2); }
.cl-3w-k { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: var(--cl-ink2); }
.cl-3w-v { font-size: 14.5px; line-height: 1.35; color: var(--cl-ink); overflow-wrap: anywhere; }
.cl-3w.is-bad .cl-3w-v { color: #8E1B22; }
.cl-3w-sub { font-size: 13px; line-height: 1.4; color: var(--cl-ink2); overflow-wrap: anywhere; }
.cl-3w-reg { margin-top: 8px; }
body[data-mode="phone"] .cl-3way { grid-template-columns: 1fr; }

/* 月結表：期初＋入帳－轉出＝期末，三個帳戶各一列。 */
.cl-md-roll { margin-top: 14px; }
.cl-roll-wrap { overflow-x: auto; }
.cl-roll { width: 100%; border-collapse: collapse; font-size: 14px; }
.cl-roll th, .cl-roll td { padding: 6px 10px; border-bottom: 1px solid var(--cl-line); text-align: right; white-space: nowrap; }
.cl-roll thead th { font-size: 12.5px; font-weight: 700; color: var(--cl-ink2); }
.cl-roll thead th:first-child, .cl-roll .cl-roll-name { text-align: left; }
.cl-roll-name { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--cl-ink); }
.cl-roll td[colspan] { text-align: left; color: var(--cl-ink2); }
body[data-mode="phone"] .cl-roll { font-size: 13px; }
