/* ABBOT HR 出勤系統：企業後台風格（深藍品牌色、灰階版面、線條圖示）。手機＝員工打卡；寬螢幕＝側邊選單後台。 */
:root {
  --brand: #0f2747; --brand-2: #16345e;
  --primary: #1d4ed8; --primary-h: #1e40af; --primary-50: #eef3ff; --primary-100: #dbe5ff;
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #f8fafc; --border: #e2e7ee; --border-2: #cfd6e0;
  --text: #111827; --text-2: #4b5563; --text-3: #8a94a6;
  --ok: #157f3d; --ok-50: #ecf8f0; --warn: #b45309; --warn-50: #fff6e5; --bad: #b42318; --bad-50: #fef0ee;
  --radius: 10px; --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Noto Sans", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: .01em; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 15px; }
.num, .t-num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); font-size: 13px; }
.sub { color: var(--text-2); font-size: 14px; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.boot { display: flex; height: 100vh; align-items: center; justify-content: center; opacity: .5; }

/* ---------- 版面 */
.layout { display: flex; min-height: 100vh; }
.side { display: none; }
.main { flex: 1; min-width: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px;
  background: var(--brand); color: #fff; }
.brandmark { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brandmark img { width: 30px; height: 30px; border-radius: 7px; }
.brandmark .name { font-weight: 700; letter-spacing: .06em; font-size: 15px; line-height: 1.1; }
.brandmark .org { font-size: 11px; opacity: .72; letter-spacing: .04em; }
.appbar .spacer { flex: 1; }
.appbar .lang, .side .lang { height: 30px; padding: 0 10px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .28); background: transparent; color: #fff; font: 600 12px var(--font); cursor: pointer; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-100); color: var(--primary); font-weight: 700; font-size: 14px; flex: none; }
.appbar .avatar { background: rgba(255, 255, 255, .16); color: #fff; border: 0; cursor: pointer; }
.page { max-width: 1120px; margin: 0 auto; padding: 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.page-head .sub { margin-top: 2px; }
.subtabs { position: sticky; top: 56px; z-index: 15; display: flex; gap: 2px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 8px; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { flex: none; padding: 12px 12px 10px; color: var(--text-2); text-decoration: none; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.subtabs a.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 手機底部導覽 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(16, 24, 40, .04); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; color: var(--text-3); text-decoration: none; font-size: 11px; position: relative; }
.tabbar a .ico { width: 22px; height: 22px; }
.tabbar a.on { color: var(--primary); font-weight: 600; }
.dot-badge { position: absolute; top: 5px; left: calc(50% + 8px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; line-height: 16px; text-align: center; font-weight: 700; }

/* 寬螢幕：左側選單 */
@media (min-width: 960px) {
  .side { display: flex; flex-direction: column; width: 240px; flex: none; background: var(--brand); color: #c9d4e5; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .side .brandmark { padding: 18px 18px 14px; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .side nav { padding: 10px 10px 16px; flex: 1; }
  .side .grp { margin: 14px 10px 6px; font-size: 11px; letter-spacing: .12em; color: #7f93b3; }
  .side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #c9d4e5; text-decoration: none; font-size: 14px; }
  .side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .side nav a.on { background: var(--primary); color: #fff; }
  .side nav a .cnt { margin-left: auto; min-width: 20px; height: 20px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11px; line-height: 20px; text-align: center; font-weight: 700; padding: 0 6px; }
  .side .me { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
  .side .me .avatar { background: rgba(255, 255, 255, .14); color: #fff; }
  .main { padding-bottom: 24px; }
  .appbar, .tabbar, .subtabs { display: none; }
  .page { padding: 28px 32px; }
  .page-head h1 { font-size: 22px; }
}

/* ---------- 元件 */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-b { padding: 16px; }
.card-b.tight { padding: 4px 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .k { color: var(--text-2); font-size: 13px; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat.alert .v { color: var(--bad); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text); font: 600 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; touch-action: manipulation; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-h); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--primary); padding: 0 8px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.line { background: #06c755; border-color: #06c755; color: #fff; height: 48px; font-size: 16px; }
.btn.line:hover { background: #05b34c; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge.ok { background: var(--ok-50); color: var(--ok); border-color: #c7e9d3; }
.badge.warn { background: var(--warn-50); color: var(--warn); border-color: #f6dcb0; }
.badge.bad { background: var(--bad-50); color: var(--bad); border-color: #f8cfc9; }
.badge.info { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.field { margin-bottom: 14px; }
.field label, .lbl { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
input, select, textarea { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); color: var(--text); font: 15px var(--font); }
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-100); border-color: var(--primary); }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; gap: 2px; }
.seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font: 600 13px var(--font); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.seg.full { display: flex; } .seg.full button { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }

/* 表格 */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: .04em; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl tr.detail td { background: var(--surface-2); padding: 8px 12px 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.chip .k { font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.chip .k.in { background: var(--ok-50); color: var(--ok); }
.chip .k.out { background: var(--primary-50); color: var(--primary); }
.chip.void { text-decoration: line-through; color: var(--text-3); }
.chip.fix { border-style: dashed; }
.empty { padding: 28px 16px; text-align: center; color: var(--text-3); font-size: 14px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }

/* ---------- 打卡 */
.clock-card { text-align: center; padding: 22px 16px 18px; }
.clock-date { color: var(--text-2); font-size: 14px; }
.clock { font-size: 56px; font-weight: 700; letter-spacing: .02em; line-height: 1.1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; color: var(--brand); }
.clock small { font-size: 24px; color: var(--text-3); font-weight: 600; margin-left: 2px; }
.clock-cap { font-size: 12px; color: var(--text-3); letter-spacing: .06em; }
.net { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; text-align: left; }
.net.ok { background: var(--ok-50); color: var(--ok); }
.net.bad { background: var(--bad-50); color: var(--bad); }
.net .why { font-weight: 400; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.punch-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.pbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 112px; border-radius: 14px; border: 1.5px solid var(--border-2);
  background: var(--surface); color: var(--text); font: 700 18px var(--font); cursor: pointer; touch-action: manipulation; }
.pbtn .ico { width: 28px; height: 28px; }
.pbtn small { font-weight: 500; font-size: 12px; color: var(--text-3); }
.pbtn.in.sug { background: var(--ok); border-color: var(--ok); color: #fff; }
.pbtn.out.sug { background: var(--primary); border-color: var(--primary); color: #fff; }
.pbtn.sug small { color: rgba(255, 255, 255, .8); }
.pbtn:disabled { opacity: .4; cursor: not-allowed; }
.today { display: grid; grid-template-columns: 1fr 1fr; }
.today > div { padding: 14px 16px; }
.today > div + div { border-left: 1px solid var(--border); }
.today .t { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.today .t.none { color: var(--text-3); font-weight: 500; }
.tl { list-style: none; margin: 0; padding: 4px 16px 10px; }
.tl li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px dashed var(--border); font-size: 14px; }
.tl li .tm { font-weight: 700; font-variant-numeric: tabular-nums; width: 48px; }
.tl li.void { color: var(--text-3); }
.tl li.void .tm { text-decoration: line-through; }
.tl li .note { margin-left: auto; color: var(--text-3); font-size: 12px; text-align: right; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav .lbl2 { min-width: 110px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2); }

/* ---------- 登入 */
.login { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 16vh 16px 24px;
  background: linear-gradient(180deg, var(--brand) 0, var(--brand) 34vh, var(--bg) 34vh); }
.login .top { position: absolute; top: 14px; right: 14px; }
.login .lang { height: 30px; padding: 0 10px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #fff; font: 600 12px var(--font); cursor: pointer; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 28px 24px 22px; }
.login-card .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-card .logo img { width: 44px; height: 44px; border-radius: 10px; }
.login-card .logo .n { font-size: 20px; font-weight: 800; letter-spacing: .08em; color: var(--brand); }
.login-card .logo .o { font-size: 13px; color: var(--text-2); }
.steps { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 34px; color: var(--text-2); font-size: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-50); color: var(--primary); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.code { font-size: 26px; font-weight: 700; letter-spacing: .3em; font-variant-numeric: tabular-nums; color: var(--brand); }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 14px; }
.names button { height: 44px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); font: 600 14px var(--font); cursor: pointer; color: var(--text); }
.names button.on { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--text-3); }

/* ---------- 對話框、提示 */
#modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(15, 23, 42, .45); padding: 0; }
#modal[hidden] { display: none; }
.dlg { width: 100%; max-width: 460px; background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg); max-height: 92vh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 600px) { #modal { align-items: center; padding: 16px; } .dlg { border-radius: 16px; } }
.dlg-h { padding: 18px 20px 6px; }
.dlg-b { padding: 8px 20px 4px; }
.dlg-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px 18px; }
.dlg-f .btn { min-width: 96px; }
.success { text-align: center; padding: 26px 20px 8px; }
.success .ring { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; background: var(--ok-50); color: var(--ok); }
.success .ring .ico { width: 34px; height: 34px; stroke-width: 2.5; }
.success .big { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand); }
#toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 70;
  background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; max-width: 88vw; transition: all .2s; box-shadow: var(--shadow-lg); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 960px) { #toast { bottom: 28px; } }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.notice.warn { background: var(--warn-50); color: var(--warn); }
.notice.info { background: var(--primary-50); color: var(--primary-h); }
.notice.bad { background: var(--bad-50); color: var(--bad); }
.copybox { display: flex; gap: 8px; }
.copybox input { font-size: 13px; color: var(--text-2); }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: var(--border-2); transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }

/* ---------- 1.1：打卡憑證、防偽說明、文件連結 */
.receipt { margin: 16px 0 0; border: 1px dashed var(--border-2); border-radius: 10px; padding: 10px 14px; text-align: left; background: var(--surface-2); }
.receipt > div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13px; }
.receipt span { color: var(--text-3); }
.receipt b { color: var(--text); letter-spacing: .04em; }
.tl li { flex-wrap: wrap; }
.tl li .rno { flex-basis: 100%; padding-left: 58px; font-size: 11px; color: var(--text-3); margin-top: -4px; }
.tl li.void .rno { text-decoration: none; }
.tl li .rno .vby { display: block; color: var(--bad); }
.trust { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--ok-50); color: var(--ok); font-size: 13px; border: 1px solid #c7e9d3; }
.trust .muted { margin-top: 2px; }
.trust.bad { background: var(--bad-50); color: var(--bad); border-color: #f8cfc9; }
.linkbtn.outage { display: block; margin: 8px auto 0; font-size: 13px; color: var(--bad); }
.foot .links { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 6px; }
.linkbtn { border: 0; background: none; padding: 2px 0; color: var(--text-2); font: 12px var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
button.list-row { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: none; font: 15px var(--font); color: var(--text); cursor: pointer; text-align: left; }
button.list-row:last-child { border-bottom: 0; }
.linkrow span { display: inline-flex; align-items: center; gap: 10px; }
.linkrow > .ico { color: var(--text-3); }
.doc ol { margin: 0; padding: 0 0 0 20px; }
.doc li { margin: 0 0 10px; font-size: 14px; color: var(--text-2); }
.doc li b { display: block; color: var(--text); margin-bottom: 2px; }
.page-head .row .btn { height: 36px; }

/* App 模式（加到主畫面）：狀態列透明，內容讓開瀏海 */
.appbar { height: calc(56px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
.subtabs { top: calc(56px + env(safe-area-inset-top)); }
.login .top { top: calc(14px + env(safe-area-inset-top)); }

/* ---------- 出勤紀錄表（A4） */
.sheet-view { min-height: 100vh; background: #e5e9ef; padding-bottom: 32px; }
.sheet-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.sheet-bar .spacer { flex: 1; }
.papers { padding: 16px 10px; }
.paper { max-width: 794px; margin: 0 auto 18px; background: #fff; color: #111; padding: 34px 38px 26px; box-shadow: 0 2px 10px rgba(16, 24, 40, .14); font-size: 12px; line-height: 1.45; }
.doc-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 2px solid var(--brand); padding-bottom: 10px; }
.doc-co { display: flex; align-items: center; gap: 10px; }
.doc-co img { width: 34px; height: 34px; border-radius: 7px; }
.doc-co .co { font-size: 17px; font-weight: 700; letter-spacing: .08em; color: var(--brand); white-space: nowrap; }
.doc-co .en { font-size: 10px; color: #6b7280; letter-spacing: .06em; }
.doc-no { text-align: right; font-size: 10px; color: #6b7280; }
.doc-no b { display: block; font-size: 12px; color: #111; letter-spacing: .03em; }
.doc-title { text-align: center; font-size: 20px; letter-spacing: .3em; margin: 16px 0 12px; color: #111; }
.doc-title small, .paper th small, .doc-sign small { display: block; font-size: 9px; font-weight: 500; letter-spacing: 0; color: #6b7280; }
.paper table { width: 100%; border-collapse: collapse; }
.doc-meta { margin-bottom: 10px; }
.doc-meta th, .doc-meta td { border: 1px solid #9aa4b2; padding: 5px 8px; text-align: left; }
.doc-meta th { background: #f1f4f8; width: 13%; font-weight: 600; white-space: nowrap; }
.doc-tbl th, .doc-tbl td { border: 1px solid #9aa4b2; padding: 3px 6px; text-align: left; vertical-align: top; }
.doc-tbl th { background: #f1f4f8; font-weight: 600; white-space: nowrap; }
.doc-tbl .r { text-align: right; }
.doc-tbl tr.we td { background: #f7f8fa; color: #6b7280; }
.doc-tbl .seq { font-size: 11px; }
.doc-tbl .seq .v { text-decoration: line-through; color: #9ca3af; }
.doc-tbl tfoot td { font-weight: 700; background: #f1f4f8; }
.doc-notes { margin: 10px 0 0; font-size: 10px; color: #4b5563; }
.doc-sign { display: grid; grid-template-columns: 2fr 2fr 1.2fr; gap: 18px; margin: 30px 0 0; }
.doc-sign div { border-top: 1px solid #111; padding-top: 4px; font-size: 11px; color: #4b5563; }
.doc-f { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 6px; border-top: 1px solid #d1d5db; font-size: 9.5px; color: #6b7280; }
@media (max-width: 600px) {
  .paper { padding: 18px 12px 16px; font-size: 11px; }
  .doc-tbl th, .doc-tbl td { padding: 3px 4px; }
  .doc-title { font-size: 17px; letter-spacing: .15em; }
  .doc-meta th { width: auto; }
  .doc-h { flex-wrap: wrap; }
  .doc-no { text-align: left; }
  .doc-f { flex-direction: column; gap: 2px; }
}
/* 約定簽署（11/3）：手機上只顯示目前語言那一段；列印兩種語言都印 */
.agree-doc { font-size: 15px; line-height: 1.75; color: var(--text); }
.agree-doc h1 { display: none; }
.agree-doc.zh section[lang="vi"], .agree-doc.vi section[lang="zh-Hant"] { display: none; }
.agree-doc p { margin: 0 0 10px; }
.agree-doc .item { padding-left: 1.6em; text-indent: -1.6em; }
.agree-doc .fill { font-weight: 700; }
.agree-doc .eg { color: var(--text-2); font-size: 14px; }
.agree-doc.both { font-size: 12px; line-height: 1.6; color: #111; }
.agree-doc.both h1 { display: block; text-align: center; font-size: 19px; letter-spacing: .2em; margin: 16px 0 14px; }
.agree-doc.both h1 small { display: block; font-size: 11px; letter-spacing: 0; font-weight: 500; color: #6b7280; }
.agree-doc.both section[lang="vi"] { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #9aa4b2; font-size: 11.5px; }
.agree-doc.both .eg { color: #4b5563; font-size: 11px; }
.sig-pad { display: block; width: 100%; height: 190px; border: 1.5px dashed var(--border-2); border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; }
.sig-img { display: block; max-width: 100%; height: 90px; object-fit: contain; object-position: left center; }
.agree-paper .doc-meta { margin-top: 16px; }
.agree-nag { width: 100%; border: 0; text-align: left; font: inherit; cursor: pointer; }
@page { size: A4; margin: 10mm 12mm; }
@media print {
  html, body, .sheet-view { background: #fff !important; }
  .sheet-bar, #toast, #modal { display: none !important; }
  .papers { padding: 0; }
  .paper { box-shadow: none; margin: 0; max-width: none; padding: 0; font-size: 10.5px; break-after: page; }
  .paper:last-child { break-after: auto; }
  .doc-tbl tr { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
