/* SFS Attendance — v1.4 design system
   Palette from the school crest: deep indigo/navy + gold, red only for alerts. System fonts only (no downloads).
   Light + dark (v1.7.1: <html data-theme>, chosen in Settings; dark is the default). Mobile-first (360 px), comfortable on desktop. */
:root {
  --navy: #2E2352; --navy-2: #3D305C; --navy-3: #4b3d78;
  --gold: #E6C44A; --gold-d: #C9A227; --gold-ink: #7d5f06; --gold-l: #fbf3d6;
  --primary: #2E2352; --on-primary: #ffffff; --primary-h: #3D305C;
  --brand: #3a2d6e;          /* links, active nav, chart bars (AA on white) */
  --brand-d: #2E2352;
  --brand-l: #eeebf8;
  --accent: var(--gold);
  --ok: #17784b; --ok-l: #e2f4ea; --ok-b: #22a06b;
  --warn: #a45a00; --warn-l: #fff2dc; --warn-b: #f0a020;
  --bad: #c41f27; --bad-l: #fde9e9; --bad-b: #D7262E;
  --info-l: #eceaf8; --info-ink: #2E2352;
  --muted: #615b74;
  --line: #e7e3f0;
  --track: #ebe8f3;
  --bg: #f5f3fa;
  --card: #ffffff;
  --card-2: #faf9fd;
  --text: #1c1830;
  --label: #3b3550;
  --input-bg: #ffffff; --input-b: #d6d1e4;
  --radius: 16px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(31, 22, 64, .06), 0 6px 20px rgba(31, 22, 64, .07);
  --shadow-lg: 0 10px 30px rgba(31, 22, 64, .16);
  --hero: linear-gradient(140deg, #2E2352 0%, #3D305C 55%, #514085 100%);
  --nav-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-size: 16px;
  color-scheme: light;
}
/* v1.7.1: the theme is chosen in Settings (Dark default / Light / System) and set on <html data-theme> before first paint
   (inline script in index.html, js/theme.js). Dark = deep navy / near-black field with the school's gold accents (WCAG AA). */
:root[data-theme="dark"] {
  --navy-3: #9a8bea;
  --primary: #4a3b8f; --primary-h: #5a4aa6; --on-primary: #ffffff;
  --brand: #f0d272; --brand-d: #f6dc7a; --brand-l: #2a2450;
  --gold-ink: #f0d272; --gold-l: #2c2611;
  --ok: #5fd39a; --ok-l: #0f2e20; --ok-b: #1f9a63; --warn: #ffbf5c; --warn-l: #33250c; --warn-b: #e8961a; --bad: #ff8a8f; --bad-l: #3b1418; --bad-b: #d7262e;
  --info-l: #1d1938; --info-ink: #e4defc;
  --muted: #aaa4c6; --line: #2b2748; --track: #25213f;
  --bg: #0b0a17; --card: #151329; --card-2: #1b1833; --text: #f3f0fb; --label: #dad5ef;
  --input-bg: #0f0d20; --input-b: #3d3766;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Bengali", "Nirmala UI", Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.45;
  -webkit-tap-highlight-color: transparent; min-height: 100vh;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; font-weight: 600; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; font-weight: 800; } h2 { font-size: 1.18rem; font-weight: 750; } h3 { font-size: 1.02rem; font-weight: 750; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .tiny { font-size: .75rem; }
.right { text-align: right; } .center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--hero); color: #fff;
  display: flex; align-items: center; gap: .7rem; padding: .65rem 1rem; padding-top: max(.65rem, env(safe-area-inset-top));
  box-shadow: 0 2px 0 var(--gold), 0 6px 18px rgba(20, 12, 50, .25);
}
.topbar .logo { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; overflow: hidden; box-shadow: 0 0 0 2px rgba(230, 196, 74, .85); }
.topbar .logo img { width: 34px; height: 34px; object-fit: contain; border-radius: 50%; }
.topbar .ttl { flex: 1; min-width: 0; }
.topbar .ttl b { display: block; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }
.topbar .ttl span { font-size: .76rem; opacity: .88; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .ttl[data-act] { cursor: pointer; }
.topbar button { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding: .42rem .8rem; font: inherit; font-size: .8rem; font-weight: 650; cursor: pointer; white-space: nowrap; }
.topbar button:active { transform: scale(.96); }
.demo-banner { background: var(--gold-l); color: var(--gold-ink); font-size: .78rem; padding: .45rem 1rem; text-align: center; border-bottom: 1px solid rgba(201, 162, 39, .35); }
.demo-banner button { background: none; border: 0; color: inherit; text-decoration: underline; font: inherit; font-weight: 700; cursor: pointer; padding: 0 .2rem; }
main#view { max-width: 760px; margin: 0 auto; padding: 1rem 1rem calc(var(--nav-h) + 1.5rem + env(safe-area-inset-bottom)); animation: viewIn .28s var(--ease); }
body.wide main#view { max-width: 1160px; }
body.no-nav main#view { padding-bottom: 2rem; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(31, 22, 64, .06);
  display: flex; justify-content: space-around; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0 .25rem env(safe-area-inset-bottom);
}
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 650; min-width: 0; position: relative; text-align: center; line-height: 1.1; padding: 0 2px; }
.bottomnav a .ic { height: 30px; width: 52px; display: grid; place-items: center; border-radius: 999px; transition: background .2s var(--ease), transform .2s var(--ease); }
.bottomnav a .ic svg { width: 22px; height: 22px; }
.bottomnav a.active { color: var(--brand); }
.bottomnav a.active .ic { background: var(--brand-l); transform: translateY(-1px); }
.bottomnav a.active::after { content: ""; position: absolute; top: 4px; left: 50%; margin-left: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.bottomnav a .dot { position: absolute; top: 6px; left: 50%; margin-left: 8px; background: var(--bad-b); color: #fff; border-radius: 9px; font-size: .62rem; padding: 0 5px; }

/* ---------- cards & grid ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.05rem; margin-bottom: 1rem; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .7rem; flex-wrap: wrap; }
.card-h h1, .card-h h2, .card-h h3 { margin: 0; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem; margin: .2rem 0 1rem; flex-wrap: wrap; }
.page-h h1 { margin: 0; }
.page-h .sub { color: var(--muted); font-size: .85rem; }
.grid { display: grid; gap: .75rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--card); border-radius: 14px; padding: .8rem .85rem; box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); position: relative; overflow: hidden; }
.tile .v { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.15; }
.tile .l { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.tile.ok .v { color: var(--ok); } .tile.warn .v { color: var(--warn); } .tile.bad .v { color: var(--bad); } .tile.brand .v { color: var(--brand); } .tile.gold .v { color: var(--gold-ink); }
.tile::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--line); }
.tile.ok::before { background: var(--ok-b); } .tile.warn::before { background: var(--warn-b); } .tile.bad::before { background: var(--bad-b); } .tile.brand::before { background: var(--navy-3); } .tile.gold::before { background: var(--gold); }
button.tile { border: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
button.tile.sel { outline: 2px solid var(--brand); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 48px; padding: .7rem 1.1rem; border-radius: 14px; border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; background: var(--primary); color: var(--on-primary); text-align: center;
  user-select: none; transition: transform .12s var(--ease), background .2s, box-shadow .2s; box-shadow: 0 2px 6px rgba(46, 35, 82, .18);
  text-decoration: none;
}
.btn:hover { background: var(--primary-h); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.block { width: 100%; }
.btn.sec { background: var(--card); color: var(--text); border-color: var(--line); box-shadow: none; }
.btn.sec:hover { background: var(--card-2); }
.btn.ghost { background: transparent; color: var(--brand); box-shadow: none; }
.btn.gold { background: var(--gold); color: #2a2000; }
.btn.gold:hover { background: #ecd065; }
.btn.ok { background: var(--ok-b); color: #fff; } .btn.ok:hover { background: #1b8f5c; }
.btn.warn { background: #c26d00; color: #fff; } .btn.warn:hover { background: #ad6100; }
.btn.bad { background: var(--bad-b); color: #fff; } .btn.bad:hover { background: #bf1f27; }
.btn.wa { background: #1fa855; color: #fff; } .btn.wa:hover { background: #198f48; }
.btn.sm { min-height: 38px; padding: .4rem .8rem; font-size: .86rem; border-radius: 11px; white-space: nowrap; }
.btn.xl { min-height: 92px; font-size: 1.3rem; border-radius: 20px; flex-direction: column; gap: .2rem; }
.btn.xl small { font-weight: 500; font-size: .8rem; opacity: .9; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }

label.f { display: block; margin-bottom: .85rem; }
label.f > span { display: block; font-size: .84rem; font-weight: 700; margin-bottom: .32rem; color: var(--label); }
input, select, textarea {
  width: 100%; font: inherit; padding: .72rem .85rem; min-height: 48px; border: 1px solid var(--input-b); border-radius: 12px; background: var(--input-bg); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-3); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 35%, transparent); }
/* v1.8.1: custom checkbox / radio, visible in Light and Dark (owner: "tick mark is not visible in Dark Theme").
   Unchecked: a 2px border ≥3:1 against the card in both themes. Checked: gold fill + dark tick (≈11:1). 22px box. */
:root { --chk-b: #7a7194; --chk-bg: #ffffff; --chk-on: #E6C44A; --chk-on-b: #9a7a10; --chk-tick: #231a00; }
:root[data-theme="dark"] { --chk-b: #9d94c8; --chk-bg: #0f0d20; --chk-on: #f0d272; --chk-on-b: #f0d272; --chk-tick: #1a1300; }
input[type=checkbox], input[type=radio] {
  -webkit-appearance: none; appearance: none; flex: none; display: inline-grid; place-content: center;
  width: 22px; height: 22px; min-width: 22px; min-height: 0; padding: 0; margin: 0 .15rem; vertical-align: middle; cursor: pointer;
  background: var(--chk-bg) no-repeat center / 16px 16px; border: 2px solid var(--chk-b); border-radius: 6px; box-shadow: none;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:hover:not(:disabled), input[type=radio]:hover:not(:disabled) { border-color: var(--chk-on-b); }
input[type=checkbox]:checked, input[type=checkbox]:indeterminate { background-color: var(--chk-on); border-color: var(--chk-on-b); }
input[type=checkbox]:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.2 8.4l3.1 3.1 6.5-7' fill='none' stroke='%23231a00' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
input[type=checkbox]:indeterminate { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8h9' stroke='%23231a00' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
input[type=radio]:checked { border-color: var(--chk-on-b); background-color: var(--chk-bg); box-shadow: inset 0 0 0 4px var(--chk-bg), inset 0 0 0 11px var(--chk-on); }
input[type=checkbox]:focus, input[type=radio]:focus { outline: none; box-shadow: none; }
input[type=radio]:checked:focus { box-shadow: inset 0 0 0 4px var(--chk-bg), inset 0 0 0 11px var(--chk-on); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
input[type=checkbox]:disabled, input[type=radio]:disabled { cursor: not-allowed; opacity: .5; background-color: var(--card-2); }
input[type=checkbox]:checked:disabled, input[type=checkbox]:indeterminate:disabled { background-color: var(--chk-on); }
.slip input[type=checkbox], .paper input[type=checkbox] { --chk-b: #7a7194; --chk-bg: #fff; }
.check { display: flex; gap: .6rem; align-items: center; margin: .4rem 0 .85rem; font-weight: 600; }
.pin-input { letter-spacing: .5em; font-size: 1.4rem; text-align: center; }
.row { display: flex; gap: .6rem; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.row input, .row select { min-width: 0; width: 100%; }
.help { font-size: .8rem; color: var(--muted); margin-top: -.5rem; margin-bottom: .85rem; }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: .85rem; margin: 0 0 1rem; min-width: 0; background: var(--card); }
legend { font-weight: 800; padding: 0 .4rem; color: var(--brand-d); }
input[readonly] { background: var(--card-2); color: var(--muted); }
.seg { display: flex; background: var(--track); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: .85rem; }
.seg label { flex: 1; text-align: center; padding: .55rem .3rem; border-radius: 9px; font-weight: 700; font-size: .86rem; cursor: pointer; color: var(--muted); min-width: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--card); color: var(--brand-d); box-shadow: 0 1px 4px rgba(31, 22, 64, .15); }

/* ---------- chips & lists ---------- */
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .6rem; border-radius: 999px; font-size: .73rem; font-weight: 750; background: var(--track); color: var(--label); white-space: nowrap; line-height: 1.35; }
.chip.ok { background: var(--ok-l); color: var(--ok); }
.chip.warn { background: var(--warn-l); color: var(--warn); }
.chip.bad { background: var(--bad-l); color: var(--bad); }
.chip.brand { background: var(--brand-l); color: var(--brand); }
.chip.gold { background: var(--gold-l); color: var(--gold-ink); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .85rem; }
.chips button.chip { border: 1px solid var(--line); cursor: pointer; font-size: .82rem; padding: .45rem .85rem; background: var(--card); }
.chips button.chip.sel { background: var(--primary); color: #fff; border-color: var(--primary); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: .75rem; padding: .72rem 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .name { font-weight: 700; overflow-wrap: anywhere; }
a.grow, a.li-link { color: inherit; font-weight: inherit; }
a.li-link { display: flex; align-items: center; gap: .75rem; width: 100%; }
.thumb { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--brand-l); flex: none; display: grid; place-items: center; color: var(--brand); font-weight: 800; font-size: .9rem; }
.thumb.sq { border-radius: 12px; }
.thumb.lg { width: 92px; height: 92px; border-radius: 22px; font-size: 1.6rem; }
img.thumb { cursor: zoom-in; }
.ring-ok { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--ok-b); }
.ring-warn { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--warn-b); }
.ring-bad { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--bad-b); }
.ring-none { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--line); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.t th, table.t td { padding: .58rem .55rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.t th { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--card-2); position: sticky; top: 0; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tfoot td { font-weight: 800; border-top: 2px solid var(--line); }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--brand-l) 45%, transparent); }

/* ---------- notices ---------- */
.notice { border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1rem; font-size: .92rem; border: 1px solid transparent; }
.notice.info { background: var(--info-l); color: var(--info-ink); border-color: color-mix(in srgb, var(--navy-3) 18%, transparent); }
.notice.warn { background: var(--warn-l); color: var(--warn); border-color: color-mix(in srgb, var(--warn-b) 30%, transparent); }
.notice.bad { background: var(--bad-l); color: var(--bad); border-color: color-mix(in srgb, var(--bad-b) 30%, transparent); }
.notice.ok { background: var(--ok-l); color: var(--ok); }
.notice a { color: inherit; text-decoration: underline; }
a.notice { display: flex; align-items: center; gap: .6rem; font-weight: 650; text-decoration: none; }
a.notice::after { content: "›"; margin-left: auto; font-size: 1.3rem; line-height: 1; opacity: .7; }
.board { position: relative; background: linear-gradient(135deg, var(--gold-l), color-mix(in srgb, var(--gold-l) 60%, var(--card))); border: 1px solid color-mix(in srgb, var(--gold-d) 45%, transparent); border-radius: var(--radius); padding: .85rem 1rem .85rem 3.2rem; margin-bottom: 1rem; color: var(--text); }
.board::before { content: ""; position: absolute; left: 1rem; top: .95rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E2352' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.7 21a2 2 0 0 1-3.4 0'/%3E%3C/svg%3E") center / 15px no-repeat; }
.board b { display: block; font-size: .98rem; }
.board p { margin: .2rem 0 0; font-size: .9rem; white-space: pre-line; overflow-wrap: anywhere; }
.board .meta { font-size: .74rem; color: var(--muted); margin-top: .35rem; }
.backup-banner { display: flex; gap: .8rem; align-items: center; }
.backup-banner .grow { flex: 1; min-width: 0; }

/* ---------- staff home: hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--hero); color: #fff; border-radius: 22px; padding: 1.15rem 1.15rem 1.05rem; margin-bottom: 1rem; box-shadow: var(--shadow-lg); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 220px; height: 220px; right: -70px; top: -90px; background: radial-gradient(circle, rgba(230, 196, 74, .35), transparent 65%); }
.hero::after { width: 180px; height: 180px; left: -60px; bottom: -110px; background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 65%); }
.hero > * { position: relative; }
.hero .date { font-size: .82rem; opacity: .85; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.hero h2 { color: #fff; margin: .25rem 0 0; font-size: 1.32rem; font-weight: 800; overflow-wrap: anywhere; }
.hero .clock { font-size: 2.9rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.05; margin: .45rem 0 .2rem; }
.hero .clock small { font-size: 1rem; font-weight: 700; opacity: .75; margin-left: .25rem; letter-spacing: 0; }
.hero .duty { font-size: .8rem; opacity: .85; }
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .75rem; border-radius: 999px; font-size: .8rem; font-weight: 750; background: rgba(255, 255, 255, .15); color: #fff; border: 1px solid rgba(255, 255, 255, .25); margin-top: .6rem; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { background: #e3f6ec; color: #116a40; border-color: transparent; }
.pill.warn { background: var(--gold); color: #2a2000; border-color: transparent; }
.pill.done { background: #fff; color: var(--navy); border-color: transparent; }
.pill.holiday { background: rgba(230, 196, 74, .22); color: #fff3c4; }
.hero .pill-row { display: flex; gap: .4rem; flex-wrap: wrap; }

/* punch buttons */
.punch-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin: .2rem 0 1rem; }
.punch { display: flex; flex-direction: column; align-items: center; gap: .45rem; }
.punch-btn {
  width: min(38vw, 148px); height: min(38vw, 148px); border-radius: 50%; border: 0; cursor: pointer; color: #fff; font: inherit; font-weight: 800; font-size: 1.08rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; position: relative;
  box-shadow: 0 10px 24px rgba(31, 22, 64, .22), inset 0 -4px 0 rgba(0, 0, 0, .12); transition: transform .15s var(--ease), box-shadow .2s, filter .2s;
}
.punch-btn svg { width: 34px; height: 34px; }
.punch-btn small { font-size: .72rem; font-weight: 650; opacity: .92; }
.punch-btn.in { background: radial-gradient(circle at 30% 25%, #3fcf8e, #17784b 70%); }
.punch-btn.out { background: radial-gradient(circle at 30% 25%, #6b5ab8, #2E2352 72%); }
.punch-btn.out::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 3px solid var(--gold); opacity: .9; }
.punch-btn.in::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--ok-b) 45%, transparent); }
.punch-btn:not(:disabled):active { transform: scale(.94); }
.punch-btn:not(:disabled) { animation: breathe 3.2s ease-in-out infinite; }
.punch-btn:disabled { filter: grayscale(.85) brightness(1.05); opacity: .42; cursor: not-allowed; box-shadow: none; animation: none; }
.punch-btn:disabled::after { opacity: .3; }
@keyframes breathe { 0%, 100% { box-shadow: 0 10px 24px rgba(31, 22, 64, .22), inset 0 -4px 0 rgba(0, 0, 0, .12); } 50% { box-shadow: 0 14px 34px rgba(31, 22, 64, .32), inset 0 -4px 0 rgba(0, 0, 0, .12); } }
.punch .when { font-size: .82rem; color: var(--muted); font-weight: 650; text-align: center; }
.today-status { display: flex; gap: .6rem; }
.today-status > div { flex: 1; min-width: 0; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: .65rem .75rem; display: flex; flex-direction: column; gap: .2rem; }
.today-status .k { font-size: .74rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.today-status b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.today-status .chip { align-self: flex-start; }
.streak { display: flex; align-items: center; gap: .9rem; }
.streak .flame { width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, var(--gold), #f3a73b); display: grid; place-items: center; flex: none; box-shadow: 0 6px 14px rgba(201, 162, 39, .35); }
.streak .flame svg { width: 28px; height: 28px; color: #3a2400; }
.streak .n { font-size: 1.5rem; font-weight: 850; line-height: 1.1; }
.streak .dots { display: flex; gap: 4px; margin-top: .35rem; flex-wrap: wrap; }
.streak .dots i { width: 10px; height: 10px; border-radius: 3px; background: var(--track); }
.streak .dots i.on { background: var(--ok-b); } .streak .dots i.late { background: var(--warn-b); } .streak .dots i.miss { background: var(--bad-b); opacity: .7; }
.est { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px dashed var(--line); font-size: .9rem; color: var(--muted); }
.est b { color: var(--text); font-size: 1.05rem; }

/* success pop after a punch */
.success-pop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(16, 12, 32, .35); animation: fade .2s; pointer-events: none; }
.success-pop .box { background: var(--card); color: var(--text); border-radius: 26px; padding: 1.5rem 2rem 1.25rem; text-align: center; box-shadow: var(--shadow-lg); animation: pop .35s var(--ease); min-width: 220px; }
.success-pop svg { width: 92px; height: 92px; }
.success-pop circle { stroke: var(--ok-b); stroke-width: 5; fill: none; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw .55s .05s var(--ease) forwards; }
.success-pop path { stroke: var(--ok-b); stroke-width: 6; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .35s .5s var(--ease) forwards; }
.success-pop b { display: block; font-size: 1.2rem; margin-top: .4rem; }
.success-pop span { color: var(--muted); font-size: .92rem; }
.success-pop.out { animation: fadeOut .3s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

/* ---------- calendar ---------- */
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.days .dh { font-size: .7rem; color: var(--muted); text-align: center; font-weight: 800; padding-bottom: 2px; }
.days .d { aspect-ratio: 1; border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .84rem; font-weight: 750; background: var(--track); color: var(--label); position: relative; }
.days .d small { font-size: .55rem; font-weight: 800; letter-spacing: .02em; }
.days .d.present { background: var(--ok-l); color: var(--ok); }
.days .d.late { background: var(--warn-l); color: var(--warn); }
.days .d.absent, .days .d.leave { background: var(--bad-l); color: var(--bad); }
.days .d.holiday { background: var(--brand-l); color: var(--brand); }
.days .d.holiday.sandwich { background: repeating-linear-gradient(45deg, var(--bad-l), var(--bad-l) 4px, var(--brand-l) 4px, var(--brand-l) 8px); color: var(--bad); }
.days .d.holiday-worked { background: var(--gold-l); color: var(--gold-ink); }
.days .d.future, .days .d.pending, .days .d.not-joined, .days .d.unknown { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.days .d.today { outline: 2.5px solid var(--gold); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: .45rem .9rem; font-size: .75rem; color: var(--muted); margin-top: .7rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: .4rem .75rem; font-size: .95rem; }
.kv .k { color: var(--label); } .kv .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.kv .total { font-size: 1.15rem; font-weight: 850; border-top: 1px solid var(--line); padding-top: .55rem; }
.kv .minus { color: var(--bad); } .kv .plus { color: var(--ok); }

/* leave balances */
.bal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.bal .b { background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .6rem; text-align: center; min-width: 0; }
.bal .b .t { font-size: .72rem; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.bal .b .n { font-size: 1.55rem; font-weight: 850; line-height: 1.1; color: var(--brand-d); font-variant-numeric: tabular-nums; }
.bal .b .n small { font-size: .78rem; font-weight: 700; color: var(--muted); }
.bal .b .u { font-size: .72rem; color: var(--muted); margin-top: .1rem; }
.bal .bar { height: 6px; border-radius: 6px; background: var(--track); margin: .4rem 0 .15rem; overflow: hidden; }
.bal .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy-3), var(--gold)); border-radius: 6px; }
.bal .b.over .n { color: var(--bad); }
.lt-chip { font-size: .68rem; padding: .12rem .45rem; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(16, 12, 32, .55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@media (min-width: 640px) { .modal-back { align-items: center; } }
.modal { background: var(--card); color: var(--text); width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 1.15rem 1.15rem calc(1.15rem + env(safe-area-inset-bottom)); animation: sheetUp .25s var(--ease); }
@media (min-width: 640px) { .modal { border-radius: 22px; } }
.modal h2 { margin-bottom: .85rem; }
.modal .actions { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.modal .actions .btn { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(30px); opacity: .5; } }
.share-preview { white-space: pre-wrap; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: .75rem; font-size: .85rem; max-height: 46vh; overflow: auto; font-family: inherit; margin: 0; }

/* camera */
.cam-modal { position: fixed; inset: 0; background: #0d0a1c; z-index: 60; display: flex; flex-direction: column; color: #fff; }
.cam-modal .cam-top { padding: 1rem; padding-top: max(1rem, env(safe-area-inset-top)); display: flex; justify-content: space-between; align-items: center; }
.cam-modal .cam-top .btn.sec { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .2); }
.cam-modal .cam-stage { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; }
.cam-modal video { width: min(88vw, 400px); aspect-ratio: 3/4; object-fit: cover; border-radius: 50% / 42%; transform: scaleX(-1); background: #15112a; border: 4px solid rgba(230, 196, 74, .45); transition: border-color .2s; }
.cam-modal video.good { border-color: #2fd08a; } .cam-modal video.bad { border-color: #ff5a62; }
.cam-modal .cam-status { text-align: center; font-size: 1.12rem; font-weight: 700; padding: 1rem 1.2rem .4rem; min-height: 3.6rem; }
.cam-modal .cam-sub { text-align: center; font-size: .85rem; opacity: .75; min-height: 1.2rem; padding: 0 1rem; }
.cam-modal .cam-actions { padding: 1rem; padding-bottom: max(1rem, env(safe-area-inset-bottom)); display: flex; gap: .6rem; }
.cam-modal .cam-actions .btn { flex: 1; }
.progress-dots { display: flex; gap: 8px; justify-content: center; margin-top: .4rem; }
.progress-dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .25); }
.progress-dots i.on { background: var(--gold); }

/* toast & loaders */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; gap: .4rem; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
#toast div { background: #1c1830; color: #fff; padding: .72rem 1.05rem; border-radius: 14px; font-size: .92rem; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastIn .25s var(--ease); }
#toast div.ok { background: #17784b; } #toast div.bad { background: #b81f26; } #toast div.warn { background: #9a5300; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }
.loader { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 2.5rem 1rem; color: var(--muted); }
.loader.skel { display: block; padding: .2rem 0; }
.sk { height: 14px; border-radius: 8px; margin: 0 0 .7rem; background: linear-gradient(90deg, var(--track) 0%, color-mix(in srgb, var(--track) 40%, var(--card)) 50%, var(--track) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk.h { height: 22px; width: 55%; } .sk.w70 { width: 70%; } .sk.w40 { width: 40%; }
.sk.block { height: 110px; border-radius: 16px; } .sk.hero { height: 190px; border-radius: 22px; }
.sk-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-bottom: .7rem; }
.sk-row .sk { height: 68px; border-radius: 14px; margin: 0; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spin { width: 22px; height: 22px; border: 3px solid var(--track); border-top-color: var(--navy-3); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- login ---------- */
body.login-page { background: var(--bg); }
.login-hero { background: var(--hero); color: #fff; padding: calc(2.2rem + env(safe-area-inset-top)) 1.2rem 5.2rem; text-align: center; border-radius: 0 0 36px 36px; position: relative; overflow: hidden; }
.login-hero::before { content: ""; position: absolute; width: 320px; height: 320px; right: -120px; top: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(230, 196, 74, .32), transparent 65%); }
.login-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.login-hero > * { position: relative; }
.login-hero h1 { color: #fff; font-size: 1.5rem; margin: .8rem 0 .2rem; }
.login-hero p { margin: 0; opacity: .88; font-size: .95rem; }
.login-logo { width: 112px; height: 112px; border-radius: 50%; background: #fff; display: grid; place-items: center; margin: 0 auto; box-shadow: 0 0 0 4px var(--gold), 0 12px 30px rgba(0, 0, 0, .3); overflow: hidden; }
.login-logo img { width: 104px; height: 104px; object-fit: contain; border-radius: 50%; }
.login-logo.custom img { width: 96px; height: 96px; border-radius: 12px; }
.login-wrap { max-width: 440px; margin: -3.6rem auto 0; padding: 0 1.1rem 2rem; position: relative; }
.login-wrap.solo { margin-top: 0; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.login-wrap .card { padding: 1.3rem 1.2rem; border-radius: 20px; box-shadow: var(--shadow-lg); }
.login-wrap .welcome { font-weight: 800; font-size: 1.12rem; margin: 0 0 .15rem; }
.login-foot { text-align: center; font-size: .78rem; color: var(--muted); margin-top: 1rem; }

/* month nav */
.monthnav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; background: var(--card); border-radius: 14px; padding: .35rem; box-shadow: var(--shadow); }
.monthnav b { font-size: 1.05rem; }
.monthnav .btn { min-width: 44px; min-height: 40px; }

/* ---------- admin register ---------- */
.sum { display: grid; grid-template-columns: 1fr; gap: .8rem; margin-bottom: 1rem; }
@media (min-width: 720px) { .sum { grid-template-columns: 300px 1fr; } }
.sum-chart { display: flex; align-items: center; justify-content: center; gap: 1.4rem; }
.sum-chart .legend { flex-direction: column; gap: .35rem; font-size: .82rem; margin: 0; }
.sum-chart .legend b { color: var(--text); margin-left: .2rem; }
.sum-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .6rem; }
.sum-tiles .tile { grid-column: span 2; }
.sum-tiles .tile:nth-child(n+4) { grid-column: span 3; }
@media (min-width: 720px) { .sum-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } .sum-tiles .tile, .sum-tiles .tile:nth-child(n+4) { grid-column: auto; } }
.sum-tiles .tile { padding: .7rem .7rem .65rem; cursor: pointer; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); text-align: left; font: inherit; color: inherit; }
.sum-tiles .tile .v { font-size: 1.6rem; }
.sum-tiles .tile.sel { outline: 2.5px solid var(--gold); }
.sum-tiles .tile.none .v { color: var(--muted); }
.donut .donut-top { font-size: 26px; font-weight: 850; fill: var(--text); }
.donut .donut-bottom { font-size: 10.5px; font-weight: 700; fill: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.reg-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.sec-h { display: flex; align-items: center; gap: .5rem; font-size: .98rem; font-weight: 800; margin: 0 0 .3rem; color: var(--brand-d); letter-spacing: .01em; }
.sec-h::before { content: ""; width: 4px; height: 16px; border-radius: 3px; background: var(--gold); }
.sec-h .chip { font-size: .72rem; text-transform: none; letter-spacing: 0; }
.list.reg li { gap: .8rem; }
.list.reg .times { font-size: .82rem; color: var(--muted); }
.list.reg .times b { color: var(--text); font-weight: 700; }

/* ---------- dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1rem; }
.dash-grid > * { min-width: 0; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .2rem; }
svg.chart { display: block; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .goal { stroke: var(--gold-d); stroke-width: 1.5; stroke-dasharray: 4 4; }
svg.chart .axis { font-size: 9.5px; fill: var(--muted); font-weight: 600; }
.hbars { list-style: none; margin: 0; padding: 0; }
.hbars li { margin-bottom: .7rem; }
.hbars .hb-top { display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; margin-bottom: .25rem; }
.hbars .hb-l { min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.hbars .hb-track { height: 9px; border-radius: 9px; background: var(--track); overflow: hidden; }
.hbars .hb-track i { display: block; height: 100%; border-radius: 9px; }
.medal { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: .72rem; font-weight: 850; background: var(--track); color: var(--label); margin-right: .35rem; vertical-align: 1px; }
.medal.m1 { background: var(--gold); color: #2a2000; } .medal.m2 { background: #d5d9e2; color: #333; } .medal.m3 { background: #e7b98f; color: #4a2a0c; }

/* ---------- slip (screen + print) ---------- */
.slip { background: #fff; color: #1d1830; max-width: 800px; margin: 0 auto; border-radius: 16px; overflow: hidden; font-size: .9rem; box-shadow: var(--shadow); border: 1px solid #e6e2f0; }
.slip-h { display: flex; align-items: center; gap: .9rem; background: linear-gradient(135deg, #2E2352, #3D305C); color: #fff; padding: 1rem 1.2rem; border-bottom: 4px solid #E6C44A; }
.slip-logo { width: 62px; height: 62px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; overflow: hidden; }
.slip-logo img { width: 58px; height: 58px; object-fit: contain; border-radius: 50%; }
.slip-school { min-width: 0; flex: 1; }
.slip-school h1 { color: #fff; margin: 0; font-size: 1.25rem; }
.slip-school div { font-size: .8rem; opacity: .85; }
.slip-tag { text-align: right; flex: none; }
.slip-tag b { display: block; color: #E6C44A; letter-spacing: .06em; font-size: .95rem; }
.slip-tag span { font-size: .82rem; }
.slip-emp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem 1rem; margin: 1rem 1.2rem; padding: .85rem 1rem; background: #f5f3fa; border: 1px solid #e6e2f0; border-radius: 12px; }
.slip-emp span { display: block; font-size: .66rem; font-weight: 800; color: #615b74; text-transform: uppercase; letter-spacing: .05em; }
.slip-emp b { font-size: .92rem; overflow-wrap: anywhere; }
.slip-net { margin: 0 1.2rem 1rem; background: #3D305C; color: #fff; border-radius: 12px; padding: .8rem 1rem; border-left: 6px solid #E6C44A; display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.slip-net span { display: block; font-size: .7rem; font-weight: 800; color: #E6C44A; letter-spacing: .06em; text-transform: uppercase; }
.slip-net b { font-size: 1.55rem; }
.slip-net i { font-size: .8rem; opacity: .9; text-align: right; }
.slip h3 { margin: .2rem 1.2rem .4rem; font-size: .76rem; color: #7d5f06; letter-spacing: .07em; text-transform: uppercase; }
.slip table { width: calc(100% - 2.4rem); margin: 0 1.2rem .9rem; border-collapse: collapse; }
.slip td, .slip th { padding: .42rem .55rem; text-align: left; border-bottom: 1px solid #ebe8f3; }
.slip td.num, .slip th.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.slip-kv td:nth-child(odd) { color: #615b74; }
.slip-kv tr:nth-child(even) td { background: #faf9fd; }
.slip-kv tr.em td { font-weight: 800; color: #1d1830; border-top: 2px solid #e6e2f0; }
.slip-kv tr.em td.num { color: #c41f27; }
.slip-kv tr.em.net td.num { color: #17784b; }
.slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin: 0 1.2rem .9rem; }
.slip-cols table { width: 100%; margin: 0; }
.slip-money th { color: #fff; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.slip-cols table:first-child th { background: #2f7d4f; } .slip-cols table:last-child th { background: #b3261e; }
.slip-money tr.tot td { font-weight: 800; border-top: 2px solid #e6e2f0; }
.slip-days th { background: #f5f3fa; font-size: .74rem; color: #615b74; }
.slip-days td, .slip-kv td.num, .slip-money td.num { white-space: nowrap; }
.slip-note { margin: 0 1.2rem .8rem; font-size: .76rem; color: #615b74; }
.slip .sign { display: flex; justify-content: space-between; margin: 2.4rem 1.2rem 1.2rem; gap: 1rem; }
.slip .sign div { border-top: 1px solid #555; padding-top: .3rem; width: 42%; text-align: center; font-size: .8rem; color: #615b74; }
@media (max-width: 600px) {
  .slip { font-size: .8rem; }
  .slip-emp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slip-cols { grid-template-columns: 1fr; }
  .slip td, .slip th { padding: .32rem .4rem; }
  .slip-days td, .slip-days th { padding: .3rem .25rem; font-size: .72rem; }
  .slip-h { padding: .8rem; gap: .6rem; } .slip-logo { width: 46px; height: 46px; } .slip-logo img { width: 42px; height: 42px; }
  .slip-school h1 { font-size: 1rem; }
}
.slip-break { page-break-after: always; break-after: page; height: 1rem; }
@media print {
  @page { size: A4; margin: 10mm; }
  :root { color-scheme: light; }
  body { background: #fff !important; }
  .topbar, .bottomnav, .demo-banner, .no-print, #toast { display: none !important; }
  main#view { padding: 0 !important; max-width: none !important; animation: none; }
  .slip { box-shadow: none; border: 0; border-radius: 0; max-width: none; font-size: 10.5pt; }
  .slip-h, .slip-net, .slip-money th, .slip-kv tr:nth-child(even) td, .slip-emp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .slip-emp { grid-template-columns: repeat(3, 1fr) !important; } .slip-cols { grid-template-columns: 1fr 1fr !important; }
  .card { box-shadow: none; }
}

/* ---------- misc v1.2/v1.3 ---------- */
.topbar .me-btn { padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .2); border: 2px solid var(--gold); width: 38px; height: 38px; display: grid; place-items: center; flex: none; overflow: hidden; }
.topbar .me-btn .avatar { width: 34px; height: 34px; border-radius: 50%; }
.topbar .me-btn .avatar.ini { background: #fff; color: var(--navy); }
.logo-preview { width: 84px; height: 84px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; flex: none; overflow: hidden; }
.logo-preview img { max-width: 78px; max-height: 78px; object-fit: contain; }
ol.steps { padding-left: 1.3rem; margin: .4rem 0 .8rem; }
ol.steps li { margin: .45rem 0; line-height: 1.45; }
.kbd { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 0 .35rem; background: var(--card-2); font-weight: 700; }
table.t tr.grp td { background: var(--brand-l); color: var(--brand-d); font-weight: 800; font-size: .8rem; letter-spacing: .02em; }
table.att-grid th, table.att-grid td { padding: .3rem .25rem; text-align: center; font-size: .74rem; min-width: 1.6rem; }
table.att-grid td:first-child, table.att-grid th:first-child { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 8rem; }
table.att-grid tr.grp td { text-align: left; position: static; }
table.att-grid th.sun { color: var(--brand); }
table.att-grid td.c-present { background: var(--ok-l); color: var(--ok); }
table.att-grid td.c-late { background: var(--warn-l); color: var(--warn); font-weight: 800; }
table.att-grid td.c-absent, table.att-grid td.c-leave, table.att-grid td.c-sandwich { background: var(--bad-l); color: var(--bad); font-weight: 800; }
table.att-grid td.c-holiday { background: var(--brand-l); color: var(--brand); }
table.att-grid td.c-holiday-worked { background: var(--gold-l); color: var(--gold-ink); }
body.offline .topbar { background: linear-gradient(140deg, #4a4560, #5d5878); }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; background: var(--brand-l); display: inline-grid; place-items: center; color: var(--brand); font-weight: 800; font-size: 1rem; }
.avatar.ini { background: var(--brand-l); }
.avatar.sm { width: 34px; height: 34px; font-size: .8rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.15rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 1.9rem; box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--gold); }
.chip.owner { background: var(--gold-l); color: var(--gold-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold-d) 60%, transparent); }
.chip.owner::before { content: "★ "; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; max-width: 1px !important; padding: 0 !important; margin: -1px !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; left: 0; }
.file-btn { cursor: pointer; }
.profile-head { margin-bottom: .6rem; }
.profile-head .btn-row { margin: 0; }
.avatar-edit { flex: none; }
.sm-select { width: auto; max-width: 46%; min-height: 38px; padding: .3rem .5rem; font-size: .85rem; }
a.me-card { display: flex; align-items: center; gap: .8rem; color: inherit; font-weight: inherit; }
a.me-card .name { font-weight: 800; }
.menu-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-l); color: var(--brand); display: grid; place-items: center; flex: none; }
.menu-ic svg { width: 22px; height: 22px; }
.lang-pick { display: grid; gap: .5rem; }
.lang-pick label { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 700; background: var(--card-2); }
.lang-pick label:has(input:checked) { border-color: var(--navy-3); background: var(--brand-l); box-shadow: inset 0 0 0 1px var(--navy-3); }
.version { text-align: center; font-size: .72rem; color: var(--muted); margin-top: 1rem; }

.quota .ql { font-weight: 750; font-size: .88rem; margin: .2rem 0 .35rem; color: var(--brand-d); }
.quota .row { gap: .5rem; }
.quota label.f { margin-bottom: .6rem; }

/* v1.4 settings polish: times side by side, duty hours full width; long buttons may wrap; checkboxes never shrink */
.timing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .6rem; }
.timing > label.f:last-child { grid-column: 1 / -1; }
@media (min-width: 640px) { .timing { grid-template-columns: repeat(3, minmax(0, 1fr)); } .timing > label.f:last-child { grid-column: auto; } }
.btn.wrap { white-space: normal; line-height: 1.3; }
.check input { flex: none; }

/* ---------------- v1.5: personal details, sections, login ID ---------------- */
.pct-bar { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.pct-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy-3), var(--gold)); transition: width .4s var(--ease); }
.pct-bar.ok > i { background: var(--ok-b); }
.pct-bar.warn > i { background: linear-gradient(90deg, var(--warn-b), var(--gold)); }
.pd-pct { font-size: 1.5rem; font-weight: 800; color: var(--brand-d); flex: none !important; }
.pd-head .chip { margin: .15rem .1rem 0 0; }
.pd-form fieldset { margin-bottom: 1rem; }
.pd-form .sub-h { margin: .4rem 0 .5rem; font-size: .9rem; color: var(--label); }
.rep { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
.rep-row { border: 1px dashed var(--line); border-radius: 12px; padding: .6rem .6rem 0; background: var(--card-2); }
.rep-row .row { align-items: flex-end; flex-wrap: wrap; }
.rep-row .row > label.f { flex: 1 1 140px; }
.rep-row .rep-rm { flex: none !important; margin-bottom: .85rem; min-width: 44px; }
.field-msg { font-size: .8rem; min-height: 0; margin: -.55rem 0 .7rem; font-weight: 600; }
.field-msg:empty { display: none; }
.field-msg.bad { color: var(--bad); }
.field-msg.ok { color: var(--ok); }
input.invalid, select.invalid { border-color: var(--bad-b); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad-b) 18%, transparent); }
.pd-form textarea { min-height: 84px; }
.consent .check span { font-weight: 700; }
.consent .check { align-items: flex-start; }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: .45rem .8rem; margin: 0; font-size: .92rem; }
.kv dt { color: var(--muted); font-weight: 650; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.doc-list .doc-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--track); flex: none; font-size: 1.15rem; }
.doc-list .doc-ic.ok { background: var(--ok-l); color: var(--ok); font-weight: 800; }
.doc-btns { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 52%; }
.file-btn { cursor: pointer; position: relative; }
.staff-tools { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.staff-tools input { flex: 1 1 200px; }
.staff-tools .chips { flex: none; }
.li-chips { display: inline-flex; gap: .3rem; flex: none; align-items: center; }
b.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; color: var(--brand-d); }
.code-done { text-align: center; padding: .4rem 0; }
.code-big { font: 800 2.2rem/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--brand-d); background: var(--gold-l); border-radius: 14px; padding: .55rem .9rem; margin: .45rem auto; display: inline-block; }
.sec-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .4rem .5rem; padding: .6rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.sec-row:last-child { border-bottom: 0; }
.sec-row .sec-meta { grid-column: 1; grid-row: 2; }
.sec-row .sec-btns { display: flex; gap: .35rem; grid-column: 2; grid-row: 2; justify-content: flex-end; }
.sec-row .sec-btns .btn { min-width: 44px; min-height: 36px; padding: .3rem .6rem; }
@media (min-width: 640px) {
  .sec-row { grid-template-columns: 1.3fr 1fr auto; }
  .sec-row .sec-btns { grid-column: 3; grid-row: 1; }
  .sec-row .sec-meta { grid-column: 1 / -1; }
}
@media (max-width: 420px) { .doc-list li { flex-wrap: wrap; } .doc-btns { max-width: none; width: 100%; justify-content: flex-start; padding-left: 52px; } }
.pd-form + .card, #pdDocs { margin-top: 1rem; }

/* ---------------- v1.5 Step C2: payments, suppliers, staff payments ---------------- */
.gw-note { font-size: .82rem; }
.pay-tiles { margin-bottom: 1rem; }
.pay-tiles .tile .v { font-size: 1.2rem; white-space: nowrap; }
@media (max-width: 560px) { .pay-tiles.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pay-tiles.g3 .tile:last-child { grid-column: 1 / -1; } }
.pay-tools { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.pay-tools .check { margin: 0 0 .5rem; }
.pay-actions { margin-bottom: .4rem; }
.pay-actions > .btn { flex: 1 1 30%; min-width: 0; white-space: normal; line-height: 1.15; }
.pay-list > li { align-items: flex-start; }
.pay-list > li > .sel, .pay-list .sel { width: 22px; height: 22px; margin-top: .2rem; flex: none; accent-color: var(--navy); }
.pl-top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.pl-top .name { min-width: 0; }
.pl-amt { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; flex: none; font-variant-numeric: tabular-nums; }
.pl-route { display: flex; flex-wrap: wrap; gap: .3rem; margin: .35rem 0 .2rem; }
.pl-route .chip { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.pl-btns { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.pl-btns .btn { flex: 0 1 auto; }
.list > li.void { opacity: .55; }
.list > li.void .name { text-decoration: line-through; text-decoration-thickness: 1px; }
.qr-box { text-align: center; }
.qr-box .qr-svg { width: min(240px, 70vw); height: auto; border-radius: 12px; border: 1px solid var(--line); padding: 6px; background: #fff; }
.qr-amt { font-size: 1.6rem; font-weight: 800; margin: .1rem 0; color: var(--brand-d); }
.upi-link { display: block; font-size: .7rem; word-break: break-all; background: var(--track); border-radius: 8px; padding: .4rem .5rem; text-align: left; color: var(--label); }
span.code, dd.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.bank-note { font-size: .82rem; }
ol.steps { padding-left: 1.2rem; margin: .6rem 0 0; }
ol.steps li { margin-bottom: .3rem; }
.sup-actions { margin-bottom: .6rem; }
.led-btns { display: flex; flex-direction: column; gap: .3rem; flex: none; }
.sup-sec .list .li-link .chip { flex: none; }
/* staff Payments tab */
.notif-list > li { align-items: flex-start; }
.notif-list .n-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: .45rem; flex: none; background: transparent; }
.notif-list li.unread .n-dot { background: var(--bad-b); }
.notif-list li:not(.unread) .name { font-weight: 600; color: var(--label); }
.pay-month + .pay-month { margin-top: .8rem; }
.pm-h { display: flex; justify-content: space-between; align-items: baseline; padding: .35rem .6rem; background: var(--brand-l); border-radius: 10px; }
.school-payee { display: flex; flex-direction: column; gap: .1rem; background: var(--gold-l); border-radius: 12px; padding: .6rem .8rem; margin-bottom: .85rem; }
.pay-status-card .card-h { margin-bottom: .4rem; }
.slip-net .slip-pay { display: inline-flex; flex-basis: 100%; justify-content: center; font-size: .78rem; letter-spacing: 0; text-transform: none; white-space: normal; text-align: center; }
.slip-net .slip-pay.ok { background: #e2f4ea; color: #17784b; } .slip-net .slip-pay.warn { background: #fff2dc; color: #a45a00; } .slip-net .slip-pay.bad { background: #fde9e9; color: #c41f27; }
#payHist .list > li { flex-wrap: wrap; }
#payHist .list > li .grow { flex: 1 1 180px; }
#payHist [data-ack] { margin-left: auto; }

/* ===================== v1.6 Step B ===================== */
.days .d.off { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.legend i.lg-off { background: transparent; border: 1px solid var(--line); }
.slot-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.slot-chips .chip { font-size: .7rem; }
/* Duty 1 / Duty 2 segmented control */
.duty-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--track); border-radius: 14px; padding: 4px; margin: 0 0 1rem; }
.duty-seg button { border: 0; background: transparent; color: var(--label); font: inherit; font-weight: 750; padding: .55rem .4rem; border-radius: 11px; cursor: pointer; min-height: 44px; overflow-wrap: anywhere; }
.duty-seg button small { display: block; font-weight: 600; font-size: .72rem; opacity: .8; }
.duty-seg button.sel { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.duty-seg button.sel small { color: var(--gold); opacity: 1; }
/* Admin home: my attendance */
.ap-card { background: var(--hero); color: #fff; border: 0; }
.ap-card .ap-head { display: flex; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: .8rem; flex-wrap: wrap; }
.ap-card .ap-ttl { display: flex; flex-direction: column; min-width: 0; }
.ap-card .ap-ttl b { font-size: 1.08rem; } .ap-card .ap-ttl span { font-size: .8rem; opacity: .85; }
.ap-card .duty-seg { background: rgba(255, 255, 255, .12); margin-bottom: .8rem; }
.ap-card .duty-seg button { color: #fff; } .ap-card .duty-seg button.sel { background: var(--gold); color: #2a2000; } .ap-card .duty-seg button.sel small { color: #2a2000; }
.ap-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.ap-btns .punch-btn { width: 100%; height: auto; min-height: 64px; aspect-ratio: auto; border-radius: 16px; font-size: 1.05rem; font-weight: 800; animation: none; }
.ap-btns .punch-btn::after { display: none; }
/* App lock */
.lock-screen { position: fixed; inset: 0; z-index: 200; background: var(--hero); color: #fff; display: grid; place-items: center; padding: 1.2rem; overflow: auto; }
.lock-box { width: min(100%, 360px); text-align: center; }
.lock-box .login-logo { margin: 0 auto .4rem; }
.lock-box .lock-ic { color: var(--gold); line-height: 0; margin-top: .3rem; }
.lock-box h1 { color: #fff; margin: .2rem 0 .4rem; }
.lock-box .lock-who { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: 0 0 1rem; }
.lock-box form { background: var(--card); color: var(--text); border-radius: 18px; padding: 1rem; box-shadow: var(--shadow-lg); text-align: left; }
.lock-box form .pin-input { width: 100%; text-align: center; font-size: 1.6rem; letter-spacing: .4em; margin-bottom: .4rem; }
.lock-box .lock-msg { min-height: 1.3rem; color: var(--bad); font-weight: 700; font-size: .9rem; margin-bottom: .5rem; text-align: center; }
.lock-box .btn.ghost { color: #fff; margin-top: .8rem; }
.lock-box.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
body.locked { overflow: hidden; }
/* Holidays import */
.imp-cta { display: flex; align-items: center; gap: .7rem; color: inherit; }
.imp-cta .name { font-weight: 800; color: var(--text); }
.imp-list > li.imp-row { align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .65rem .7rem; margin-bottom: .55rem; opacity: .62; }
.imp-list > li.imp-row.on { opacity: 1; border-color: color-mix(in srgb, var(--gold) 70%, var(--line)); box-shadow: var(--shadow); }
.imp-list .imp-sel { width: 22px; height: 22px; margin-top: .45rem; flex: none; accent-color: var(--primary); }
.imp-list .imp-top { display: flex; gap: .4rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.imp-list .imp-date { width: auto; max-width: 165px; padding: .35rem .5rem; min-height: 38px; }
.imp-list .imp-name { width: 100%; margin: .35rem 0 .25rem; font-weight: 700; min-height: 40px; padding: .35rem .55rem; }
.imp-list .imp-note { margin-top: .15rem; }
.imp-bar { position: sticky; bottom: calc(var(--nav-h) + 8px); z-index: 5; padding-top: .3rem; }
/* Staff form v1.6 parts */
fieldset.f16 { background: var(--card-2); }
.slot-day { border-top: 1px solid var(--line); padding: .45rem 0; }
.slot-day .slot-h { display: flex; justify-content: space-between; align-items: center; }
.slot-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: .35rem; align-items: center; margin-top: .35rem; }
.slot-row input { min-width: 0; width: 100%; padding: .35rem .4rem; }
.dow-pick { display: flex; flex-wrap: wrap; gap: .35rem; margin: .3rem 0 .6rem; }
.dow-pick label.chip { cursor: pointer; font-size: .8rem; padding: .35rem .6rem; }
.s16-info { margin-top: .35rem; line-height: 1.5; }
/* Savings + deposits */
.sav-tiles { margin-bottom: .8rem; }
.sav-mo .row input { min-width: 0; }
.list b.minus { color: var(--bad); } .list b.plus { color: var(--ok); }
.dep-list > li { flex-wrap: wrap; }
.dep-list > li.dim { opacity: .55; }
.dep-list .dep-bal { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.dep-list .dep-btns { display: flex; gap: .4rem; flex-wrap: wrap; width: 100%; }
.list > li.void { opacity: .5; }
/* Settings */
.timing.sat { margin-top: .5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.timing label.f input[type="time"] { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; }  /* v1.7.1: 320 px fit (Settings Saturday times) */
/* TRIAL entrance QR */
.entrance { max-width: 460px; margin: 0 auto; }
.entrance .ent-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.entrance .ent-card { background: var(--hero); color: #fff; border-radius: 24px; padding: 1.2rem 1rem 1rem; text-align: center; box-shadow: var(--shadow-lg); margin-bottom: 1rem; }
.entrance .ent-logo { width: 64px; height: 64px; border-radius: 50%; background: #fff; padding: 4px; object-fit: contain; }
.entrance h1 { color: #fff; font-size: 1.25rem; margin: .4rem 0 .1rem; }
.entrance .ent-sub { margin: 0 0 .8rem; color: var(--gold); font-weight: 750; }
.entrance .ent-qr { background: #fff; border-radius: 18px; padding: 10px; display: inline-block; line-height: 0; max-width: 100%; border: 4px solid var(--gold); }
.entrance .ent-qr svg { width: min(300px, 74vw); height: auto; }
.entrance .ent-qr.stale { opacity: .35; }
.entrance .ent-count { display: flex; align-items: center; gap: .6rem; margin: .8rem auto 0; max-width: 320px; font-size: .85rem; font-weight: 700; }
.entrance .ent-bar { flex: 1; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.entrance .ent-bar i { display: block; height: 100%; width: 100%; background: var(--gold); transition: width 1s linear; }
.entrance .ent-clock { font-size: 1.6rem; font-weight: 800; margin-top: .4rem; font-variant-numeric: tabular-nums; }
.qr-scan .cam-inner { display: flex; flex-direction: column; height: 100%; padding: 1rem; padding-top: max(1rem, env(safe-area-inset-top)); gap: .8rem; }
.qr-scan .cam-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.qr-scan .cam-head .btn.sec { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .2); }
.qr-scan .qr-view { position: relative; flex: 1; display: grid; place-items: center; overflow: hidden; border-radius: 18px; background: #15112a; min-height: 240px; }
.qr-scan video { width: 100%; height: 100%; object-fit: cover; transform: none; border: 0; border-radius: 0; aspect-ratio: auto; }
.qr-scan .qr-frame { position: absolute; width: min(64vw, 260px); aspect-ratio: 1; }
.qr-scan .qr-frame i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--gold); }
.qr-scan .qr-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.qr-scan .qr-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.qr-scan .qr-frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.qr-scan .qr-frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.qr-scan .qr-msg { text-align: center; font-weight: 700; margin: 0; min-height: 2.6rem; }
.qr-scan .qr-msg.bad { color: #ffb3b0; }
@media print { .entrance .ent-card { box-shadow: none; } body.wide .entrance, .entrance { max-width: none; } }
.timing.sat > label.f:last-child { grid-column: auto; }
.wd-list > li { flex-wrap: wrap; }
.wd-list .wd-btns { display: flex; gap: .5rem; width: 100%; padding-left: calc(34px + .75rem); }
.wd-list .wd-btns:empty { display: none; }
.entrance .ent-card .muted { color: rgba(255, 255, 255, .78); }

/* ---------- v1.6 Step B2/C: chat, birthdays, Duty 2 timings ---------- */
.topbar .chat-btn { position: relative; padding: 0; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; border: 0; display: grid; place-items: center; flex: none; }
.topbar .chat-btn svg { width: 21px; height: 21px; }
.topbar .chat-btn .dot { position: absolute; top: -3px; right: -3px; background: var(--bad-b); color: #fff; border-radius: 9px; font-size: .62rem; line-height: 1.35; padding: 0 5px; font-weight: 700; }
.chat-row { align-items: center; }
.chat-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem; flex: none; background: var(--brand-l); }
.chat-ico.ann { background: var(--gold-l); }
.chat-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.chat-head h1 { margin: 0; font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-msgs { display: flex; flex-direction: column; gap: .45rem; min-height: 40vh; max-height: calc(100vh - 290px); overflow-y: auto; padding: .6rem .2rem; }
.chat-day { align-self: center; font-size: .72rem; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .1rem .55rem; margin: .3rem 0; }
.msg { max-width: 82%; align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: .45rem .7rem .3rem; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--brand-l); border-radius: 14px 14px 4px 14px; }
.msg.wish { background: var(--gold-l); border-color: var(--gold); }
.msg.del .txt { color: var(--muted); }
.msg .by { font-size: .72rem; font-weight: 700; color: var(--brand); margin-bottom: .1rem; }
.msg .txt { white-space: pre-wrap; line-height: 1.4; }
.msg .meta { font-size: .68rem; color: var(--muted); text-align: right; margin-top: .15rem; }
.msg .msg-act { border: 0; background: none; padding: 0 .25rem; font-size: 1rem; line-height: 1; color: var(--muted); cursor: pointer; }
.chat-form { display: flex; gap: .5rem; align-items: flex-end; position: sticky; bottom: calc(var(--nav-h) + .4rem); background: var(--bg); padding: .5rem 0; }
.chat-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; border-radius: 22px; padding: .6rem .9rem; border: 1px solid var(--input-b); font: inherit; }
.dir-list { max-height: 55vh; overflow-y: auto; }
.dir-pick { width: 100%; border: 0; background: none; text-align: left; padding: .35rem 0; display: flex; gap: .7rem; align-items: center; font: inherit; color: inherit; cursor: pointer; }
.bday-card { background: linear-gradient(135deg, #fff8e1, #fdf0f6); border: 1px solid var(--gold); }
.bday { display: flex; gap: .75rem; align-items: flex-start; }
.bday + .bday { margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--gold); }
.bday-ic { font-size: 2rem; line-height: 1; }
.bday-btns { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.bday-soon { margin-top: .6rem; }
.cam-modal .cam-debug { position: absolute; left: .75rem; right: .75rem; top: 4.2rem; z-index: 2; background: rgba(0, 0, 0, .75); color: #fff; font: 600 .8rem/1.35 ui-monospace, monospace; border-radius: 10px; padding: .5rem .7rem; text-align: center; }
.d2-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .2rem 0 .7rem; }
.month-nav { display: flex; align-items: center; justify-content: space-between; }
.month-nav h3 { margin: 0; }
.d2-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.d2-grid .d2h { text-align: center; font-size: .7rem; font-weight: 700; color: var(--muted); }
.d2c { border: 1px solid var(--line); border-radius: 8px; background: var(--card-2); min-height: 52px; padding: 2px 1px; display: flex; flex-direction: column; align-items: center; font: inherit; color: var(--text); cursor: pointer; }
.d2c .dn { font-size: .72rem; font-weight: 700; }
.d2c .tm { font-size: .64rem; font-variant-numeric: tabular-nums; }
.d2c .tm2 { font-size: .6rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.d2c.default { background: #fff; }
.d2c.month { background: var(--brand-l); border-color: #c9c1ea; }
.d2c.week { background: var(--ok-l); border-color: #a9dbc0; }
.d2c.date { background: var(--gold-l); border-color: var(--gold); }
.d2c.off { background: #f1eff5; color: var(--muted); }
.d2c.today { outline: 2px solid var(--brand); outline-offset: 1px; }
.d2-legend { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .6rem; }
.d2-legend .d2c { min-height: 0; padding: .1rem .45rem; cursor: default; font-size: .7rem; }

/* ---------- v1.6.3: "Mark Register" row directly below the top bar (full text on every screen size) ---------- */
.mr-row { max-width: 760px; margin: 0 auto; padding: .75rem 1rem 0; }
body.wide .mr-row { max-width: 1160px; }
.mr-wide {
  display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 52px; padding: .5rem .7rem .5rem .55rem; border-radius: 16px;
  background: linear-gradient(150deg, #f6dc7a 0%, var(--gold) 48%, var(--gold-d) 100%);
  color: var(--navy); text-decoration: none; font-weight: 800; font-size: 1rem; letter-spacing: .01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 0 0 1px rgba(125, 95, 6, .3), 0 6px 16px rgba(46, 35, 82, .18);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), filter .15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.mr-wide .mr-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--navy); color: var(--gold); box-shadow: 0 2px 6px rgba(20, 12, 50, .3); }
.mr-wide .mr-ic svg { width: 21px; height: 21px; }
.mr-wide .mr-lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-wide .mr-go { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(46, 35, 82, .1); }
.mr-wide .mr-go svg { width: 18px; height: 18px; }
.mr-wide:hover { filter: brightness(1.04); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 0 1px rgba(125, 95, 6, .4), 0 8px 20px rgba(46, 35, 82, .24); }
.mr-wide:active { transform: scale(.985); }
.mr-wide:focus-visible { outline: 3px solid var(--navy-3); outline-offset: 2px; }
.mr-row + main#view { padding-top: .75rem; }
body.offline .mr-wide { filter: saturate(.75); }
/* Narrow phones: a little tighter so the school name keeps room next to the top-bar buttons */
@media (max-width: 400px) {
  .topbar { gap: .4rem; padding-left: .7rem; padding-right: .7rem; }
  .topbar .logo { width: 34px; height: 34px; } .topbar .logo img { width: 30px; height: 30px; }
  .topbar .chat-btn, .topbar .me-btn { width: 34px; min-width: 34px; height: 34px; }
  .topbar .chat-btn svg { width: 19px; height: 19px; }
  .topbar .me-btn .avatar { width: 30px; height: 30px; }
  .topbar button[data-act=switch] { padding: .36rem .55rem; font-size: .72rem; }
  .mr-row { padding: .65rem .75rem 0; }
}

/* ---------- v1.6.3: in-app Mark Register view (full screen, slim fixed header, safe-area aware) ---------- */
body.mr-open { overflow: hidden; }
body.mr-open .demo-banner { display: none; }
.mr-view { position: fixed; inset: 0; z-index: 40; white-space: normal; display: flex; flex-direction: column; background: var(--bg, #f6f4fb); }
.mr-head {
  flex: none; display: flex; align-items: center; gap: .5rem; min-height: 50px;
  padding: .35rem max(.6rem, env(safe-area-inset-right)) .35rem max(.45rem, env(safe-area-inset-left)); padding-top: max(.35rem, env(safe-area-inset-top));
  background: var(--hero); color: #fff; box-shadow: 0 2px 0 var(--gold), 0 4px 14px rgba(20, 12, 50, .28);
}
.mr-back {
  display: inline-flex; align-items: center; gap: .2rem; height: 38px; padding: 0 .8rem 0 .35rem; border-radius: 999px; flex: none;
  background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .24); font: inherit; font-size: .88rem; font-weight: 750; cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.mr-back:active { transform: scale(.96); }
.mr-back:focus-visible, .mr-open:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.mr-title { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: .4rem; font-weight: 750; font-size: .95rem; color: var(--gold); }
.mr-title svg { width: 19px; height: 19px; flex: none; }
.mr-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-open {
  display: inline-flex; align-items: center; gap: .3rem; height: 34px; padding: 0 .7rem; border-radius: 999px; flex: none;
  color: #fff; text-decoration: none; font-size: .78rem; font-weight: 650; white-space: nowrap; border: 1px solid rgba(255, 255, 255, .24);
}
.mr-open:hover { background: rgba(255, 255, 255, .1); }
.mr-note { flex: none; display: flex; align-items: center; gap: .5rem; padding: .5rem .5rem .5rem .9rem; background: var(--gold-l); color: var(--gold-ink); font-size: .84rem; font-weight: 600; border-bottom: 1px solid color-mix(in srgb, var(--gold-d) 40%, transparent); }
.mr-note span { flex: 1; min-width: 0; white-space: normal; line-height: 1.35; }
.mr-note button { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; }
.mr-stage { position: relative; flex: 1; min-height: 0; background: #fff; }
.mr-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fff; padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; }
.mr-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem; color: #5b5675; font-size: .9rem; }
.mr-view.loaded .mr-loading { display: none; }
.mr-fail { position: absolute; left: 1rem; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 2; margin: 0 auto; max-width: 420px; padding: 1rem; border-radius: 16px; background: var(--card, #fff); color: var(--text, #222); box-shadow: 0 10px 30px rgba(20, 12, 50, .25); text-align: center; }
.mr-fail p { margin: 0 0 .7rem; font-weight: 600; }
.mr-fail .btn { display: inline-flex; align-items: center; gap: .4rem; }
.mr-fail[hidden] { display: none; }
/* Narrow phones: the title shows only its icon so "← SFS Quantum" and "Open in browser" keep their full text */
@media (max-width: 439.98px) {
  .mr-title span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .mr-back { font-size: .84rem; padding-right: .7rem; }
  .mr-open { padding: 0 .6rem; font-size: .75rem; }
}
/* v1.6.2 app name: login hero line + top-bar tag (tag shown from 560 px; phones keep the room for the name) */
.login-hero .app-name { margin: .1rem 0 .15rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .8rem; color: var(--gold); }
.topbar .ttl .app-tag { font-style: normal; color: var(--gold); font-weight: 700; }
@media (max-width: 559.98px) { .topbar .ttl .app-tag { display: none; } }

/* ---------- v1.6.4: premium navy + metallic gold (Cinzel wordmark, shimmer line, gold back button, splash) ---------- */
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 400 900; font-display: swap; src: url(../vendor/fonts/cinzel-latin.woff2) format('woff2'); }
:root {
  --serif-wm: 'Cinzel', 'Playfair Display', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --gold-metal: linear-gradient(115deg, #a77d12 0%, #e6c44a 22%, #fff3c4 40%, #d9b13c 55%, #f6dc7a 72%, #a77d12 100%);
  --hero: radial-gradient(120% 140% at 18% 0%, #5a4996 0%, #3D305C 38%, #2E2352 62%, #1b1438 100%);
}
:root[data-theme="dark"] { --hero: radial-gradient(120% 140% at 18% 0%, #3d2f78 0%, #2a2152 40%, #1a1438 66%, #0d0a1f 100%); }
@keyframes sfs-shimmer { 0% { background-position: 160% 0; } 100% { background-position: -60% 0; } }
@keyframes sfs-sweep { 0%, 55% { transform: translateX(-120%) skewX(-20deg); } 100% { transform: translateX(260%) skewX(-20deg); } }
.gold-line { display: block; height: 2px; width: 100%; background: linear-gradient(90deg, transparent, #a77d12 12%, #f6dc7a 35%, #fffbe6 50%, #f6dc7a 65%, #a77d12 88%, transparent); background-size: 220% 100%; animation: sfs-shimmer 4.5s linear infinite; }
/* top bar: deep navy radial field + a thin gold shimmer line instead of the flat 2 px border */
.topbar { box-shadow: 0 6px 18px rgba(20, 12, 50, .28); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, #8a6a12, #e6c44a 20%, #fff3c4 50%, #e6c44a 80%, #8a6a12); background-size: 220% 100%; animation: sfs-shimmer 5s linear infinite; }
.topbar .logo { background: #1b1438; box-shadow: 0 0 0 2px #e6c44a, 0 0 10px rgba(246, 220, 122, .55); }
.topbar .ttl .wm { display: block; font-style: normal; font-family: var(--serif-wm); font-weight: 700; font-size: .8rem; line-height: 1.15; letter-spacing: .12em; text-transform: uppercase;
  background: var(--gold-metal); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: #f0d272; -webkit-text-fill-color: transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: sfs-shimmer 6s linear infinite; }
.topbar .ttl b { font-size: .95rem; line-height: 1.2; }
.topbar .ttl span { font-size: .72rem; line-height: 1.2; }
/* sign-in hero + boot splash */
.login-hero .app-name { font-family: var(--serif-wm); font-weight: 700; font-size: 1.12rem; letter-spacing: .14em; margin: .25rem 0 .35rem;
  background: var(--gold-metal); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: #f0d272; -webkit-text-fill-color: transparent; animation: sfs-shimmer 6s linear infinite; }
.login-hero .gold-line { width: 150px; margin: 0 auto .5rem; }
.login-hero .login-logo { box-shadow: 0 0 0 3px #e6c44a, 0 0 22px rgba(246, 220, 122, .45); }
.splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; background: var(--hero); color: #fff; text-align: center; padding: env(safe-area-inset-top) 1.5rem env(safe-area-inset-bottom); }
.splash img { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 0 0 1px rgba(246, 220, 122, .5), 0 10px 40px rgba(0, 0, 0, .4), 0 0 36px rgba(230, 196, 74, .28); }
.splash-wm { margin: .6rem 0 0; font-family: var(--serif-wm); font-weight: 700; font-size: 1.7rem; letter-spacing: .14em; text-transform: uppercase;
  background: var(--gold-metal); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: #f0d272; -webkit-text-fill-color: transparent; animation: sfs-shimmer 5s linear infinite; }
.splash .gold-line { width: 180px; }
.splash-sub { margin: .2rem 0 0; font-size: .8rem; letter-spacing: .06em; opacity: .8; }
/* Mark Register view: "← SFS Quantum" is a metallic gold pill with a soft glow and a slow light sweep */
.mr-head { box-shadow: 0 4px 14px rgba(20, 12, 50, .28); position: relative; }
.mr-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: linear-gradient(90deg, #8a6a12, #e6c44a 20%, #fff3c4 50%, #e6c44a 80%, #8a6a12); background-size: 220% 100%; animation: sfs-shimmer 5s linear infinite; }
.mr-head { min-height: 56px; }
.mr-back, .mr-wide { position: relative; overflow: hidden; isolation: isolate; }
.mr-back {
  height: 44px; min-height: 44px; padding: 0 1rem 0 .5rem; gap: .25rem; color: #1b1438; border: 0; font-weight: 800; font-size: .92rem; letter-spacing: .01em;
  background: linear-gradient(160deg, #fff1b8 0%, #f6dc7a 22%, #e6c44a 50%, #c9a227 78%, #a77d12 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), inset 0 -2px 0 rgba(120, 88, 8, .35), 0 0 0 1px rgba(255, 236, 160, .55), 0 0 14px rgba(246, 210, 100, .55), 0 3px 10px rgba(0, 0, 0, .3);
  text-shadow: 0 1px 0 rgba(255, 248, 220, .55);
}
.mr-back svg { stroke-width: 2.6; }
.mr-back:hover { filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -2px 0 rgba(120, 88, 8, .35), 0 0 0 1px rgba(255, 236, 160, .7), 0 0 20px rgba(246, 210, 100, .7), 0 3px 10px rgba(0, 0, 0, .3); }
.mr-back:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.mr-back::after, .mr-wide::after { content: ""; position: absolute; top: -10%; bottom: -10%; left: 0; width: 38%; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent); animation: sfs-sweep 3.6s ease-in-out infinite; }
.mr-back > *, .mr-wide > * { position: relative; }
.mr-back::after { z-index: 0; mix-blend-mode: soft-light; }
.mr-wide::after { z-index: 0; mix-blend-mode: soft-light; }
.mr-back > *, .mr-wide > * { z-index: 1; }
.mr-wide { background: linear-gradient(160deg, #fff1b8 0%, #f6dc7a 20%, #e6c44a 50%, #c9a227 80%, #a77d12 100%); color: #1b1438;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(120, 88, 8, .3), 0 0 0 1px rgba(167, 125, 18, .45), 0 0 16px rgba(230, 196, 74, .4), 0 6px 16px rgba(46, 35, 82, .18); }
.mr-wide .mr-ic { background: radial-gradient(circle at 30% 20%, #4b3d78, #1b1438); }
@media (max-width: 439.98px) { .mr-back { padding-right: .8rem; } }
@media (prefers-reduced-motion: reduce) {
  .gold-line, .topbar::after, .mr-head::after, .topbar .ttl .wm, .login-hero .app-name, .splash-wm { animation: none; }
  .mr-back::after, .mr-wide::after { animation: none; display: none; }
}

/* ===== v1.7.0 Mark Register inside SFS Quantum (#/mr) ===== */
.mr-page { min-width: 0; }
.mr-tabs { display: flex; gap: .35rem; overflow-x: auto; margin: 0 0 .8rem; padding-bottom: 2px; }
.mr-tabs a { flex: none; padding: .45rem .9rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; min-height: 38px; display: inline-flex; align-items: center; }
.mr-tabs a.on { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: inset 0 -2px 0 var(--gold); }
.mr-head2 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-bottom: .4rem; min-width: 0; }
.mr-head2 h2 { margin: 0; flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; font-size: 1.25rem; }
.mr-up { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: 1.6rem; color: var(--brand); }
.mr-exam { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; color: var(--muted); max-width: 100%; }
.mr-exam select { min-height: 40px; max-width: 13rem; border-radius: 10px; border: 1px solid var(--input-b); background: var(--input-bg); color: var(--text); padding: 0 .5rem; font: inherit; }
.mr-sync { font-size: .82rem; margin: .1rem 0 .7rem; color: var(--muted); min-height: 1em; }
.mr-sync.ok::before { content: '✓ '; color: var(--ok); } .mr-sync.wait { color: var(--warn); font-weight: 600; }
.mr-cls-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .7rem; margin-bottom: 1rem; }
.mr-cls { display: flex; flex-direction: column; gap: .2rem; min-width: 0; padding: .9rem 1rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: var(--text); border-left: 4px solid var(--gold); }
.mr-cls-name { font-weight: 700; font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.mr-cls-meta, .mr-cls-prog { font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
.bad-t { color: var(--bad); }
.mr-st { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .45rem; border-radius: 999px; background: var(--track); color: var(--label); white-space: nowrap; vertical-align: middle; }
.mr-st.st-submitted { background: var(--info-l); color: var(--info-ink); } .mr-st.st-reviewed { background: var(--warn-l); color: var(--warn); }
.mr-st.st-approved { background: var(--ok-l); color: var(--ok); } .mr-st.st-final { background: var(--navy); color: var(--gold); } .mr-st.st-returned { background: var(--bad-l); color: var(--bad); }
.mr-seg { display: flex; gap: 0; margin: .3rem 0 .7rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; width: fit-content; max-width: 100%; }
.mr-seg a { padding: .5rem .9rem; text-decoration: none; color: var(--text); font-weight: 600; font-size: .9rem; background: var(--card); min-height: 40px; display: inline-flex; align-items: center; }
.mr-seg a.on { background: var(--navy); color: #fff; }
.mr-codes { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .2rem 0 .5rem; }
.mr-codes .btn.sm { min-width: 52px; }
.mr-grid-wrap { overflow: auto; max-height: calc(100vh - 210px); max-height: calc(100dvh - 210px); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; margin-bottom: 1rem; }
.mr-grid { border-collapse: separate; border-spacing: 0; font-size: .9rem; min-width: 100%; }
.mr-grid th, .mr-grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; background: var(--card); }
.mr-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--card-2); padding: .35rem .3rem; font-weight: 600; text-align: center; vertical-align: bottom; min-width: 4.6rem; max-width: 7rem; }
.mr-grid thead th .sn { display: block; font-size: .78rem; line-height: 1.15; overflow-wrap: anywhere; }
.mr-grid thead th .pt { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }
.mr-grid thead th.ro { color: var(--muted); }
.mr-grid .mr-stu { position: sticky; left: 0; z-index: 1; text-align: left; padding: .3rem .45rem; min-width: 7.5rem; max-width: 9.5rem; font-weight: 500; box-shadow: 1px 0 0 var(--line); }
.mr-grid thead .mr-stu.corner { z-index: 3; vertical-align: middle; }
.mr-grid .mr-stu .roll { display: inline-block; min-width: 1.6em; color: var(--muted); font-size: .78rem; margin-right: .25rem; }
.mr-grid .mr-stu .nm { font-size: .84rem; line-height: 1.2; overflow-wrap: anywhere; word-break: break-word; }
@media (min-width: 700px) { .mr-grid .mr-stu { min-width: 12rem; max-width: 16rem; } .mr-grid-wrap { max-height: calc(100vh - 240px); } }
.mr-cell { width: 100%; min-width: 4.4rem; height: 44px; border: 0; background: transparent; text-align: center; font: inherit; font-size: 1rem; color: var(--text); padding: 0 .2rem; border-radius: 0; }
.mr-cell:focus { outline: 2px solid var(--gold-d); outline-offset: -2px; background: var(--gold-l); }
.mr-cell[readonly] { color: var(--muted); background: var(--card-2); }
.mr-cell.bad { background: var(--bad-l); color: var(--bad); outline: 2px solid var(--bad-b); outline-offset: -2px; }
.mr-cell.pend { box-shadow: inset 0 -3px 0 var(--warn-b); }
.mr-subjects { display: grid; gap: .5rem; margin-bottom: 1rem; }
.mr-subj, .mr-rev-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); min-width: 0; }
.mr-subj-t, .mr-rev-t { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; min-width: 0; flex: 1 1 14rem; }
.mr-subj-t b, .mr-rev-t b { overflow-wrap: anywhere; }
.mr-rev { display: grid; gap: .5rem; }
.mr-sheet-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.mr-actions { margin: .5rem 0 1rem; }
.mr-hist { margin-bottom: 1rem; font-size: .88rem; } .mr-hist ul { padding-left: 1.1rem; }
.mr-sbs-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.mr-sbs-who { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; flex: 1; }
.mr-sbs-who b { overflow-wrap: anywhere; }
.mr-sbs-list { display: grid; gap: .4rem; margin-top: .5rem; }
.mr-sbs-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.mr-sbs-row > span { min-width: 0; overflow-wrap: anywhere; }
.mr-sbs-row .mr-cell { width: 6.5rem; flex: none; border: 1px solid var(--input-b); border-radius: 10px; }
.mr-tbl { overflow-x: auto; margin: .4rem 0 .6rem; }
.mr-tbl table { border-collapse: collapse; font-size: .88rem; }
.mr-tbl td, .mr-tbl th { padding: .25rem .3rem; border-bottom: 1px solid var(--line); text-align: left; }
.mr-tbl input:not([type=checkbox]), .mr-tbl select, #suAllot select { min-height: 36px; border: 1px solid var(--input-b); border-radius: 8px; background: var(--input-bg); color: var(--text); padding: 0 .4rem; font: inherit; max-width: 14rem; }
#suAllot select { max-width: 100%; }
@media (max-width: 600px) { .mr-codes .small { display: none; } .mr-head2 h2 { font-size: 1.1rem; flex-basis: 9rem; } .mr-tabs { margin-bottom: .5rem; } .mr-sync { margin-bottom: .4rem; } }

/* ===== v1.7.0-fixes: one-time "new icon" tip (installed app) ===== */
.icon-tip { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: min(92vw, 520px); box-sizing: border-box; display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem;
  background: linear-gradient(135deg, #2E2352, #1b1436); color: #fff7dc; border: 1.5px solid var(--gold, #D4AF37);
  border-radius: 16px; box-shadow: 0 10px 30px rgba(20, 12, 50, .35); }
body.no-nav .icon-tip { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.icon-tip img { flex: 0 0 40px; border-radius: 10px; }
.icon-tip p { margin: 0; flex: 1 1 auto; min-width: 0; font-size: .86rem; line-height: 1.35; overflow-wrap: anywhere; }
.icon-tip .btn { flex: 0 0 auto; background: linear-gradient(180deg, #f7dc7d, #d4a838); color: #2E2352; border: 0; font-weight: 800; }
/* v1.7.0-fixes: slip "Notable days" status column wraps on 360 px phones (Holiday-worked etc. stayed inside the border) */
@media (max-width: 600px) { .slip-days td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; } .slip-days { max-width: 100%; } }
/* v1.7.0-fixes: gold "← SFS Quantum" back row inside the built-in Mark Register (#/mr) */
.mr-row .mr-qback { display: flex; width: 100%; box-sizing: border-box; min-height: 48px; height: auto; padding: .5rem 1rem .5rem .6rem; border-radius: 16px; font-size: 1rem; text-decoration: none;
  background: linear-gradient(110deg, #a77d12 0%, #e6c44a 18%, #fff1b8 32%, #f6dc7a 46%, #c9a227 70%, #f6dc7a 86%, #a77d12 100%); background-size: 220% 100%; animation: sfs-shimmer 5s linear infinite; }
.mr-row .mr-qback span { font-family: 'Cinzel', Georgia, serif; font-weight: 800; letter-spacing: .04em; }
@media (prefers-reduced-motion: reduce) { .mr-row .mr-qback { animation: none; } }
.hero .school-day { margin-top: .35rem; font-size: .8rem; font-weight: 650; color: #f6dc7a; opacity: .95; overflow-wrap: anywhere; }


/* ===== v1.7.1: dark theme (navy + gold), Back / Forward / Home in the top bar ===== */
/* Paper stays white: salary slips on screen and EVERYTHING when printed use the light palette whatever the theme. */
:root[data-theme="dark"] .slip, :root[data-theme="dark"] .paper { --navy: #2E2352; --navy-2: #3D305C; --navy-3: #4b3d78; --gold: #E6C44A; --gold-d: #C9A227; --gold-ink: #7d5f06; --gold-l: #fbf3d6; --primary: #2E2352; --on-primary: #ffffff; --primary-h: #3D305C; --brand: #3a2d6e; --brand-l: #eeebf8; --accent: var(--gold); --ok: #17784b; --ok-l: #e2f4ea; --ok-b: #22a06b; --warn: #a45a00; --warn-l: #fff2dc; --warn-b: #f0a020; --bad: #c41f27; --bad-l: #fde9e9; --bad-b: #D7262E; --info-l: #eceaf8; --info-ink: #2E2352; --muted: #615b74; --line: #e7e3f0; --track: #ebe8f3; --bg: #f5f3fa; --card: #ffffff; --card-2: #faf9fd; --text: #1c1830; --label: #3b3550; --input-bg: #ffffff; --input-b: #d6d1e4; --radius: 16px; --radius-sm: 12px; --shadow: 0 1px 2px rgba(31, 22, 64, .06), 0 6px 20px rgba(31, 22, 64, .07); --shadow-lg: 0 10px 30px rgba(31, 22, 64, .16); --hero: linear-gradient(140deg, #2E2352 0%, #3D305C 55%, #514085 100%); --nav-h: 68px; --ease: cubic-bezier(.2, .8, .2, 1); --hero: radial-gradient(120% 140% at 18% 0%, #5a4996 0%, #3D305C 38%, #2E2352 62%, #1b1438 100%); color-scheme: light; color: #1d1830; }
@media print {
  :root[data-theme="dark"] { --navy: #2E2352; --navy-2: #3D305C; --navy-3: #4b3d78; --gold: #E6C44A; --gold-d: #C9A227; --gold-ink: #7d5f06; --gold-l: #fbf3d6; --primary: #2E2352; --on-primary: #ffffff; --primary-h: #3D305C; --brand: #3a2d6e; --brand-l: #eeebf8; --accent: var(--gold); --ok: #17784b; --ok-l: #e2f4ea; --ok-b: #22a06b; --warn: #a45a00; --warn-l: #fff2dc; --warn-b: #f0a020; --bad: #c41f27; --bad-l: #fde9e9; --bad-b: #D7262E; --info-l: #eceaf8; --info-ink: #2E2352; --muted: #615b74; --line: #e7e3f0; --track: #ebe8f3; --bg: #f5f3fa; --card: #ffffff; --card-2: #faf9fd; --text: #1c1830; --label: #3b3550; --input-bg: #ffffff; --input-b: #d6d1e4; --radius: 16px; --radius-sm: 12px; --shadow: 0 1px 2px rgba(31, 22, 64, .06), 0 6px 20px rgba(31, 22, 64, .07); --shadow-lg: 0 10px 30px rgba(31, 22, 64, .16); --hero: linear-gradient(140deg, #2E2352 0%, #3D305C 55%, #514085 100%); --nav-h: 68px; --ease: cubic-bezier(.2, .8, .2, 1); --hero: radial-gradient(120% 140% at 18% 0%, #5a4996 0%, #3D305C 38%, #2E2352 62%, #1b1438 100%); color-scheme: light; }
  :root[data-theme="dark"] body { background: #fff !important; color: #1c1830 !important; }
  .navc { display: none !important; }
}
/* dark: the few light-only fills that were not on variables */
:root[data-theme="dark"] .pill.ok { background: #123d29; color: #8ff0bf; }
:root[data-theme="dark"] .d2c.default { background: var(--card); }
:root[data-theme="dark"] .d2c.month { border-color: #4a3f86; }
:root[data-theme="dark"] .d2c.week { border-color: #23624a; }
:root[data-theme="dark"] .d2c.off { background: #1d1a33; }
:root[data-theme="dark"] .bday-card { background: linear-gradient(135deg, #2a2310, #2a1630); }
:root[data-theme="dark"] .mr-loading { color: #5b5675; }
:root[data-theme="dark"] .bottomnav { box-shadow: 0 -4px 20px rgba(0, 0, 0, .45); }
:root[data-theme="dark"] .modal-back { background: rgba(3, 2, 10, .72); }
:root[data-theme="dark"] .mr-tabs a.on, :root[data-theme="dark"] .mr-seg a.on { background: #2E2352; border-color: var(--gold-d); }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { color-scheme: dark; }
:root[data-theme="dark"] .btn.sec { border-color: #3d3766; }
:root[data-theme="dark"] .card { border-color: #24203f; }

/* top-bar Back / Forward / Home (js/nav.js). Small, always visible, fits 320 px. */
.navc { display: inline-flex; align-items: center; flex: none; gap: 1px; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, .10); border: 1px solid rgba(230, 196, 74, .45); }
.topbar .navc button, .mr-head .navc button { width: 30px; height: 30px; min-width: 30px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: #f6dc7a; cursor: pointer; }
.topbar .navc button svg, .mr-head .navc button svg { width: 18px; height: 18px; }
.topbar .navc button:disabled, .mr-head .navc button:disabled { color: rgba(255, 255, 255, .62); cursor: default; opacity: 1; }
.topbar .navc button:disabled svg, .mr-head .navc button:disabled svg { opacity: .55; }
.topbar .navc button:not(:disabled):active, .mr-head .navc button:not(:disabled):active { background: rgba(230, 196, 74, .25); transform: scale(.94); }
.topbar .navc button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
@media (max-width: 419.98px) {
  .topbar { gap: .45rem; padding-left: .6rem; padding-right: .6rem; }
  .topbar .logo { display: none; }
  .topbar .navc button, .mr-head .navc button { width: 28px; height: 28px; min-width: 28px; }
}
@media (max-width: 339.98px) {
  .topbar { gap: .35rem; padding-left: .45rem; padding-right: .45rem; }
  .topbar .chat-btn, .topbar .me-btn { width: 34px; height: 34px; }
}
/* Settings → Appearance */
.theme-seg { display: flex; gap: .35rem; flex-wrap: wrap; }
.theme-seg button { flex: 1 1 0; min-width: 0; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.theme-seg button.sel { background: var(--primary); color: var(--on-primary); border-color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold); }
/* v1.7.1: with Back/Forward/Home in the bar, "My attendance" wraps to two short lines on phones so the school name keeps room */
@media (max-width: 419.98px) {
  .topbar button[data-act="switch"] { white-space: normal; line-height: 1.05; max-width: 5.6rem; padding: .3rem .6rem; font-size: .72rem; text-align: center; }
}
@media (max-width: 339.98px) { .topbar button[data-act="switch"] { padding: .28rem .45rem; font-size: .68rem; max-width: 4.9rem; } }
/* v1.7.1 dark: white-on-colour buttons at AA (4.5:1) */
:root[data-theme="dark"] .btn.ok { background: #17784b; } :root[data-theme="dark"] .btn.ok:hover { background: #136a42; }
:root[data-theme="dark"] .btn.wa { background: #157a3d; } :root[data-theme="dark"] .btn.wa:hover { background: #126a35; }
:root[data-theme="dark"] .btn.warn { background: #9a5300; } :root[data-theme="dark"] .btn.warn:hover { background: #864800; }
:root[data-theme="dark"] .punch-btn.in { background: radial-gradient(circle at 30% 25%, #17744a, #0c4a2e 70%); box-shadow: 0 0 0 2px rgba(95, 211, 154, .45), 0 10px 24px rgba(0, 0, 0, .45); }
:root[data-theme="dark"] .punch-btn.out { background: radial-gradient(circle at 30% 25%, #5a4aa6, #2E2352 72%); box-shadow: 0 0 0 2px rgba(230, 196, 74, .45), 0 10px 24px rgba(0, 0, 0, .45); }
.topbar .sw-s { display: none; }
@media (max-width: 339.98px) { .topbar .sw-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .topbar .sw-s { display: inline; } }
/* v1.7.1: old in-frame Mark Register header (Super Admin fallback) keeps room for Back / Forward / Home on phones */
.mr-head .navc { margin-left: .2rem; }
@media (max-width: 419.98px) {
  .mr-head .mr-title { display: none; }
  .mr-head .mr-open { margin-left: auto; padding: 0 .55rem; }
  .mr-head .mr-open span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 339.98px) { .mr-head .mr-back { padding: 0 .7rem 0 .4rem; font-size: .84rem; } }
/* v1.8.0 global search (top bar + overlay) */
.topbar .search-btn { position: relative; padding: 0; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; border: 0; display: grid; place-items: center; flex: none; cursor: pointer; }
.topbar .search-btn svg { width: 20px; height: 20px; }
@media (max-width: 400px) { .topbar .search-btn { width: 32px; min-width: 32px; height: 32px; } .topbar .search-btn svg { width: 18px; height: 18px; } }
@media (max-width: 339.98px) { .topbar .search-btn { width: 30px; min-width: 30px; height: 30px; } }
.gs-back { align-items: flex-start; }
.modal.gs { width: min(640px, calc(100vw - 1rem)); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; margin-top: .5rem; }
.gs-top { display: flex; gap: .4rem; align-items: center; }
.gs-top input { flex: 1 1 auto; min-width: 0; font-size: 1rem; min-height: 44px; }
.gs-list { overflow-y: auto; display: flex; flex-direction: column; gap: .25rem; }
.gs-row { display: grid; grid-template-columns: auto 1fr; gap: .1rem .5rem; padding: .5rem .55rem; border-radius: 12px; border: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0; }
.gs-row b { overflow-wrap: anywhere; min-width: 0; }
.gs-row .small { grid-column: 2; overflow-wrap: anywhere; min-width: 0; }
.gs-k { grid-row: span 2; align-self: center; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
a.gs-row:hover, a.gs-row:focus-visible { border-color: var(--gold); }
/* v1.8.0: list rows never push text or chips past the card on 320–360 px phones (staff list, deleted lists, suppliers) */
.list li .grow, .list li .li-link .grow { min-width: 0; }
.list li .grow .name, .list li .grow .small { overflow-wrap: anywhere; }
@media (max-width: 400px) { .li-chips { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; } .li-chips .chip { max-width: 100%; white-space: normal; } }
/* v1.8.0: room for the search button next to Admin / My attendance, chat and profile on narrow phones */
@media (max-width: 419.98px) {
  .topbar { gap: .3rem; }
  .topbar .search-btn, .topbar .chat-btn { width: 30px; min-width: 30px; height: 30px; }
  .topbar .search-btn svg, .topbar .chat-btn svg { width: 17px; height: 17px; }
  .topbar .me-btn { width: 32px; min-width: 32px; height: 32px; } .topbar .me-btn .avatar { width: 28px; height: 28px; }
  .topbar button[data-act=switch] { padding: .3rem .45rem; }
}
@media (max-width: 339.98px) {
  .topbar { gap: .22rem; padding-left: .35rem; padding-right: .35rem; }
  .topbar .search-btn, .topbar .chat-btn { width: 28px; min-width: 28px; height: 28px; }
  .topbar .me-btn { width: 30px; min-width: 30px; height: 30px; } .topbar .me-btn .avatar { width: 26px; height: 26px; }
  .topbar button[data-act=switch] { padding: .28rem .35rem; font-size: .68rem; }
}
@media (max-width: 379.98px) { .topbar .sw-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .topbar .sw-s { display: inline; } }
@media (max-width: 339.98px) {
  .topbar .search-btn, .topbar .chat-btn { width: 27px; min-width: 27px; height: 27px; }
  .topbar .me-btn { width: 28px; min-width: 28px; height: 28px; } .topbar .me-btn .avatar { width: 25px; height: 25px; }
}
@media (max-width: 339.98px) { .topbar { gap: .16rem; } }

/* v1.8.0: narrow-phone fixes for the staff list rows and the chat badge */
.list li .grow { min-width: 0; }
.list li .grow .name, .list li .grow .small { overflow-wrap: anywhere; }
@media (max-width: 400px) {
  .list li .grow .name .chip, .list li .grow .small .chip { white-space: normal; max-width: 100%; }
  .topbar .chat-btn .dot { right: 0; top: -4px; padding: 0 3px; font-size: .58rem; }
}
/* v1.8.0: approval action buttons as a wrapping grid (no squeezed vertical text on phones) */
.mr-ap-act, #apSheets .btn-row { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.mr-ap-act .btn, #apSheets .btn-row .btn { width: 100%; white-space: normal; word-break: normal; overflow-wrap: normal; min-height: 40px; margin: 0; }
@media (max-width: 400px) {
  .list.face-reqs li { flex-wrap: wrap; }
  .list.face-reqs li .grow { flex: 1 1 calc(100% - 64px); }
  .list.face-reqs li .btn { flex: 1 1 40%; }
}

/* ===== v1.8.2: "New SFS Quantum app available" banner (Android app / TWA only, js/apk-update.js) ===== */
.apk-upd { position: fixed; left: 50%; transform: translateX(-50%); top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 70;
  width: min(94vw, 520px); box-sizing: border-box; display: flex; align-items: center; gap: .4rem; padding: .55rem .5rem .55rem .8rem;
  background: linear-gradient(180deg, #f7dc7d, #d4a838); color: #2E2352; border: 1px solid #b8901f;
  border-radius: 14px; box-shadow: 0 8px 24px rgba(20, 12, 50, .35); }
.apk-upd-go { flex: 1 1 auto; min-width: 0; color: #2E2352; font-weight: 800; font-size: .86rem; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
.apk-upd-x { flex: 0 0 36px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: rgba(46, 35, 82, .12); color: #2E2352; font-size: 1.3rem; line-height: 1; cursor: pointer; }
/* v1.9.0: a part of Settings opened from a Mark Register link (#/a/settings?sec=…) */
fieldset.deep-hit, .card.deep-hit { box-shadow: 0 0 0 3px var(--gold), var(--shadow); scroll-margin-top: 80px; }

/* v1.9.1: admin Photo sheet (Staff → a staff member → Photo) */
.sp-big { display: flex; justify-content: center; }
.sp-big img, .sp-none { width: 140px; height: 180px; border-radius: 10px; box-shadow: var(--shadow); object-fit: cover; }
.sp-none { display: flex; align-items: center; justify-content: center; color: var(--muted, #888); background: rgba(127,127,127,.12); }
.sp-note { margin: .7rem 0 0; text-align: center; overflow-wrap: anywhere; }

/* ===== v1.9.1 (owner Master Prompt v2.0, Phase A) ===== */
/* A1 calendar day view */
.dv-nav input[type=date] { flex: 1 1 auto; min-width: 0; max-width: 220px; text-align: center; min-height: 40px; }
.dv-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.dv-tiles .tile { padding: .55rem .6rem; min-width: 0; }
.dv-tiles .tile .v { font-size: 1.2rem; }
.dv-tiles .tile .l { font-size: .62rem; overflow-wrap: anywhere; }
.list.dv li { align-items: flex-start; gap: .7rem; }
.list.dv li.tap { cursor: pointer; }
.list.dv li .grow { min-width: 0; }
.list.dv .name { overflow-wrap: anywhere; }
.list.dv .times { font-size: .82rem; color: var(--muted); }
.list.dv .times b { color: var(--text); font-weight: 700; }
.dv-chips { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; }
.dv-chips .chip { white-space: nowrap; }
a.chip { text-decoration: none; }
.dv-rem { margin-top: .25rem; overflow-wrap: anywhere; }
.att-grid th a.dh-link { color: inherit; text-decoration: underline dotted; display: block; min-width: 1.4em; }
/* A2 overtime report */
.ot-seg { display: flex; }
.ot-seg a { flex: 1; text-align: center; padding: .55rem .3rem; border-radius: 9px; font-weight: 700; font-size: .86rem; color: var(--muted); text-decoration: none; min-width: 0; }
.ot-seg a.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(31, 22, 64, .15); }
.ot-nav input[type=date] { flex: 1 1 auto; min-width: 0; max-width: 220px; text-align: center; min-height: 40px; }
.ot-list li { align-items: center; gap: .6rem; }
.ot-list .grow { min-width: 0; }
.ot-list .name { overflow-wrap: anywhere; }
.ot-v { display: flex; flex-direction: column; align-items: flex-end; flex: none; text-align: right; }
.ot-v .small { color: var(--ok); font-weight: 700; }
a.ot-link { font-weight: 800; }
.ot-dates { white-space: normal; min-width: 70px; }
.btn-col { display: flex; flex-direction: column; gap: .3rem; flex: none; }
/* A3 action sheet */
.da-p li { padding: .35rem 0; }
.modal:has(#daSheet) .actions { flex-wrap: wrap; }
.modal:has(#daSheet) .actions .btn { flex: 1 1 auto; }
/* A5 pending card */
.pend-card .card-h { margin-bottom: .3rem; }
.pend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.pend-list a { display: flex; align-items: center; gap: .55rem; padding: .32rem .5rem; border-radius: 12px; border: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0; }
.pend-list .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; font-size: .9rem; font-weight: 650; }
.pend-list small { font-weight: 500; font-size: .76rem; }
.pend-n { flex: none; min-width: 1.75rem; height: 1.75rem; padding: 0 .35rem; border-radius: 999px; display: grid; place-items: center; background: var(--track); color: var(--label); font-size: .9rem; }
.pend-n.warn { background: var(--warn-l); color: var(--warn); } .pend-n.bad { background: var(--bad-l); color: var(--bad); } .pend-n.gold { background: var(--gold-l); color: var(--gold-ink); }
.pend-go { color: var(--muted); font-size: 1.2rem; flex: none; }
.tmr-hol { margin-top: .5rem; }
/* A6 locked check-out */
.punch-btn.out.locked small { font-weight: 800; }
/* A4 Ask Quantum */
.ask-fab { position: fixed; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  height: 48px; min-width: 48px; padding: 0 .7rem; border-radius: 999px; border: 1px solid #b8901f; cursor: pointer; font: inherit; font-weight: 800; font-size: .9rem;
  background: linear-gradient(180deg, #f7dc7d, #d4a838); color: #2E2352; box-shadow: 0 6px 18px rgba(20, 12, 50, .35); }
.ask-fab.with-nav { bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); }
.ask-fab:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
body.mr-open .ask-fab, body.login-page .ask-fab, body:has(.modal-back) .ask-fab, body:has(.cam-modal) .ask-fab { display: none; }
main#view { padding-bottom: calc(var(--nav-h) + 4.6rem + env(safe-area-inset-bottom)); }
.ask-back { align-items: flex-end; }
.modal.ask { display: flex; flex-direction: column; gap: .45rem; max-height: min(86vh, 640px); width: min(100%, 560px); box-sizing: border-box; }
.ask-h { flex: none; display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; }
.ask-h > b { display: inline-flex; align-items: center; gap: .35rem; font-size: 1.05rem; color: var(--gold-ink); }
:root[data-theme="dark"] .ask-h > b { color: var(--gold); }
.ask-hb { display: flex; align-items: center; gap: .3rem; }
.ask-hb select { min-height: 36px; padding: 0 .3rem; }
.ask-note { margin: 0; }
.ask-log { flex: 1 1 auto; min-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; padding: .2rem 0; }
.ask-m { display: flex; } .ask-m.me { justify-content: flex-end; }
.ask-b { max-width: 88%; padding: .5rem .7rem; border-radius: 14px; font-size: .9rem; line-height: 1.42; overflow-wrap: anywhere; background: var(--track); color: var(--text); }
.ask-m.me .ask-b { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
:root[data-theme="dark"] .ask-m.me .ask-b { background: #4b3d78; }
.ask-m.bot .ask-b { border-bottom-left-radius: 4px; }
.ask-open { display: flex; width: fit-content; margin-top: .45rem; max-width: 100%; white-space: normal; text-align: left; overflow-wrap: anywhere; }
.ask-sug { flex: none; display: flex; flex-wrap: nowrap; gap: .3rem; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: thin; }
.ask-sug .chip { flex: none; border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.ask-in { flex: none; display: flex; gap: .35rem; align-items: center; }
.ask-in input { flex: 1 1 auto; min-width: 0; min-height: 44px; font-size: 1rem; }
.ask-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.ask-ic.on { background: var(--gold-l); color: var(--gold-ink); border-color: var(--gold-d); }
.ask-ic.go { background: var(--brand); color: #fff; border-color: transparent; }
.ask-ic.rec { background: var(--bad-l); color: var(--bad); animation: askPulse 1s infinite; }
.ask-ic[data-novoice] { opacity: .45; }
@keyframes askPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .ask-ic.rec { animation: none; } }
@media print { .ask-fab, .ask-back { display: none !important; } }
.pend-more summary { cursor: pointer; font-weight: 800; font-size: .82rem; color: var(--muted); padding: .35rem .2rem; list-style: none; }
.pend-more summary::after { content: ' more ▾'; }
.pend-more[open] summary::after { content: ' ▴'; }
.pend-more .pend-list { margin-top: .25rem; }
.dv-tiles .tile { cursor: pointer; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); text-align: left; font: inherit; color: inherit; }
.dv-tiles .tile.sel { outline: 2.5px solid var(--gold); }
@media (max-width: 400px) { .ask-fab span { display: none; } .ask-fab { padding: 0; width: 48px; } }
/* the Ask button never covers the one-time icon tip or a sticky bottom bar (chat box, approval selection, import) */
body:has(#iconTip) .ask-fab { display: none; }
body:has(.chat-form) .ask-fab.with-nav, body:has(.ap-selbar) .ask-fab.with-nav, body:has(.imp-bar) .ask-fab.with-nav { bottom: calc(var(--nav-h) + 84px + env(safe-area-inset-bottom)); }
body:has(.chat-form) .ask-fab:not(.with-nav), body:has(.ap-selbar) .ask-fab:not(.with-nav) { bottom: calc(88px + env(safe-area-inset-bottom)); }

/* v1.9.2: staff-detail month cells open the day view */
a.d { text-decoration: none; cursor: pointer; }
.dv li.dv-focus { outline: 2px solid var(--gold, #d4a72c); outline-offset: 2px; border-radius: 10px; }

/* v1.9.3 Phase B: day remarks (calendar marker + day view), correction requests */
.days .d.rmk { position: relative; }
.days .d .rmk-dot, .legend .rmk-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand, #1f4e8c); box-shadow: 0 0 0 1.5px var(--card, #fff); }
.days .d .rmk-dot { position: absolute; top: 3px; right: 3px; }
.legend .lg-rmk .rmk-dot { margin-right: .3rem; vertical-align: middle; }
.dv-remark { display: flex; gap: .6rem; align-items: flex-start; flex-wrap: wrap; }
.dv-remark .grow { min-width: 0; overflow-wrap: anywhere; }
.corr-list li, .corr-admin li { align-items: flex-start; }
.corr-list .grow, .corr-admin .grow { min-width: 0; overflow-wrap: anywhere; }
.corr-acts { display: flex; flex-direction: column; gap: .35rem; flex: none; }
.corr-admin .chip { white-space: normal; }
