:root {
  --brand: #7E1822;
  --bg: #f4f3f0;
  --card: #fff;
  --text: #2b2724;
  --muted: #7a736d;
  --line: #e4e1db;
  --ok: #2e7d4f;
  --danger: #b3261e;
  /* 思源黑體：iPhone、電腦、Android 看起來都一樣，筆畫勻稱、久看不累 */
  font-family: "Noto Sans TC Variable", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; }
/* ===== 全站字體規則（之後新加的畫面都照這裡，不要在別的地方另外指定字體） =====
   字體：思源黑體（public/*.html 都要先載入 /fonts/noto-sans-tc.css 再載入 style.css）
   粗細只用這三種：內文 --w-text、按鈕／分頁／標籤 --w-ui、標題與強調 --w-strong */
:root { --w-text: 430; --w-ui: 500; --w-strong: 650; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; line-height: 1.6; letter-spacing: .02em; font-weight: var(--w-text); text-rendering: optimizeLegibility; }
h1, h2, h3, h4, strong, b, th { font-weight: var(--w-strong); letter-spacing: .03em; }
button, .btn, .tab, .nav a, .pill, .tag, .link-btn, label, summary { font-weight: var(--w-ui); }
/* 按鈕預設不吃網頁字體，要特別指定，不然會變回系統字 */
button, input, select, textarea, option { font-family: inherit; letter-spacing: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px; padding: 12px 18px; font-size: 16px; text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s; }
.btn:active { transform: scale(.98); }
/* 手機點下去要「馬上」有反應：不等 iPhone 判斷是不是要放大畫面，點的地方立刻變色 */
/* 手機點兩下不會被放大（EC 2026-10-17）：整頁都關掉雙擊放大，捲動、兩指縮放照常 */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button, .btn, .tab, label, summary, input, select, textarea { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.btn:active, .tab:active { background: #f1eeea; }
.btn.primary:active, .btn.primary-inline:active { filter: brightness(.88); }
.tabbar a:active { opacity: .55; }
/* 按下去等主機回應的時候：按鈕鎖住、旁邊轉圈，免得以為沒按到又按一次 */
.btn.busy { opacity: .7; cursor: progress; }
.btn.busy::after { content: ''; display: inline-block; width: .9em; height: .9em; margin-left: .45em; vertical-align: -.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; width: 100%; text-align: center; }
.btn.small { padding: 6px 12px; font-size: 14px; }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: var(--card); border-radius: 16px; padding: 32px 24px; width: 100%; max-width: 360px; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.login-card h1 { font-size: 22px; margin: 12px 0 4px; }
.login-card p { color: var(--muted); margin: 0 0 20px; }
.login-alt { display: block; margin-top: 16px; font-size: 14px; color: var(--muted); }
/* 隱私權說明：字比較多，靠左排、寬一點 */
.privacy-card { max-width: 560px; text-align: left; }
.privacy-card h2 { font-size: 16px; margin: 18px 0 4px; }
.privacy-card p { margin: 0 0 8px; }
.privacy-card .brand-mark { display: block; margin: 0 auto; }
.privacy-card h1 { text-align: center; }
.privacy-card .btn { margin-top: 16px; }
.login-links { margin-top: 12px; font-size: 13px; }
.login-links a { color: var(--muted); }
.brand-mark { width: 112px; height: 112px; }
.error-text { color: var(--danger); min-height: 1.4em; margin-bottom: 12px; font-size: 15px; }
/* 上方列固定在最上面、白色一路鋪到狀態列：iPhone 才會把頂端當成白色，不會把底下的內容糊成一片 */
.topbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .spacer { flex: 1; }
/* 名字和登出不要被擠到斷行 */
#me-name, #logout { white-space: nowrap; flex-shrink: 0; }
.page { max-width: 720px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: 16px; padding: 20px 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(60,40,30,.05), 0 4px 16px rgba(60,40,30,.04); }
.card h2 { font-size: 18px; margin: 0 0 6px; }
.status-list { list-style: none; padding: 0; margin: 12px 0 0; }
.status-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.status-list li.ok { color: var(--ok); }
.status-list li.todo { color: var(--muted); }
.nav { display: flex; gap: 4px; overflow-x: auto; }
/* 電腦版：選單底下的下拉要露出來，不能被捲動框切掉 */
@media (min-width: 701px) { .nav { overflow: visible; flex-wrap: nowrap; } }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: 15px; }
.nav a.active { color: var(--brand); background: #f6eced; font-weight: var(--w-strong); }
.nav-menu { position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; color: var(--muted); padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: 15px; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: ' ▾'; font-size: 11px; }
.nav-menu summary.active { color: var(--brand); background: #f6eced; font-weight: var(--w-strong); }
.nav-drop a { padding: 8px 12px; }
.nav-drop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 10; display: flex; flex-direction: column; gap: 2px; min-width: 120px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }
.check-group { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 4px; }
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; }
}
.btn.primary-inline { background: var(--brand); border-color: var(--brand); color: #fff; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list { display: flex; flex-direction: column; margin-top: 8px; }
.list-item { all: unset; display: block; padding: 12px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.list-item:active { background: #faf8f5; }
.list-item.dim { opacity: .55; }
.li-sub { font-size: 14px; margin-top: 2px; }
.tag { display: inline-block; font-size: 12px; background: #eee; border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.form { display: flex; flex-direction: column; gap: 18px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; color: #555; font-weight: var(--w-strong); }
.field > small, .form > small { font-size: 13px; line-height: 1.5; }
input, select, textarea { font: inherit; font-weight: var(--w-text); font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); max-width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(126,24,34,.12); }
select[multiple] { min-height: 90px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.check input { width: 18px; height: 18px; }
.history h3, .special h4 { font-size: 15px; margin: 18px 0 6px; }
.timeline, .plain { list-style: none; padding: 0; margin: 0; }
.timeline li, .plain li { padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.inline-form input:not([type=checkbox]) { flex: 1 1 120px; }
.unit-card { border-top: 1px solid var(--line); padding: 10px 0; }
.unit-card summary { cursor: pointer; font-weight: var(--w-strong); padding: 4px 0; }
.unit { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.hours { border-collapse: collapse; }
.hours th { text-align: left; font-weight: var(--w-text); color: var(--muted); padding-right: 8px; white-space: nowrap; }
.hours td { padding: 3px 2px; }
.hours input[type=time] { padding: 6px; }
.dept { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.dept.archived input[name=name] { color: var(--muted); background: #f3f3f3; }
.link-btn { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 14px; margin-left: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #333; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 10; max-width: 90vw; }
.toast.bad { background: var(--danger); }
h2 { font-size: 18px; }
.hours { width: 100%; table-layout: auto; }
.hours td:nth-child(2), .hours td:nth-child(4) { width: 40%; }
.hours input[type=time] { width: 100%; min-width: 0; font-size: 15px; }
.hours .check { white-space: nowrap; font-size: 14px; }
.hours th { padding-right: 4px; }

/* 任務 */
textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
.small { font-size: 13px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; margin: 0 0 10px; font-size: 15px; }
.tabs { display: flex; gap: 6px; margin: 12px 0 4px; overflow-x: auto; }
.tabs.sub { margin-top: 4px; }
.tab { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font-size: 15px; color: #5c544e; cursor: pointer; white-space: nowrap; }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs.sub .tab { padding: 4px 12px; font-size: 14px; }
.tabs.sub .tab.active { background: #f6eced; color: var(--brand); border-color: #f6eced; }
/* 階段按鈕：固定兩列、每列四顆，手機上也不會排成三列 */
.tabs.sub { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; overflow: visible; }
.tab.chip { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 6px 4px; min-width: 0; }
.tabs.sub .tab.chip { padding: 6px 4px; font-size: 14px; }
.tab.chip .count { min-width: 18px; padding: 0 5px; border-radius: 999px; background: #f1eeea; color: #6b635c; font-size: 12px; line-height: 20px; text-align: center; font-weight: var(--w-strong); }
.tab.chip.active .count { background: var(--brand); color: #fff; }
.tab.chip.alert { color: var(--danger); border-color: #f0c9c6; }
.tab.chip.alert .count { background: var(--danger); color: #fff; }
.tab.chip.active.alert { color: #fff; border-color: var(--brand); }
.empty { padding: 16px 0; }
.list:has(.task-row) { gap: 10px; margin-top: 12px; }
.list-item.task-row { display: block; color: inherit; text-decoration: none; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; transition: box-shadow .15s, transform .1s; }
.list-item.task-row:hover { box-shadow: 0 3px 12px rgba(60,40,30,.08); }
.list-item.task-row:active { transform: scale(.99); background: #fff; }
.task-row .li-main strong { font-size: 16px; line-height: 1.4; }
.tab.chip.just-moved { animation: just-moved 2.4s ease-out; }
@keyframes just-moved { 0%, 40% { box-shadow: 0 0 0 3px var(--brand); } 100% { box-shadow: none; } }
.task-row .tags { margin-top: 8px; }
.task-row .li-sub { margin-top: 8px; font-size: 13px; line-height: 1.5; }
.task-row.s-row-pending { border-left-color: #f0c35a; }
.task-row.s-row-in_progress { border-left-color: #7ea6e0; }
.task-row.s-row-blocked { border-left-color: #f0a06a; }
.task-row.s-row-review { border-left-color: #b39ae6; }
.task-row.s-row-done { border-left-color: #8fcaa2; }
.task-row.overdue { border-left-color: var(--danger); }
.task-row.overdue strong { color: var(--danger); }
.tags { gap: 4px; margin-top: 4px; }
.pill { display: inline-block; font-size: 12px; border-radius: 999px; padding: 2px 8px; background: #eee; color: #444; }
.s-pending { background: #fff3d6; color: #8a5a00; }
.s-in_progress { background: #e3efff; color: #1d4f91; }
.s-blocked { background: #ffe6d5; color: #9a3d00; }
.s-review { background: #efe6ff; color: #5b2ca0; }
.s-done { background: #e2f3e8; color: var(--ok); }
.s-cancelled { background: #eee; color: #777; }
.s-overdue, .i-urgent { background: var(--danger); color: #fff; }
.i-important { background: #fde7e7; color: var(--danger); }
.task-title { font-size: 20px; margin: 4px 0 6px; }
.criteria { background: #faf8f5; border-radius: 10px; padding: 10px 12px; margin: 12px 0; white-space: pre-wrap; line-height: 1.5; }
.progress-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; font-size: 14px; }
progress { flex: 1 1 140px; height: 10px; appearance: none; -webkit-appearance: none; border: none; border-radius: 999px; overflow: hidden; background: #eee; }
progress::-webkit-progress-bar { background: #eee; border-radius: 999px; }
progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--brand); }
.infos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.info { display: flex; flex-direction: column; font-size: 15px; }
.info .muted { font-size: 13px; }
.notice { border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: #f2f2f2; line-height: 1.5; }
.notice.warn { background: #fff1e6; color: #8a3a00; }
.notice.ok { background: #e2f3e8; color: var(--ok); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.big { padding: 12px 26px; font-weight: var(--w-strong); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-outline { color: var(--danger); border-color: #f0c9c6; }
#panel:not(:empty) { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 4px; }
#panel h3 { margin: 10px 0 0; font-size: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two input { width: 100%; }
.segmented { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.segmented label { position: relative; flex: 1; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: block; padding: 11px 8px; font-size: 15px; text-align: center; cursor: pointer; border-right: 1px solid var(--line); transition: background .15s; }
.segmented label:last-child span { border-right: none; }
.segmented input:checked + span { background: var(--brand); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.milestones { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 4px; }
.milestone-row { display: grid; grid-template-columns: 1fr minmax(150px, 38%); gap: 8px; }
.tree { list-style: none; padding: 0; margin: 6px 0 0; }
.tree .tree { padding-left: 14px; border-left: 2px solid var(--line); margin-left: 4px; }
.tree-node { padding: 8px 0; border-top: 1px solid var(--line); }
.tree-node a { color: var(--text); font-weight: var(--w-strong); text-decoration: none; }
.summary { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #faf8f5; border-radius: 12px; padding: 12px 4px; color: var(--text); text-decoration: none; }
.stat strong { font-size: 22px; }
.stat span { font-size: 13px; color: var(--muted); text-align: center; }
.stat.bad strong { color: var(--danger); }
@media (max-width: 420px) {
  .infos { grid-template-columns: 1fr 1fr; }
  .milestone-row { grid-template-columns: 1fr 140px; }
}
.milestone-row input { min-width: 0; width: 100%; }
@media (max-width: 380px) {
  .tabs.sub .tab.chip { font-size: 13px; gap: 3px; padding: 6px 2px; letter-spacing: 0; }
  .tab.chip .count { min-width: 16px; padding: 0 4px; }
}

/* 手機 App：下方分頁列（電腦版藏起來，用上方選單） */
.tabbar { display: none; }
@media (max-width: 700px) {
  .topbar .nav { display: none; }
  /* 下方按鈕列：iPhone 底部那條橫線的位置不用整段留白，只留一點，按鈕下面不會空一大塊 */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: #fff; border-top: 1px solid var(--line); padding: 4px 4px max(6px, calc(env(safe-area-inset-bottom) - 18px)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: var(--muted); text-decoration: none; font-size: 12px; -webkit-tap-highlight-color: transparent; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active { color: var(--brand); }
  .tabbar a.active svg { stroke-width: 2.2; }
  .tabbar a.tab-new svg { width: 30px; height: 30px; padding: 5px; border-radius: 999px; background: var(--brand); color: #fff; stroke: #fff; stroke-width: 2.4; margin-top: -4px; }
  .tabbar a.tab-new { color: var(--brand); }
  body.has-tabbar { padding-bottom: calc(66px + max(6px, env(safe-area-inset-bottom) - 18px)); }
  body.has-tabbar .toast { bottom: calc(76px + max(6px, env(safe-area-inset-bottom) - 18px)); }
}

/* 加到主畫面的教學卡 */
.install-card { border: 1px dashed #e3c9cc; background: #fdf8f8; }
.line-card ol { margin: 8px 0 12px; padding-left: 20px; line-height: 2; }
.line-card .btn.small { white-space: nowrap; flex-shrink: 0; }
.btn.line-btn { background: #06C755; border-color: #06C755; color: #fff; padding: 6px 14px; font-size: 15px; }
.bind-code { text-align: center; padding: 14px 8px; border-radius: 12px; background: #f6f4f1; }
.bind-code .code { font-size: 34px; letter-spacing: .3em; font-weight: var(--w-strong); font-variant-numeric: tabular-nums; }
.install-card ol { margin: 8px 0 12px; padding-left: 20px; line-height: 1.9; }
.install-card .row-between { align-items: flex-start; }
/* 設定頁 */
.setting-row { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.symbol-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.symbol-table th, .symbol-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.symbol-table th { font-weight: var(--w-ui); color: var(--muted); }
.symbol-table input[name=symbol] { width: 4.5em; }
.symbol-table select { width: 100%; }
.symbol-table .center { text-align: center; }
.leave-types li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.leave-types .actions { margin-left: auto; }
.leave-types li.dim { opacity: .55; }
.break { word-break: break-all; }
.warn { color: #9a6200; }
.symbol-table td:nth-child(n+3), .symbol-table th:nth-child(n+3) { white-space: nowrap; width: 1%; }
.setting-row h3 { margin: 2px 0 0; }
.setting-row:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
#quiet-card h3 { margin: 20px 0 4px; font-size: 16px; font-weight: var(--w-strong); }
#quiet-card .row select { width: auto; }
/* 權限頁 */
.perm-group h3 { margin: 18px 0 4px; font-size: 15px; font-weight: var(--w-strong); color: #6b635c; }
.perm-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.perm-row.on .perm-main strong { color: var(--brand); }
.perm-main { flex: 1 1 220px; min-width: 0; }
.perm-ctl { display: flex; gap: 6px; align-items: center; }
.perm-ctl select { width: auto; }
.pill.lv-mid { background: #fdf1dc; color: #8a5a00; }
.pill.lv-high { background: #fbe4e2; color: var(--danger); }
.pill.adv { background: #e7f0fb; color: #2a5a8f; margin-left: 4px; }
/* 手機「更多」：從下面滑上來的選單，管理頁都收在這裡 */
.more-sheet { display: none; }
@media (max-width: 700px) {
  .more-sheet { display: block; position: fixed; inset: 0; z-index: 8; background: rgba(0, 0, 0, 0); pointer-events: none; transition: background .2s; }
  .more-sheet.open { background: rgba(0, 0, 0, .35); pointer-events: auto; }
  /* 選單最高到畫面上方留一點空，超過就在選單裡面捲（原本沒限高度，項目一多就超出畫面、滑不動） */
  .more-panel { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; max-height: calc(100dvh - 48px - env(safe-area-inset-top)); background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, .08); transform: translateY(100%); transition: transform .22s ease-out; }
  .more-sheet.open .more-panel { transform: translateY(0); }
  .more-head { position: relative; display: flex; align-items: center; justify-content: center; padding: 18px 16px 10px; border-bottom: 1px solid #f0ebe6; flex: none; }
  .more-head strong { font-size: 16px; font-weight: var(--w-strong); }
  .more-handle { position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: #e3ddd7; }
  .more-x { position: absolute; right: 10px; top: 50%; margin-top: -14px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f4f0ec; color: var(--muted); font-size: 14px; line-height: 32px; padding: 0; cursor: pointer; }
  .more-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); }
  .more-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px 4px; flex: none; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .more-tabs::-webkit-scrollbar { display: none; }
  .more-tabs button { flex: none; border: 0; border-radius: 999px; padding: 7px 14px; background: #f4f0ec; color: var(--muted); font-size: 14px; font-weight: var(--w-ui); cursor: pointer; }
  .more-tabs button.on { background: var(--brand); color: #fff; }
  /* 只顯示選到的那一類；高度留一點，切分類時選單不會一下長一下短 */
  .more-body { min-height: 300px; }
  .more-group { display: none; }
  .more-group.on { display: block; }
  .more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .more-grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 10px 4px; border-radius: 14px; background: #f7f4f1; color: var(--text, #333); text-decoration: none; font-size: 14px; line-height: 1.3; text-align: center; }
  .more-grid a:active { background: #efe9e4; }
  .more-grid a.active { background: #f6eced; color: var(--brand); }
  .more-grid svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  html.more-open, html.more-open body { overflow: hidden; }
  .more-close { width: 100%; }
}

/* 留休 */
.carry-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.carry-table th, .carry-table td { text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.carry-table th:first-child, .carry-table td:first-child { text-align: left; }
.carry-table th { font-weight: var(--w-ui); color: var(--muted); }
.carry-table .bad { color: #b42318; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.tag.bad { background: #fde8e6; color: #b42318; }
.tag.good { background: #e7f4ec; color: #1e7b45; }
.bad-text { color: #b42318; }
button.list-item { width: 100%; box-sizing: border-box; }

/* 選人（店長、部門主管、區經理） */
.picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.picker select { width: auto; min-width: 7em; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: #f3ece8; border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 14px; }
.chip-x { all: unset; cursor: pointer; padding: 0 6px; color: var(--muted); font-size: 16px; line-height: 1; }
.leaders { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.head-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.region .field { margin-top: 8px; }
.leaders > .btn { margin-top: 10px; }

/* 班表：顏色淡、線條少，一眼看出誰休誰請假，久看不累 */
.page.wide { max-width: 1100px; }
:root { --on: #2e7d4f; --on-bg: #e9f4ed; --off: #5d6b78; --off-bg: #eef1f4; --leave: #a15c12; --leave-bg: #fcefdf; }
.sched-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sched-head h2 { margin: 0; }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: #f6f4f1; border-radius: 999px; padding: 3px; }
.stepper button { all: unset; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; color: var(--muted); }
.stepper button:active { background: #e9e5e0; }
.stepper .now { padding: 0 8px; font-weight: var(--w-ui); white-space: nowrap; font-size: 15px; }
.today-link { all: unset; cursor: pointer; font-size: 13px; color: var(--brand); font-weight: var(--w-ui); padding: 4px 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.multi { position: relative; border: 1px solid var(--line); border-radius: 999px; background: #fff; transition: border-color .15s, background .15s; }
.multi.on { border-color: #d9b9bc; background: #fbf5f5; }
.multi summary { padding: 7px 14px; cursor: pointer; list-style: none; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.multi summary::-webkit-details-marker { display: none; }
.multi summary::after { content: '⌄'; margin-left: 6px; color: var(--muted); }
.multi .lbl { color: var(--muted); margin-right: 4px; }
.multi.on .val { color: var(--brand); }
.multi-list { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 11em; display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 28px rgba(60,40,30,.14); padding: 8px; }
.multi-list .check { padding: 6px 8px; border-radius: 8px; }
.multi-list .check:active { background: #f6f4f1; }
.clear-filters { all: unset; cursor: pointer; font-size: 13px; color: var(--muted); padding: 7px 4px; text-decoration: underline; text-underline-offset: 3px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

.stats.three { grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.stat.on { background: var(--on-bg); } .stat.on strong { color: var(--on); }
.stat.off { background: var(--off-bg); } .stat.off strong { color: var(--off); }
.stat.leave { background: var(--leave-bg); } .stat.leave strong { color: var(--leave); }
.stat strong { font-size: 26px; line-height: 1.2; }
.day-group { margin-top: 16px; }
.day-group h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: var(--w-ui); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--on); } .dot.off { background: var(--off); } .dot.leave { background: var(--leave); }
.names { display: flex; flex-wrap: wrap; gap: 8px; }
.person { display: inline-flex; align-items: baseline; gap: 6px; border-radius: 10px; padding: 6px 12px; font-size: 15px; background: #f7f6f3; }
.person.on { background: var(--on-bg); }
.person.off { background: var(--off-bg); }
.person.leave { background: var(--leave-bg); }
.person small { font-size: 12px; color: var(--muted); }
.person.leave small { color: var(--leave); }
.empty { text-align: center; color: var(--muted); padding: 18px 0 6px; }

.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 12px; padding-bottom: 4px; }
.sched { border-collapse: separate; border-spacing: 3px; font-size: 13px; }
.sched th, .sched td { min-width: 30px; height: 32px; text-align: center; padding: 0; border-radius: 7px; }
.sched thead th { cursor: pointer; font-weight: var(--w-ui); color: var(--text); line-height: 1.15; padding: 4px 0; }
.sched thead th.wk, .sched thead th.wk .wd { color: #b3261e; }
.sched .wd { font-size: 11px; color: var(--muted); font-weight: var(--w-text); }
.sched thead th.today { background: var(--brand); color: #fff; }
.sched thead th.today .wd { color: #fff; opacity: .85; }
.sched th.who { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; padding: 0 10px 0 2px; white-space: nowrap; font-weight: var(--w-ui); box-shadow: -4px 0 0 #fff, 4px 0 0 #fff, 9px 0 7px -6px rgba(0,0,0,.14); border-radius: 0; }
.sched td { background: #f9f8f6; color: var(--muted); }
.sched td.on { background: #f9f8f6; }
.sched td.off { background: var(--off-bg); color: var(--off); font-weight: var(--w-ui); }
.sched td.leave { background: var(--leave-bg); color: var(--leave); font-weight: var(--w-ui); }
.sched td.none { background: repeating-linear-gradient(135deg, #f6f5f3 0 4px, #fff 4px 8px); color: transparent; }
.sched td.unknown { background: #fde8e6; color: #b42318; }
.sched td.faded { background: #fcfcfb; color: transparent; }
.sched td.sel, .sched th.sel { box-shadow: inset 0 0 0 2px var(--brand); }
.sched tbody tr:active th.who { color: var(--brand); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-style: normal; font-size: 12px; background: #f9f8f6; }
.legend i.off { background: var(--off-bg); color: var(--off); } .legend i.leave { background: var(--leave-bg); color: var(--leave); }
.legend i.none { background: repeating-linear-gradient(135deg, #f0eeeb 0 4px, #fff 4px 8px); }

/* 佈告欄（首頁「即將到來」、班表頁那天的備註） */
:root { --notice: #8a5a14; --notice-bg: #fbf4e6; }
.notice-hint { margin: 0 0 10px; }
.notices { display: flex; flex-direction: column; gap: 8px; }
.notice { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: #f9f8f6; width: 100%; }
.notice.tappable { cursor: pointer; }
.notice.tappable:active { background: #f1eeea; }
.notice.now { background: var(--notice-bg); }
.notice.now.tappable:active { filter: brightness(.97); }
.notice-when { font-size: 13.5px; font-weight: var(--w-ui); color: var(--muted); }
.notice.now .notice-when { color: var(--notice); }
.notice-text { font-size: 15.5px; line-height: 1.5; word-break: break-word; }
.notice-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.notice-meta .tag { font-size: 12px; }
.notice-edit { margin-left: auto; color: var(--brand); font-weight: var(--w-ui); }
.notice-empty { text-align: center; padding: 10px 0 4px; margin: 0; }
.notice-form { display: flex; flex-direction: column; gap: 12px; padding: 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.notice-form textarea, .notice-form select, .notice-form input { width: 100%; min-width: 0; }
.notice-form .two > * { min-width: 0; }
.notice-form .form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notice-form .check { white-space: nowrap; }
.notice-form .check input { width: 18px; min-width: 18px; }
.notice-form .form-actions .danger-outline { margin-left: auto; }
.day-notes { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.day-note { display: flex; gap: 8px; align-items: baseline; background: var(--notice-bg); color: var(--text); border-radius: 10px; padding: 8px 12px; font-size: 14.5px; }
.day-note::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--notice); transform: translateY(-1px); }
.day-note small { color: var(--muted); margin-left: auto; white-space: nowrap; font-size: 12px; }
.sched thead th .pin { display: block; width: 5px; height: 5px; margin: 2px auto 0; border-radius: 50%; background: var(--notice); }
.sched thead th.today .pin { background: #fff; }
.tag.repeat { background: var(--notice-bg); color: var(--notice); }
.legend i.pin-key { background: transparent; } .legend i.pin-key::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--notice); }
.sched-head { flex-wrap: wrap; }
.sched-head h2 { white-space: nowrap; }
.sched-head .row-between { gap: 4px; }
.today-link { white-space: nowrap; }
@media (max-width: 400px) { .stepper .now { padding: 0 2px; font-size: 14.5px; } .stepper button { width: 30px; } }
/* 電腦版：整個月一頁看完，不用左右捲（EC 2026-10-14） */
@media (min-width: 900px) {
  .page.wide { max-width: 1280px; }
  .grid-wrap { overflow-x: visible; }
  .sched { width: 100%; table-layout: fixed; border-spacing: 2px; }
  .sched th, .sched td { min-width: 0; }
  .sched thead th.who, .sched th.who { width: 6.5em; box-shadow: none; position: static; }
}
.sched thead th { position: relative; padding-bottom: 8px; }
.sched thead th .pin { position: absolute; left: 50%; bottom: 2px; margin: 0 0 0 -2.5px; }

/* 調整班表順序：按住 ☰ 拖，或按 ↑ ↓ */
.order-list { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.order-item { display: flex; align-items: center; gap: 10px; background: #f7f6f3; border-radius: 12px; padding: 6px 8px; }
.order-item.dragging { background: var(--on-bg); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.order-item .grip { touch-action: none; cursor: grab; width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); font-size: 18px; user-select: none; -webkit-user-select: none; }
.order-item .order-no { width: 1.6em; text-align: right; color: var(--muted); font-size: 13px; }
.order-item .order-name { flex: 1; font-size: 15px; }
.order-btn { all: unset; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.order-btn:active { background: #e9e5e0; }
.order-btn:disabled { opacity: .3; cursor: default; }
.order-unit { font: inherit; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.row-end .btn.primary { width: auto; }

/* 公告點開的內文、地址 */
.notice-detail { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 2px; }
.notice-body { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.65; color: var(--text); }
.notice-body a { color: var(--brand); text-decoration: underline; word-break: break-all; }
.notice-address { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.notice-address .btn { flex: none; }
.notice-more { color: var(--brand); font-weight: var(--w-ui); }
button.notice-edit { all: unset; cursor: pointer; margin-left: auto; color: var(--brand); font-weight: var(--w-ui); }
details.day-note { display: block; }
details.day-note::before { display: none; }
details.day-note summary { display: flex; gap: 8px; align-items: baseline; cursor: pointer; list-style: none; }
details.day-note summary::-webkit-details-marker { display: none; }
details.day-note summary::before { content: '›'; color: var(--notice); transition: transform .15s; }
details.day-note[open] summary::before { transform: rotate(90deg); }
details.day-note summary small { color: var(--muted); margin-left: auto; white-space: nowrap; font-size: 12px; }

/* 設定頁：每日備份 */
.backup-checks li { padding: 3px 0; }
.backup-checks li.ok { color: var(--ok); }
.backup-checks small { color: var(--muted); }
.backup-runs { margin-top: 12px; font-size: 13.5px; }
.backup-runs li { padding: 6px 0; border-top: 1px solid var(--line); word-break: break-word; }
.backup-runs li.warn { color: #8a3a00; }
.backup-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
#backup-card .btn:disabled { opacity: .4; cursor: default; }

/* 排休頁（內建班表）：日曆點一下選休、撞到禁止同休的格子是橘色 */
:root { --clash: #b45309; --clash-bg: #fde7c8; }
.roster-phase { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #f6f4f1; font-size: 14.5px; line-height: 1.55; }
.roster-phase.ok { background: var(--on-bg); color: var(--on); }
.roster-phase.warn { background: var(--leave-bg); color: var(--leave); }
.roster-manage { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.roster-manage input:not([type]) { flex: 1; min-width: 10em; }
.roster-window { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.roster-window input { -webkit-appearance: none; appearance: none; }
.roster-window input { width: 100%; min-width: 0; }
.roster-count { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-top: 12px; max-width: 560px; }
@media (min-width: 900px) { .roster-window { max-width: 560px; } }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 2px; }
.cal-wd.wk { color: #b3261e; }
.cal-day { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; border-radius: 10px; background: #f9f8f6; transition: background .15s, transform .1s; }
.cal-day:active:not(:disabled) { transform: scale(.95); }
.cal-day .n { font-size: 15px; font-weight: var(--w-ui); }
.cal-day.wk .n { color: #b3261e; }
.cal-day .m { font-size: 12px; min-height: 1.2em; font-weight: var(--w-ui); }
.cal-day.off { background: var(--off-bg); color: var(--off); }
.cal-day.annual { background: var(--leave-bg); color: var(--leave); }
.cal-day.clash { background: var(--clash-bg); color: var(--clash); box-shadow: inset 0 0 0 2px var(--clash); }
.cal-day.none { background: repeating-linear-gradient(135deg, #f6f5f3 0 4px, #fff 4px 8px); color: transparent; }
.cal-day:disabled { cursor: default; }
.pick-sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .35); display: flex; align-items: flex-end; justify-content: center; }
.pick-panel { width: 100%; max-width: 480px; background: #fff; border-radius: 18px 18px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.pick-panel h3 { margin: 0; font-size: 17px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; border-radius: 12px; border: 1px solid var(--line); }
.pick strong { font-size: 20px; }
.pick span { font-size: 12.5px; color: var(--muted); }
.pick.on { border-color: var(--brand); background: #f6eced; color: var(--brand); }
.pick.work strong { color: var(--on); }
@media (min-width: 700px) { .pick-sheet { align-items: center; } .pick-panel { border-radius: 18px; } }
.clash-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; margin-top: 12px; border-radius: 12px; background: #fffaf2; border: 1px solid #f3dcb5; }
.clash-card textarea { width: 100%; box-sizing: border-box; }
.clash-talk { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.clash-talk li { display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; padding: 8px 10px; background: #fff; border-radius: 10px; }
.clash-talk li small { color: var(--muted); font-size: 12px; }
.clash-talk li.insist { border-left: 3px solid var(--danger); }
.clash-talk li.yield, .clash-talk li.decide { border-left: 3px solid var(--on); }
.clash-decide { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px dashed #f3dcb5; }
.clash-decide small { color: var(--muted); }
.sched.roster td.tap { cursor: pointer; }
.sched.roster td.tap:active { filter: brightness(.94); }
.sched td.clash { background: var(--clash-bg); color: var(--clash); font-weight: var(--w-ui); box-shadow: inset 0 0 0 2px var(--clash); }
.sched tr.sum td { background: transparent; font-size: 12px; color: var(--muted); }
.legend i.clash { background: var(--clash-bg); box-shadow: inset 0 0 0 2px var(--clash); }
.group-row { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.group-row.archived { opacity: .55; }
.group-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* 請假頁 */
.leave-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; margin-top: 10px; border-radius: 12px; background: #f9f8f6; border: 1px solid transparent; }
.leave-card.focus { border-color: var(--brand); background: #fbf5f5; }
.leave-card.cancelled { opacity: .55; }
.leave-when { font-size: 14.5px; color: var(--muted); }
.leave-reason { font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.leave-proof { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.leave-proof small { color: var(--muted); font-size: 13px; }
.leave-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.leave-tools input:not([type]) { flex: 1; min-width: 10em; }
.leave-card .row input:not([type]) { flex: 1; min-width: 10em; }
.pill.ok { background: var(--on-bg); color: var(--on); }
.proof-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.proof-thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.table-wrap { overflow-x: auto; margin-top: 10px; }
.leave-stats { border-collapse: collapse; width: 100%; font-size: 14px; }
.leave-stats th, .leave-stats td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.leave-stats thead th { color: var(--muted); font-weight: var(--w-ui); border-top: none; white-space: nowrap; }
.leave-stats tbody th { white-space: nowrap; font-weight: var(--w-ui); }
#ask .form textarea, #ask .form select { width: 100%; box-sizing: border-box; }
.proof-rule { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.proof-rule .tag { margin-left: 6px; }
.leave-review { display: grid; gap: 8px; }
.proof-rule:first-child { border-top: none; }
.proof-rule select { max-width: 100%; }
.proof-rule .days-input { width: 64px; }
.proof-rule.dim { opacity: .55; }
/* 不能改的欄位（例如轉交時的標題、類型、份量）：灰底，一看就知道是固定的 */
.form input:disabled, .form select:disabled, .form textarea:disabled { background: var(--bg); color: var(--muted); }
.segmented input:disabled + span { opacity: .6; }
.segmented:has(input:disabled) { background: var(--bg); }

/* 排休的申請與規則（EC 2026-10-15）：虛線＝送了申請等同意；紅字日期＝國定假日 */
.cal-day.pending { box-shadow: inset 0 0 0 2px var(--leave); border: 0; background: repeating-linear-gradient(135deg, #fbf3f4 0 6px, #fff 6px 12px); color: var(--leave); }
.sched td.pending { background: repeating-linear-gradient(135deg, #fbf3f4 0 6px, #fff 6px 12px); color: var(--leave); font-weight: var(--w-ui); }
.legend i.pending { background: repeating-linear-gradient(135deg, #fbf3f4 0 6px, #fff 6px 12px); color: var(--leave); }
#mine .roster-count { white-space: normal; margin: 4px 0 8px; }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; }
.rules-grid input { width: 100%; }
.holiday-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.holiday-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.holiday-row > input:first-child { flex: 1 1 140px; min-width: 0; }
.holiday-row input[type=number] { width: 60px; }
#rules .row input { flex: 1 1 200px; min-width: 0; }
.red-staff { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; margin: 8px 0; }

/* 需關注事項：紅色要立刻處理、黃色要留意 */
.attention { list-style: none; padding: 0; margin: 8px 0; }
.att { border-left: 4px solid #e8b400; background: #fff8e1; border-radius: 8px; padding: 8px 10px; margin: 6px 0; line-height: 1.5; }
.att.red { border-left-color: var(--danger); background: #fdecea; }
.att-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.att-top a { color: inherit; }
.att.red .att-top a { color: var(--danger); }
.pill.att-red { background: var(--danger); color: #fff; }
.pill.att-yellow { background: #fff1c2; color: #7a5a00; }

/* 總覽頁：準時綠、晚交橘、逾期紅（顏色只當輔助，旁邊一定有文字件數） */
:root { --ov-on: #2e7d4f; --ov-late: #d98a1f; --ov-over: var(--danger); --ov-soft: #faf8f5; }
.ov-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ov-head h2 { margin: 0; }
.ov-note { margin: 12px 0 0; }
.ov-empty { text-align: center; padding: 18px 0 8px; }
.ov-ring { --p: 0deg; flex: 0 0 auto; width: 128px; height: 128px; border-radius: 50%; background: conic-gradient(var(--ov-on) var(--p), #ece8e2 0); display: grid; place-items: center; }
.ov-ring-in { width: 100px; height: 100px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ov-ring-in strong { font-size: 26px; line-height: 1.1; }
.ov-ring-in span { font-size: 11.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.ov-grid { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.ov-rows { list-style: none; padding: 0; margin: 0; }
.ov-rows li { padding: 10px 0; border-top: 1px solid #f0ede8; }
.ov-rows li:first-child { border-top: 0; padding-top: 2px; }
.ov-row-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ov-label { font-weight: var(--w-strong); }
.ov-big { font-size: 20px; font-weight: var(--w-strong); }
.ov-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: #ece8e2; margin: 6px 0 4px; }
.ov-bar span { display: block; height: 100%; flex-basis: 0; }
.ov-bar .on, .ov-legend .on { background: var(--ov-on); }
.ov-bar .late, .ov-legend .late { background: var(--ov-late); }
.ov-bar .over, .ov-legend .over { background: var(--ov-over); }
.ov-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.ov-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ov-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ov-av { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: 14px; font-weight: var(--w-strong); }
.ov-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ov-list { display: flex; flex-direction: column; gap: 8px; }
.ov-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #fdf1ef; color: var(--text); text-decoration: none; }
.ov-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.ov-item-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-days { flex: 0 0 auto; background: var(--danger); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: var(--w-ui); }
.ov-pairs { list-style: none; padding: 0; margin: 0; }
.ov-pairs li { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid #f0ede8; }
.ov-pairs li:first-child { border-top: 0; }
.ov-arrow { font-size: 16px; }
.ov-chips { margin-left: auto; display: inline-flex; gap: 6px; }
.ov-chip { background: var(--ov-soft); border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: var(--w-ui); white-space: nowrap; }
.ov-chip.red { background: #fdecea; color: var(--danger); }
.ov-trees { display: flex; flex-direction: column; gap: 10px; }
.ov-tree { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--card); }
.ov-tree.late { border-color: #f0c9c6; }
.ov-tree summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.ov-tree summary::-webkit-details-marker { display: none; }
.ov-tree summary::after { content: '›'; color: var(--muted); font-size: 20px; transition: transform .15s; }
.ov-tree[open] summary::after { transform: rotate(90deg); }
.ov-pct { font-weight: var(--w-strong); }
.ov-progress { height: 6px; border-radius: 3px; background: #ece8e2; margin: 10px 0 8px; overflow: hidden; }
.ov-progress-fill { display: block; height: 100%; background: var(--ov-on); border-radius: 3px; }
.ov-tree.late .ov-progress-fill { background: var(--ov-over); }
.ov-tree-kids { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid #ece8e2; }
.ov-tree-kids li { margin: 6px 0; }
.ov-node { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--ov-soft); color: var(--text); text-decoration: none; }
.ov-node-title { font-weight: var(--w-ui); }
.ov-node-top { display: flex; align-items: center; gap: 10px; }
.ov-node .ov-av { width: 26px; height: 26px; font-size: 12.5px; }
.ov-node .tags { margin-top: 4px; }
@media (max-width: 380px) { .ov-ring { width: 110px; height: 110px; } .ov-ring-in { width: 86px; height: 86px; } .ov-ring-in strong { font-size: 22px; } }
@media (min-width: 900px) {
  .page.ov-page { max-width: 1100px; }
  .ov-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}
.ov-date { color: var(--muted); }
/* 總覽：圓環＋小標籤、每月小圓環 */
.ov-ring.brand { background: conic-gradient(var(--brand) var(--p), #ece8e2 0); }
.ov-rings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ov-ring-box { display: flex; justify-content: center; background: var(--ov-soft); border-radius: 14px; padding: 14px 0; }
.ov-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ov-pill { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--ov-soft); border-radius: 999px; padding: 8px 10px; color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: var(--w-ui); white-space: nowrap; }
.ov-pill strong { font-size: 17px; color: var(--text); }
.ov-pill.red { background: #fdecea; } .ov-pill.red strong { color: var(--danger); }
.ov-pill.yellow { background: #fff6dc; } .ov-pill.yellow strong { color: #8a6200; }
.ov-month-rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.ov-month { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.ov-ring.small { width: 88px; height: 88px; margin-bottom: 4px; }
.ov-ring.small .ov-ring-in { width: 68px; height: 68px; }
.ov-ring.small .ov-ring-in strong { font-size: 18px; }
/* 總覽：三個圓環（第三個是上個月，灰色） */
.ov-ring.gray { background: conic-gradient(#8b8178 var(--p), #ece8e2 0); }
.ov-rings.n3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ov-rings.n3 .ov-ring { width: 96px; height: 96px; }
.ov-rings.n3 .ov-ring-in { width: 74px; height: 74px; }
.ov-rings.n3 .ov-ring-in strong { font-size: 19px; }
.ov-rings.n3 .ov-ring-in span { font-size: 11px; }
.ov-rings.n3 .ov-ring-box { padding: 12px 0; }

/* 例行任務：首頁「今天要做的事」、例行事項管理頁 */
.routine-card h2 { margin: 0; }
.routine-count { font-size: 20px; font-weight: var(--w-strong); color: var(--brand); }
.routine-progress { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
.routine-list { display: flex; flex-direction: column; }
.routine-item { padding: 12px 2px; border-top: 1px solid var(--line); }
.routine-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.routine-photo-ask { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0 0 36px; padding: 8px 10px; border-radius: 10px; background: var(--notice-bg); color: var(--notice); font-size: 14px; }
.routine-photo-ask button { flex: none; }
.review-photo { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 8px; margin-top: 4px; }
.routine-check input { width: 24px; height: 24px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }
.routine-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.routine-title { font-size: 16px; }
.routine-item.done .routine-title { color: var(--muted); text-decoration: line-through; }
.routine-time { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 6px; background: #f6eced; color: var(--brand); font-size: 13px; font-weight: var(--w-ui); }
.routine-review { color: var(--muted); }
.routine-review.ok { color: var(--ok); }
.routine-review.bad { color: var(--danger); }
.routine-carry { color: var(--notice); }
.routine-unfinished { margin-bottom: 14px; padding: 10px 12px; border-radius: 12px; background: var(--notice-bg); }
.routine-unfinished h3 { font-size: 15px; margin: 0 0 4px; color: var(--notice); }
.routine-unfinished .routine-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted-link { color: var(--muted); margin: 4px 0 0 36px; padding: 0; font-size: 13px; }
.routine-due { margin-top: 12px; }
.routine-due h3 { font-size: 15px; margin: 0 0 2px; }
.routine-dept { margin-top: 18px; }
/* 打掃和部門例行事項中間空一點（EC 2026-10-20：打掃獨立一區） */
.section-gap { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.dayend-nav { gap: 8px; align-items: center; margin: 8px 0; }
.dayend-close { margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: #faf8f5; }
.dayend-attention { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: var(--notice-bg); color: var(--notice); }
.dayend-attention h3 { font-size: 15px; margin: 0 0 4px; }
.dayend-dept { margin-top: 10px; }
.dayend-person { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.dayend-person progress { width: 100%; flex: none; }
.dayend-bad { color: var(--danger); }
.dayend-item { padding: 6px 0 6px 10px; border-left: 3px solid var(--danger); display: flex; flex-direction: column; gap: 2px; }
.dayend-item.done { border-left-color: var(--ok); }
.dayend-item .btn { align-self: flex-start; margin-top: 4px; }
.review-group { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.review-item, .assign-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.review-actions { display: flex; gap: 6px; flex: none; }
.assign-row select { flex: none; max-width: 45%; }
.exempt-picks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 10px; }
.check-line { display: flex; align-items: center; gap: 8px; }
.check-line.small { font-size: 14px; color: var(--muted); }
.rule-line { margin: 4px 0 12px; }
.check-line input { width: 20px; height: 20px; flex: none; accent-color: var(--brand); }
.exempt-pick { display: flex; align-items: center; gap: 6px; }
.routine-dept h3 { font-size: 16px; margin: 0 0 4px; }
.routine-tpl { padding: 10px 2px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.routine-tpl.off { opacity: .6; }
.routine-tpl .tags .tag:first-child { margin-left: 0; }
.routine-form { display: flex; flex-direction: column; gap: 12px; padding: 12px; margin: 10px 0; border-radius: 12px; background: #faf8f5; }
.day-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pick { display: inline-flex; }
.day-pick input { position: absolute; opacity: 0; pointer-events: none; }
.day-pick span { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.day-pick input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.day-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 例行事項分組（EC 2026-10-17） */
.tag.group { background: #efe7f6; color: #5b2a86; }
.routine-title .tag.group { margin-left: 6px; vertical-align: 1px; }
.group-box { margin: 6px 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #faf9f7; }
.group-box summary { cursor: pointer; }
.group-box p { margin: 8px 0; }
.group-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.rgroup-row { display: flex; align-items: center; gap: 8px; }
.group-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.group-no { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.group-actions { display: inline-flex; gap: 4px; margin-left: auto; flex-shrink: 0; }
.group-add { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.group-add input { flex: 1 1 160px; min-width: 0; }
.group-head { display: flex; align-items: center; gap: 8px; padding: 10px 2px 2px; }
.group-head .tag { margin-left: 0; }
.ext-hint { display: block; }

/* ===== 打卡（EC 2026-10-17）：首頁和打卡頁共用 ===== */
.tag.warn { background: var(--leave-bg); color: var(--leave); }
.punch-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.punch-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #faf8f5; border-radius: 12px; padding: 12px 4px; }
.punch-slot span { font-size: 13px; color: var(--muted); }
.punch-slot strong { font-size: 24px; line-height: 1.2; color: var(--muted); }
.punch-slot.done { background: var(--on-bg); }
.punch-slot.done strong { color: var(--on); }
.punch-flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.punch-flags .tag { margin-left: 0; }
.punch-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.punch-buttons > .btn { flex: 1 1 0; min-width: 120px; }
.punch-buttons > .btn.small { flex: 0 0 auto; min-width: 0; }
.punch-buttons > input { flex: 1 1 auto; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; }
.punch-outside { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 14px; border-radius: 12px; background: var(--leave-bg); }
.punch-outside p { margin: 0; }
.punch-outside textarea, .punch-fix-row input, .punch-fix-row select, .punch-place-row input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; background: #fff; }
.punch-photo-row { display: flex; align-items: center; gap: 10px; }
.punch-photo { max-width: 160px; max-height: 160px; border-radius: 10px; object-fit: cover; margin-top: 6px; }
.punch-record { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px dashed var(--line); }
.punch-record.dim { opacity: .55; }
.punch-actions { text-align: right; }
.punch-days, .punch-team { display: flex; flex-direction: column; margin-top: 8px; }
.punch-day, .punch-person { border-top: 1px solid var(--line); padding: 10px 2px; }
.punch-day summary, .punch-person summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; cursor: pointer; list-style: none; }
.punch-day summary::-webkit-details-marker, .punch-person summary::-webkit-details-marker { display: none; }
.punch-date, .punch-name { min-width: 92px; }
.punch-times { font-variant-numeric: tabular-nums; }
.punch-day .punch-flags, .punch-person .punch-flags { margin: 0; flex-basis: 100%; }
.punch-month-nav { display: flex; align-items: center; gap: 8px; }
.punch-month { margin-top: 10px; padding: 10px; border-radius: 12px; background: #faf8f5; }
.punch-month h3 { font-size: 15px; margin: 0 0 4px; }
.punch-fix-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.punch-fix-row .field:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
.punch-place { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.punch-place .btn { align-self: flex-start; }
.punch-place-row { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.punch-howto { padding-left: 20px; margin: 4px 0 8px; }
.punch-howto li { margin-bottom: 2px; }
.punch-actions .muted-link { margin: 0; }
.punch-card a.link-btn, .punch-person .link-btn, .punch-place a.link-btn { color: var(--brand); text-decoration: none; margin-left: 0; }
#fix textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; }

/* ===== 出勤異常（打卡頁）：上面四格數字、下面一人一張卡，點開看哪幾天 =====
   配色是 EC 2026-10-17 選的 A 版「品牌酒紅」：遲到早退金褐、少打卡酒紅、等主管處理灰 */
:root { --anom-time: #8a6a2e; --anom-time-bg: #f6efe0; --anom-miss: var(--brand); --anom-miss-bg: #f6e9ea; --anom-wait: #5b5f66; --anom-wait-bg: #eeeef0; }
.anom-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.anom-head h2 { margin: 0; }
.anom-nav { display: inline-flex; align-items: center; gap: 2px; background: var(--brand); color: #fff; border-radius: 999px; padding: 3px; font-weight: var(--w-ui); font-variant-numeric: tabular-nums; }
.anom-nav span { padding: 0 8px; font-size: 15px; }
.anom-nav-btn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.anom-nav-btn:active { background: rgba(255,255,255,.18); }
.anom-stats { margin: 16px 0 14px; }
.anom-stats .stat strong { font-variant-numeric: tabular-nums; }
.anom-stats .stat { background: #faf8f5; border: 1px solid #ece7e1; }
.anom-stats .stat strong { color: var(--muted); }
.anom-stats .stat.bad strong { color: var(--brand); }
.anom-stats .stat.time strong { color: var(--anom-time); }
.anom-list { display: flex; flex-direction: column; gap: 10px; }
.anom-person { background: #faf8f5; border-radius: 14px; border: 1px solid transparent; transition: border-color .15s, background .15s; }
.anom-person[open] { background: var(--card); border-color: var(--line); }
.anom-person summary { display: block; padding: 12px 14px; cursor: pointer; list-style: none; }
.anom-row { display: flex; align-items: center; gap: 12px; }
.anom-person summary::-webkit-details-marker { display: none; }
.anom-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--brand); color: #fff; font-weight: var(--w-strong); font-size: 17px; }
.anom-avatar.two { font-size: 13px; letter-spacing: 0; }
.anom-who { flex: 1; display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.anom-who small { color: var(--muted); font-size: 13px; }
.anom-total { display: flex; align-items: baseline; gap: 2px; color: var(--brand); }
.anom-total strong { font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.anom-total small { font-size: 13px; }
.anom-chevron { width: 18px; color: var(--muted); font-size: 20px; transition: transform .2s; text-align: center; }
.anom-person[open] .anom-chevron { transform: rotate(90deg); }
.anom-person summary .anom-chips { padding-left: 52px; margin-top: 8px; }
.anom-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.anom-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: var(--w-ui); white-space: nowrap; }
.anom-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.anom-chip.time { background: var(--anom-time-bg); color: var(--anom-time); }
.anom-chip.miss { background: var(--anom-miss-bg); color: var(--anom-miss); }
.anom-chip.wait { background: var(--anom-wait-bg); color: var(--anom-wait); }
.anom-days { margin: 0 14px 12px 66px; border-left: 2px solid var(--line); }
.anom-day { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px 0 10px 16px; }
.anom-day::before { content: ''; position: absolute; left: -6px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--anom-miss); }
.anom-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.anom-day-time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.anom-empty { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 22px 12px; border-radius: 14px; background: var(--on-bg); color: var(--on); text-align: center; }
.anom-empty small { color: var(--muted); }
.anom-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.anom-legend span { display: inline-flex; align-items: center; gap: 6px; }
.anom-legend i { width: 10px; height: 10px; border-radius: 50%; }
.anom-legend i.time { background: var(--anom-time); } .anom-legend i.miss { background: var(--anom-miss); } .anom-legend i.wait { background: var(--anom-wait); }
@media (max-width: 480px) { .anom-days { margin-left: 24px; } .anom-person summary .anom-chips { padding-left: 0; } }
.punch-photo-backup { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ===== 人員指標（metrics）：收到速度、準時率、退回次數，只觀察不考核 =====
   圖表顏色：單一數字用品牌酒紅；準時／晚交／逾期沿用總覽頁的綠橘紅（旁邊一定有文字） */
:root { --mx-series: var(--brand); --mx-series-soft: #d9b7bb; --mx-grid: #ece8e2; }
.page.mx-page { max-width: 1100px; }
.mx-page.mx-loading { opacity: .55; transition: opacity .15s; }
.mx-card h2 { margin: 0; }
.mx-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mx-head select { width: auto; }
.mx-note { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: #f6eced; color: var(--brand); font-size: 14px; line-height: 1.6; }
.mx-label { font-size: 13px; color: var(--muted); font-weight: var(--w-ui); }
.mx-small { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
/* 這個月三個數字 */
.mx-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mx-kpi { background: var(--ov-soft); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mx-kpi-big { font-size: 30px; line-height: 1.15; font-weight: var(--w-strong); color: var(--text); }
.mx-kpi-big.none { color: var(--muted); }
.mx-prev { margin-top: 4px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 6px; }
/* 趨勢圖 */
.mx-trends { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mx-trend { background: var(--ov-soft); border-radius: 14px; padding: 12px 10px 6px; min-width: 0; }
.mx-trend-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 4px 4px; }
.mx-chart { display: block; width: 100%; height: auto; overflow: visible; }
.mx-grid { stroke: var(--mx-grid); stroke-width: 1; }
.mx-base { stroke: #cfc9c1; stroke-width: 1; }
.mx-axis { font-size: 10.5px; fill: var(--muted); }
.mx-axis.sel { fill: var(--text); font-weight: var(--w-strong); }
.mx-val { font-size: 12.5px; fill: var(--text); font-weight: var(--w-strong); stroke: var(--ov-soft); stroke-width: 4px; stroke-linejoin: round; paint-order: stroke; }
.mx-line { fill: none; stroke: var(--mx-series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mx-dot { fill: var(--mx-series); stroke: var(--ov-soft); stroke-width: 2; }
.mx-dot.sel { stroke: #fff; stroke-width: 2.5; }
.mx-col { fill: var(--mx-series-soft); }
.mx-col.sel { fill: var(--mx-series); }
.mx-hit { fill: transparent; cursor: pointer; outline: none; }
.mx-hit:hover, .mx-hit:focus { fill: rgba(126, 24, 34, .06); }
/* 提示框 */
.mx-tip { position: absolute; z-index: 50; pointer-events: none; background: #2b2724; color: #fff; border-radius: 10px; padding: 8px 11px; font-size: 13px; line-height: 1.5; box-shadow: 0 6px 18px rgba(0,0,0,.18); max-width: 240px; }
.mx-tip[hidden] { display: none; }
.mx-tip-head { display: flex; align-items: baseline; gap: 8px; }
.mx-tip-head strong { font-size: 16px; font-weight: var(--w-strong); }
.mx-tip-head span { color: #d8d2cb; }
.mx-tip-row { color: #e9e4de; }
/* 長條（準時／晚交／逾期） */
.mx-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--mx-grid); margin: 4px 0 2px; }
.mx-bar span { display: block; height: 100%; flex-basis: 0; }
.mx-bar .on, .mx-legend .on { background: var(--ov-on); }
.mx-bar .late, .mx-legend .late { background: var(--ov-late); }
.mx-bar .over, .mx-legend .over { background: var(--ov-over); }
.mx-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.mx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mx-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
/* 每個人比較 */
.mx-tabs { grid-template-columns: repeat(3, 1fr); margin: 0 0 6px; }
.mx-rank-sub { margin: 6px 0 8px; }
.mx-rank { display: flex; flex-direction: column; gap: 2px; }
.mx-rank-row { display: grid; grid-template-columns: 64px 1fr 72px; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 10px; cursor: pointer; outline: none; }
.mx-rank-row:hover, .mx-rank-row:focus { background: #f6eced; }
.mx-rank-name { font-weight: var(--w-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-rank-bar .mx-bar { height: 12px; border-radius: 6px; margin: 0; }
.mx-track { height: 12px; border-radius: 6px; background: var(--mx-grid); overflow: hidden; }
.mx-fill { display: block; height: 100%; background: var(--mx-series); border-radius: 0 6px 6px 0; }
.mx-rank-val { text-align: right; font-weight: var(--w-strong); white-space: nowrap; }
/* 每個人的卡片 */
.mx-two { display: grid; grid-template-columns: 1fr; gap: 0 16px; align-items: start; }
.mx-people { display: flex; flex-direction: column; gap: 10px; }
.mx-person { background: #faf8f5; border-radius: 14px; padding: 12px; }
.mx-who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mx-av { flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--brand); color: #fff; font-weight: var(--w-strong); font-size: 16px; }
.mx-av.two { font-size: 12.5px; }
.mx-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.mx-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mx-big { font-size: 20px; font-weight: var(--w-strong); line-height: 1.25; color: var(--text); }
.mx-big.none { color: var(--muted); }
.mx-empty { text-align: center; padding: 16px 0 6px; }
.mx-how-box summary { cursor: pointer; font-weight: var(--w-strong); font-size: 16px; }
.mx-how { margin: 10px 0 0; padding-left: 18px; line-height: 1.7; font-size: 14px; }
.mx-how li { margin-bottom: 8px; }
@media (min-width: 900px) {
  .mx-two { grid-template-columns: 1fr 1fr; }
  .mx-two .mx-cells { gap: 8px; }
  .mx-two .mx-big { font-size: 18px; }
}
@media (max-width: 720px) {
  .mx-trends { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 480px) {
  .mx-kpis { grid-template-columns: 1fr; }
  .mx-kpi { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: baseline; }
  .mx-kpi .mx-label, .mx-kpi .mx-bar, .mx-kpi .mx-small, .mx-kpi .mx-prev { grid-column: 1 / -1; }
  .mx-kpi-big { font-size: 26px; }
  .mx-cells { gap: 8px; }
  .mx-big { font-size: 17px; }
  .mx-rank-row { grid-template-columns: 56px 1fr 64px; gap: 8px; }
}

/* ---------- 考核設置（review-settings）：每一類一個可以點開的標題 ---------- */
.rv-section { padding: 0; overflow: hidden; }
.rv-section > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; }
.rv-section > summary::-webkit-details-marker { display: none; }
.rv-section > summary h2 { margin: 0; font-size: 17px; }
.rv-section > summary p { margin: 2px 0 0; }
.rv-section > summary::after { content: ''; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 4px 4px 0; transition: transform .2s; }
.rv-section[open] > summary::after { transform: rotate(225deg); margin: 4px 4px 0 0; }
.rv-section[open] > summary { border-bottom: 1px solid var(--line); }
.rv-count { margin-left: auto; flex: none; font-size: 13px; color: var(--muted); }
.rv-body, .rv-section > .timeline, .rv-section > p { padding: 4px 18px 18px; }
.rv-item { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; border-top: 1px solid var(--line); }
.rv-item:first-child { border-top: 0; }
.rv-item-head { display: flex; align-items: center; gap: 8px; }
.rv-item h3 { margin: 0; font-size: 15.5px; }
.rv-item p { margin: 0; }
.rv-item .inline-form { margin: 4px 0 0; }
.rv-inline { display: flex; align-items: center; gap: 8px; }
.rv-inline > span { white-space: nowrap; }
.rv-inline input { width: 110px; }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.rv-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rv-field > span { font-size: 13.5px; color: #555; }
.rv-field select, .rv-field input:not([type=checkbox]) { width: 100%; min-width: 0; }
.rv-grid .rv-inline input { width: 100%; min-width: 0; }
.rv-rows { display: flex; flex-direction: column; }
.rv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; font-size: 14.5px; }
.rv-row input { width: 80px; }
.rv-rules { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.rv-rule { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #fff; }
.rv-rule-head { display: flex; align-items: flex-end; gap: 12px; }
.rv-grow { flex: 1; }

/* 考核待辦（review-team）：責任主管每天確認自己負責的人 */
.rt-section { margin-top: 18px; }
.rt-section > summary { cursor: pointer; list-style: none; }
.rt-section > summary h3 { display: inline; }
.rt-section > summary::before { content: '▸ '; color: var(--muted); }
.rt-section[open] > summary::before { content: '▾ '; }
.rt-section .routine-item small { display: block; margin-top: 4px; line-height: 1.5; }
.rt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.rt-cats { display: flex; flex-direction: column; gap: 6px; }
.rt-cat { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.rt-cat span { display: flex; flex-direction: column; gap: 2px; }
.rt-cat input { margin-top: 4px; }
.rt-scope { display: flex; align-items: center; gap: 6px; margin: 6px 0 2px; color: var(--muted); }
.rt-fallback .small { margin-top: 4px; }
.rt-notice { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.rt-notice .btn { align-self: flex-start; }
.rt-region-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line); }

/* 考核：計分任務標籤、協調清單 */
.pill.score { background: #e7f0fb; color: #2a5a8f; }
.timeline li .pill { margin-left: 6px; }
.timeline li .form { margin-top: 8px; }
.notice .btn.small { margin-left: 8px; }

/* 任務照片：小圖一排、點開全螢幕 */
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.photo-thumb { position: relative; width: 72px; height: 72px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f4f4f4; cursor: pointer; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-x { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; line-height: 22px; cursor: pointer; }
.photo-view { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .9); padding: 16px; }
.photo-view img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* 考核：季出勤（人資）、季評價（主管） */
.tag.warn-tag { background: #fff1e6; color: #8a3a00; }
.ra-summary { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 4px; font-size: 14px; font-weight: var(--w-ui); }
.ra-row .row-between { flex-wrap: wrap; }
.ra-row small { display: block; margin-top: 4px; line-height: 1.5; }
.ra-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.ra-num { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 10px; background: #f6f4f1; color: var(--muted); }
.ra-num b { font-size: 18px; font-weight: var(--w-strong); color: var(--text); }
.ra-num.has b { color: #8a3a00; }
.ra-num small { font-size: 12px; margin: 0; }
.ra-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ra-inputs input { width: 100%; }
.ra-awol { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ra-awol > small { flex-basis: 100%; }
.ra-day { display: flex; align-items: center; gap: 4px; font-size: 15px; }
.ra-confirm { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.rr-person { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; color: inherit; font: inherit; cursor: pointer; }
.rr-person:active { background: #f6f4f1; }
.rr-name { margin-top: 12px; }
.rr-item { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.rr-item-head { display: flex; justify-content: space-between; align-items: center; }
.rr-scale > summary { cursor: pointer; }
.rr-scale > div { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; line-height: 1.5; }
.rr-evidence textarea { width: 100%; }
.rr-preview { margin: 12px 0 0; font-weight: var(--w-strong); }
.rr-incident { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; line-height: 1.5; }
.rr-incident.revoked { color: var(--muted); text-decoration: line-through; }
.rr-revoke { align-self: flex-start; margin-left: 0; }
.rr-add { margin-top: 10px; }
.rr-add > summary { cursor: pointer; color: var(--brand); font-weight: var(--w-ui); }
.rr-add textarea { width: 100%; }
/* 考核申訴（R6） */
.ap-item { display: flex; flex-direction: column; gap: 6px; }
.ap-item.ap-overdue { border: 1.5px solid #e3a49c; border-radius: 12px; padding: 12px; margin: 8px 0; background: #fffafa; }
.ap-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ap-tags .tag { margin-left: 0; }
.ap-title { font-size: 16px; line-height: 1.45; }
.ap-result-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.ap-result { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: var(--w-ui); background: #f1eeea; color: #5c544e; }
.ap-result.bad { background: #fde8e6; color: #b42318; }
.ap-result.warn { background: #fff1e6; color: #8a3a00; }
.ap-result.good { background: #e7f4ec; color: #1e7b45; }
.ap-timeline { list-style: none; margin: 6px 0 0; padding: 0 0 0 4px; }
.ap-step { position: relative; padding: 0 0 12px 20px; border-left: 2px solid var(--line); line-height: 1.55; }
.ap-step:last-child { border-left-color: transparent; padding-bottom: 0; }
.ap-step::before { content: ''; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); }
.ap-step.good::before { background: #1e7b45; }
.ap-step.pending::before { background: var(--card); border: 2px solid #b8aea6; width: 8px; height: 8px; }
.ap-step.pending.bad::before { border-color: #b42318; }
.ap-step.pending.bad small { color: #b42318; }
.ap-step-body { white-space: pre-wrap; }
.ap-item textarea { width: 100%; }
.ap-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ap-help { margin: -4px 0 4px; font-size: 14px; }
.ap-help > summary, .ap-done > summary { cursor: pointer; color: var(--brand); font-weight: var(--w-ui); }
.ap-help ol { margin: 6px 0 0; padding-left: 20px; line-height: 1.6; color: #5c544e; }
.ap-done { margin-top: 18px; }
.ap-done > summary { padding: 8px 0; }

/* ===== 考核分數（我的考核、團隊考核、全公司考核、資格清單；員工考核 R7） ===== */
/* 分數顏色：90 以上綠、70 以上酒紅、60 以上橘、60 以下紅 */
:root { --sc-top: #2e7d4f; --sc-good: #7E1822; --sc-mid: #c26a12; --sc-low: #b3261e; --sc-none: #c9c3bc; --sc-soft: #faf8f5; }
.t-top { color: var(--sc-top); } .t-good { color: var(--sc-good); } .t-mid { color: var(--sc-mid); } .t-low { color: var(--sc-low); } .t-none { color: var(--muted); }
.warn-text { color: #8a3a00; }
.stat.warn { background: #fff1e6; } .stat.warn strong { color: #8a3a00; }
.sc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sc-top h2 { margin: 0; }
.sc-top select, .sc-filter-box select { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 14px; }
.sc-note { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.55; }

/* 分數卡 */
.sc-card { margin-top: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); padding: 18px; box-shadow: 0 2px 10px rgba(60,40,30,.05); }
.sc-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 18px; }
.sc-empty-icon { font-size: 34px; }
.sc-empty p { margin: 6px 0 0; }
.sc-hero { display: flex; align-items: center; gap: 18px; }
.sc-hero-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.sc-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.sc-badges .tag { margin-left: 0; font-size: 12.5px; padding: 2px 8px; }
.sc-ring { --p: 0; --c: var(--sc-none); flex-shrink: 0; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #efebe6 0); }
.sc-ring.b-top { --c: var(--sc-top); } .sc-ring.b-good { --c: var(--sc-good); } .sc-ring.b-mid { --c: var(--sc-mid); } .sc-ring.b-low { --c: var(--sc-low); }
.sc-ring-in { width: 88px; height: 88px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sc-ring-in strong { font-size: 30px; line-height: 1.05; color: var(--c); letter-spacing: 0; }
.sc-ring-in span { font-size: 12px; color: var(--muted); }
.sc-formula { margin: 12px 0 0; display: flex; flex-direction: column; gap: 1px; font-size: 14px; background: var(--sc-soft); border-radius: 10px; padding: 8px 12px; }
.sc-formula small { font-size: 12px; }
.sc-rows { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.sc-row { display: flex; flex-direction: column; gap: 5px; }
.sc-row-flat { background: var(--sc-soft); border-radius: 12px; padding: 10px 12px; }
.sc-row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sc-row-name .tag { margin-left: 6px; }
.sc-row-top b { font-size: 18px; letter-spacing: 0; white-space: nowrap; }
.sc-row-top b small { font-size: 13px; font-weight: var(--w-text); }
.sc-coef.b-good, .sc-coef.b-top { color: var(--sc-top); } .sc-coef.b-mid { color: var(--sc-mid); } .sc-coef.b-low { color: var(--sc-low); }
.sc-zero { color: var(--muted); }
.sc-bar { height: 8px; border-radius: 999px; background: #efebe6; overflow: hidden; }
.sc-bar i { display: block; height: 100%; border-radius: 999px; background: var(--sc-none); transition: width .4s ease; }
.sc-bar.b-top i { background: var(--sc-top); } .sc-bar.b-good i { background: var(--sc-good); } .sc-bar.b-mid i { background: var(--sc-mid); } .sc-bar.b-low i { background: var(--sc-low); }

/* 明細、資格、歷史 */
.sc-section { margin-top: 22px; }
.sc-section h3, .sc-history h3 { margin: 0 0 6px; font-size: 17px; }
.sc-detail { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 0 14px; }
.sc-items + .sc-items { border-top: 1px solid var(--line); }
.sc-items { padding: 12px 0; }
.sc-items summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; list-style: none; }
.sc-items summary::-webkit-details-marker { display: none; }
.sc-items summary::after { content: '⌄'; color: var(--muted); margin-left: 8px; }
.sc-items[open] summary::after { content: '⌃'; }
.sc-items summary > span:first-child { flex: 1; }
.sc-count { min-width: 24px; padding: 0 8px; border-radius: 999px; background: #f1eeea; color: #6b635c; font-size: 12.5px; line-height: 22px; text-align: center; }
.sc-list { list-style: none; padding: 0; margin: 6px 0 0; }
.sc-list li { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.sc-list li .tag { margin-left: 0; }
.sc-date { color: var(--muted); font-size: 13px; min-width: 40px; }
.sc-name { flex: 1; min-width: 140px; }
.sc-name .tag { margin-left: 6px; }
.sc-appeal { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sc-elig-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.sc-elig-card { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.sc-elig-card.ok { border-color: #bfe0cb; background: #f4fbf6; }
.sc-elig-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sc-elig-top > div:first-child { display: flex; flex-direction: column; }
.sc-elig-res { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sc-elig-res .tag { margin-left: 0; }
.sc-meter { display: flex; flex-direction: column; gap: 3px; }
.sc-history { margin-top: 22px; }
.sc-hist-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.sc-hist { display: flex; flex-direction: column; align-items: stretch; gap: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 10px 12px; cursor: pointer; text-align: left; color: var(--text); font-size: 14px; }
.sc-hist.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(126,24,34,.12); }
.sc-hist b { font-size: 22px; letter-spacing: 0; line-height: 1.2; }
.sc-hist .sc-bar { height: 5px; }

/* 名單 */
.sc-people { display: flex; flex-direction: column; margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.sc-person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--text); font-size: 15px; cursor: pointer; }
.sc-person:first-child { border-top: 0; }
.sc-person:not(.sc-static):active { background: var(--sc-soft); }
.sc-person.sc-static { cursor: default; }
.sc-person-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sc-person-score { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.sc-person-score b { font-size: 24px; line-height: 1.1; letter-spacing: 0; }
.sc-person-score .tag { margin-left: 0; }
.sc-avatar { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: var(--w-strong); color: #fff; background: var(--sc-none); }
.sc-avatar.b-top, .sc-avatar.s-eligible { background: var(--sc-top); } .sc-avatar.b-good { background: var(--sc-good); } .sc-avatar.b-mid, .sc-avatar.s-insufficient, .sc-avatar.s-extra_missing { background: var(--sc-mid); } .sc-avatar.b-low { background: var(--sc-low); }
.sc-avatar.big { width: 52px; height: 52px; font-size: 22px; }
.sc-avatar.small { width: 26px; height: 26px; font-size: 12px; display: inline-grid; vertical-align: middle; margin-right: 8px; }
.sc-minis { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.sc-mini { display: inline-flex; gap: 3px; align-items: baseline; font-size: 12.5px; background: #f3f0ec; border-radius: 6px; padding: 1px 6px; font-weight: var(--w-ui); }
.sc-mini i { font-style: normal; color: var(--muted); font-weight: var(--w-text); }
.sc-mini.warn-tag { background: #fff1e6; color: #8a3a00; }
.sc-mini.bad { background: #fde8e6; color: #b42318; }
.sc-who { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.sc-who h2 { margin: 0; line-height: 1.2; }

/* 全公司考核：季的狀態、篩選、分布、表格 */
.sc-panel { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.sc-qstate { display: flex; align-items: center; gap: 6px; }
.sc-filter-box { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; padding: 12px 14px; border-radius: 14px; background: var(--sc-soft); }
.sc-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sc-filter-label { font-size: 13px; color: var(--muted); min-width: 2.5em; }
.sc-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; }
.sc-chip-group { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: #efebe6; }
.sc-chip, .sc-chip-title { border: 1px solid transparent; border-radius: 999px; padding: 5px 12px; font-size: 14px; background: var(--card); color: var(--text); cursor: pointer; }
.sc-chip-title { background: none; color: var(--muted); font-size: 13px; padding: 5px 8px; }
.sc-chip-title.on { color: var(--brand); }
.sc-chip.on { background: var(--brand); color: #fff; }
.sc-chips > .sc-chip { border-color: var(--line); }
.sc-chips > .sc-chip.on { border-color: var(--brand); }
.sc-spread-box { margin-top: 12px; }
.sc-spread { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; background: #efebe6; }
.sc-spread i { display: block; min-width: 6px; }
.sc-spread i.b-top, .sc-legend i.b-top { background: var(--sc-top); } .sc-spread i.b-good, .sc-legend i.b-good { background: var(--sc-good); }
.sc-spread i.b-mid, .sc-legend i.b-mid { background: var(--sc-mid); } .sc-spread i.b-low, .sc-legend i.b-low { background: var(--sc-low); }
.sc-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--muted); }
.sc-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.sc-legend b { color: var(--text); }
.sc-table { width: 100%; border-collapse: collapse; margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; font-size: 14.5px; }
.sc-table th { text-align: left; font-size: 13px; color: var(--muted); background: var(--sc-soft); padding: 10px 12px; white-space: nowrap; }
.sc-table td { padding: 10px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
.sc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sc-table td.num b { font-size: 17px; }
.sc-table td .tag { margin-left: 0; margin-right: 4px; }
.sc-table tbody tr { cursor: pointer; }
.sc-table tbody tr:hover, .sc-table tbody tr:focus { background: #fbf7f4; outline: none; }
.sc-wide { display: none; overflow-x: auto; }
@media (min-width: 760px) { .sc-wide { display: block; } .sc-narrow { display: none; } }

/* 資格清單 */
.sc-rule { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.sc-tally { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sc-tally-item { display: flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 12px; background: #f1eeea; font-size: 13.5px; }
.sc-tally-item strong { font-size: 20px; letter-spacing: 0; }
.sc-tally-item.good { background: #e7f4ec; color: #1e7b45; } .sc-tally-item.warn-tag { background: #fff1e6; color: #8a3a00; } .sc-tally-item.bad { background: #fde8e6; color: #b42318; }
.sc-correct { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: var(--card); }
.sc-correct summary { cursor: pointer; }
.sc-correct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.sc-date-pick { display: flex; align-items: center; gap: 6px; }
.sc-date-pick input { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.sc-warn { background: #fff1e6; color: #8a3a00; border-radius: 10px; padding: 8px 12px; }
@media (max-width: 420px) {
  .sc-hero { gap: 14px; }
  .sc-ring { width: 96px; height: 96px; } .sc-ring-in { width: 76px; height: 76px; } .sc-ring-in strong { font-size: 26px; }
}
.att-rule { margin-left: 0; margin-right: 2px; }

/* ===== 考核規則（review-rules，R9）：公布版說明，內容是主機產生的，樣式都在這裡 ===== */
.rr-title { font-size: 20px; margin: 0; }
.rr-pick { margin-top: 10px; }
.rr-preview-flag { background: #fff1e6; color: #8a3a00; border-radius: 10px; padding: 10px 12px; margin: 0 0 16px; font-weight: var(--w-ui); }
.rr-doc { line-height: 1.75; }
.rr-doc h2 { font-size: 18px; color: var(--brand); margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.rr-doc h3 { font-size: 16px; margin: 20px 0 6px; }
.rr-doc h4 { font-size: 15px; margin: 16px 0 6px; }
.rr-doc p { margin: 0 0 10px; }
.rr-doc ul { margin: 0 0 10px; padding-left: 1.3em; }
.rr-doc li { margin-bottom: 4px; }
.rr-head { text-align: center; margin-bottom: 18px; }
.rr-head h1 { font-size: 22px; margin: 0 0 4px; }
.rr-sub { color: var(--muted); }
.rr-ver { font-size: 13px; color: var(--muted); }
.rr-box { background: #f7f5f1; border-left: 4px solid var(--brand); border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.rr-box p:last-child { margin-bottom: 0; }
.rr-box-title { font-weight: var(--w-strong); }
.rr-box.rr-formula { background: #eef3f8; border-left-color: #1f4e79; text-align: center; }
.rr-table-wrap { overflow-x: auto; margin: 8px 0 14px; -webkit-overflow-scrolling: touch; }
.rr-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.rr-table th, .rr-table td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.rr-table th { background: #f4f1ec; white-space: nowrap; }
.rr-fig { margin: 14px 0; text-align: center; }
.rr-fig img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.rr-fig figcaption { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.rr-faq dt { font-weight: var(--w-strong); margin-top: 12px; }
.rr-faq dd { margin: 4px 0 0; }
.rr-end { margin-top: 22px; text-align: center; color: var(--muted); }

/* 列印：只印規則內容（上方選單、版本選擇、發布區塊都不印），表格和圖不要被切成兩半 */
@media print {
  body { background: #fff; }
  .topbar, .tabbar, #nav, #bar, #publish, .toast { display: none !important; }
  .page { max-width: none; padding: 0; }
  .card { box-shadow: none; border-radius: 0; padding: 0; margin: 0; }
  .rr-preview-flag { border: 1px solid #8a3a00; }
  .rr-doc h2 { break-after: avoid; }
  .rr-table-wrap { overflow: visible; }
  .rr-table, .rr-fig, .rr-box, .rr-faq dd { break-inside: avoid; }
  .rr-fig img { max-height: 9cm; width: auto; }
}

/* 會議紀錄：內容可以粗體和 5 種顏色（黑色就是沒有顏色） */
.mc-red { color: #c62828; }
.mc-blue { color: #1565c0; }
.mc-green { color: #2e7d32; }
.mc-orange { color: #e65100; }
.mc-black { color: var(--text); }
.mt-search { width: 100%; margin: 8px 0 0; }
/* 清單：左邊日期塊、右邊標題和狀態，還沒收到的右上角紅點 */
.list:has(.mt-row) { gap: 10px; margin-top: 12px; }
.list-item.mt-row { display: flex; gap: 14px; align-items: flex-start; position: relative; color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; transition: box-shadow .15s, transform .1s; }
.list-item.mt-row:hover { box-shadow: 0 3px 12px rgba(60,40,30,.08); }
.list-item.mt-row:active { transform: scale(.99); background: #fff; }
.list-item.mt-row.mt-todo { border-color: #ecd3d5; background: #fffafa; }
.mt-date { flex: 0 0 52px; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 10px; background: #f6efea; color: #6b4f45; line-height: 1.2; }
.mt-date strong { font-size: 22px; color: var(--text); }
.mt-date-m, .mt-date-w { font-size: 12px; }
.mt-todo .mt-date { background: var(--brand); color: #f6dfe1; }
.mt-todo .mt-date strong { color: #fff; }
.mt-row-main { flex: 1; min-width: 0; }
.mt-row-title { display: block; font-size: 16px; line-height: 1.4; }
.mt-row-sub { font-size: 13px; margin-top: 2px; }
.mt-row .tags { margin-top: 8px; gap: 6px; }
.mt-row .tags .tag { margin-left: 0; }
.mt-dot { position: absolute; top: 12px; right: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
/* 看一份：酒紅頁首放標題、時間、誰的會；收到了／收到進度固定在最下面 */
.mt-card { padding: 0; overflow: hidden; }
.mt-head { position: relative; padding: 20px 18px 16px; background: linear-gradient(135deg, var(--brand), #a3343f); color: #fff; }
.mt-head-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mt-head-tags .tag { margin-left: 0; background: rgba(255,255,255,.18); color: #fff; }
.mt-head-tags .tag.bad, .mt-head-tags .tag.warn { background: #ffe7b8; color: #7a4b00; }
.mt-head-tags .tag.good { background: #dff3e6; color: #1e7b45; }
.mt-card h2 { margin: 0; font-size: 22px; line-height: 1.4; color: #fff; }
.mt-when { margin-top: 6px; color: #f3d9dc; font-size: 14.5px; }
.mt-tools { display: flex; gap: 8px; margin-top: 14px; }
.mt-tools .btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); }
.mt-infos { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.22); font-size: 14.5px; }
.mt-info { display: grid; grid-template-columns: 4.5em 1fr; gap: 10px; align-items: baseline; }
.mt-label { color: #f0c9cd; font-size: 13.5px; }
.mt-people { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-person { background: rgba(255,255,255,.16); border-radius: 999px; padding: 1px 10px; font-size: 14px; }
.mt-infos .muted { color: #f0c9cd; }
.mt-paper, .mt-photos, .mt-foot { margin-left: 18px; margin-right: 18px; }
.mt-paper { padding: 6px 0 4px; }
.mt-content { margin: 14px 0 6px; font-size: 16px; line-height: 1.8; word-break: break-word; }
.mt-content p { margin: 0; min-height: 1.8em; white-space: pre-wrap; }
.mt-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; margin-bottom: 4px; }
.mt-photo { aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f4f4f4; cursor: pointer; }
.mt-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 700px) { .mt-photos { grid-template-columns: repeat(4, 1fr); } }
.mt-foot { margin-top: 10px; margin-bottom: 18px; }
.mt-ack, .mt-dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(100%, 720px); z-index: 6; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgba(60,40,30,.14); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.mt-ack { text-align: center; }
.mt-ack p { margin: 0 0 8px; font-size: 13px; }
.mt-ack .btn { width: 100%; }
.mt-ack.done { position: static; transform: none; width: auto; margin: 0 18px 18px; padding: 14px; box-shadow: none; border: 1px solid #cfe8d8; border-radius: 12px; display: flex; justify-content: center; align-items: baseline; gap: 10px; flex-wrap: wrap; background: #eef8f1; color: #1e7b45; }
.mt-dock { display: flex; align-items: center; gap: 12px; }
.mt-dock strong { white-space: nowrap; }
.mt-dock .mt-bar { flex: 1; margin: 0; }
.mt-dock a { white-space: nowrap; color: var(--brand); font-weight: var(--w-ui); text-decoration: none; }
body.mt-docked .page { padding-bottom: 130px; }
@media (max-width: 700px) {
  body.has-tabbar .mt-ack, body.has-tabbar .mt-dock { bottom: calc(66px + max(6px, env(safe-area-inset-bottom) - 18px)); padding-bottom: 12px; border-radius: 16px 16px 0 0; }
  body.has-tabbar.mt-docked .page { padding-bottom: 130px; }
}
.mt-changed { color: #8a3a00; font-weight: var(--w-ui); }
/* 第一版審核（EC 2026-10-20）：審核人、備註 */
.mt-draft-note { margin: 12px 18px 0; padding: 10px 12px; border-radius: 10px; background: var(--notice-bg); color: var(--notice); }
.mt-review h3 { margin: 0; font-size: 17px; }
.mt-review h4 { margin: 16px 0 8px; font-size: 15px; font-weight: var(--w-strong); }
.mt-reviewers li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mt-notes { display: grid; gap: 8px; }
.mt-note { padding: 10px 12px; border-radius: 12px; background: #f6f3ef; }
.mt-note.mine { background: #f8eced; }
.mt-note-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.mt-note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.mt-note-add { display: grid; gap: 8px; margin-top: 10px; }
.mt-note-add .btn { justify-self: end; }
.mt-ack .btn:disabled { opacity: .4; cursor: default; }
/* 誰看過了：進度條＋三格數字，名單在下面 */
.mt-status h3 { margin: 0; font-size: 17px; }
.mt-bar { height: 8px; margin: 14px 0 12px; border-radius: 999px; background: #efe9e4; overflow: hidden; }
.mt-bar-fill { display: block; height: 100%; border-radius: 999px; background: #2e9a5b; }
.mt-bar-fill.w0 { width: 0%; }
.mt-bar-fill.w5 { width: 5%; }
.mt-bar-fill.w10 { width: 10%; }
.mt-bar-fill.w15 { width: 15%; }
.mt-bar-fill.w20 { width: 20%; }
.mt-bar-fill.w25 { width: 25%; }
.mt-bar-fill.w30 { width: 30%; }
.mt-bar-fill.w35 { width: 35%; }
.mt-bar-fill.w40 { width: 40%; }
.mt-bar-fill.w45 { width: 45%; }
.mt-bar-fill.w50 { width: 50%; }
.mt-bar-fill.w55 { width: 55%; }
.mt-bar-fill.w60 { width: 60%; }
.mt-bar-fill.w65 { width: 65%; }
.mt-bar-fill.w70 { width: 70%; }
.mt-bar-fill.w75 { width: 75%; }
.mt-bar-fill.w80 { width: 80%; }
.mt-bar-fill.w85 { width: 85%; }
.mt-bar-fill.w90 { width: 90%; }
.mt-bar-fill.w95 { width: 95%; }
.mt-bar-fill.w100 { width: 100%; }
.mt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.mt-stat { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 12px; font-size: 13px; }
.mt-stat strong { font-size: 22px; line-height: 1.2; }
.mt-stat.good { background: #eef8f1; color: #1e7b45; }
.mt-stat.warn { background: #fff6e5; color: #8a5a00; }
.mt-stat.bad { background: #fdeeed; color: var(--danger); }
.mt-group { border-top: 1px solid var(--line); padding: 8px 0; margin-top: 6px; }
.mt-group summary { cursor: pointer; padding: 4px 0; font-weight: var(--w-ui); }
.mt-group.good summary { color: #1e7b45; }
.mt-group.warn summary { color: #8a5a00; }
.mt-group.bad summary { color: var(--danger); }
.mt-group li { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
/* 寫會議紀錄：分成 4 塊 */
.mt-form { gap: 14px; }
.mt-part { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.mt-part legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-weight: var(--w-strong); font-size: 15px; }
.mt-step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12.5px; }
.mt-two { display: grid; grid-template-columns: 1fr; gap: 14px; }
.mt-two > * { min-width: 0; }
.mt-two input, .mt-two select { width: 100%; }
@media (min-width: 640px) { .mt-two { grid-template-columns: 1fr 1fr; } }
.mt-actions { display: flex; flex-direction: column; gap: 6px; }
.mt-actions .error-text { margin: 0; min-height: 0; }
.mt-actions p { margin: 0; }
.chip-picker { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.chip-add { width: 100%; }
.rich { display: flex; flex-direction: column; gap: 6px; }
.rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #faf8f5; }
.rt-btn { font: inherit; display: inline-flex; align-items: center; gap: 4px; min-width: 40px; height: 36px; justify-content: center; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 14px; }
.rt-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rt-bold { font-weight: var(--w-strong); font-size: 16px; }
.rt-dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.rt-color.mc-black .rt-dot { background: var(--text); }
.rt-sep { width: 1px; height: 24px; background: var(--line); margin: 0 2px; }
.rich-area { min-height: 220px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; line-height: 1.75; outline: none; word-break: break-word; -webkit-user-select: text; user-select: text; }
.rich-area:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(126,24,34,.12); }
@media (max-width: 480px) {
  .rt-bar { gap: 4px; padding: 5px; }
  .rt-btn { min-width: 0; padding: 0 7px; gap: 3px; height: 34px; }
  .rt-sep { margin: 0; }
}
/* 會議分類：像資料夾一排，可以左右滑 */
.mt-folders { display: flex; gap: 8px; margin: 12px -4px 2px; padding: 2px 4px 6px; overflow-x: auto; scrollbar-width: none; }
.mt-folders::-webkit-scrollbar { display: none; }
.mt-folders:empty { display: none; }
.mt-folder { font: inherit; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); cursor: pointer; font-size: 14.5px; font-weight: var(--w-ui); }
.mt-folder.on { border-color: var(--brand); background: #fbf1f2; color: var(--brand); }
.mt-folder-n { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #f1eeea; color: #6b635c; font-size: 12px; line-height: 20px; text-align: center; }
.mt-folder.on .mt-folder-n { background: var(--brand); color: #fff; }
.mt-folder-edit { color: var(--muted); border-style: dashed; }
.mt-group-head { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 2px 0; font-size: 14px; font-weight: var(--w-strong); color: #5c544e; }
.mt-group-head:first-child { margin-top: 0; }
.mt-cat-row { display: flex; gap: 6px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mt-cat-row input { flex: 1; min-width: 0; padding: 8px 10px; }
.mt-cat-row.off input { color: var(--muted); background: #f3f3f3; }
/* 會議紀錄：選字留備註（EC 2026-10-20 選 A）：標的字黃底、後面一個小編號，點一下看備註 */
.mt-content .mk-mark { background: #ffe58a; border-bottom: 2px solid #e0a800; border-radius: 2px; cursor: pointer; }
.mt-content .mk-mark.done { background: #f3efe2; border-bottom-color: #cbbf98; }
.mt-content .mk-mark[data-n]::after { content: attr(data-n); display: inline-block; min-width: 18px; height: 18px; line-height: 18px; margin-left: 3px; border-radius: 9px; background: #e0a800; color: #fff; font-size: 11px; font-weight: var(--w-ui); text-align: center; vertical-align: super; }
.mt-content .mk-mark.done[data-n]::after { background: #b5a978; }
.mk-pop { position: absolute; z-index: 20; border: 0; border-radius: 10px; padding: 10px 14px; background: #2b2724; color: #fff; font: inherit; font-size: 15px; font-weight: var(--w-ui); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.mk-card, .mk-form { margin: 8px 0 12px; padding: 10px 12px; border-radius: 12px; background: #fff8dc; border: 1px solid #f0d77a; font-size: 14.5px; }
.mk-form { display: grid; gap: 8px; }
.mk-q { color: #8a6d00; font-size: 13px; margin-bottom: 4px; overflow-wrap: anywhere; }
.mk-one + .mk-one { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #f0d77a; }
.mk-who { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.mk-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.mk-act:empty { display: none; }
.mk-hint { margin: 4px 0 0; color: #8a6d00; }
.mk-quote { display: block; margin: 0 0 4px; padding: 0; border: 0; background: none; color: #8a6d00; font: inherit; text-align: left; cursor: pointer; }
.mk-note-foot { margin-top: 6px; }
.mt-note.resolved .mt-note-text { color: #8a837c; }
/* 佈告欄（EC 2026-10-20）：發公告選「選店、部門或人」才出現選擇區；首頁即將到來的公告整則可以點 */
.bl-pick { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border-radius: 12px; background: #f6f3ef; }
a.notice.bl-home { display: block; color: inherit; text-decoration: none; }
/* 兩欄的日期框在 iPhone 上不要撐破畫面 */
.two > * { min-width: 0; }
.two input[type=date] { min-width: 0; }
/* 佈告欄：要簽名同意的公告（EC 2026-10-22）。簽名框在內容下面，手指寫字不要捲動頁面 */
.bl-sign-card { margin: 0 18px 18px; padding: 14px; border: 1px solid #f0d77a; border-radius: 14px; background: #fffbea; display: grid; gap: 10px; }
.bl-sign-card h3 { margin: 0; font-size: 17px; }
.bl-sign-card p { margin: 0; }
.bl-sign { display: grid; gap: 8px; }
.bl-sign .btn { justify-self: end; }
.bl-sign-box { position: relative; }
.bl-sign-pad { display: block; width: 100%; height: auto; aspect-ratio: 5 / 2; background: #fff; border: 1.5px dashed #c9b26a; border-radius: 12px; touch-action: none; cursor: crosshair; }
.bl-sign-hint { position: absolute; left: 14px; bottom: 10px; color: #b9ad8a; font-size: 13px; pointer-events: none; }
.bl-sign-law { color: #6b5a2a; }
.bl-signed { margin: 0 18px 18px; padding: 14px; border: 1px solid #cfe8d8; border-radius: 12px; background: #eef8f1; color: #1e7b45; display: grid; gap: 4px; justify-items: start; }
.bl-sign-view { width: 200px; height: 80px; background: #fff; border-radius: 8px; border: 1px solid #cfe8d8; }
.bl-sign-mini { width: 120px; height: 48px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }

/* ===== SOP 區（EC 2026-10-23）：搜尋放最上面，內容一塊一塊 ===== */
:root { --sop-warn: #9a4a00; --sop-warn-bg: #fff4e5; --sop-warn-line: #f2c48d; --sop-tip: #1f6b45; --sop-tip-bg: #eaf6ef; --sop-tip-line: #a9d8bd; }
.sop-search { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; }
.sop-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(126,24,34,.12); }
.sop-search input { flex: 1; min-width: 0; border: none; padding: 13px 0; font-size: 16px; background: transparent; box-shadow: none; }
.sop-search input:focus { box-shadow: none; }
.sop-search-ic { font-size: 17px; }
.sop-row-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #f6eced; font-size: 20px; }
.sop-snippet { margin-top: 4px; font-size: 14px; line-height: 1.6; color: #5c544e; }
.sop-row mark, .sop-body mark { background: #ffe58a; color: inherit; border-radius: 2px; padding: 0 1px; }
.sop-hits { margin: 2px 2px 0; }
.sop-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 18px 0; padding: 10px 12px; border-radius: 12px; background: #faf8f5; }
.sop-toc a { padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: 14px; text-decoration: none; }
.sop-body { margin: 6px 18px 4px; font-size: 16px; line-height: 1.8; word-break: break-word; }
.sop-body > * { margin: 12px 0; }
.sop-body .mt-content { margin: 8px 0; }
.sop-h { margin: 22px 0 6px; padding-left: 10px; border-left: 4px solid var(--brand); font-size: 18px; line-height: 1.4; scroll-margin-top: 70px; }
.sop-body > .sop-h:first-child { margin-top: 14px; }
.sop-steps { list-style: none; counter-reset: step; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sop-steps li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.sop-steps li::before { content: counter(step); flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 14px; font-weight: var(--w-strong); line-height: 1; }
.sop-list { padding-left: 1.3em; }
.sop-list li { margin: 4px 0; }
.sop-note { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--sop-warn-line); background: var(--sop-warn-bg); color: var(--sop-warn); }
.sop-note.tip { border-color: var(--sop-tip-line); background: var(--sop-tip-bg); color: var(--sop-tip); }
.sop-note strong { display: block; font-size: 14px; }
.sop-note div { color: var(--text); white-space: pre-wrap; }
.sop-photo { margin: 12px 0; }
.sop-photo button { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f4f4f4; cursor: zoom-in; }
.sop-photo img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.sop-photo figcaption { margin-top: 6px; font-size: 14px; color: var(--muted); text-align: center; }
.mt-foot .link-btn { color: var(--brand); margin-left: 0; padding: 0; font-size: inherit; }
.sop-ver { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; font: inherit; cursor: pointer; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px 14px; }
.sop-old { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; padding: 10px 14px; border-radius: 12px; background: #fff4e5; color: #7a4b00; font-weight: var(--w-ui); }
/* 編輯：每一塊一張小卡，上面一條寫是什麼塊、↑ ↓ ✕ */
.sop-blocks { display: flex; flex-direction: column; gap: 10px; }
.sop-block { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 10px; background: #fff; min-width: 0; }
.sop-block-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.sop-block-kind { font-size: 12.5px; color: var(--muted); font-weight: var(--w-ui); }
.sop-block-bar .spacer { flex: 1; }
.sop-mini { font: inherit; width: 32px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; }
.sop-mini:disabled { opacity: .35; cursor: default; }
.sop-mini.danger { color: var(--danger); }
.sop-block textarea, .sop-block input { width: 100%; }
.sop-h-input { font-size: 17px; font-weight: var(--w-strong); border-left: 4px solid var(--brand); }
.sop-block .rich-area.sop-rich { min-height: 90px; }
.sop-note-edit { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 10px; background: var(--sop-warn-bg); }
.sop-note-edit.tip { background: var(--sop-tip-bg); }
.sop-tone span { padding: 8px 6px; font-size: 14px; background: #fff; }
.sop-photo-edit { display: flex; gap: 10px; align-items: center; }
.sop-photo-edit img { flex: none; width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.sop-add { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1.5px dashed #d8d2ca; border-radius: 12px; }
.sop-add-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sop-add-btn { font: inherit; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 10px; background: #faf8f5; color: var(--text); font-size: 14px; font-weight: var(--w-ui); cursor: pointer; }
@media (min-width: 700px) { .sop-add-btns { grid-template-columns: repeat(6, 1fr); } }
.sop-grow { resize: none; overflow: hidden; line-height: 1.6; }
.sop-add-btn { flex-direction: column; gap: 2px; padding: 8px 4px; }
.sop-add-ic { font-size: 17px; line-height: 1.2; }
/* SOP「只有負責人看得到」：一眼看出還沒開放給大家 */
.tag.sop-lock { background: #fff3e0; color: #8a4b00; border-color: #f0c78a; }
.sop-lock-note { margin: 4px 0 12px; }

/* 測試站提醒條（搬家前先在新主機試用） */
.test-strip { background: #fff3cd; color: #8a3a00; text-align: center; padding: 6px 16px; font-size: 14px; border-bottom: 1px solid #f0d58a; }
