:root {
  --bg: #f4f5f7; --panel: #ffffff; --ink: #1c2330; --muted: #5f6b7a; --line: #d9dde3;
  --brand: #9b1c1c; --brand-ink: #ffffff; --head: #3f5568; --head-ink: #ffffff;
  --open: #d11a1a; --mine: #1f4fd1; --off: #1f4fd1; --pick: #7b2cbf; --ok: #1d7a3a; --warn: #a15c00; --bad: #b42318;
  --chip-ok: #e3f4e8; --chip-warn: #fff1d6; --chip-bad: #fde7e5; --chip-open: #eef1f5;
  --today: #fff8db; --focus: #2b6cff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c; --panel: #1b2129; --ink: #e8ecf1; --muted: #9aa6b5; --line: #2e3742;
    --head: #2c3c4b; --open: #ff6b6b; --mine: #7aa2ff; --off: #7aa2ff; --pick: #c9a0ff; --ok: #58c27d; --warn: #f2b45c; --bad: #ff8577;
    --chip-ok: #193325; --chip-warn: #3a2c12; --chip-bad: #3d1d1a; --chip-open: #26303b; --today: #2c2a1a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--mine); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  background: var(--brand); color: var(--brand-ink); padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.nav { display: none; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a, .tabbar a { color: inherit; text-decoration: none; }
.nav a { padding: 6px 7px; border-radius: 6px; opacity: .9; white-space: nowrap; flex: none; }
.nav a.on { background: rgba(255,255,255,.18); opacity: 1; font-weight: 600; }
.who { margin-left: auto; flex: none; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.who button { background: rgba(255,255,255,.15); border: 0; color: inherit; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: var(--panel);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; text-align: center; padding: 10px 2px; font-size: 12px; color: var(--muted); }
.tabbar a.on { color: var(--brand); font-weight: 700; }
.tabbar a span { display: block; font-size: 18px; line-height: 1.1; }
@media (min-width: 900px) {
  .nav { display: flex; }
  .tabbar { display: none; }
  body { padding-bottom: 0; }
}
.offline { background: var(--chip-warn); color: var(--warn); text-align: center; padding: 6px; font-size: 14px; }

main { padding: 16px; max-width: 1700px; margin: 0 auto; }
.loading { color: var(--muted); padding: 40px; text-align: center; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; margin: 20px 0 8px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.bar .grow { flex: 1; }
.btn { background: var(--panel); border: 1px solid var(--line); padding: 7px 12px; border-radius: 7px; cursor: pointer; min-height: 36px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.good { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 3px 8px; min-height: 28px; font-size: 13px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--chip-open); white-space: nowrap; }
.chip.ok { background: var(--chip-ok); color: var(--ok); }
.chip.warn { background: var(--chip-warn); color: var(--warn); }
.chip.bad { background: var(--chip-bad); color: var(--bad); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 6px 12px; cursor: pointer; }
.seg button.on { background: var(--head); color: var(--head-ink); }
label.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }

/* ---------- month schedule (mirrors the current layout) ---------- */
.month { display: grid; grid-template-columns: repeat(7, minmax(var(--col, 0px), 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: var(--panel); font-size: 11.5px; letter-spacing: -0.1px; }
.month .ln > span:first-child { font-variant-numeric: tabular-nums; }
.month .dow .ds { display: none; }
.month .dow { background: var(--head); color: var(--head-ink); text-align: center; font-weight: 700; padding: 4px; border-right: 1px solid var(--line); }
.day { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 110px; padding: 2px 3px 6px; min-width: 0; overflow: hidden; }
.day.other { background: color-mix(in srgb, var(--bg) 60%, var(--panel)); }
.day.other .dnum { color: var(--muted); }
.day.today { background: var(--today); }
.dnum { font-weight: 700; font-size: 14px; padding: 2px 2px 4px; display: flex; justify-content: space-between; align-items: center; }
.dnum button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.grp { margin-bottom: 6px; }
.grp-h { font-weight: 700; font-size: 13px; padding: 2px 4px; border-left: 3px solid rgba(0,0,0,.25); color: #1c2330; }
.ln { display: grid; grid-template-columns: max-content minmax(0, 1fr) 8px; gap: 6px; padding: 1px 2px; cursor: pointer; border-radius: 3px; align-items: center; white-space: nowrap; }
.ln:hover { background: color-mix(in srgb, var(--focus) 10%, transparent); }
.ln .who { overflow: hidden; text-overflow: ellipsis; display: block; margin: 0; }
.ln.open { color: var(--open); }
.ln.mine { color: var(--pick); font-weight: 600; }
.ln .st { width: 8px; height: 8px; border-radius: 50%; }
.st.pending { background: var(--warn); } .st.approved { background: var(--ok); } .st.rejected { background: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin: 8px 0; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

.phone-only { display: none; }
.tabs-phone { display: none; }
/* month zoom (pinch / − + on phones) */
.month-wrap { overflow-x: auto; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.month-wrap.zoomed { max-height: calc(100dvh - 170px); overflow: auto; border-bottom: 1px solid var(--line); }
.month-wrap.zoomed .month .dow { position: sticky; top: 0; z-index: 2; }
.month.zoomed { font-size: 12.5px; }
.month.zoomed .ln { padding: 3px 2px; }
.month.zoomed .grp-h { font-size: 13.5px; }
.seg.zoom button { min-width: 38px; font-size: 15px; padding: 6px 10px; }
.legend-wrap { margin: 6px 0; font-size: 13px; color: var(--muted); }
.legend-wrap summary { cursor: pointer; }
@media (max-width: 759px) {
  main { padding: 10px; }
  .month { font-size: 11px; }
  .month .ln { gap: 4px; }
  .day { min-height: 90px; }
  .desk-only { display: none; }
  .tabs-desk { display: none !important; }
  .tabs-phone { display: block; width: 100%; padding: 10px; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font-weight: 600; }
  /* tab bars (Admin, Payroll …) wrap onto more lines instead of running off the screen */
  .seg { display: flex; flex-wrap: wrap; max-width: 100%; }
  .seg button { flex: 1 1 auto; border-bottom: 1px solid var(--line); }
  .bar > .seg { width: 100%; }
  .phone-only { display: inline; }
  /* zoomed in on a phone: time on its own row, then the person (two-line lines) */
  .month.zoomed .ln { grid-template-columns: minmax(0, 1fr) 8px; gap: 0 4px; row-gap: 0; padding: 3px 2px; border-bottom: 1px dotted var(--line); }
  .month.zoomed .ln > span:first-child { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
  .month.zoomed .ln.open > span:first-child, .month.zoomed .ln.off > span:first-child { color: inherit; }
  .month.zoomed .ln .who { white-space: nowrap; }
  .month:not(.zoomed) .pos:not(.off-code) { display: none; }
  /* squeezed to fit a phone: just start time + name, smaller headers */
  .month:not(.zoomed) .dur { display: none; }
  .month:not(.zoomed) .ln { grid-template-columns: 1fr; gap: 0; padding: 2px 1px; border-bottom: 1px dotted var(--line); }
  .month:not(.zoomed) .ln .st { display: none; }
  .month:not(.zoomed) .grp-h { font-size: 10.5px; padding: 1px 2px; }
  .month:not(.zoomed) .dow { font-size: 11px; padding: 4px 0; }
  .month:not(.zoomed) .dow .dl { display: none; }
  .month:not(.zoomed) .dow .ds { display: inline; }
  .month:not(.zoomed) .dnum { font-size: 12px; }
  .bar h1 { font-size: 19px; }
  .bar label.chk { font-size: 13px; }
}

/* agenda (phones) */
.agenda .aday { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.agenda .aday.today { outline: 2px solid var(--brand); }
.agenda .ah { background: var(--head); color: var(--head-ink); padding: 6px 10px; font-weight: 700; display: flex; justify-content: space-between; }
.agenda .grp { padding: 4px 8px 0; }
.agenda .ln { grid-template-columns: max-content minmax(0,1fr) 10px; font-size: 14px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.agenda .ln:last-child { border-bottom: 0; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: color-mix(in srgb, var(--head) 12%, var(--panel)); font-size: 13px; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.sub td { background: color-mix(in srgb, var(--head) 7%, var(--panel)); font-weight: 700; }
tr:last-child td { border-bottom: 0; }

/* ---------- payroll steps ---------- */
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.step { flex: 1; min-width: 140px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.step b { display: block; font-size: 14px; }
.step.done { border-color: var(--ok); background: var(--chip-ok); }
.step.now { border-color: var(--warn); background: var(--chip-warn); }

/* ---------- dialog & forms ---------- */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 24px)); background: var(--panel); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10,15,20,.5); }
#dlgForm { padding: 18px; max-height: 85vh; overflow: auto; }
#dlgForm h3 { margin: 0 0 12px; }
.f { display: grid; gap: 4px; margin-bottom: 10px; font-size: 14px; }
.f input, .f select, .f textarea { padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); width: 100%; }
.f input[type=checkbox], .f input[type=radio] { width: auto; padding: 0; flex: none; }
.f label.chk { justify-content: flex-start; white-space: nowrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 > * { min-width: 0; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.actions .left { margin-right: auto; }
.err { color: var(--bad); font-size: 14px; min-height: 1em; }
.dows { display: flex; gap: 4px; flex-wrap: wrap; }
.dows label { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 13px; cursor: pointer; }
.dows input { margin: 0 4px 0 0; }

.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: #1c2330; color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; }
.toast.bad { background: var(--bad); }

.signin { max-width: 420px; margin: 10vh auto; text-align: center; }
.signin img { width: 84px; height: 84px; border-radius: 16px; }
.signin .btn { width: 100%; margin-top: 12px; padding: 12px; font-size: 16px; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.grid-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }

@media print {
  .topbar, .tabbar, .bar, .noprint { display: none !important; }
  main { padding: 0; }
  .day { min-height: 0; }
}

/* compact inputs inside tables (admin editors) */
.tbl-wrap input:not([type=checkbox]), .tbl-wrap select, table input:not([type=checkbox]), table select {
  padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); max-width: 100%;
}
dialog td, dialog th { white-space: nowrap; }
.daylink { border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; padding: 0 4px; border-radius: 4px; text-decoration: underline dotted; text-underline-offset: 3px; }
.daylink:hover { background: color-mix(in srgb, var(--focus) 15%, transparent); }
details summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
dialog ul { margin: 8px 0 0; padding-left: 20px; }
.ln.off { color: var(--off); font-style: italic; font-weight: 400; }
.ln.off .who::before { content: ''; }

.reqn { color: var(--warn); }
tr.grpstart td { border-top: 2px solid var(--line); }

/* notifications */
.bell { position: relative; background: none; border: 0; font-size: 18px; cursor: pointer; padding: 4px 6px; color: inherit; }
.bell-n { position: absolute; top: -2px; right: -4px; background: #ffd23f; color: #222; border-radius: 9px; font-size: 11px; font-weight: 700; min-width: 17px; padding: 0 4px; line-height: 17px; text-align: center; }
.nlist { display: grid; gap: 6px; max-height: 50vh; overflow: auto; margin: 8px 0; }
.nitem { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 10px; color: inherit; font: inherit; }
.nitem-b { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; }
.nact { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.nact input { flex: 1; min-width: 160px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: inherit; }
.my-today { display: flex; flex-direction: column; gap: 8px; }
.my-shift { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.my-shift:first-child { border-top: 0; }
.my-shift-b { display: flex; gap: 6px; flex-wrap: wrap; }
.nitem.unread { border-left: 4px solid var(--brand); background: color-mix(in srgb, var(--brand) 5%, var(--panel)); }
.nset h4 { margin: 12px 0 4px; font-size: 14px; }
.nset label.chk { margin: 4px 0; }
.nudge { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Payroll by station: station / earning-code pickers */
.pickset { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 8px 0; }
.pickset label.chk.pick { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; background: var(--panel); }
.pickset label.chk.pick:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--panel)); }
@media print { .no-print { display: none !important; } }

/* Build number / revision at the bottom of every screen */
.buildbar { text-align: center; font-size: 11px; color: var(--muted); padding: 10px 16px 14px; font-variant-numeric: tabular-nums; user-select: all; }
@media print { .buildbar { display: none; } }

.buildbar { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.buildbar .report-btn { font-size: 12px; }
.buildbar .build-txt { user-select: all; }

/* Help tab */
.help-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; justify-content: space-between; }
.help-toc ol { margin: 8px 0 0; padding-left: 22px; columns: 2 260px; }
.help-toc li { margin: 3px 0; }
.md { line-height: 1.55; max-width: 980px; }
.md h2, .md h3 { margin: 22px 0 8px; scroll-margin-top: 70px; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md h4, .md h5 { margin: 16px 0 6px; scroll-margin-top: 70px; }
.md p { margin: 8px 0; }
.md-list { margin: 6px 0; padding-left: 22px; }
.md-list li { margin: 3px 0; }
.md code, .md-pre { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 0.92em; }
.md-pre { padding: 8px 10px; overflow-x: auto; white-space: pre; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.md table { margin: 8px 0; }
.bell.help-q { font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-width: 34px; }

/* View as (troubleshooting) */
.viewas { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 16px;
  background: #fff1d6; color: #5a3d00; border-bottom: 2px solid #e0a800; font-size: 14px; }
.viewas span { flex: 1; min-width: 200px; }
.viewas-list { max-height: 50vh; overflow-y: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; }
.viewas-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 10px; cursor: pointer; color: inherit; font: inherit; }
.viewas-item:hover { background: color-mix(in srgb, var(--focus) 8%, transparent); }
@media print { .viewas { display: none; } }

.viewas.test { background: #ffe1e8; color: #6b0f23; border-bottom-color: #c2185b; }
.viewas-item.is-test { background: color-mix(in srgb, #c2185b 5%, transparent); }

/* Section drop-down (Admin / Reports / Payroll / Help) */
.tabs-pick { display: inline-flex; align-items: center; gap: 8px; }
.tabs-pick select { min-width: 230px; padding: 8px 34px 8px 12px; font-size: 15px; font-weight: 600; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: inherit; cursor: pointer; }
@media (max-width: 759px) {
  .tabs-pick { display: flex; width: 100%; }
  .tabs-pick > span { display: none; }
  .tabs-pick select { flex: 1; width: 100%; padding: 10px; font-size: 16px; }
}

/* Schedule template: rotation editor */
.rot { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.rot-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rot-top input[type=date] { padding: 4px 6px; }
.rot-days { flex-wrap: wrap; max-width: 330px; }
.tpl-table td { vertical-align: top; }
[hidden] { display: none !important; }

/* Accrual rules */
.bank-class { margin-top: 10px; }
.bank-class tr.tier-first td { border-top: 1px solid var(--line); }
.bank-class tr.tier-more td { border-top: 0; background: color-mix(in srgb, var(--bg) 60%, transparent); }

.linkbtn { background: none; border: 0; padding: 0 2px; cursor: pointer; color: inherit; font: inherit; }

/* Assets module */
.as-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 18px; }
.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.as-truck { text-decoration: none; color: inherit; display: block; margin: 0; }
.as-truck:hover { border-color: var(--head); }
.as-labels { display: grid; grid-template-columns: repeat(3, 2.625in); gap: 0 0.125in; justify-content: center; }
.as-label { width: 2.625in; height: 1in; box-sizing: border-box; padding: 0.08in 0.12in; display: flex; gap: 0.1in; align-items: center; overflow: hidden;
  background: #fff; color: #000; border: 1px dashed #ccc; }
.as-label .qr { width: 0.84in; height: 0.84in; flex: none; }
.as-label .qr svg { width: 100%; height: 100%; display: block; }
.as-label .txt { min-width: 0; line-height: 1.15; }
.as-label .org { font-size: 8pt; font-weight: 700; letter-spacing: .05em; }
.as-label .tag { font-size: 13pt; font-weight: 800; font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.as-label .nm { font-size: 8pt; max-height: 2.3em; overflow: hidden; }
@media print {
  body { padding: 0; background: #fff; }
  .as-labels { padding-top: 0.5in; }
  .as-label { border: 0; }
  #dlg, .toast, .offline { display: none !important; }
}
@media print { .buildbar { display: none !important; } html, body { background: #fff !important; } }
/* phones: with modules added there can be more tabs than fit — the bar scrolls sideways; top bar keeps Sign out visible */
@media (max-width: 760px) {
  .tabbar { overflow-x: auto; scrollbar-width: none; }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar a { flex: 1 0 auto; min-width: 58px; white-space: nowrap; padding-left: 6px; padding-right: 6px; }
  .who { gap: 5px; min-width: 0; }
  .who > .small { display: none; }
  .who button { padding: 5px 8px; }
}

/* truck QR screen */
.qa-head { display: flex; align-items: center; gap: 10px; }
.qa-unit { font-size: 30px; font-weight: 800; }
.qa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; }
.qa-btn { display: flex; align-items: center; gap: 14px; text-align: left; padding: 18px 16px; min-height: 76px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: inherit; cursor: pointer; font: inherit; }
.qa-btn b { display: block; font-size: 17px; }
.qa-btn .qa-sub { display: block; color: var(--muted); margin-top: 2px; }
.qa-btn .qa-ic { font-size: 28px; width: 36px; text-align: center; }
.qa-btn.primary { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.qa-btn:disabled { opacity: .55; cursor: default; }

/* truck QR labels */
.tq-sheet { display: flex; flex-wrap: wrap; gap: 0.25in; justify-content: center; }
.tq-label { background: #fff; color: #000; border: 1px dashed #bbb; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-sizing: border-box; page-break-inside: avoid; break-inside: avoid; }
.tq-big .tq-label { width: 4in; height: 4in; padding: 0.2in; }
.tq-big .qr { width: 2.6in; height: 2.6in; }
.tq-small .tq-label { width: 2in; height: 2in; padding: 0.08in; }
.tq-small .qr { width: 1.25in; height: 1.25in; }
.tq-label .qr svg { width: 100%; height: 100%; display: block; }
.tq-top { font-weight: 800; letter-spacing: .1em; font-size: 10pt; }
.tq-big .tq-top { font-size: 13pt; margin-bottom: 4px; }
.tq-unit { font-weight: 800; font-size: 20pt; line-height: 1.1; margin-top: 4px; }
.tq-small .tq-unit { font-size: 11pt; }
.tq-sub { font-size: 10pt; }
.tq-small .tq-sub { font-size: 7pt; }
.tq-help { font-size: 9pt; margin-top: 2px; }
.tq-small .tq-help { display: none; }
@media print { .tq-label { border: 1px solid #ddd; } }

/* Today */
.today-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.today-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; background: var(--bg); }
.today-row:hover { border-color: var(--head); }
.today-row.done { opacity: .75; }
.today-row.done .today-ic { color: var(--ok); }
.today-ic { font-size: 20px; width: 26px; text-align: center; }
.today-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 4px; }
.today-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-decoration: none; color: inherit; font-weight: 600; }
.today-tile:hover { border-color: var(--head); }
.today-tile-ic { font-size: 26px; }
/* scanner */
.scan-wrap { position: fixed; inset: 0; z-index: 1000; background: #000; display: flex; align-items: center; justify-content: center; }
.scan-wrap video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; width: min(70vw, 300px); aspect-ratio: 1; border: 3px solid #fff; border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
.scan-msg { position: absolute; bottom: calc(90px + env(safe-area-inset-bottom)); left: 16px; right: 16px; text-align: center; color: #fff; font-size: 15px; text-shadow: 0 1px 3px #000; }
.scan-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; background: rgba(255,255,255,.9); color: #000; }

/* truck check form */
.ck-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ck-row:first-of-type { border-top: 0; }
.ck-label { flex: 1 1 220px; font-weight: 500; }
.ck-seg button { padding: 9px 14px; min-height: 40px; }
.ck-seg button.on.ck-ok { background: var(--ok); color: #fff; }
.ck-seg button.on.ck-bad { background: var(--bad); color: #fff; }
.ck-note { flex: 1 1 100%; }
.ck-actions { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--bg); padding: 8px 0; }
@media (min-width: 761px) { .ck-actions { bottom: 0; } }

/* Schedule ▾ menu and section bar */
.nav-dd { position: relative; }
.nav-dd-btn { background: none; border: 0; color: inherit; font: inherit; padding: 6px 10px; border-radius: 6px; cursor: pointer; opacity: .9; }
.nav-dd-btn.on { background: rgba(255,255,255,.18); opacity: 1; font-weight: 600; }
.nav-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 210px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; }
.nav-menu[hidden] { display: none; }
.nav-menu a { color: var(--ink) !important; padding: 8px 10px; border-radius: 6px; display: flex; gap: 8px; opacity: 1; }
.nav-menu a:hover, .nav-menu a.on { background: var(--chip-open); font-weight: 600; }
.subnav { padding: 10px 16px 0; max-width: 1700px; margin: 0 auto; }
.subnav-pick { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.subnav-pick select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-weight: 400; min-width: 200px; }
@media print { .subnav { display: none !important; } }

/* Today: collapsible sections, who's working */
.today-sec { padding: 0; }
.today-sec > summary { list-style: none; cursor: pointer; padding: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.today-sec > summary::-webkit-details-marker { display: none; }
.today-sec > summary::before { content: '▸'; color: var(--muted); width: 12px; }
.today-sec[open] > summary::before { content: '▾'; }
.today-sec-t { font-weight: 700; font-size: 17px; }
.today-sec-s { flex: 1 1 200px; }
.today-sec[open] { padding-bottom: 14px; }
.today-sec[open] > :not(summary) { margin-left: 14px; margin-right: 14px; }
.who-grp { margin-top: 8px; }
.who-g { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.who-row { display: grid; grid-template-columns: 110px 1fr; gap: 0 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.who-row .who-p { grid-column: 2; }
.who-row.off .who-n { color: var(--off); }
.who-row.open .who-n { color: var(--open); font-weight: 700; }
.who-t { font-variant-numeric: tabular-nums; color: var(--muted); grid-row: span 2; }
@media (min-width: 761px) { .who-row { grid-template-columns: 120px minmax(160px, 260px) 1fr; } .who-row .who-p { grid-column: 3; } .who-t { grid-row: auto; } }

.today-row.overdue { border-color: var(--bad); }
.today-row .grow { flex: 1; min-width: 0; }

#dlg .f input[hidden] { display: none; }
#dlg .f div > select + input { margin-top: 6px; width: 100%; }

/* checklist tree editor */
.tree-card { padding: 8px; }
.tree-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 4px; border-top: 1px solid var(--line); }
.tree-row:first-child { border-top: 0; }
.tree-row input, .tree-row select { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.tree-label { flex: 1 1 220px; min-width: 160px; }
.tree-area .tree-label { font-weight: 700; }
.tree-ic { width: 20px; text-align: center; }
.tree-btns { display: inline-flex; gap: 3px; margin-left: auto; flex-wrap: wrap; }
.tree-daily { font-size: 13px; }

/* check form: nested areas */
.ck-tree { padding: 6px 10px; }
.ck-area { border-left: 3px solid var(--line); margin: 6px 0 6px 2px; padding-left: 10px; }
.ck-area > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 0; font-weight: 700; list-style: none; }
.ck-area > summary::-webkit-details-marker { display: none; }
.ck-area > summary::before { content: '▾'; color: var(--muted); }
.ck-area:not([open]) > summary::before { content: '▸'; }
.ck-area .ck-allok { margin-left: auto; font-weight: 400; }
.ck-d0 { border-left-color: var(--head); }
.ck-d0 > summary { font-size: 17px; }
.ck-qty { color: var(--muted); font-weight: 600; }

/* reports */
.rp-pick { min-width: 320px; max-width: 100%; }
.rp-params { flex-wrap: wrap; align-items: flex-end; margin-top: 8px; }
.rp-params .f { margin: 0; }
.rp-quick { display: flex; flex-wrap: wrap; gap: 4px; align-self: flex-end; }
.rp-quick .btn.on { background: var(--head); color: var(--head-ink); }
.rp-head h2 { margin: 6px 0 2px; }
.rp-table td.num, .rp-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rp-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.rp-bad { color: var(--bad); font-weight: 600; }
@media print { .rp-out .tbl-wrap { overflow: visible; } .rp-table { font-size: 11px; } }

.ask-q { flex: 1 1 300px; min-height: 52px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.ask-sql { white-space: pre-wrap; font-size: 12px; background: var(--bg); padding: 8px; border-radius: 6px; }

.plan-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 0; }
.btn.onoff { min-width: 44px; padding: 2px 8px; }
.btn.onoff.on { background: var(--chip-ok); color: var(--ok); border-color: var(--ok); }

/* controlled substances */
.cs-draft { background: var(--chip-warn); color: var(--warn); border-radius: 8px; padding: 6px 10px; margin: 0 0 10px; }
.cs-alert { display: block; background: var(--chip-bad); color: var(--bad); font-weight: 600; text-decoration: none; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.cs-grid .card { margin: 0; }
.cs-tbl { width: 100%; border-collapse: collapse; margin-top: 6px; }
.cs-tbl td { padding: 5px 4px; border-top: 1px solid var(--line); }
.cs-tbl td.num { text-align: right; }
.cs-wit { border-color: var(--head); }
.cs-unit { border-top: 1px solid var(--line); padding: 8px 0; }
.cs-unit.nested { margin-left: 22px; border-left: 3px solid var(--line); padding-left: 10px; }
.cs-row { margin: 6px 0; }
.cs-row.card { padding: 8px; }
.scan-panel { position: absolute; left: 16px; right: 16px; bottom: calc(140px + env(safe-area-inset-bottom)); background: var(--card, #fff); color: var(--ink, #000); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.cs-sigwrap { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 6px 0; }
.cs-sig { width: 100%; max-width: 420px; aspect-ratio: 600 / 170; border: 1px solid var(--line); border-radius: 8px; background: #fff; touch-action: none; }
.cs-print { position: fixed; inset: 0; z-index: 2000; background: #fff; color: #000; overflow: auto; padding: 24px; }
.cs-print .cs-tbl td, .cs-print .cs-tbl th { border: 1px solid #999; padding: 4px 6px; font-size: 12px; text-align: left; }
.cs-print-sigs { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 18px; }
.cs-print-sigs > div { width: 300px; font-size: 12px; }
.cs-print-sigs img { width: 280px; border-bottom: 1px solid #000; }
.cs-line { height: 60px; border-bottom: 1px solid #000; }
@media print { body:has(.cs-print) > *:not(.cs-print) { display: none !important; } .cs-print { position: static; } }
/* Protocols: the protocol reader in a frame, filling the screen under the header */
.proto-frame { display: block; width: 100%; height: calc(100dvh - 190px); min-height: 420px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
@media (max-width: 700px) { .proto-frame { height: calc(100dvh - 255px - env(safe-area-inset-bottom, 0px)); border-radius: 8px; } }

/* ---------- Fire Incidents (NERIS report form) ---------- */
.fi-head { position: sticky; top: 60px; z-index: 6; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(16,24,40,.05); }
.fi-head-l { display: flex; align-items: center; gap: 10px; }
.fi-head h1 { margin: 0; font-size: 20px; letter-spacing: .2px; }
.fi-sum { display: flex; gap: 26px; flex: 1; min-width: 0; padding-left: 18px; border-left: 1px solid var(--line); }
.fi-sum > div, .fi-rt > div { display: flex; flex-direction: column; min-width: 0; }
.fi-sum span, .fi-rt span { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.fi-sum b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-head-r { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.fi-vbad { background: var(--chip-bad); color: var(--bad); border-color: transparent; font-weight: 600; text-decoration: none; }
.fi-vok { background: var(--chip-ok); color: var(--ok); border-color: transparent; font-weight: 600; text-decoration: none; }
.fi-wrap { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 22px; align-items: start; padding-bottom: 84px; }
.fi-nav { position: sticky; top: 136px; display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; max-height: calc(100vh - 230px); overflow: auto; }
.fi-nav a { padding: 9px 10px; color: inherit; text-decoration: none; display: flex; gap: 10px; align-items: center; font-size: 14px; border-radius: 8px; }
.fi-nav a:hover { background: var(--bg); }
.fi-nav a.on { background: var(--head); color: var(--head-ink); font-weight: 600; }
.fi-nav a.parent { background: var(--bg); color: inherit; font-weight: 600; }
.fi-nav a.fi-subnav { padding: 6px 10px 6px 42px; font-size: 13px; }
.fi-ic { width: 20px; text-align: center; flex: none; }
.fi-badge { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.fi-pagepick { display: none; }
.fi-main { min-width: 0; max-width: 980px; }
.fi-ptitle { margin: 2px 0 14px; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.fi-ptitle .fi-ic { width: auto; }
.fi-unitbar { margin-bottom: 14px; }
.fi-body { border: 0; padding: 0; margin: 0; min-width: 0; }
.fi-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px 20px; margin-bottom: 16px; }
.fi-h { margin: 0 0 14px; font-size: 17px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.fi-note { font-size: 13px; color: var(--muted); margin: -4px 0 12px; }
.fi-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 26px; align-items: start; }
.fi-form + .fi-form, .fi-form + .fi-list, .fi-var > .fi-form, .fi-card > .fi-var + .fi-var { margin-top: 18px; }
.fi-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fi-f.fi-wide, .fi-form > .fi-sub, .fi-form > .fi-list, .fi-form > .fi-var, .fi-form > .fi-more, .fi-form > .fi-form { grid-column: 1 / -1; }
.fi-f.fi-when { grid-column: span 1; }
.fi-lab { font-size: 14px; font-weight: 600; line-height: 1.3; }
.fi-req { color: var(--bad); }
.fi-help { color: var(--muted); cursor: help; font-weight: 400; }
.fi-desc { font-size: 12px; color: var(--muted); }
.fi-f input:not([type=checkbox]), .fi-f select, .fi-f textarea, .fi-sel, .fi-ta, .fi-dt input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font: inherit; font-size: 15px; min-width: 0; box-sizing: border-box; }
.fi-f textarea, .fi-ta { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.fi-f input:focus, .fi-f select:focus, .fi-f textarea:focus, .fi-ta:focus, .fi-sel:focus, .fi-ms-box:focus, .fi-ms-box.open { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(43,108,255,.15); }
.fi-num { max-width: 180px; }
.fi-addsel { max-width: 320px; margin-top: 12px; }
.fi-dt { display: flex; gap: 6px; align-items: center; }
.fi-dt input[type=date] { flex: 1.2; min-width: 130px; }
.fi-dt input[type=time] { flex: 1; min-width: 110px; }
.fi-dt input[type=number] { flex: 1; }
.fi-dt .btn { height: 40px; flex: none; }
.fi-x { color: var(--muted); }
.fi-seg { display: inline-flex; flex-wrap: wrap; align-self: flex-start; border-radius: 8px; }
.fi-seg button { min-width: 64px; height: 38px; padding: 0 16px; font: inherit; font-size: 14px; border-right: 1px solid var(--line); color: inherit; }
.fi-seg button:last-child { border-right: 0; }
.fi-seg button:hover { background: var(--bg); }
.fi-seg button.on { background: var(--head); color: var(--head-ink); font-weight: 600; }
.fi-ms { position: relative; }
.fi-ms-box { min-height: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px 34px 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; position: relative; box-sizing: border-box; }
.fi-ph { color: var(--muted); padding-left: 3px; }
.fi-caret { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; }
.fi-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--chip-open); border: 1px solid var(--line); border-radius: 6px; padding: 3px 4px 3px 9px; font-size: 13px; line-height: 1.25; }
.fi-tagx { cursor: pointer; padding: 0 5px; border-radius: 4px; color: var(--muted); font-size: 15px; }
.fi-tagx:hover { background: var(--line); color: var(--ink); }
.fi-ms-add { font-size: 13px; color: var(--brand); font-weight: 600; padding: 3px 6px; white-space: nowrap; }
.fi-ms-panel { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(16,24,40,.18); overflow: hidden; }
.fi-ms-q { width: 100%; box-sizing: border-box; border: 0; border-bottom: 1px solid var(--line); padding: 11px 12px; font: inherit; background: var(--panel); color: inherit; outline: none; }
.fi-ms-list { max-height: 320px; overflow: auto; padding: 4px 0; }
.fi-ms-g { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 10px 12px 4px; }
.fi-ms-o { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; font-size: 14px; }
.fi-ms-o:hover { background: var(--bg); }
.fi-ms-o.on { font-weight: 600; }
.fi-ms-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 8px 12px; background: var(--bg); }
.fi-sub { border-left: 3px solid var(--line); padding: 2px 0 2px 16px; }
.fi-subt { margin-bottom: 10px; font-size: 15px; }
.fi-subt .fi-lab { font-size: 15px; }
.fi-list { display: flex; flex-direction: column; gap: 12px; }
.fi-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 16px; background: var(--bg); }
.fi-item-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 15px; }
.fi-add { align-self: flex-start; border-style: dashed; }
.fi-more { margin-top: 14px; }
.fi-more summary { cursor: pointer; color: var(--mine); font-size: 14px; }
.fi-more > .fi-form { margin-top: 14px; }
.fi-q { padding: 2px 0; }
.fi-warn { background: var(--chip-warn); color: var(--warn); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; border: 1px solid rgba(161,92,0,.2); }
.fi-warn b { display: block; margin-bottom: 4px; }
.fi-err { white-space: pre-wrap; background: var(--chip-bad); color: var(--bad); padding: 10px; border-radius: 8px; font-size: 12px; max-height: 50vh; overflow: auto; }
.fi-probs li { margin: 4px 0; }
.fi-rt { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.fi-rt > div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; min-width: 130px; }
.fi-rt b { font-size: 17px; font-variant-numeric: tabular-nums; }
.fi-counts { margin: 0 0 16px; }
.fi-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 14px; }
.fi-unit { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--bg); color: inherit; text-decoration: none; }
.fi-unit:hover { border-color: var(--head); box-shadow: 0 2px 8px rgba(16,24,40,.08); }
.fi-unit-h { display: flex; justify-content: space-between; align-items: center; font-size: 16px; }
.fi-unit-t { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fi-unit-t > div { display: flex; flex-direction: column; }
.fi-unit-t span { font-size: 11px; color: var(--muted); }
.fi-unit-t b { font-size: 13px; font-variant-numeric: tabular-nums; }
.fi-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(16,24,40,.06); }
.fi-foot-in { max-width: 1700px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.fi-foot-m { text-align: center; }
.fi-files { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.fi-file { width: 150px; display: flex; flex-direction: column; gap: 6px; }
.fi-file img { width: 150px; height: 112px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
/* setup page still uses the simple grid */
.fi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 16px; margin-bottom: 8px; }
@media (max-width: 1100px) { .fi-sum { display: none; } }
@media (max-width: 800px) {
  .fi-head { position: static; padding: 10px 12px; gap: 10px; }
  .fi-wrap { grid-template-columns: 1fr; padding-bottom: 140px; }
  .fi-nav { display: none; }
  .fi-pagepick { display: block; width: 100%; height: 44px; padding: 0 10px; font-size: 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 12px; color: inherit; }
  .fi-form { grid-template-columns: 1fr; gap: 16px; }
  .fi-card { padding: 14px 14px 16px; }
  .fi-grid { grid-template-columns: 1fr; }
  .fi-foot { bottom: calc(57px + env(safe-area-inset-bottom)); }
  .fi-foot-m { display: none; }
  .fi-unit-t { grid-template-columns: repeat(2, 1fr); }
  .fi-dt { flex-wrap: wrap; }
  .fi-dt input[type=date] { flex: 1 1 100%; }
  .fi-dt input[type=time] { flex: 1 1 auto; }
}

/* Master Admin → Access roles */
.role-list { display: grid; gap: 10px; }
.role-card { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.role-grants { display: flex; flex-wrap: wrap; gap: 6px; }
.role-checks { display: grid; gap: 6px; }
.role-mods td { vertical-align: top; padding: 6px 8px; }
.role-pick { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 10px; margin-top: 6px; }

/* ---------- Personnel ---------- */
.pm-q { min-width: 260px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; }
.pm-by { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font: inherit; }
@media (max-width: 520px) { .pm-q, .pm-by { min-width: 0; flex: 1 1 100%; } }
.pm-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 18px; align-items: start; }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 12px; }
.pm-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 10px 6px; border-radius: 12px; color: inherit; text-decoration: none; }
.pm-card:hover { background: var(--panel); box-shadow: 0 2px 10px rgba(16,24,40,.08); }
.pm-av { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: var(--head); flex: none; }
.pm-ini { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 30px; letter-spacing: .5px; }
.pm-name { font-weight: 700; font-size: 13px; line-height: 1.2; }
.pm-sub { font-size: 12px; color: var(--muted); min-height: 15px; }
.pm-dot { position: absolute; top: 8px; right: 22%; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg); }
.pm-dot.bad { background: var(--bad); } .pm-dot.warn { background: #e6a700; }
.pm-side { position: sticky; top: 80px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.pm-side a { padding: 7px 10px; border-radius: 7px; color: inherit; text-decoration: none; font-size: 14px; }
.pm-side a:hover { background: var(--bg); }
.pm-side a.on { background: var(--head); color: var(--head-ink); font-weight: 600; }
.pm-side hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.pm-head { display: flex; gap: 20px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin-bottom: 16px; }
.pm-head-ph { position: relative; }
.pm-head-ph .pm-av { width: 112px; height: 112px; }
.pm-photo-edit { position: absolute; right: -6px; bottom: -6px; background: var(--panel); border: 1px solid var(--line); border-radius: 50%; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pm-wrap2 { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.pm-nav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.pm-nav a { padding: 9px 10px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 14px; }
.pm-nav a:hover { background: var(--bg); }
.pm-nav a.on { background: var(--head); color: var(--head-ink); font-weight: 600; }
.pm-pagepick { display: none; }
.pm-main { min-width: 0; max-width: 900px; }
.pm-sec { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 14px; }
.pm-sec-h { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.pm-sec-h h2 { margin: 0; font-size: 18px; flex: 1; }
.pm-kv { display: grid; grid-template-columns: 220px 1fr; gap: 8px 16px; margin: 0; }
.pm-kv dt { color: var(--muted); font-size: 14px; }
.pm-kv dd { margin: 0; font-size: 14px; }
.pm-contacts { display: grid; gap: 10px; }
.pm-crow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.pm-crow input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: inherit; min-width: 0; }
.pm-certs { display: grid; gap: 10px; }
.pm-cert { border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.pm-cert.expiring { border-left-color: #e6a700; } .pm-cert.expired { border-left-color: var(--bad); }
.pm-cert-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.pm-note { border-top: 1px solid var(--line); padding: 10px 0; }
.pm-note:first-child { border-top: 0; padding-top: 0; }
.pm-log { display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.pm-lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pm-lists textarea { width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font: inherit; }
@media (max-width: 800px) {
  .pm-wrap { grid-template-columns: 1fr; } .pm-side { position: static; flex-direction: row; flex-wrap: wrap; order: -1; } .pm-side hr { display: none; }
  .pm-wrap2 { grid-template-columns: 1fr; } .pm-nav { display: none; }
  .pm-pagepick { display: block; width: 100%; height: 44px; margin-bottom: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: inherit; font-size: 16px; padding: 0 10px; }
  .pm-kv { grid-template-columns: 1fr; gap: 2px; } .pm-kv dd { margin-bottom: 8px; }
  .pm-head { flex-direction: column; text-align: center; } .pm-crow { grid-template-columns: 1fr 1fr; }
  .pm-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); } .pm-av { width: 72px; height: 72px; }
}

.cs-pars { display: grid; gap: 6px; margin: 8px 0; }
.cs-par { display: grid; grid-template-columns: minmax(0, 1fr) 80px minmax(0, .8fr) 34px; gap: 6px; align-items: center; }
.cs-par-head { margin-top: 8px; }
@media (max-width: 560px) { .cs-par { grid-template-columns: minmax(0, 1fr) 64px 34px; } .cs-par > input:nth-of-type(2) { grid-column: 1 / -1; grid-row: 2; } .cs-par-head span:nth-child(3) { display: none; } }
.cs-par select, .cs-par input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: inherit; min-width: 0; }
.cs-should { margin-top: 6px; }

.cs-hist { cursor: pointer; }
.cs-hist:hover td { background: var(--hover, rgba(0,0,0,.04)); }
.cs-par.cs-sc { grid-template-columns: minmax(0, 1.4fr) 80px 140px minmax(0, 1fr) auto; }
@media (max-width: 560px) { .cs-par.cs-sc { grid-template-columns: minmax(0, 1fr) 70px; } .cs-par.cs-sc-head, .cs-sc.cs-par-head { display: none; } }
.ck-seals .ck-seal { padding: 8px 0; border-top: 1px dashed var(--line); }
.ck-seals .ck-seal:first-of-type { border-top: 0; }
.ck-seals .ck-seg button { white-space: nowrap; }
.ck-row.ck-seals { display: block; }
.ck-row.ck-seals > .ck-label { margin-bottom: 4px; font-weight: 600; }
.ck-seals .ck-seal.inside { margin-left: 22px; padding-left: 10px; border-left: 3px solid var(--line); }
.brand #org { display: flex; flex-direction: column; line-height: 1.1; }
.brand .brand-org { font-size: 11px; font-weight: 500; opacity: .85; }
@media (max-width: 700px) { .brand .brand-org { display: none; } }
.signin .signin-org { margin: -6px 0 10px; font-weight: 600; opacity: .8; }
.today-logo { width: 72px; height: 72px; object-fit: contain; flex: none; margin-right: 4px; }
@media (max-width: 560px) { .today-logo { width: 44px; height: 44px; } }
.gear-pts { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.gear-pts .small { width: 100%; }
.chip-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; color: inherit; }
.chip-btn.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.gear-look { margin: 2px 0 4px; } .gear-look ul { margin: 4px 0 0 18px; padding: 0; }
/* community events calendar */
.ev-nav { margin: 8px 0; }
.ev-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ev-dow { background: var(--panel); text-align: center; font-size: 12px; font-weight: 700; padding: 4px; }
.ev-day { background: var(--panel); min-height: 92px; padding: 3px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.ev-day.other { opacity: .5; }
.ev-day.today { box-shadow: inset 0 0 0 2px var(--accent, #9b1c1c); }
.ev-dnum { font-size: 12px; font-weight: 700; pointer-events: none; }
.ev-chip { display: block; font-size: 11.5px; line-height: 1.25; padding: 2px 4px; border-radius: 4px; background: #dbeafe; color: #1e3a8a; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-chip.completed { background: #dcfce7; color: #14532d; }
.ev-chip.cancelled { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }
.ev-chip.mine { outline: 2px solid #1e3a8a; outline-offset: -2px; }
.ev-ages { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; } .ev-ages label { display: flex; flex-direction: column; }
.chip-btn.on.ok { background: #15803d; border-color: #15803d; }
@media (max-width: 640px) { .ev-day { min-height: 64px; } .ev-chip { font-size: 10px; } }
.month-foot { margin: 14px 0 6px; }
/* phones: wide tables scroll inside their card instead of pushing the whole page sideways */
@media (max-width: 520px) { .cs-tbl, .rp-table { display: block; max-width: 100%; overflow-x: auto; } .cs-tbl td .bar { flex-wrap: wrap !important; } }
/* property inspections */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px; }
.kv > div > b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.pi-codes { max-height: 46vh; overflow: auto; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.pi-code { text-align: left; border: 1px solid var(--line); background: var(--panel); color: inherit; border-radius: 8px; padding: 7px 10px; cursor: pointer; font: inherit; }
.pi-code:hover, .pi-code.on { border-color: var(--accent, #a51c1c); background: color-mix(in srgb, var(--accent, #a51c1c) 7%, var(--panel)); }
.pi-ck { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pi-ck .seg button { min-width: 42px; }
.pi-v { border: 1px solid var(--line); border-left: 4px solid #c62828; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.pi-v.corrected, .pi-v.na { border-left-color: #2e7d32; opacity: .85; }
.pi-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
/* Master Admin → Alert routing: grouped, one row per alert */
.al-grp > summary { cursor: pointer; padding: 2px 0; list-style-position: inside; }
.al-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.al-row:first-of-type { margin-top: 8px; }
.al-b { display: flex; gap: 6px; flex: none; }
@media (max-width: 520px) { .al-row { flex-direction: column; } .al-b { align-self: stretch; } .al-b .btn { flex: 1; } }
/* grouped navigation: computer menus, phone ☰ More sheet, Today tiles */
.nav { overflow: visible; }
.nav-dd-btn { white-space: nowrap; }
dialog.sheet { margin: auto auto 0; width: 100vw; max-width: 640px; border-radius: 16px 16px 0 0; max-height: 86vh; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.more-grp { margin: 10px 0 4px; }
.more-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.more-item { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-height: 56px; }
.more-item.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.more-item a { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.more-ic { font-size: 22px; flex: none; }
.more-l { font-weight: 600; font-size: 14px; line-height: 1.2; }
.more-pin { background: none; border: 0; border-left: 1px solid var(--line); padding: 0 12px; font-size: 18px; color: var(--muted); cursor: pointer; }
.more-pin.on { color: #c98a00; }
.today-grp-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 2px 6px; }
.today-nav .today-tiles { margin-top: 0; }
/* Hydrants */
.hy-map { height: calc(100vh - 230px); min-height: 360px; border-radius: 12px; border: 1px solid var(--line); }
@media (max-width: 899px) { .hy-map { height: calc(100vh - 270px - env(safe-area-inset-bottom)); } }
.hy-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; } .hy-legend i, .hy-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }
.hy-me { background: #fff; border: 2px solid rgba(0,0,0,.2); border-radius: 4px; width: 34px; height: 34px; font-size: 18px; cursor: pointer; }
/* batch selection (Properties / Hydrants) */
.batch-bar { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 64px); z-index: 500; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 2px solid #1e66d0; border-radius: 10px; padding: 8px 10px; margin: 8px 0; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.batch-bar[hidden] { display: none; }
.batch-selecting { cursor: crosshair; outline: 3px solid #1e66d0; user-select: none; -webkit-user-select: none; }
td.batch-ck, th.batch-ck { width: 34px; text-align: center; }
td.batch-ck input, th.batch-ck input { width: 20px; height: 20px; }
.batch-list { max-height: 160px; overflow: auto; border: 1px solid var(--line, #ddd); border-radius: 6px; padding: 4px 8px; margin: 4px 0 10px; }
.batch-list > div { display: flex; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--line, #eee); }
.batch-list > div:last-child { border-bottom: 0; }
/* Inventory */
.inv-lines { display: grid; gap: 6px; }
.inv-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel); }
.inv-line.done { border-color: var(--ok, #2e9e44); }
.inv-line .grow { min-width: 160px; }
.inv-pick { display: grid; gap: 4px; }
.inv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
a.inv-room { display: block; color: inherit; text-decoration: none; }
.inv-scan { padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); font-size: 15px; }
a.qa-btn { text-decoration: none; color: inherit; }
a.qa-btn.primary { color: inherit; }
/* Training */
.tr-people { display: grid; gap: 2px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.tr-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.tr-bar i { display: block; height: 100%; background: var(--ok, #2e9e44); }
.tr-year { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 10px; }
.tr-year > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel); }
.tr-year b { display: block; font-size: 20px; } .tr-year span { font-size: 12px; color: var(--muted); }
.tr-rule { padding: 10px 12px; margin: 6px 0; }
.tr-sheet { text-align: center; max-width: 7in; margin: 0 auto; padding: 0.3in; border: 2px solid #222; border-radius: 12px; background: #fff; color: #111; }
.tr-sheet h1 { font-size: 28pt; margin: 6px 0; }
.tr-sheet-h { font-size: 14pt; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.tr-sheet-sub { font-size: 12pt; color: #444; margin: 4px 0; }
.tr-sheet-do { font-size: 15pt; font-weight: 700; margin: 12px 0 4px; }
.tr-qr { width: 4.2in; max-width: 80vw; margin: 12px auto; } .tr-qr svg { width: 100%; height: auto; display: block; }
.fi-sethead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 2px; padding: 6px 8px; background: var(--bg); border-radius: 6px; }
/* Station displays */
.disp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.disp-card .pill { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.disp-card .pill.ok { background: color-mix(in srgb, #1e8a46 15%, var(--panel)); color: #1e8a46; font-weight: 700; }
.disp-slide { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0; background: var(--panel); }
.disp-slide.off { opacity: .55; }
.disp-slide .bar { flex-wrap: nowrap; }
.disp-more summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.disp-more { margin-top: 4px; }
/* citations */
.pi-cite { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; flex-wrap: wrap; }
.pi-cv { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0; }
.pi-cv.off { opacity: .6; }
.pi-cmap { display: grid; grid-template-columns: 1fr minmax(0, 1fr); gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 600px) { .pi-cmap { grid-template-columns: 1fr; } }
.fi-psaps { max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.fi-psap { display: grid; grid-template-columns: 60px 1fr; gap: 2px 8px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; cursor: pointer; font: inherit; color: inherit; }
.fi-psap small { grid-column: 2; }
.fi-psap:hover { border-color: var(--brand); }
.who-ride { color: var(--brand); }
.ride-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.ride-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ride-who { flex: 1 1 180px; min-width: 0; }
.ride-sel { display: flex; gap: 6px; flex: 1 1 220px; }
.ride-sel select { flex: 1; min-width: 0; }
.unit-pick { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; flex: 1; }
.unit-pick select { flex: 1; min-width: 70px; }
.unit-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--chip-open, #eef1f5); border: 1px solid var(--line); border-radius: 6px; padding: 2px 2px 2px 8px; font-weight: 600; font-size: 13px; }
.unit-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; padding: 0 6px; }
.sc-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sc-row:last-child { border-bottom: 0; }
.sc-ic { font-size: 18px; width: 24px; text-align: center; }
/* holiday (bonus) label on the schedule */
.hol { font-size: 11px; font-weight: 600; color: var(--warn); background: var(--chip-warn); border-radius: 5px; padding: 1px 5px; margin: 0 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aday .hol { font-size: 12px; white-space: normal; display: inline-block; margin: 2px 0 4px; }

/* Past incidents */
.ph-files { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-file { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 140px; text-decoration: none; }
.ph-file img { width: 140px; height: 105px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.ph-printhead { display: none; }
@media print { .ph-printhead { display: block; margin-bottom: 8px; } .ph-sec { break-inside: avoid-page; } .ph-file img { width: 120px; height: 90px; } }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 12px; }
@media print { .ph-grid { display: block; } }
.ph-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 16px; }
.ph-sum > div { display: flex; flex-direction: column; } .ph-sum span { font-size: 12px; color: var(--muted); }
.fi-search summary { cursor: pointer; } .fi-search h4 { margin: 12px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fi-search-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 12px; }
.fi-search-grid select, .fi-search-grid input { width: 100%; }
.fi-fchip { display: inline-flex; align-items: center; gap: 4px; } .fi-fchip button { border: 0; background: none; cursor: pointer; padding: 0 2px; font-size: 12px; }

/* pages written in the app (policies, course lessons) */
.page-text { line-height: 1.55; max-width: 820px; }
.page-text h2 { font-size: 1.25em; margin: 18px 0 6px; } .page-text h3 { font-size: 1.1em; margin: 14px 0 4px; } .page-text h4 { margin: 12px 0 4px; }
.page-text p { margin: 0 0 10px; } .page-text ul, .page-text ol { margin: 0 0 10px; padding-left: 22px; }
.pol-frame { width: 100%; height: min(70vh, 900px); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.lms-steps { display: flex; flex-direction: column; gap: 6px; }
.lms-step { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: inherit; }
.lms-step.on { border-color: var(--accent, #a51c1c); background: var(--accent-bg, rgba(165, 28, 28, .06)); }
.lms-step .ic { width: 28px; text-align: center; font-size: 18px; }
.lms-video { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; background: #000; }
.lms-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; } .lms-bar i { display: block; height: 100%; background: var(--ok, #2e9e44); }
.lms-task { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); } .lms-task:last-child { border-bottom: 0; }
