:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #f8f6f2;
  --ink: #17202f;
  --ink-2: #4a5568;
  --ink-3: #8a93a3;
  --line: #e6e1d8;
  --brand: #1d3557;
  --brand-ink: #ffffff;
  --accent: #e8913a;
  --ok: #1f9d6a;
  --ok-bg: #e3f5ec;
  --warn: #c77a12;
  --warn-bg: #fdf1dc;
  --bad: #d14343;
  --bad-bg: #fbe6e6;
  --info: #2f6fd1;
  --info-bg: #e5eefb;
  --muted-bg: #eeebe5;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(23, 32, 47, .05), 0 4px 16px rgba(23, 32, 47, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141c; --surface: #18202b; --surface-2: #1e2834; --ink: #edf0f4; --ink-2: #b4bcc8; --ink-3: #7c8796;
    --line: #2a3542; --brand: #8fb3e3; --brand-ink: #0f141c; --accent: #f0a65c;
    --ok: #4cc795; --ok-bg: #173327; --warn: #e8a948; --warn-bg: #3a2c14; --bad: #ef7272; --bad-bg: #3b1d1f;
    --info: #79a8f0; --info-bg: #1a2a42; --muted-bg: #252f3b; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45;
  min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.topbar .title { flex: 1; min-width: 0; }
.topbar .title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; }
.iconbtn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
main { max-width: 760px; margin: 0 auto; padding: 4px 16px 24px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 600px) { .grid3.wide4 { grid-template-columns: repeat(4, 1fr); } }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.tight { padding: 12px 14px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 2px 8px; }
.section-title h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 700; }

/* ---------- bottom nav ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--ink-3); font-size: 11px; font-weight: 600; border-radius: 12px; position: relative; }
.tabbar a.on { color: var(--brand); }
.tabbar a.on svg { stroke-width: 2.4; }
.tabbar .dot { position: absolute; top: 4px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 700; cursor: pointer; background: var(--muted-bg); color: var(--ink); min-height: 44px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.bad { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.sm { padding: 7px 12px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
label.field { display: block; }
label.field > span { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin: 0 0 5px 2px; text-transform: uppercase; letter-spacing: .04em; }
input.in, select.in, textarea.in {
  width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); outline: none; min-height: 44px;
}
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--brand); background: var(--surface); }
textarea.in { min-height: 80px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 2px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.seg { display: flex; background: var(--muted-bg); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- chips & pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--muted-bg); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }

.stat { background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.stat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* ---------- avatar ---------- */
.avatar { width: 44px; height: 44px; border-radius: 14px; flex: none; background: var(--info-bg); color: var(--info); display: grid; place-items: center; font-weight: 800; overflow: hidden; position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.avatar.lg { width: 84px; height: 84px; border-radius: 24px; font-size: 28px; }
.avatar.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }

/* ---------- punch card ---------- */
.punch { background: var(--brand); color: var(--brand-ink); border-radius: 22px; padding: 20px; position: relative; overflow: hidden; }
.punch::after { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.07); }
.punch .clock { font-size: 40px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.punch .sub { opacity: .8; font-size: 13px; }
.punch .times { display: flex; gap: 10px; margin: 16px 0; }
.punch .times > div { flex: 1; background: rgba(255,255,255,.1); border-radius: 14px; padding: 10px 12px; }
.punch .times b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.punch .times span { font-size: 11px; opacity: .75; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.punch .btn { width: 100%; min-height: 54px; font-size: 16px; border-radius: 14px; }
.punch .btn.in { background: var(--accent); color: #1b1203; }
.punch .btn.out { background: #fff; color: #1d3557; }
@media (prefers-color-scheme: dark) { .punch .btn.out { background: #0f141c; color: #edf0f4; } }
.punch .geo { margin-top: 10px; font-size: 12px; opacity: .85; display: flex; gap: 6px; align-items: center; }

/* ---------- list ---------- */
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 700; }
.item .s { font-size: 13px; color: var(--ink-3); }
.item.static { cursor: default; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .h { text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 4px 0; }
.cal .d { aspect-ratio: 1; border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; cursor: pointer; background: var(--surface); border: 2px solid transparent; position: relative; font-variant-numeric: tabular-nums; }
.cal .d small { font-size: 9px; font-weight: 700; opacity: .8; margin-top: 1px; }
.cal .d.today { border-color: var(--brand); }
.cal .d.present { background: var(--ok-bg); color: var(--ok); }
.cal .d.late { background: var(--warn-bg); color: var(--warn); }
.cal .d.half, .cal .d.halfleave { background: linear-gradient(135deg, var(--ok-bg) 50%, var(--bad-bg) 50%); color: var(--ink); }
.cal .d.absent { background: var(--bad-bg); color: var(--bad); }
.cal .d.leave { background: var(--info-bg); color: var(--info); }
.cal .d.off, .cal .d.holiday { background: transparent; color: var(--ink-3); }
.cal .d.extra { background: var(--info-bg); color: var(--info); border-style: dashed; border-color: var(--info); }
.cal .d.future, .cal .d.na, .cal .d.untracked { background: transparent; color: var(--ink-3); opacity: .55; }
.cal .d.pending, .cal .d.in { background: var(--surface); }
.cal .d .mark { position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- sheet / modal ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(10, 14, 20, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--surface); width: 100%; max-width: 640px; max-height: 90vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: var(--shadow); animation: up .2s; }
.toast.bad { background: var(--bad); color: #fff; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; word-break: break-word; }
.breakdown { width: 100%; border-collapse: collapse; font-size: 14px; }
.breakdown td { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.breakdown td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.breakdown tr.total td { border-bottom: 0; font-size: 17px; font-weight: 800; padding-top: 12px; }
.breakdown .neg { color: var(--bad); }
.breakdown .pos { color: var(--ok); }

.empty { text-align: center; padding: 30px 16px; color: var(--ink-3); }
.banner { border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 380px; }
.brandmark { width: 56px; height: 56px; border-radius: 18px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; margin-bottom: 18px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabs-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.chipbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px; white-space: nowrap; cursor: pointer; color: var(--ink-2); }
.chipbtn.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

.livealert { position: fixed; z-index: 90; left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top)); max-width: 520px; margin: 0 auto; display: flex; gap: 12px; align-items: center;
  background: var(--surface); color: var(--ink); border-radius: 16px; padding: 12px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.18); border-left: 4px solid var(--accent); animation: drop .25s ease-out; }
.livealert .t { font-weight: 800; } .livealert .s { font-size: 13px; color: var(--ink-2); }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }
.leaflet-container { font: inherit; }

/* punch register */
.daystrip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.daystrip::-webkit-scrollbar { display: none; }
.dchip { flex: none; width: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 6px 0; font-weight: 800; font-size: 15px; display: flex; flex-direction: column; align-items: center; cursor: pointer; color: var(--ink); font-variant-numeric: tabular-nums; }
.dchip small { font-size: 10px; color: var(--ink-3); font-weight: 700; }
.dchip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.dchip.on small { color: inherit; opacity: .8; }
.dchip.fut { opacity: .45; }
.preg { align-items: center; gap: 10px; }
.pcells { display: flex; gap: 6px; flex: none; }
.pcell { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 4px 8px 4px 4px; cursor: zoom-in; min-width: 92px; color: var(--ink); text-align: left; }
.pcell.empty { justify-content: center; color: var(--ink-3); cursor: default; padding: 4px 8px; min-height: 48px; }
.pcell img, .pcell .noimg { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; flex: none; background: var(--muted-bg); display: grid; place-items: center; color: var(--ink-3); }
.pcell b { display: block; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pcell small { display: block; font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--line); }
.sdot.present, .sdot.in { background: var(--ok); } .sdot.late { background: var(--warn); } .sdot.half, .sdot.halfleave { background: var(--warn); }
.sdot.absent { background: var(--bad); } .sdot.leave, .sdot.extra { background: var(--info); }
@media (max-width: 400px) { .pcell { min-width: 0; padding-right: 6px; } .pcell small { display: none; } }

/* full-screen selfie viewer */
.viewer { position: fixed; inset: 0; z-index: 95; background: #0b0f15; color: #fff; display: flex; flex-direction: column; animation: fade .15s; }
.viewer .vtop { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 10px; }
.viewer .vtop .t { font-weight: 800; font-size: 17px; } .viewer .vtop .s { font-size: 13px; opacity: .75; }
.viewer .vbtn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 18px; cursor: pointer; }
.viewer .vimg { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; padding: 0 8px; }
.viewer .vimg img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; }
.viewer .vnav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-size: 28px; cursor: pointer; }
.viewer .vnav.l { left: 10px; } .viewer .vnav.r { right: 10px; }
.viewer .vinfo { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); max-width: 640px; width: 100%; margin: 0 auto; }
.viewer .pill { background: rgba(255,255,255,.14); color: #fff; }
.viewer .pill.ok { background: rgba(76,199,149,.25); color: #8fe6c0; } .viewer .pill.warn { background: rgba(232,169,72,.25); color: #f3c98a; } .viewer .pill.info { background: rgba(121,168,240,.25); color: #b5cff7; }

.stat.tap { display: block; color: inherit; cursor: pointer; transition: transform .1s; border: 2px solid transparent; }
.stat.tap:active { transform: scale(.97); }
.stat.tap.sel { border-color: var(--brand); }

.breakdown.dw td { padding: 6px 4px; vertical-align: top; } .breakdown.dw td:nth-child(3) { text-align: center; }

/* ---------- print: salary sheet & payslips ---------- */
.printbar { position: sticky; top: 0; z-index: 10; display: flex; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.printdoc { background: #fff; color: #111; padding: 18px; max-width: 1200px; margin: 0 auto; font-size: 12px; }
.printdoc .ph { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #E8620F; padding-bottom: 10px; margin-bottom: 12px; }
.printdoc .ph img { width: 110px; }
.printdoc h1 { font-size: 20px; color: #111; }
.printdoc .sm { font-size: 11px; color: #555; }
.printdoc .miss { color: #c2410c; }
.printdoc .tot { text-align: right; } .printdoc .tot b { font-size: 22px; color: #111; }
.printdoc table { max-width: none !important; width: 100% !important; border-collapse: collapse; table-layout: auto; }
.printdoc .salsheet td.nm, .printdoc .salsheet th:nth-child(3) { width: 14%; }
.printdoc .salsheet th:nth-child(14) { width: 13%; }
.printdoc .salsheet th, .printdoc .salsheet td { border: 1px solid #ccc; padding: 5px 6px; vertical-align: top; text-align: left; }
.printdoc .salsheet th { background: #fff1e6; font-size: 11px; }
.printdoc .r { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.printdoc .net { font-weight: 800; }
.printdoc .grp td { background: #fafafa; font-weight: 800; font-size: 12px; }
.printdoc .sub td { font-weight: 700; background: #fffaf5; }
.printdoc tfoot td { font-weight: 800; background: #fff1e6; border: 1px solid #ccc; padding: 7px 6px; }
.printdoc .sig { width: 90px; }
.printdoc .nm { min-width: 120px; }
.printdoc .signs { display: flex; gap: 30px; margin-top: 40px; }
.printdoc .signs div { flex: 1; border-top: 1px solid #999; padding-top: 6px; text-align: center; font-size: 11px; color: #555; }
.printdoc .slip { border: 1px solid #ddd; border-radius: 10px; padding: 18px; margin-bottom: 18px; page-break-after: always; break-after: page; }
.printdoc .kvt td { padding: 5px 6px; border-bottom: 1px solid #eee; } .printdoc .kvt td:nth-child(odd) { color: #666; width: 22%; }
.printdoc .earn { margin-top: 12px; } .printdoc .earn th, .printdoc .earn td { border: 1px solid #ddd; padding: 6px 8px; text-align: left; } .printdoc .earn th { background: #fff1e6; }
.printdoc .netbox { display: flex; justify-content: space-between; align-items: center; background: #fff1e6; border-radius: 8px; padding: 10px 14px; margin-top: 12px; }
.printdoc .netbox b { font-size: 22px; color: #111; }
.printdoc .foot { text-align: center; margin-top: 10px; }
@media screen and (max-width: 700px) { .printdoc { overflow-x: auto; } .printdoc .salsheet { min-width: 1000px; } }
@media print {
  .noprint, .tabbar, .topbar, .toast, .livealert { display: none !important; }
  body { background: #fff !important; padding: 0 !important; }
  .printdoc { padding: 0; max-width: none; }
  .printdoc .slip { border: 0; border-radius: 0; padding: 0; }
}

.printdoc .paybox { display: flex; gap: 16px; align-items: flex-end; border: 1px dashed #bbb; border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.printdoc .stampwrap { text-align: center; flex: none; width: 150px; position: relative; }
.printdoc .stampimg { max-width: 140px; max-height: 120px; display: block; margin: 0 auto 4px; transform: rotate(-8deg); }
.printdoc .stampsvg { transform: rotate(-12deg); opacity: .9; display: block; margin: 0 auto; }
.printdoc .paidmark { position: absolute; top: 34px; left: 50%; transform: translateX(-50%) rotate(-12deg); border: 2px solid #15803d; color: #15803d; font-weight: 900; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.7); white-space: nowrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: inherit; font-weight: 700; font-size: 13px; white-space: nowrap; text-decoration: none; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.printdoc .letter { max-width: 760px; margin: 0 auto 24px; font-size: 13.5px; line-height: 1.6; color: #111; }
.printdoc .letter .ph { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid #e8913a; padding-bottom: 10px; margin-bottom: 14px; }
.printdoc .letter .ph img { height: 64px; width: auto; max-width: 250px; object-fit: contain; }
.printdoc .letter h1 { font-size: 20px; margin: 0; }
.printdoc .letter h2 { font-size: 15px; margin: 18px 0 6px; }
.printdoc .letter .lmeta { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 12px; }
.printdoc .letter .lmeta2 { text-align: right; font-size: 12px; white-space: nowrap; }
.printdoc .letter h3 { font-size: 13.5px; margin: 12px 0 4px; }
.printdoc .letter ul { margin: 0 0 8px; padding-left: 20px; }
.printdoc .letter ul li { margin-bottom: 3px; }
.printdoc .letter ol { margin: 0 0 8px; }
.printdoc .letter .lfoot { border-top: 1px solid #e8913a; margin-top: 14px; padding-top: 6px; font-size: 10.5px; color: #444; text-align: center; }

.printdoc .letter .lto { margin-bottom: 12px; }
.printdoc .letter .lsub { font-weight: 800; margin: 6px 0 10px; }
.printdoc .letter .lbody p { margin: 0 0 10px; }
.printdoc .letter ol { margin: 0; padding-left: 22px; }
.printdoc .letter ol li { margin-bottom: 4px; }
.printdoc .letter .lsigns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 34px; break-inside: avoid; align-items: end; }
.printdoc .letter .lsigimg { height: 86px; position: relative; display: flex; align-items: flex-end; }
.printdoc .letter .lsigimg img { max-height: 80px; max-width: 220px; object-fit: contain; position: relative; }
.printdoc .letter .lline { border-top: 1px solid #333; margin: 4px 0 6px; }
.printdoc .letter .sm { font-size: 11.5px; color: #444; }
.printdoc .letter .foot { margin-top: 26px; text-align: center; }
.lpanel { max-width: 760px; margin: 0 auto 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.sigpad { width: 100%; height: 170px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; display: block; }

.printdoc .letter .lsigimg .lstamp.gen svg { display: block; }

/* signature + stamp: the stamp sits over the signature so neither can be lifted cleanly; a fine ref-number band runs through both */
.printdoc .letter .lsigimg.secure { position: relative; height: 96px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overflow: visible; }
.printdoc .letter .lsigimg .lsign { position: relative; z-index: 1; max-height: 84px; max-width: 230px; pointer-events: none; }
.printdoc .letter .lsigimg .lstamp { position: absolute; z-index: 2; left: 70px; bottom: -10px; pointer-events: none; mix-blend-mode: multiply; }
.printdoc .letter .lsigimg img.lstamp { max-height: 104px; max-width: 120px; opacity: .78; transform: rotate(-9deg); }
.printdoc .letter .lsigimg .lstamp.gen { opacity: .74; transform: rotate(-10deg); }
.printdoc .letter .lsigimg .lstamp.gen svg { display: block; }
.printdoc .letter .lsec { position: absolute; z-index: 3; left: -4px; right: 0; top: 46px; font-size: 6.5px; line-height: 1; letter-spacing: .4px; color: rgba(30, 58, 138, .38); white-space: nowrap; overflow: hidden; transform: rotate(-6deg); pointer-events: none; font-family: Arial, sans-serif; }

.printdoc .letter .ldig { font-size: 10.5px; color: #1e3a8a; margin-top: 3px; }
.printdoc .letter .ldigital { display: flex; gap: 14px; align-items: center; margin-top: 22px; padding: 10px 12px; border: 1.5px solid #1e3a8a; border-radius: 10px; font-size: 11px; line-height: 1.5; color: #1f2937; break-inside: avoid; }
.printdoc .letter .lseal { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #1e3a8a; font-weight: 900; font-size: 9px; letter-spacing: .08em; text-align: center; line-height: 1.15; }
.printdoc .letter .lqr { flex: none; width: 84px; height: 84px; }
.printdoc .letter .lqr svg { width: 84px; height: 84px; display: block; }

/* ---------- public plans & legal pages ---------- */
.pub { max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }
.pub-top { display: flex; align-items: center; gap: 10px; padding: 14px 0; }
.pub-top img { width: 44px; height: 44px; border-radius: 50%; }
.pub-top b { font-size: 18px; } .pub-top .grow { flex: 1; }
.pub-hero { text-align: center; padding: 28px 0 22px; }
.pub-hero img { width: 120px; height: 120px; border-radius: 50%; box-shadow: var(--shadow); }
.pub-hero h1 { font-size: clamp(26px, 6vw, 40px); line-height: 1.15; margin: 16px 0 8px; }
.pub-hero p { color: var(--ink-2, #555); font-size: 17px; max-width: 620px; margin: 0 auto; }
.pub-by { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .03em; }
.pub-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.pub h2 { font-size: 24px; margin: 34px 0 6px; text-align: center; }
.pub .sub { text-align: center; color: var(--ink-2, #666); margin: 0 0 16px; }
.feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.feat .card h3 { font-size: 16px; margin: 6px 0 4px; } .feat .card p { margin: 0; font-size: 14px; color: var(--ink-2, #555); }
.feat .fi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--warn-bg); color: var(--accent); }
.steps3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; counter-reset: st; }
.steps3 .card { position: relative; padding-left: 58px; }
.steps3 .card::before { counter-increment: st; content: counter(st); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; }
.plans4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 8px; position: relative; }
.plan.pop { border: 2px solid var(--accent); }
.plan .tag { position: absolute; top: -11px; right: 14px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.plan .pr { font-size: 30px; font-weight: 800; } .plan .pr small { font-size: 13px; font-weight: 600; color: var(--ink-3, #888); }
.plan ul { list-style: none; padding: 0; margin: 4px 0 8px; font-size: 13.5px; flex: 1; }
.plan li { padding: 4px 0 4px 22px; position: relative; } .plan li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.plan li.x { color: var(--ink-3, #999); } .plan li.x::before { content: '–'; color: var(--ink-3, #999); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.faq summary { font-weight: 700; cursor: pointer; } .faq p { margin: 8px 0 0; color: var(--ink-2, #555); font-size: 14.5px; }
.pub-foot { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2, #666); text-align: center; line-height: 1.8; }
.pub-foot a { margin: 0 6px; }
.legal { max-width: 760px; margin: 0 auto; } .legal h1 { font-size: 28px; margin: 10px 0 4px; } .legal h3 { margin: 22px 0 6px; font-size: 17px; }
.legal p, .legal li { font-size: 15px; line-height: 1.65; color: var(--ink); } .legal ul { padding-left: 20px; }

/* ---------- reports ---------- */
.rtable-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.rtable { border-collapse: collapse; width: 100%; font-size: 13px; }
.rtable th, .rtable td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.rtable th { background: var(--muted-bg); font-size: 12px; position: sticky; top: 0; }
.rtable td.r, .rtable th.r { text-align: right; font-variant-numeric: tabular-nums; }
.rtable tfoot td { font-weight: 800; background: var(--muted-bg); }
.rtable td.mc { text-align: center; padding: 6px 3px; font-weight: 700; font-size: 11.5px; }
.mc-p { color: var(--ok); } .mc-a { color: var(--bad); background: var(--bad-bg); } .mc-h { color: var(--warn); } .mc-l { color: var(--info); } .mc-o { color: var(--ink-3, #999); } .mc-q { color: var(--ink-3, #999); }
.rprint .rtable { font-size: 10px; } .rprint .rtable th, .rprint .rtable td { padding: 4px 5px; border: 1px solid #ccc; }

/* multiple punches */
.punch .breaks { margin: 8px 0 4px; display: grid; gap: 4px; }
.punch .breaks .row { background: rgba(255,255,255,.08); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; }
.punch .breaks span { opacity: .8; } .punch .breaks b { font-weight: 700; white-space: nowrap; } .punch .breaks small { opacity: .7; font-weight: 500; }
.punch .onbreak { background: rgba(232,145,58,.25); border-radius: 10px; padding: 8px 10px; margin: 8px 0 6px; font-size: 13px; display: flex; gap: 6px; align-items: center; }
/* swipe-away alerts */
.livestack { position: fixed; top: calc(env(safe-area-inset-top) + 10px); left: 10px; right: 10px; z-index: 9000; display: grid; gap: 8px; pointer-events: none; max-width: 520px; margin: 0 auto; }
.livestack .livealert { position: relative; inset: auto; pointer-events: auto; touch-action: pan-y; padding-right: 40px; }
.livealert .la-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--muted-bg); color: var(--ink-2, #555); font-size: 13px; cursor: pointer; }
#nlist .item { touch-action: pan-y; background: var(--surface); }
/* graphs */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2, #555); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbars { display: grid; gap: 8px; }
.hb { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-b { display: flex; height: 14px; background: var(--muted-bg); border-radius: 7px; overflow: hidden; }
.hb-b i { display: block; height: 100%; }
.hb-v { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }

.piegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.piegrid .card h3 { margin-bottom: 8px; }
.pie { display: flex; align-items: center; gap: 14px; }
.pie svg { width: 128px; height: 128px; flex: none; }
.pie-leg { display: grid; gap: 5px; flex: 1; min-width: 0; font-size: 12.5px; }
.pie-leg div { display: grid; grid-template-columns: 10px 1fr auto 34px; align-items: center; gap: 6px; }
.pie-leg i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.pie-leg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pie-leg small { color: var(--ink-3); text-align: right; }

.punch-help { display: block; margin: 8px auto 0; background: none; border: 0; color: inherit; opacity: .8; font-size: 12.5px; text-decoration: underline; cursor: pointer; }
