/* 版面以 Tabler（vendor/tabler-1.7.4/tabler.min.css）為主，這裡只放少量補充樣式 */
:root {
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}
[hidden] { display: none !important; }
/*
 * 上懿工程 SunYi GROUP 品牌色（2026-11-30）：主色湖水藍綠 #159394、深湖綠 #0E6B6C、亮湖綠 #1B9A9B、極淺背景 #F2F7F7、淺湖綠膠囊 #E3F6F6。
 * 覆寫 Tabler 的主色變數（primary、連結、焦點框、active、分頁、按鈕）。白字底色（主要按鈕、分頁 active、選單）一律用深湖綠 #0E6B6C，
 * 對比 6.3:1（#159394 配白字只有 3.7:1，只用在框線、焦點、圓點與強調色塊）；連結文字也用深湖綠。
 * 字型只在 font-family 點名系統內建字型，不打包任何字型檔。
 */
:root {
  --sunyi-primary: #159394;
  --sunyi-primary-dark: #0e6b6c;
  --sunyi-primary-light: #1b9a9b;
  --sunyi-bg: #f2f7f7;
  --sunyi-chip-bg: #e3f6f6;
  --tblr-primary: #159394;
  --tblr-primary-rgb: 21, 147, 148;
  --tblr-primary-fg: #fff;
  --tblr-primary-darken: #0e6b6c;
  --tblr-primary-text-emphasis: #0e6b6c;
  --tblr-primary-lt: rgb(21 147 148 / 0.1);
  --tblr-primary-lt-rgb: 227, 246, 246;
  --tblr-link-color: #0e6b6c;
  --tblr-link-color-rgb: 14, 107, 108;
  --tblr-link-hover-color: #0a5253;
  --tblr-link-hover-color-rgb: 10, 82, 83;
  --tblr-focus-ring-color: rgb(21 147 148 / 0.35);
  --tblr-active-bg: rgb(21 147 148 / 0.1);
  --tblr-body-bg: #f2f7f7;
  /* 放大全站閱讀字級與表單、按鈕（Tabler 原本 14px）：桌機 15px，手機（下方 @media）16px */
  --tblr-body-font-size: 0.9375rem;
  --tblr-body-line-height: 1.5;
  --tblr-btn-input-font-size: 0.9375rem;
  --tblr-btn-input-line-height: 1.375rem;
  --tblr-btn-input-sm-font-size: 0.875rem;
  --tblr-btn-input-sm-line-height: 1.25rem;
  --tblr-font-size-h3: 1.0625rem;
  --tblr-font-size-h4: 0.9375rem;
}
body { background-color: var(--sunyi-bg); }
.text-primary { color: var(--sunyi-primary-dark) !important; }
.bg-primary { background-color: var(--sunyi-primary-dark) !important; color: #fff !important; }
.btn { --tblr-btn-font-size: 0.9375rem; --tblr-btn-line-height: 1.375rem; min-height: 40px; }
.btn-sm { --tblr-btn-font-size: 0.875rem; --tblr-btn-line-height: 1.25rem; min-height: 36px; }
.btn-primary {
  --tblr-btn-variant: var(--sunyi-primary-dark); --tblr-btn-variant-fg: #fff; --tblr-btn-variant-darken: #0a5253;
  --tblr-btn-bg: var(--sunyi-primary-dark); --tblr-btn-border-color: var(--sunyi-primary-dark); --tblr-btn-color: #fff;
  --tblr-btn-hover-bg: #0a5253; --tblr-btn-hover-border-color: #0a5253; --tblr-btn-hover-color: #fff;
  --tblr-btn-active-bg: #084445; --tblr-btn-active-border-color: #084445; --tblr-btn-active-color: #fff;
  --tblr-btn-disabled-bg: var(--sunyi-primary-dark); --tblr-btn-disabled-border-color: var(--sunyi-primary-dark);
}
.btn-outline-primary {
  --tblr-btn-color: var(--sunyi-primary-dark); --tblr-btn-border-color: var(--sunyi-primary);
  --tblr-btn-hover-bg: var(--sunyi-primary-dark); --tblr-btn-hover-border-color: var(--sunyi-primary-dark); --tblr-btn-hover-color: #fff;
  --tblr-btn-active-bg: var(--sunyi-primary-dark); --tblr-btn-active-border-color: var(--sunyi-primary-dark); --tblr-btn-active-color: #fff;
}
.form-control, .form-select { min-height: 40px; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--sunyi-primary); box-shadow: 0 0 0 0.25rem rgb(21 147 148 / 0.25);
}
.form-check-input:checked { background-color: var(--sunyi-primary-dark); border-color: var(--sunyi-primary-dark); }
:focus-visible { outline-color: var(--sunyi-primary); }
.pagination { --tblr-pagination-font-size: 0.9375rem; --tblr-pagination-active-bg: var(--sunyi-primary-dark); --tblr-pagination-active-border-color: var(--sunyi-primary-dark); --tblr-pagination-active-color: #fff; }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: var(--sunyi-primary-dark); border-bottom-color: var(--sunyi-primary); }
.nav-pills .nav-link.active { background-color: var(--sunyi-primary-dark); color: #fff; }
/* 側邊選單：深湖綠底、白字（對比 6.3:1）；目前項目淡白底 */
#app-layout > aside.navbar {
  --tblr-navbar-bg: var(--sunyi-primary-dark); --tblr-navbar-color: rgb(255 255 255 / 0.9); --tblr-navbar-hover-color: #fff;
  --tblr-navbar-active-color: #fff; --tblr-navbar-active-bg: rgb(255 255 255 / 0.16); --tblr-navbar-border-color: transparent;
  background: var(--sunyi-primary-dark);
}
#app-layout > aside.navbar .nav-section-title { color: rgb(255 255 255 / 0.78) !important; }
#app-layout > aside.navbar .nav-link:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
/* 頂部品牌列：左邊標誌與公司名稱、目前頁面副標（回首頁的連結），右上角登入員工名字膠囊，再來是我的帳號、登出 */
.brand-bar { background: #fff; }
.brand-bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding-block: 0.375rem; }
.brand-home { display: flex; align-items: center; gap: 0.625rem; flex: 1 1 auto; min-width: 0; color: inherit; text-decoration: none; }
.brand-home:hover { color: inherit; text-decoration: none; }
.brand-home:focus-visible { outline: 2px solid var(--sunyi-primary); outline-offset: 2px; border-radius: 0.5rem; }
.brand-logo { flex: none; width: 64px; height: 44px; }
.login-brand .brand-logo { display: block; width: 116px; height: 80px; margin: 0 auto 0.5rem; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-title { font-size: 1.125rem; font-weight: 800; color: var(--sunyi-primary-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-subtitle { font-size: 0.875rem; color: #4b5b5b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 自訂公司標誌（core.branding.manage 上傳的 PNG／WebP；docs/specs/core/branding.md）：高度同內建標誌、寬度依比例，不變形 */
.brand-logo-custom { flex: none; height: 44px; width: auto; max-width: 160px; object-fit: contain; }
.login-brand .brand-logo-custom { display: block; height: 80px; max-width: 280px; margin: 0 auto 0.5rem; }
.branding-preview { display: flex; align-items: center; justify-content: center; min-height: 120px; padding: 1rem; margin-bottom: 1rem; border: 1px dashed var(--tblr-border-color); border-radius: 0.75rem; background: #fff; }
.branding-preview .branding-current { max-width: 100%; height: 96px; width: auto; object-fit: contain; }
.branding-preview svg.branding-current { width: 150px; height: 104px; }
.user-chip {
  display: inline-block; flex: none; max-width: 14rem; padding: 7px 16px; border-radius: 999px;
  background: #e3f6f6; color: #0e6b6c; font-size: 18px; font-weight: 800; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-chip:empty { display: none; }
.brand-actions { display: flex; flex: none; align-items: center; gap: 0.5rem; }
.field-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 0; }
.field-list dt { color: var(--tblr-secondary); font-weight: normal; }
.field-list dd { margin: 0; word-break: break-all; }
dialog.app-dialog { border: 0; border-radius: 0.5rem; padding: 0; width: min(32rem, 92vw); }
dialog.app-dialog::backdrop { background: rgb(0 0 0 / 0.4); }
.comment-cell { white-space: pre-wrap; }
dialog.app-dialog .modal-header,
dialog.app-dialog .modal-body,
dialog.app-dialog .modal-footer { padding: 1rem 1.25rem; }
dialog.app-dialog .modal-footer { display: flex; justify-content: flex-end; gap: 0.5rem; border-top: 1px solid var(--tblr-border-color); }
dialog.app-dialog .modal-header { border-bottom: 1px solid var(--tblr-border-color); }
tr.row-link { cursor: pointer; }
/* 工地 GPS 打卡的告知全文：放在可捲動的區塊裡，保留原文換行（規格 hr/punches.md §7.11） */
.punch-notice { max-height: 14rem; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
/* 逐筆打卡的定位示意圖（畫面內自繪的 SVG，不是地圖；規格 hr/punches.md §7.12） */
.geo-diagram-figure { text-align: center; }
.geo-diagram { max-width: 100%; height: auto; border: 1px solid var(--tblr-border-color); border-radius: 0.25rem; }
.geo-diagram-bg { fill: var(--tblr-bg-surface-secondary, #f6f8fb); }
.geo-diagram-site { fill: rgb(32 107 196 / 0.1); stroke: #206bc4; stroke-width: 1.5; }
.geo-diagram-center { fill: #206bc4; }
.geo-diagram-radius { stroke: #206bc4; stroke-width: 1; stroke-dasharray: 3 3; }
.geo-diagram-accuracy { fill: rgb(214 57 57 / 0.1); stroke: #d63939; stroke-width: 1; stroke-dasharray: 4 3; }
.geo-diagram-punch { fill: #d63939; }
.geo-diagram-label { font-size: 11px; fill: var(--tblr-body-color, #1d273b); }
/* 排班月檢視（規格 hr/schedules.md §6）：員工欄與日期列以 position: sticky 固定；週與週之間畫分隔線；未排標紅 */
.schedule-month { max-height: 70vh; overflow: auto; }
.schedule-grid { border-collapse: separate; border-spacing: 0; font-size: 0.8125rem; }
.schedule-grid th, .schedule-grid td { white-space: nowrap; text-align: center; vertical-align: middle; padding: 0.25rem 0.375rem; }
.schedule-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--tblr-bg-surface, #fff); }
.schedule-grid .schedule-emp { position: sticky; left: 0; z-index: 1; background: var(--tblr-bg-surface, #fff); text-align: left; min-width: 9rem; }
.schedule-grid thead th.schedule-emp { z-index: 3; }
.schedule-grid .schedule-week-start, .schedule-calendar td:first-child { border-left: 2px solid var(--tblr-border-color-dark, #8a94a6); }
.schedule-weekday { font-weight: normal; color: var(--tblr-secondary); }
.schedule-weekend .schedule-weekday { color: var(--tblr-danger, #d63939); }
.schedule-mark { font-weight: bold; color: var(--tblr-danger, #d63939); }
.schedule-mark-makeup_workday .schedule-mark { color: var(--tblr-primary, #206bc4); }
.schedule-mark-voting_day .schedule-mark, .schedule-mark-gov_makeup_workday .schedule-mark,
.schedule-mark-company_off .schedule-mark { color: var(--tblr-secondary, #667382); }
.schedule-cell { cursor: pointer; }
.schedule-unscheduled { color: var(--tblr-danger, #d63939); background: rgb(214 57 57 / 0.06); }
.schedule-off { color: var(--tblr-secondary); }
.schedule-cross { display: block; margin-top: 0.125rem; font-size: 0.6875rem; }
.schedule-calendar { table-layout: fixed; font-size: 0.75rem; }
.schedule-calendar th, .schedule-calendar td { text-align: center; padding: 0.25rem 0.125rem; overflow-wrap: anywhere; }
.schedule-day-number { font-weight: bold; }
/* 排班編輯（hr/schedules.md §6.6，F1）：已修改、不能排、試算後的警示（黃底）、R12 與不能排的日子（紅框） */
.schedule-staged { box-shadow: inset 0 0 0 2px var(--tblr-primary, #206bc4); }
.schedule-staged-badge, .schedule-blocked-badge { display: block; margin-top: 0.125rem; font-size: 0.6875rem; }
.schedule-blocked { color: var(--tblr-secondary); background: repeating-linear-gradient(45deg, rgb(0 0 0 / 0.03), rgb(0 0 0 / 0.03) 4px, transparent 4px, transparent 8px); cursor: not-allowed; }
/* 主管唯讀的格子（本人、範圍外、過去日期；hr/schedules.md §6.14）：灰底斜線，點了開唯讀明細 */
.schedule-locked { color: var(--tblr-secondary); background: repeating-linear-gradient(135deg, rgb(0 0 0 / 0.05), rgb(0 0 0 / 0.05) 3px, transparent 3px, transparent 7px); cursor: not-allowed; }
.schedule-day.schedule-past { color: var(--tblr-secondary); background: rgb(0 0 0 / 0.04); }
.schedule-row-lock { display: inline-block; margin-top: 0.125rem; font-size: 0.6875rem; }
.schedule-warning { background: rgb(247 103 7 / 0.15); }
/* 排班標示（hr/schedules.md §6.17，2026-11-22 公司決定）：已核准為實心標籤；簽核中為虛線框（文字另加「?」，不只靠顏色區分） */
.schedule-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.125rem; margin-top: 0.125rem; }
.schedule-tag { display: inline-block; padding: 0 0.25rem; border: 1px solid transparent; border-radius: 0.25rem; font-size: 0.6875rem; line-height: 1.3; }
.schedule-tag-leave { color: #fff; background: #1f6fb5; }
.schedule-tag-overtime { color: #fff; background: #8a2fa0; }
.schedule-tag-leave-pending { color: #1f6fb5; border: 1px dashed currentColor; background: transparent; }
.schedule-tag-overtime-pending { color: #8a2fa0; border: 1px dashed currentColor; background: transparent; }
.schedule-tag-leave-missing { color: var(--tblr-secondary); border: 1px dotted currentColor; }
.schedule-conflict { box-shadow: inset 0 0 0 2px var(--tblr-danger, #d63939); }
/* 連續上班超過上限（R12）只警示、不擋（2026-11-26 公司決定） */
.schedule-r12 { box-shadow: inset 0 0 0 2px var(--tblr-orange, #f76707); }
/* 排班圈選（F2，只在人資的桌面表格）：選取的格子淡藍底＋虛線外框；員工、日期可點選整列、整欄 */
.schedule-selected { background: rgb(32 107 196 / 0.14); outline: 2px dashed var(--tblr-primary, #206bc4); outline-offset: -3px; }
.schedule-selectable thead th[data-date], .schedule-selectable tbody th[data-employee] { cursor: pointer; }
/* 複製上月（F3）：上月沒有對應、上月班別已停用的格子標示，人資改了那格或重新查詢時拿掉 */
.schedule-copy-note { box-shadow: inset 0 0 0 2px var(--tblr-orange, #f76707); }
.schedule-copy-badge { display: block; margin-top: 0.125rem; font-size: 0.6875rem; white-space: normal; }
/* 四週變形週期（F4，只有人資）：週期分界（起日與結束後的隔天）左側紫色粗線；表格最上面的週期列不固定（日期列仍固定在上方） */
.schedule-period-start, .schedule-calendar td.schedule-period-start { border-left: 3px solid #8a2fa0 !important; }
.schedule-grid thead tr#schedule-period-row th { position: static; white-space: normal; font-weight: normal; font-size: 0.75rem; text-align: left; }
.schedule-grid thead tr#schedule-period-row th.schedule-period-head { position: sticky; left: 0; z-index: 3; }
.schedule-period-band { background: rgb(174 62 201 / 0.08) !important; border-left: 3px solid #8a2fa0 !important; }
#schedule-period-table th, #schedule-period-table td { font-size: 0.8125rem; vertical-align: top; }
/* 發布狀態（hr/schedules.md §6.15）：格子左上角的小標記；未發布灰色虛線框、已發布綠點、有更新橘點加「有更新」標示 */
.schedule-pub-unpublished, .schedule-pub-published, .schedule-pub-updated { position: relative; }
.schedule-pub-unpublished::before, .schedule-pub-published::before, .schedule-pub-updated::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 6px; height: 6px; border-radius: 50%; pointer-events: none;
}
.schedule-pub-unpublished::before { border: 1px dashed var(--tblr-secondary, #667382); }
.schedule-pub-published::before { background: var(--tblr-green, #2fb344); }
.schedule-pub-updated::before { background: var(--tblr-orange, #f76707); }
.schedule-updated-badge { display: block; margin-top: 0.125rem; font-size: 0.6875rem; }
/* 我的班表（hr/schedules.md §6.15）：一週一列的月曆，所有寬度都用；375px 不整頁橫向捲動 */
.my-schedule-calendar { table-layout: fixed; width: 100%; font-size: 0.8125rem; }
.my-schedule-calendar th, .my-schedule-calendar td { text-align: center; vertical-align: top; padding: 0.25rem 0.125rem; overflow-wrap: anywhere; }
.my-schedule-calendar td.my-schedule-updated { box-shadow: inset 0 0 0 2px var(--tblr-orange, #f76707); }
.my-schedule-calendar .my-schedule-time { display: block; font-size: 0.6875rem; color: var(--tblr-secondary); }
.my-schedule-calendar .my-schedule-off { color: var(--tblr-secondary); }
/* 我的班表：四週變形工時週期的起始週（與週期結束後的隔週）上方加粗框（hr/schedules.md §6.15，2026-11-22 PM 決定） */
.my-schedule-calendar tr.my-schedule-period-start td { border-top: 3px solid #8a2fa0 !important; }
/* 工作日曆（hr/work-calendar.md §7）：年度檢視的 12 個月小月曆；國定假日紅、補班日藍、公司休假日紫；有星期警示時加黃框 */
.wc-year-input { max-width: 8rem; }
.wc-month-table { table-layout: fixed; font-size: 0.75rem; }
.wc-month-table th, .wc-month-table td { text-align: center; padding: 0.125rem; border: 0; }
.wc-day-btn { width: 100%; border: 0; background: transparent; padding: 0.125rem 0; line-height: 1.1; border-radius: 4px; color: inherit; }
.wc-day-btn:hover, .wc-day-btn:focus-visible { background: var(--tblr-gray-100, #f1f5f9); }
.wc-day-mark { display: block; font-size: 0.625rem; font-weight: 700; }
.wc-national_holiday .wc-day-btn { background: #fde2e1; color: #b42318; }
.wc-makeup_workday .wc-day-btn { background: #dbeafe; color: #1d4ed8; }
.wc-company_off .wc-day-btn { background: #f3e8ff; color: #7e22ce; }
.wc-substitute_holiday .wc-day-btn { background: #ffedd5; color: #c2410c; }
.wc-voting_day .wc-day-btn { background: #dcfce7; color: #15803d; }
.wc-gov_makeup_workday .wc-day-btn { background: #f1f5f9; color: #475569; }
.wc-multiple .wc-day-btn { background: #fef9c3; color: #854d0e; }
.wc-site .wc-day-btn { border: 1px dashed currentColor; }
.wc-warning .wc-day-btn { box-shadow: inset 0 0 0 2px var(--tblr-yellow, #f59f00); }
.wc-today .wc-day-btn { outline: 2px solid var(--tblr-primary, #206bc4); outline-offset: -2px; }
.wc-pre-line { white-space: pre-line; }
/* 排班月檢視：日別與工作日曆不一致（只警示，hr/schedules.md §6.18） */
.schedule-calendar-mismatch { box-shadow: inset 0 0 0 2px var(--tblr-yellow, #f59f00); }
/* 特休發放告知的列印（hr/annual-leave.md §13）：畫面上有告知（.annual-notice-print）時，列印只印告知內容，隱藏選單、頂部列、按鈕與其他區塊 */
@media print {
  body:has(.annual-notice-print) #app-layout > aside,
  body:has(.annual-notice-print) .page-wrapper > header,
  body:has(.annual-notice-print) #app-root > :not(.annual-notice-print),
  .annual-notice-print .d-print-none,
  .annual-notice-print button { display: none !important; }
  body:has(.annual-notice-print) .page-wrapper { margin: 0 !important; padding: 0 !important; }
  .annual-notice-print { border: 0 !important; box-shadow: none !important; }
  .annual-notice-print #annual-notice-body { border: 0 !important; padding: 0 !important; }
}
.my-schedule-cal-company_off, .my-schedule-cal-voting_day { color: var(--tblr-secondary, #667382); }
.my-schedule-cal-makeup_workday { color: var(--tblr-primary, #206bc4); }
/* 部門樹（2026-11-28 PM 決定）：巢狀清單，下層縮排並加左邊線 */
.department-tree { list-style: none; margin: 0; padding-left: 1.25rem; border-left: 1px solid var(--tblr-border-color, #dce1e7); }
.department-tree-root { padding-left: 0; border-left: 0; }
.department-tree-item > div { overflow-wrap: anywhere; }
/* 手機卡片清單（views/common.js 的 listCard、responsiveList；只在手機寬度產生）：每筆一張卡片，欄名與內容左右兩欄、操作按鈕在底部可換行 */
.list-cards { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.75rem; }
.list-card { margin: 0; }
/* 整張可點的卡片（待簽核，<a class="card list-card card-link">）：抵掉 Tabler 的 .card-link+.card-link 左邊距
   （原意是卡片內並排文字連結的間距），否則第二張起每張都往右縮排、寬度變窄（#471）。權重同 Tabler（0,2,0）、寫在後面所以生效 */
.list-cards > .list-card { margin-inline-start: 0; }
a.list-card { color: inherit; text-decoration: none; }
.list-card > .card-body { padding: 0.75rem 1rem; }
.list-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.list-card-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.list-card-fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.25rem 0.75rem; margin: 0; }
.list-card-fields dt { color: var(--tblr-secondary); font-weight: normal; }
.list-card-fields dd { margin: 0; overflow-wrap: anywhere; }
.list-card-actions { padding: 0.5rem 1rem; }
.list-card-actions .btn-list { flex-wrap: wrap; }
/* 簽核明細的來源單據摘要（U4）與按鈕列：按鈕可換行；代簽說明獨立一行，不擠壓按鈕 */
#approval-actions { flex-wrap: wrap; }
#approval-actions > .approval-actions-note { flex: 1 0 100%; }
/* 選單「待簽核」數量徽章 */
.nav-link .menu-count { margin-left: auto; }
/* 手機寬度（Bootstrap xs，575.98px 以下）的版面補強；桌面版與 @media print 不受影響 */
@media (max-width: 575.98px) {
  /* 卡片標題列：標題與按鈕群可換行；按鈕群換到下一行時佔滿整列、按鈕之間留間距不互相擠壓 */
  .card-header { flex-wrap: wrap; row-gap: 0.5rem; }
  .card-header > .card-title { min-width: 0; overflow-wrap: anywhere; }
  .card-header > .card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; max-width: 100%; margin-block: 0; }
  .card-header > .card-actions > * { flex: 0 0 auto; max-width: 100%; }
  /* 欄位清單（dt／dd 兩欄）改成單欄：欄名在上、內容在下 */
  .field-list { grid-template-columns: minmax(0, 1fr); gap: 0 0; }
  .field-list dd { margin-bottom: 0.5rem; }
  /* 小按鈕恢復觸控友善的點擊高度（約 44px） */
  .btn-sm { min-height: 44px; }
  /* 手機放大閱讀字級與點擊熱區：本文、輸入框 16px（iOS 不會因字級太小自動放大頁面），按鈕與輸入框高度至少 44px */
  :root { --tblr-body-font-size: 1rem; --tblr-btn-input-font-size: 1rem; }
  .btn { --tblr-btn-font-size: 1rem; min-height: 44px; }
  .btn-sm { --tblr-btn-font-size: 0.9375rem; }
  .form-control, .form-select { min-height: 44px; font-size: 1rem; }
  /* 品牌列：標誌、名稱與名字膠囊在第一列，我的帳號、登出換到第二列靠右 */
  .brand-home { flex: 1 1 0; gap: 0.5rem; }
  .brand-logo { width: 55px; height: 38px; }
  .brand-title { font-size: 1rem; }
  .brand-subtitle { font-size: 0.8125rem; }
  .user-chip { max-width: 9.5rem; }
  .brand-logo-custom { height: 38px; max-width: 110px; }
  .brand-actions { flex: 1 0 100%; justify-content: flex-end; }
}
/*
 * 首頁六宮格（#/home，2026-11-30；views/home.js）：一頁最多 6 個正方形圖塊，手機（< 576px）2 欄 × 3 列 118px、桌機 3 欄 × 2 列 136px；
 * 圖框尺寸固定（flex: none、固定寬高），不因文字長短變形；圖框下只有一行粗體名稱，太長以省略號截斷。
 * 每個圖塊雙色漸層底＋頂部微光澤（::after）＋原創白色線條圖示（home-icons.js）；待辦數徽章在圖框右上角（#FF3B30、白粗框、超過 99 顯示 99+）。
 */
.home-launcher { max-width: 40rem; margin: 0.5rem auto 0; padding: 0.5rem 0 1rem; }
.home-pages { overflow: hidden; touch-action: pan-y; }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem 1rem; margin: 0; padding: 0.75rem 0.25rem; list-style: none; }
.home-cell { display: flex; justify-content: center; min-width: 0; }
.home-tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.625rem; width: 100%; min-width: 0;
  color: #1d2b2b; text-decoration: none; border-radius: 30px; -webkit-tap-highlight-color: transparent;
}
.home-tile:hover { color: #1d2b2b; text-decoration: none; }
.home-tile:focus-visible { outline: 3px solid var(--sunyi-primary); outline-offset: 4px; }
.home-tile-icon {
  position: relative; display: flex; flex: none; align-items: center; justify-content: center;
  box-sizing: border-box; width: 136px; height: 136px; border-radius: 30px; color: #fff;
  box-shadow: 0 8px 18px rgb(14 107 108 / 0.18), 0 2px 4px rgb(0 0 0 / 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
/* 頂部微光澤 */
.home-tile-icon::after {
  content: ""; position: absolute; inset: 0 0 50% 0; border-radius: 30px 30px 0 0; pointer-events: none;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.34), rgb(255 255 255 / 0.04));
}
.home-tile:hover .home-tile-icon { transform: translateY(-2px); box-shadow: 0 12px 22px rgb(14 107 108 / 0.24), 0 2px 4px rgb(0 0 0 / 0.08); }
.home-tile:active .home-tile-icon { transform: scale(0.97); }
.home-icon-svg { position: relative; z-index: 1; width: 58px; height: 58px; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.18)); }
.home-tile-label {
  display: block; max-width: 100%; font-size: 19px; font-weight: 800; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.home-badge {
  position: absolute; top: -8px; right: -8px; z-index: 2; box-sizing: border-box;
  min-width: 34px; height: 34px; padding: 0 8px; border: 3px solid #fff; border-radius: 999px;
  background: #ff3b30; color: #fff; font-size: 15px; font-weight: 800; line-height: 28px; text-align: center;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.2);
}
.home-tone-teal { background: linear-gradient(145deg, #2cc3c4, #0e6b6c); }
.home-tone-sky { background: linear-gradient(145deg, #4fc8f2, #1479c2); }
.home-tone-blue { background: linear-gradient(145deg, #5a9bff, #1d56c9); }
.home-tone-indigo { background: linear-gradient(145deg, #8577ff, #4532c4); }
.home-tone-purple { background: linear-gradient(145deg, #c072ee, #7a2fbf); }
.home-tone-pink { background: linear-gradient(145deg, #ff7aa8, #cc2f68); }
.home-tone-red { background: linear-gradient(145deg, #ff8170, #d4332a); }
.home-tone-orange { background: linear-gradient(145deg, #ffaa55, #e0600d); }
.home-tone-amber { background: linear-gradient(145deg, #f8c84a, #d27f06); }
.home-tone-green { background: linear-gradient(145deg, #56d486, #18914a); }
.home-tone-mint { background: linear-gradient(145deg, #45dcbd, #0f8a74); }
.home-tone-slate { background: linear-gradient(145deg, #8a9ab2, #44536b); }
.home-tone-brown { background: linear-gradient(145deg, #d1a06f, #865631); }
/* 換頁時新頁從滑動方向輕輕滑入；系統設定減少動態效果時不做 */
.home-enter-next { animation: home-slide-next 0.24s ease-out; }
.home-enter-prev { animation: home-slide-prev 0.24s ease-out; }
@keyframes home-slide-next { from { opacity: 0.2; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes home-slide-prev { from { opacity: 0.2; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .home-enter-next, .home-enter-prev { animation: none; }
  .home-tile-icon { transition: none; }
}
/* 分頁列：左右箭頭與底部分頁圓點（目前頁為湖水綠膠囊點） */
.home-nav { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 0.75rem; }
.home-arrow {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid #c9dede; border-radius: 999px; background: #fff; color: var(--sunyi-primary-dark);
}
.home-arrow:hover:not(:disabled) { background: var(--sunyi-chip-bg); }
.home-arrow:disabled { opacity: 0.35; cursor: default; }
.home-arrow:focus-visible, .home-dot:focus-visible { outline: 3px solid var(--sunyi-primary); outline-offset: 2px; }
.home-arrow-svg { width: 22px; height: 22px; }
.home-dots { display: flex; align-items: center; gap: 0.125rem; }
/* 圓點本身小，但按鈕的點擊熱區有 44px 高、28px 寬 */
.home-dot { position: relative; width: 28px; height: 44px; padding: 0; border: 0; background: transparent; }
.home-dot::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; border-radius: 999px;
  background: #b9cfcf; transform: translate(-50%, -50%); transition: width 0.2s ease, background-color 0.2s ease;
}
.home-dot.active::before { width: 24px; background: var(--sunyi-primary); }
@media (max-width: 575.98px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 0.75rem; }
  .home-tile-icon { width: 118px; height: 118px; border-radius: 26px; }
  .home-tile-icon::after { border-radius: 26px 26px 0 0; }
  .home-tile { border-radius: 26px; }
  .home-icon-svg { width: 50px; height: 50px; }
  .home-tile-label { font-size: 17px; }
}
