/* 帳簿清單（book.mjs）：深胡桃木桌上攤開一本老式總帳簿。
   桌面、皮面、紙張全用 CSS 漸層；印刷的格線與欄名用文具藍、邊線用紅；記帳的數字用墨色（ATLAS 藍黑、USDC 綠、英鎊歐元赭）。
   版面由容器寬決定：≥1280 雙頁攤開，較窄上下兩頁；手機（body[data-mode=phone]）單頁、索引籤在頁頂。閒置不動。 */

/* ── 刊頭：深棕皮革＋一道縫線 ── */
body[data-view="book"] .ld-mast {
  background-color: #3a2114;
  background-image:
    radial-gradient(120% 160% at 50% -40%, rgba(255, 220, 170, .16), transparent 62%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(255, 235, 200, .03) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #4d2d19, #371f11 68%, #2b170b);
  border-bottom: 1px solid #140a04;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .55);
}
body[data-view="book"] .ld-mast::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 2px; pointer-events: none;
  border-bottom: 1.5px dashed rgba(226, 190, 128, .5);
}
body[data-view="book"] .mast-sa { color: #F6E6C8; }
body[data-view="book"] .mast-db { color: #E2B567; }
body[data-view="book"] .mast-sub { color: rgba(246, 230, 200, .8); }
body[data-view="book"] .mast-btn { color: #F6E6C8; background: linear-gradient(180deg, #6a3f25, #4a2a18 60%, #3d2213); border-color: rgba(226, 181, 103, .7); }
body[data-view="book"] .mast-btn:hover { border-color: #E2B567; }
body[data-view="book"] .mast-select {
  color: #F6E6C8; border-color: rgba(226, 181, 103, .7);
  background-image: linear-gradient(45deg, transparent 50%, #E2B567 50%), linear-gradient(135deg, #E2B567 50%, transparent 50%), linear-gradient(180deg, #6a3f25, #3d2213);
}
body[data-view="book"] .mast-tables, body[data-view="book"] .mast-modes { color: #2b1a0e; background: linear-gradient(180deg, #F6EBD3, #E3CFA9); border-color: #8A5A2B; }

/* ── 桌面：深胡桃木。木紋是幾組週期互質的條紋疊起來，加一道板縫和燈光暈 ── */
.mode-book {
  container: bk / inline-size;
  overflow-x: hidden;
  color: #1F1A14;
  font: 400 15px/1.45 ui-sans-serif, system-ui, -apple-system, "PingFang TC", "Noto Sans TC", sans-serif;
  background-color: #33200f;
  background-image:
    radial-gradient(90% 70% at 50% 0%, rgba(255, 205, 150, .13), transparent 65%),
    radial-gradient(150% 110% at 50% 45%, transparent 55%, rgba(0, 0, 0, .5) 100%),
    repeating-linear-gradient(180deg, transparent 0 286px, rgba(0, 0, 0, .42) 286px 288px, rgba(255, 220, 180, .05) 288px 289px, transparent 289px 290px),
    repeating-linear-gradient(179.4deg, rgba(0, 0, 0, .1) 0 2px, transparent 2px 9px, rgba(255, 210, 160, .045) 9px 11px, transparent 11px 23px),
    repeating-linear-gradient(180.5deg, rgba(0, 0, 0, .08) 0 1px, transparent 1px 13px, rgba(0, 0, 0, .06) 13px 16px, transparent 16px 37px),
    repeating-linear-gradient(179.85deg, rgba(92, 54, 29, .55) 0 19px, rgba(50, 28, 14, .5) 19px 43px, rgba(76, 44, 24, .5) 43px 71px, rgba(42, 23, 11, .55) 71px 103px, rgba(66, 38, 20, .5) 103px 131px),
    linear-gradient(90deg, #3b2315, #2f1c0e 26%, #3f2617 52%, #2c190c 78%, #3a2213);
}
.mode-book :focus-visible { outline: 3px solid #1F4FBF; outline-offset: 2px; }
/* 手機把表格列改成 grid／block，[hidden] 要壓過去，篩掉的列才會真的消失。 */
.mode-book [hidden] { display: none !important; }
.mode-book .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.bk-desk { position: relative; min-height: 100%; padding: 30px 60px 170px 26px; }
.bk-book { position: relative; max-width: 1460px; margin: 0 auto; }

/* 封面板：撥款帳是墨綠皮，月結簿是牛血紅皮 */
.bk-book::before {
  content: ""; position: absolute; inset: -9px -9px -13px; z-index: 0; border-radius: 7px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 30% 20%, rgba(255, 255, 255, .08), transparent 60%),
    linear-gradient(180deg, #2d5240, #1f3a2c 55%, #183024);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 200, .12), inset 0 0 0 4px rgba(0, 0, 0, .18), 0 24px 48px rgba(0, 0, 0, .6), 0 5px 12px rgba(0, 0, 0, .45);
}
.bk-book[data-book="months"]::before {
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 30% 20%, rgba(255, 255, 255, .08), transparent 60%),
    linear-gradient(180deg, #6e2620, #551b17 55%, #431411);
}
.bk-spread { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); }
/* 攤開：右頁的明細欄位多，給它多一點寬（47:53，書脊陰影跟著走）。 */
@container bk (min-width: 1280px) {
  .bk-spread { grid-template-columns: minmax(0, 47fr) minmax(0, 53fr); }
}
.bk-book[data-book="grants"] .bk-m, .bk-book[data-book="months"] .bk-g { display: none; }
.bk-book[data-book="months"] .bk-tabs { display: none; }

/* ── 紙：米色、淡藍橫線、左側紅色雙邊線、邊緣微黃 ── */
.bk-page {
  --margin-x: 58px;
  --paper: #F3E9D2;
  position: relative; min-width: 0;
  padding: 26px 24px 58px var(--margin-x);
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent calc(var(--margin-x) - 13px), rgba(192, 57, 43, .78) calc(var(--margin-x) - 13px) calc(var(--margin-x) - 12px), transparent calc(var(--margin-x) - 12px) calc(var(--margin-x) - 9px), rgba(192, 57, 43, .78) calc(var(--margin-x) - 9px) calc(var(--margin-x) - 8px), transparent calc(var(--margin-x) - 8px)),
    radial-gradient(140% 110% at 50% 40%, transparent 62%, rgba(160, 118, 52, .16) 100%),
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(70, 118, 178, .26) 27px 28px);
}
/* 疊放：上頁底與下頁頂是書脊 */
.bk-left { border-radius: 4px 4px 0 0; box-shadow: inset 0 -26px 26px -22px rgba(70, 40, 10, .42), 0 -1px 0 #E3D6B9, 0 -2px 0 #CDBE9E, 0 -3px 0 #E3D6B9; }
.bk-right { border-radius: 0 0 4px 4px; box-shadow: inset 0 26px 26px -22px rgba(70, 40, 10, .42), 0 1px 0 #E3D6B9, 0 2px 0 #CDBE9E, 0 3px 0 #E3D6B9, 0 4px 0 #C4B391; }
/* 攤開：左右頁中間是書脊陰影，外緣看得到一疊紙邊 */
@container bk (min-width: 1280px) {
  .bk-left { border-radius: 4px 0 0 4px; box-shadow: inset -30px 0 30px -22px rgba(70, 40, 10, .48), -1px 0 0 #E3D6B9, -2px 1px 0 #CDBE9E, -3px 1px 0 #E3D6B9, -4px 2px 0 #C4B391; }
  .bk-right { border-radius: 0 4px 4px 0; box-shadow: inset 30px 0 30px -22px rgba(70, 40, 10, .48), 1px 0 0 #E3D6B9, 2px 1px 0 #CDBE9E, 3px 1px 0 #E3D6B9, 4px 2px 0 #C4B391; }
}
.bk-folio { position: absolute; bottom: 16px; left: 0; right: 0; margin: 0; text-align: center; font: 700 13px/1 ui-sans-serif, system-ui, sans-serif; color: rgba(47, 86, 135, .7); font-variant-numeric: tabular-nums; }
.bk-folio::before, .bk-folio::after { content: "—"; margin: 0 8px; }

/* 頁首：印刷的頁名＋雙線 */
.bk-phead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 14px; padding-bottom: 9px; border-bottom: 3px double rgba(47, 86, 135, .6); }
.bk-ptitle { margin: 0; font: 800 25px/1.2 ui-sans-serif, system-ui, -apple-system, "PingFang TC", sans-serif; color: #2F5687; letter-spacing: .03em; }
.bk-ptitle:focus { outline: none; }
.bk-ptitle:focus-visible { outline: 3px solid #1F4FBF; outline-offset: 3px; }
.bk-range { font: 700 15px/1.3 ui-sans-serif, system-ui, sans-serif; color: #2F5687; font-variant-numeric: tabular-nums; }
.bk-capt { margin-left: auto; font-size: 13.5px; font-weight: 600; color: #5B4A36; font-variant-numeric: tabular-nums; }
.bk-pmeta { margin: 0; flex: 1 1 100%; font-size: 14px; line-height: 1.45; color: #5B4A36; }
.bk-phead-r { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 16px; }
.bk-phead-r .bk-count { grid-column: 1 / -1; grid-row: 2; }
.bk-inks { margin: 2px 0 0; flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; font-weight: 700; }
.bk-ink::before { content: ""; display: inline-block; width: 18px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; background: currentColor; }

/* 查找：帳頁上印好的一格「查找」欄，後面是手寫的空格 */
.bk-find { justify-self: end; display: flex; align-items: stretch; min-width: 0; width: min(100%, 320px); border: 1.5px solid rgba(47, 86, 135, .65); border-radius: 3px; background: rgba(255, 252, 240, .75); }
.bk-find-l { flex: none; display: flex; align-items: center; padding: 0 10px; font: 800 14px/1 ui-sans-serif, system-ui, sans-serif; color: #F6EEDC; background: #2F5687; cursor: text; }
.bk-q { flex: 1 1 auto; min-width: 0; padding: 7px 10px; border: 0; background: transparent; font: 600 15.5px/1.2 ui-sans-serif, system-ui, -apple-system, "PingFang TC", sans-serif; color: #1E2F57; }
.bk-q::placeholder { color: #85745C; font-weight: 500; }
.bk-q::-webkit-search-cancel-button { display: none; }
.bk-q:focus-visible { outline: none; }
.bk-find:focus-within { box-shadow: 0 0 0 3px rgba(31, 79, 191, .55); }
.bk-find-x { flex: none; width: 34px; border: 0; background: none; color: #5B4A36; font-size: 20px; line-height: 1; cursor: pointer; }
.bk-find-x[hidden] { display: none; }
mark.bk-hit { background: rgba(255, 214, 92, .75); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ── 區段與小表 ── */
.bk-sec { margin-top: 20px; }
.bk-h { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font: 800 15.5px/1.3 ui-sans-serif, system-ui, -apple-system, "PingFang TC", sans-serif; color: #2F5687; }
.bk-h::after { content: ""; flex: 1 1 auto; border-bottom: 1px solid rgba(47, 86, 135, .45); }
.mode-book table { width: 100%; border-collapse: collapse; background-color: var(--paper, #F3E9D2); }
.mode-book th, .mode-book td { padding: 7px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(70, 118, 178, .4); }
.mode-book thead th { font: 700 13.5px/1.25 ui-sans-serif, system-ui, -apple-system, "PingFang TC", sans-serif; color: #2F5687; vertical-align: bottom; border-bottom: 2px solid rgba(47, 86, 135, .6); }
.mode-book tbody th { font-weight: 700; }
.mode-book th.bk-num, .mode-book td.bk-num { text-align: right; }
/* break-word 不會把欄的最小寬度壓成一個字（anywhere 會讓「Passed」斷成 Passe／d）；德文長字靠 hyphens 斷。 */
.mode-book th, .mode-book td { overflow-wrap: break-word; hyphens: auto; }
.bk-lines { display: grid; gap: 2px; justify-items: inherit; }
.bk-num .bk-lines { justify-items: end; }
.bk-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: inherit; gap: 0 5px; min-width: 0; }
.bk-num .bk-line { justify-content: flex-end; }
.bk-sub { display: block; font-size: 13px; line-height: 1.3; color: #6E5B44; font-weight: 600; }
.bk-dim { font-size: 13.5px; color: #6E5B44; font-style: italic; }
.bk-unit { font-size: 11.5px; font-weight: 800; letter-spacing: .03em; }
.bk-src { font-size: 11.5px; font-weight: 800; padding: 0 5px; border-radius: 3px; color: #17643F; border: 1px solid rgba(23, 100, 63, .45); }
.bk-na { font-size: 13.5px; color: #6E5B44; }
.bk-note { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: #4A3B29; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.bk-note strong { color: #2F5687; }
.bk-diff { font-weight: 700; color: #1E2F57; }

/* 金庫餘額 */
.bk-acct-name span { display: block; }
.bk-tab-acct td .ev { font-size: 16.5px; }
/* 5% 上限兩根銷：金色＝PIP-36 用的數字，紅色＝PIP-23 公式（跟鎖盤的止銷尺同色） */
.bk-pair { margin: 0; display: grid; gap: 2px; }
.bk-pair-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid rgba(70, 118, 178, .4); background: var(--paper); }
.bk-pair-row dt { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bk-pair-row dd { margin: 0; text-align: right; }
.bk-pair-row dd .ev { font-size: 17px; }
.bk-pin { flex: none; width: 9px; height: 20px; border-radius: 4px 4px 2px 2px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.bk-pin.gold { background: linear-gradient(90deg, #a8742b, #e9b65f 45%, #b57f33); }
.bk-pin.red { background: linear-gradient(90deg, #8c1d2c, #d9354f 45%, #9b2033); }

/* 各屆 Council：屆名是一顆按鈕，點了右頁只看那一屆 */
.bk-termbtn {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 28px;
  font: 700 15px/1.25 ui-sans-serif, system-ui, -apple-system, "PingFang TC", sans-serif; color: #1F1A14; text-decoration: underline; text-decoration-color: rgba(47, 86, 135, .45); text-underline-offset: 3px;
}
.bk-termbtn::before { content: ""; flex: none; width: 12px; height: 18px; border-radius: 0 4px 4px 0; background: var(--tone); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.bk-termbtn:hover { color: #1F4FBF; }
.bk-tab-terms .bk-sub { font-size: 12.5px; }

.bk-turnline { margin-top: 10px; }
.bk-link {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; min-height: 30px;
  color: #22408A; font: 700 14.5px/1.3 ui-sans-serif, system-ui, -apple-system, "PingFang TC", sans-serif; text-decoration: underline; text-underline-offset: 3px;
}
.bk-link:hover { color: #142a63; background: rgba(255, 214, 102, .35); }
.bk-link-strong { font-weight: 800; }
.bk-foldbtn { display: none; }

/* 屆期顏色（索引籤、屆名、明細列左緣都用同一組） */
.mode-book .tone-all { --tone: #EADFC4; --tone-ink: #3A2A18; }
.mode-book .tone-pre { --tone: #C99A2E; --tone-ink: #2A1C05; }
.mode-book .tone-s1 { --tone: #3F7A52; --tone-ink: #FFFFFF; }
.mode-book .tone-s2 { --tone: #2F5E9E; --tone-ink: #FFFFFF; }
.mode-book .tone-s3 { --tone: #A8442F; --tone-ink: #FFFFFF; }
.mode-book .tone-s4 { --tone: #6B4E9B; --tone-ink: #FFFFFF; }
.mode-book .tone-s5 { --tone: #2E6F76; --tone-ink: #FFFFFF; }

/* ── 證據按鈕：墨水數字＋虛線底線；幣別用墨色分 ── */
.mode-book .ev {
  display: inline-block; margin: 0; padding: 0 1px; border: 0; border-bottom: 1.5px dashed rgba(47, 86, 135, .55); border-radius: 2px;
  background: none; color: #1F1A14; font: inherit; font-size: 15px; font-weight: 700; line-height: 1.3; cursor: pointer; text-align: inherit; white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
}
.mode-book td .ev, .mode-book dd .ev { white-space: normal; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.mode-book .bk-gtable .bk-stack .ev { white-space: nowrap; }
.mode-book .bk-gtable .bk-stack .ev.bk-unconf { white-space: normal; text-align: right; }
.mode-book .ev:hover { background: rgba(255, 214, 102, .45); border-bottom-style: solid; }
.mode-book .ev .unit { font-size: 11.5px; font-weight: 800; color: inherit; opacity: .8; letter-spacing: .03em; }
.mode-book .socket { display: inline-block; padding: 0 4px; border-radius: 3px; background: none; box-shadow: none; border: 1px dashed rgba(122, 92, 58, .7); color: #6E5B44; font-size: 13.5px; font-style: italic; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.mode-book td .socket, .mode-book dd .socket { white-space: normal; }
.mode-book .cur-ATLAS, .mode-book .ev.cur-ATLAS { color: #1E2F57; }
.mode-book .cur-USDC, .mode-book .ev.cur-USDC { color: #17643F; }
.mode-book .cur-GBP, .mode-book .ev.cur-GBP, .mode-book .cur-EUR, .mode-book .ev.cur-EUR { color: #7A4518; }
.mode-book .num { font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; overflow-wrap: normal; }
.mode-book .ev.bk-unconf { color: #9B2A18; font-size: 14px; white-space: normal; font-style: italic; }

/* ── 撥款明細 ── */
.mode-book .bk-gtable {
  table-layout: fixed;
  margin-left: calc(6px - var(--margin-x)); width: calc(100% + var(--margin-x) - 6px);
}
.bk-gtable th.bk-pip { width: calc(var(--margin-x) - 19px); padding: 7px 0 7px 4px; text-align: center; }
.bk-gtable thead th.bk-pip { font-size: 12px; }
.bk-gtable .bk-c-appr, .bk-gtable .bk-c-paid, .bk-gtable .bk-c-rem { width: 108px; }
.bk-gtable th.bk-st, .bk-gtable td.bk-st { width: 114px; text-align: center; padding-left: 5px; padding-right: 5px; }
.bk-gtable thead th.bk-title { padding-left: 14px; }
.bk-gtable td.bk-num { border-left: 1px solid rgba(192, 57, 43, .3); padding-left: 6px; padding-right: 7px; }
.bk-gtable .bk-stack { display: grid; gap: 3px; justify-items: end; }
.bk-gtable .bk-c-appr .ev, .bk-gtable .bk-c-paid .ev, .bk-gtable .bk-c-rem .ev { text-align: right; }
.bk-gtable .bk-stack .ev .unit { display: block; margin-top: -1px; font-size: 11px; }
.bk-row > .bk-pip { border-left: 5px solid var(--tone); vertical-align: top; }
.bk-pip-k { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: #2F5687; }
.bk-pip-n { display: block; font: 800 18px/1.1 ui-sans-serif, system-ui, sans-serif; color: #1F1A14; }
.bk-row > .bk-title { padding-left: 14px; }
.bk-open { all: unset; box-sizing: border-box; display: flex; align-items: flex-start; gap: 6px; width: 100%; cursor: pointer; font: 600 15px/1.38 ui-sans-serif, system-ui, -apple-system, "PingFang TC", sans-serif; color: #1F1A14; }
.bk-open:hover .bk-tt { text-decoration: underline; text-decoration-color: rgba(47, 86, 135, .5); text-underline-offset: 3px; }
.bk-tt { min-width: 0; overflow-wrap: anywhere; }
.bk-pipno { display: none; }
.bk-chev { flex: none; margin-left: auto; padding-top: 2px; font-size: 13px; color: #2F5687; transition: transform .15s; }
.bk-row.is-open .bk-chev { transform: rotate(180deg); }
.bk-row { cursor: pointer; }
.bk-row:hover > * { background-color: rgba(255, 226, 140, .28); }
.bk-row.is-open > * { background-color: rgba(255, 214, 102, .36); border-bottom-color: transparent; }
/* 通過後撤回：整列灰掉，核准額一筆劃掉（帳本作廢的寫法，仍讀得出原數字） */
.bk-row.st-withdrawn .bk-open, .bk-row.st-withdrawn .bk-pip-n { color: #7A6F60; }
.mode-book .ev.bk-void { color: #7A6F60; text-decoration: line-through; text-decoration-thickness: 1.5px; }

/* 印章：雙框、微斜、墨色依狀態 */
.bk-stamp {
  --ink: #5E5E5E;
  display: inline-block; max-width: 100%; padding: 5px 7px; box-sizing: border-box;
  border: 2px solid var(--ink); border-radius: 5px; outline: 1.2px solid var(--ink); outline-offset: -5px;
  color: var(--ink); font: 800 12px/1.2 ui-sans-serif, system-ui, -apple-system, "PingFang TC", sans-serif; letter-spacing: .02em; text-align: center;
  transform: rotate(var(--tilt, -2deg)); mix-blend-mode: multiply; opacity: .94;
  overflow-wrap: anywhere; hyphens: auto;
  -webkit-mask-image: linear-gradient(103deg, #000 0 38%, rgba(0, 0, 0, .8) 52%, #000 66%, rgba(0, 0, 0, .88) 86%, #000);
  mask-image: linear-gradient(103deg, #000 0 38%, rgba(0, 0, 0, .8) 52%, #000 66%, rgba(0, 0, 0, .88) 86%, #000);
}
.bk-stamp { word-break: keep-all; }
.bk-stamp-t { display: block; padding: 2px 1px; }
.bk-stamp-p { display: block; padding: 0 1px 2px; font-size: 10.5px; font-weight: 700; letter-spacing: 0; word-break: normal; text-spacing-trim: space-all; }
body[data-mode="phone"] .bk-stamp-p { font-size: 10px; }
.bk-stamp.st-withdrawn { --ink: #5E5E5E; }
.bk-stamp.st-reconcile { --ink: #B32F1A; }
.bk-stamp.st-complete { --ink: #11615B; }
.bk-stamp.st-in-progress { --ink: #1F4E9C; }
.bk-stamp.st-unreported { --ink: #5F3591; }
.bk-stamp.st-attention { --ink: #871421; }
.bk-stateword { font-weight: 800; }
.bk-stateword.st-withdrawn { color: #5E5E5E; } .bk-stateword.st-reconcile { color: #B32F1A; } .bk-stateword.st-complete { color: #11615B; }
.bk-stateword.st-in-progress { color: #1F4E9C; } .bk-stateword.st-unreported { color: #5F3591; } .bk-stateword.st-attention { color: #871421; }

/* 合計列 */
.bk-total > * { border-top: 3px double rgba(47, 86, 135, .6); border-bottom: 0; background: var(--paper); }
.bk-total-l { text-align: right !important; padding-right: 14px !important; font-size: 14px; color: #2F5687; }
.bk-total .num { font-weight: 700; font-size: 14.5px; }
.bk-n { display: block; flex: 1 1 100%; text-align: right; font-size: 12px; color: #6E5B44; font-weight: 600; }
.bk-empty td { padding: 22px 14px; text-align: center; color: #5B4A36; font-size: 15px; }
.bk-empty td .bk-link { margin-left: 10px; }

/* ── 夾頁：略斜的黃便條，迴紋針＋紙膠帶 ── */
.bk-sliprow > td { padding: 6px 10px 20px 14px; border-bottom: 1px solid rgba(70, 118, 178, .4); background: var(--paper); cursor: default; }
.bk-slip { padding-top: 14px; }
.bk-note-paper {
  position: relative; padding: 20px 20px 14px 28px; border-radius: 2px 3px 3px 2px;
  transform: rotate(var(--tilt, -.6deg));
  background-color: #FBF4C9;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .55), transparent 40px), repeating-linear-gradient(180deg, transparent 0 23px, rgba(196, 152, 52, .2) 23px 24px);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .2), 0 12px 22px -8px rgba(60, 35, 10, .5);
  border-left: 4px solid var(--tone);
}
.bk-clip { position: absolute; top: -24px; left: 8px; width: 22px; height: 60px; overflow: visible; }
.bk-clip path { fill: none; stroke-linecap: round; }
.bk-clip-s { stroke: rgba(40, 30, 20, .3); transform: translate(1.5px, 1.5px); }
.bk-clip-w { stroke: #8f979f; }
.bk-clip-h { stroke: #eef2f5; transform: translate(-.6px, -.4px); }
.bk-tape {
  position: absolute; top: -11px; right: 40px; width: 92px; height: 24px; transform: rotate(3.5deg);
  background: repeating-linear-gradient(45deg, rgba(126, 170, 205, .58) 0 7px, rgba(170, 205, 228, .58) 7px 14px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  clip-path: polygon(2% 8%, 6% 0, 12% 9%, 18% 0, 100% 0, 98% 92%, 94% 100%, 88% 91%, 82% 100%, 0 100%);
}
.bk-note-h { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: start; margin-bottom: 10px; padding-left: 14px; }
.bk-note-t { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font: 800 17px/1.3 ui-sans-serif, system-ui, -apple-system, "PingFang TC", sans-serif; }
.bk-note-pip { color: #2F5687; font-variant-numeric: tabular-nums; }
.bk-note-alt { grid-column: 1; margin: 0; font-size: 13.5px; color: #6B5233; }
.bk-note-x { grid-column: 2; grid-row: 1; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(120, 90, 40, .12); color: #4A3B29; font-size: 22px; line-height: 1; cursor: pointer; }
.bk-note-x:hover { background: rgba(120, 90, 40, .24); }
.bk-note-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 14px 24px; }
.bk-facts { margin: 0; display: grid; gap: 6px; align-content: start; }
.bk-fact { display: grid; grid-template-columns: minmax(74px, 32%) minmax(0, 1fr); gap: 4px 10px; align-items: baseline; padding-bottom: 6px; border-bottom: 1px dashed rgba(150, 115, 50, .4); }
.bk-fact dt { font-size: 13.5px; font-weight: 800; color: #6B5233; }
.bk-fact dd { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.bk-fact dd .bk-sub { flex: 1 1 100%; }
.bk-termtag { display: inline-block; padding: 1px 8px; border-radius: 3px; background: var(--tone); color: var(--tone-ink); font-weight: 800; font-size: 13.5px; }
.bk-note-side { min-width: 0; display: grid; gap: 6px; align-content: start; }
.bk-note-k { margin: 0; font: 800 13.5px/1.3 ui-sans-serif, system-ui, sans-serif; color: #6B5233; }
.bk-quote { margin: 0 0 4px; padding: 4px 0 4px 12px; border-left: 3px solid rgba(150, 115, 50, .45); font-size: 14px; line-height: 1.5; color: #3d2f1f; }
.bk-quote p { margin: 0 0 4px; }
.bk-txs { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.bk-tx { padding: 6px 9px; border-left: 3px solid #9A8B74; border-radius: 0 4px 4px 0; background: rgba(255, 255, 255, .42); }
.bk-tx.g-linked { border-left-color: #2b7a4b; }
.bk-tx.g-possible { border-left-color: #c47d12; }
.bk-tx-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; }
.bk-tx-date { font-size: 13.5px; font-weight: 700; color: #4A3B29; font-variant-numeric: tabular-nums; }
.bk-tx-flow { font-size: 13.5px; color: #4A3B29; }
.bk-tx-why { margin: 3px 0 0; font-size: 13.5px; line-height: 1.45; color: #4A3B29; }
.bk-chip { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12.5px; font-weight: 800; line-height: 1.6; border: 1px solid rgba(107, 67, 34, .35); color: #5A4636; background: rgba(90, 70, 54, .08); }
.bk-chip.g-linked { color: #1f5a3a; border-color: rgba(31, 90, 58, .45); background: rgba(31, 90, 58, .1); }
.bk-chip.g-possible { color: #74400c; border-color: rgba(196, 125, 18, .55); background: rgba(201, 125, 61, .14); }
.bk-note-act { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; padding-top: 8px; border-top: 1px dashed rgba(150, 115, 50, .45); }

/* ── 月結簿 ── */
.bk-mtable { table-layout: fixed; }
.bk-mtable .bk-c-mon { width: 96px; }
.bk-mtable .bk-c-fund { width: 104px; }
.bk-mtable .bk-c-bal { width: 112px; }
.bk-mtable .ev .unit { font-size: 10.5px; letter-spacing: .02em; }
.bk-mtable th.bk-month { font-size: 14px; font-variant-numeric: tabular-nums; color: #2F5687; white-space: nowrap; overflow-wrap: normal; padding-right: 4px; }
.bk-mtable td.bk-num { border-left: 1px solid rgba(192, 57, 43, .3); padding-left: 4px; padding-right: 6px; }
.bk-mtable tr.bk-jan > * { border-top: 2px solid rgba(47, 86, 135, .55); }
.bk-tab-recent th.bk-month { font-size: 14.5px; color: #2F5687; }
/* 沒有擷取的一整段：像帳本上用鉛筆斜劃過的空白 */
.bk-mtable td.bk-void {
  vertical-align: top; text-align: center; padding: 40px 18px 14px;
  background-color: var(--paper);
  background-image:
    linear-gradient(to top right, transparent calc(50% - 1px), rgba(90, 80, 70, .35) calc(50% - 1px) calc(50% + .5px), transparent calc(50% + .5px)),
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(120, 100, 70, .1) 9px 10px);
}
.bk-void-t { display: inline-grid; gap: 4px; padding: 10px 14px; max-width: 100%; background: rgba(243, 233, 210, .94); border: 1px dashed rgba(90, 80, 70, .45); border-radius: 4px; color: #4A3B29; font-size: 14px; line-height: 1.4; }
.bk-void-t strong { color: #2F5687; font-size: 15px; }
.bk-mnotes { margin: 16px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; line-height: 1.5; color: #4A3B29; }

/* ── 索引籤（桌機、平板）：右頁外緣一排彩色籤，選中的整片伸出 ── */
.bk-tabs { position: absolute; top: 96px; left: 100%; z-index: 2; display: flex; flex-direction: column; gap: 5px; }
.bk-tab {
  all: unset; box-sizing: border-box; cursor: pointer; position: relative;
  writing-mode: vertical-rl; text-orientation: mixed;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 42px; min-height: 70px; padding: 12px 0;
  border-radius: 0 9px 9px 0; border: 1px solid rgba(0, 0, 0, .28); border-left: 0;
  background: var(--tone); color: var(--tone-ink);
  font: 800 14px/1.15 ui-sans-serif, system-ui, -apple-system, "PingFang TC", sans-serif; letter-spacing: .02em;
  box-shadow: inset 7px 0 7px -5px rgba(0, 0, 0, .4), 2px 2px 3px rgba(0, 0, 0, .35);
  transform: translateX(-8px); transition: transform .12s;
}
.bk-tab:hover { transform: translateX(-3px); }
.bk-tab[aria-pressed="true"] { transform: none; box-shadow: inset 4px 0 4px -3px rgba(0, 0, 0, .25), 3px 3px 5px rgba(0, 0, 0, .45); }
.bk-tab[aria-pressed="true"] .bk-tab-l { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.bk-tab:focus-visible { outline: 3px solid #FFD56B; outline-offset: 2px; }
.bk-tab-n { text-combine-upright: all; font-size: 12.5px; padding: 3px 0; border-radius: 8px; background: rgba(255, 255, 255, .28); min-width: 22px; text-align: center; }
.bk-tab.tone-all .bk-tab-n, .bk-tab.tone-pre .bk-tab-n { background: rgba(0, 0, 0, .1); }

/* ── 書籤緞帶：掛在書底；書比畫面長時貼在畫面底邊，隨時點得到。
   攤開時夾在書脊旁（左頁內側留白，不蓋到字）；疊放時垂在書的外緣（平板在桌面留白上，手機蓋住頁緣一角）。── */
.bk-ribbon-wrap { position: sticky; bottom: 140px; z-index: 6; height: 0; max-width: 1460px; margin: 0 auto; pointer-events: none; }
.bk-ribbon {
  all: unset; box-sizing: border-box; pointer-events: auto; cursor: pointer;
  position: absolute; top: -24px; right: -54px; width: 46px; height: 160px;
  filter: drop-shadow(2px 5px 3px rgba(0, 0, 0, .45)); transition: transform .14s;
}
@container bk (min-width: 1280px) {
  .bk-ribbon { right: auto; left: calc(47% - 40px); width: 36px; }
  .bk-book[data-book="months"] .bk-spread { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bk-book[data-book="months"] ~ .bk-ribbon-wrap .bk-ribbon { left: calc(50% - 40px); }
  .bk-left { padding-right: 46px; }
}
.bk-ribbon:hover { transform: translateY(4px); }
.bk-ribbon:focus-visible { outline: 3px solid #FFD56B; outline-offset: 3px; }
.bk-ribbon-tail {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #6a1111, #a82626 30%, #c2372f 47%, #941d1d 70%, #661010);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 17px), 0 100%);
}
.bk-book[data-book="months"] ~ .bk-ribbon-wrap .bk-ribbon-tail { background: linear-gradient(90deg, #173226, #2c5a43 30%, #3a7056 47%, #24493a 70%, #142b20); }
.bk-ribbon-t {
  position: absolute; top: 30px; left: 50%; transform: translateX(-50%); max-height: 118px;
  writing-mode: vertical-rl; text-orientation: mixed;
  color: #FBEBD0; font: 800 15px/1.15 ui-sans-serif, system-ui, -apple-system, "PingFang TC", sans-serif; letter-spacing: .08em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .45);
}

/* ── 翻頁（只在換本時出現，跑完就移除）── */
.bk-leaf { position: absolute; z-index: 5; transform-style: preserve-3d; pointer-events: none; }
.bk-book[data-book] .bk-face.bk-page { display: block; }
.bk-leaf > .bk-face { position: absolute; left: 0; top: 0; width: 100%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.bk-leaf > .bk-back { transform: rotateY(180deg); }
.bk-cover-face { position: absolute; z-index: 4; overflow: hidden; pointer-events: none; }
.bk-shade { position: absolute; z-index: 4; pointer-events: none; background: linear-gradient(90deg, rgba(40, 20, 5, .55), rgba(40, 20, 5, 0) 70%); }
.bk-lift { position: absolute; z-index: 5; pointer-events: none; overflow: hidden; box-shadow: 10px 10px 30px rgba(0, 0, 0, .4); }
.bk-lift > .bk-face { position: relative; }

body[data-motion="off"] .mode-book *, body[data-motion="off"] .mode-book { transition: none !important; }

/* ── 平板與較窄的桌機：上下兩頁 ── */
body[data-mode="tab"] .bk-desk { padding: 22px 60px 170px 22px; }

/* ── 手機：單頁；索引籤成頁頂一排橫向籤條；總帳的屆期與月結收在按鈕裡 ── */
body[data-mode="phone"] .bk-desk { padding: 14px 10px 170px; }
body[data-mode="phone"] .bk-book::before { inset: -7px -7px -10px; }
body[data-mode="phone"] .bk-page { --margin-x: 28px; padding: 16px 12px 52px var(--margin-x); }
body[data-mode="phone"] .bk-left { border-radius: 0; box-shadow: none; padding-bottom: 8px; }
body[data-mode="phone"] .bk-left .bk-folio { display: none; }
body[data-mode="phone"] .bk-right { border-radius: 0 0 4px 4px; box-shadow: 0 1px 0 #E3D6B9, 0 2px 0 #CDBE9E, 0 3px 0 #E3D6B9; padding-top: 12px; }
body[data-mode="phone"] .bk-g.bk-right .bk-phead { border-top: 3px double rgba(47, 86, 135, .6); padding-top: 12px; }
body[data-mode="phone"] .bk-m.bk-right { padding-top: 4px; }
body[data-mode="phone"] .bk-m.bk-left { padding-bottom: 0; }
body[data-mode="phone"] .bk-ptitle { font-size: 22px; }
body[data-mode="phone"] .bk-phead-r { grid-template-columns: minmax(0, 1fr); }
body[data-mode="phone"] .bk-phead-r .bk-find { justify-self: stretch; width: 100%; grid-row: 3; }
body[data-mode="phone"] .bk-phead-r .bk-count { grid-row: 2; }
body[data-mode="phone"] .bk-foldbtn {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  margin-top: 14px; padding: 10px 12px; border: 1.5px solid rgba(47, 86, 135, .55); border-radius: 4px; background: rgba(255, 252, 240, .7);
  color: #2F5687; font: 800 15px/1.3 ui-sans-serif, system-ui, -apple-system, "PingFang TC", sans-serif;
}
body[data-mode="phone"] .bk-foldbtn .bk-chev { margin: 0; transition: transform .15s; }
body[data-mode="phone"] .bk-left.fold-open .bk-foldbtn .bk-chev { transform: rotate(180deg); }
body[data-mode="phone"] .bk-left:not(.fold-open) .bk-fold { display: none; }

body[data-mode="phone"] .bk-tabs {
  position: sticky; top: 0; left: auto; z-index: 7; flex-direction: row; gap: 3px; align-items: flex-end;
  margin: -14px -10px 0; padding: 8px 10px 0; background: linear-gradient(180deg, #2a180c, #3a2213);
  box-shadow: 0 6px 8px -6px rgba(0, 0, 0, .55);
}
body[data-mode="phone"] .bk-tab {
  writing-mode: horizontal-tb; flex: 1 1 0; min-width: 0; width: auto; min-height: 44px; padding: 5px 3px 7px;
  flex-direction: column; gap: 2px; border-radius: 8px 8px 0 0; border: 1px solid rgba(0, 0, 0, .3); border-bottom: 0;
  font-size: 13px; line-height: 1.15; text-align: center; overflow-wrap: anywhere;
  box-shadow: inset 0 -6px 6px -5px rgba(0, 0, 0, .35); transform: translateY(5px);
}
body[data-mode="phone"] .bk-tab:hover { transform: translateY(2px); }
body[data-mode="phone"] .bk-tab[aria-pressed="true"] { transform: none; box-shadow: 0 -2px 4px rgba(0, 0, 0, .35); }
body[data-mode="phone"] .bk-tab-n { text-combine-upright: none; padding: 0 6px; font-size: 12px; }

/* 手機的撥款明細：一筆一格——上排名稱與印章，下排核准／已付／剩餘 */
body[data-mode="phone"] .bk-gtable { margin-left: 0; width: 100%; }
body[data-mode="phone"] .bk-gtable, body[data-mode="phone"] .bk-gtable tbody, body[data-mode="phone"] .bk-gtable tfoot { display: block; }
body[data-mode="phone"] .bk-gtable thead, body[data-mode="phone"] .bk-gtable .bk-row > .bk-pip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; padding: 0; border: 0; }
body[data-mode="phone"] .bk-gtable tr.bk-row, body[data-mode="phone"] .bk-gtable tr.bk-total {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "t t s" "a p r"; column-gap: 8px; row-gap: 6px;
  padding: 10px 6px 10px 8px; border-bottom: 1px solid rgba(70, 118, 178, .4); border-left: 5px solid var(--tone, transparent); background: var(--paper);
}
body[data-mode="phone"] .bk-gtable tr.bk-total { grid-template-areas: "l l l" "a p r"; border-left: 0; border-top: 3px double rgba(47, 86, 135, .6); }
body[data-mode="phone"] .bk-gtable tr > * { width: auto !important; padding: 0; border: 0; background: none !important; }
body[data-mode="phone"] .bk-gtable .bk-title { grid-area: t; }
body[data-mode="phone"] .bk-gtable .bk-st { grid-area: s; align-self: start; }
body[data-mode="phone"] .bk-gtable .bk-c-appr { grid-area: a; }
body[data-mode="phone"] .bk-gtable .bk-c-paid { grid-area: p; }
body[data-mode="phone"] .bk-gtable .bk-c-rem { grid-area: r; }
body[data-mode="phone"] .bk-gtable .bk-total-l { grid-area: l; text-align: left !important; padding: 0 !important; }
body[data-mode="phone"] .bk-gtable tr.bk-total > .bk-st { display: none; }
body[data-mode="phone"] .bk-gtable td.bk-num { text-align: left; }
body[data-mode="phone"] .bk-gtable td.bk-num::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12.5px; font-weight: 800; color: #2F5687; }
body[data-mode="phone"] .bk-gtable .bk-stack, body[data-mode="phone"] .bk-gtable .bk-num .bk-lines { justify-items: start; }
body[data-mode="phone"] .bk-gtable .bk-num .bk-line { justify-content: flex-start; }
body[data-mode="phone"] .bk-gtable .bk-n { text-align: left; }
body[data-mode="phone"] .bk-gtable .bk-c-appr .ev, body[data-mode="phone"] .bk-gtable .bk-c-paid .ev, body[data-mode="phone"] .bk-gtable .bk-c-rem .ev { text-align: left; }
body[data-mode="phone"] .bk-pipno { display: inline; flex: none; font-weight: 800; color: #2F5687; font-variant-numeric: tabular-nums; }
body[data-mode="phone"] .bk-open { flex-wrap: wrap; column-gap: 8px; }
body[data-mode="phone"] .bk-open .bk-tt { flex: 1 1 60%; }
body[data-mode="phone"] .bk-gtable tr.bk-sliprow, body[data-mode="phone"] .bk-gtable tr.bk-empty { display: block; }
body[data-mode="phone"] .bk-gtable tr.bk-sliprow > td, body[data-mode="phone"] .bk-gtable tr.bk-empty > td { display: block; padding: 4px 2px 18px; }
body[data-mode="phone"] .bk-stamp { font-size: 11.5px; padding: 4px 5px; max-width: calc(100% - 8px); }
body[data-mode="phone"] .bk-pair-row { grid-template-columns: minmax(0, 1fr); }
body[data-mode="phone"] .bk-gtable .bk-stack .ev.bk-unconf { text-align: left; }
body[data-mode="phone"] .bk-note-paper { padding: 20px 12px 12px 16px; }
body[data-mode="phone"] .bk-note-grid { grid-template-columns: minmax(0, 1fr); }
body[data-mode="phone"] .bk-fact { grid-template-columns: minmax(0, 1fr); gap: 2px; }
body[data-mode="phone"] .bk-tape { right: 18px; width: 70px; }
body[data-mode="phone"] .bk-note-paper { margin: 0 4px 0 2px; }

/* 手機的月結簿：月份一欄，其右兩排兩欄（收入｜離開 DAO，轉進基金｜月底餘額） */
body[data-mode="phone"] .bk-mtable, body[data-mode="phone"] .bk-mtable tbody { display: block; }
body[data-mode="phone"] .bk-mtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body[data-mode="phone"] .bk-mtable tr { display: grid; grid-template-columns: 84px repeat(2, minmax(0, 1fr)); column-gap: 8px; row-gap: 6px; padding: 9px 4px 9px 0; border-bottom: 1px solid rgba(70, 118, 178, .4); background: var(--paper); }
body[data-mode="phone"] .bk-mtable tr.bk-jan { border-top: 2px solid rgba(47, 86, 135, .55); }
body[data-mode="phone"] .bk-mtable tr > * { padding: 0; border: 0 !important; background-color: transparent; }
body[data-mode="phone"] .bk-mtable th.bk-month { grid-row: 1 / span 2; font-size: 13.5px; line-height: 1.3; }
body[data-mode="phone"] .bk-mtable td.bk-num { text-align: left; }
body[data-mode="phone"] .bk-mtable td.bk-num::before { content: attr(data-label); display: block; margin-bottom: 1px; font-size: 12px; font-weight: 800; color: #2F5687; line-height: 1.25; }
body[data-mode="phone"] .bk-mtable .bk-num .bk-lines { justify-items: start; }
body[data-mode="phone"] .bk-mtable .bk-num .bk-line { justify-content: flex-start; }
body[data-mode="phone"] .bk-mtable td.bk-void { grid-column: 2 / span 2; padding: 10px 8px; }
body[data-mode="phone"] .bk-tab-terms, body[data-mode="phone"] .bk-tab-recent { font-size: 14px; }
body[data-mode="phone"] .bk-tab-recent th.bk-month { white-space: nowrap; font-size: 13.5px; }
/* 手機的各屆 Council：一屆一格——上排屆名與核准額，下排 PIP 數／通過／核准撥款 */
body[data-mode="phone"] .bk-tab-terms, body[data-mode="phone"] .bk-tab-terms tbody { display: block; }
body[data-mode="phone"] .bk-tab-terms thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body[data-mode="phone"] .bk-tab-terms tr { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr); grid-template-areas: "n n n a" "p s g a"; gap: 4px 14px; padding: 9px 2px; border-bottom: 1px solid rgba(70, 118, 178, .4); background: var(--paper); }
body[data-mode="phone"] .bk-tab-terms tr > * { padding: 0 !important; border: 0; text-align: left; }
body[data-mode="phone"] .bk-tab-terms tr > :nth-child(1) { grid-area: n; }
body[data-mode="phone"] .bk-tab-terms tr > :nth-child(2) { grid-area: p; }
body[data-mode="phone"] .bk-tab-terms tr > :nth-child(3) { grid-area: s; }
body[data-mode="phone"] .bk-tab-terms tr > :nth-child(4) { grid-area: g; }
body[data-mode="phone"] .bk-tab-terms tr > :nth-child(5) { grid-area: a; text-align: right; }
body[data-mode="phone"] .bk-tab-terms td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 800; color: #2F5687; }
body[data-mode="phone"] .bk-tab-terms th, body[data-mode="phone"] .bk-tab-terms td, body[data-mode="phone"] .bk-tab-recent th, body[data-mode="phone"] .bk-tab-recent td { padding: 6px 4px; }
body[data-mode="phone"] .bk-termbtn { font-size: 14px; }
body[data-mode="phone"] .bk-ribbon-wrap { bottom: 140px; }
body[data-mode="phone"] .bk-ribbon { right: auto; left: -8px; width: 34px; height: 160px; }
body[data-mode="phone"] .bk-ribbon-t { font-size: 14px; top: 28px; max-height: 118px; }
/* 拉丁字母的書名比較長（Monatsbuch、Zuteilungsbuch）：縮字，整個字留在緞帶上，不從中間斷開。 */
.bk-ribbon-t.long { font-size: 12.5px; letter-spacing: .02em; }
/* 360 寬的小手機：金庫餘額表的數字與欄距縮一點，才放得進帳頁。 */
@media (max-width: 374px) {
  body[data-mode="phone"] .bk-tab-acct td .ev { font-size: 14.5px; }
  body[data-mode="phone"] .bk-tab-acct :is(th, td) { padding-left: 5px; padding-right: 5px; }
}
