:root {
  /* engine red, used sparingly; "ink" is the dark of the side menu */
  --red: #c8102e; --red-dark: #9e0c24; --ink: #12161b; --ink2: #1c2229; --char: #2b333c; --char2: #3d4752; --slate: #5c6b78;
  --bg: #f2f3f5; --card: #fff; --line: #e1e4e8; --line2: #eef0f2; --muted: #66727d; --text: #171c21;
  --link: #1d4f91; --gold: #f2b705; --gold-bg: #fff7dc;
  --ok: #1b5e20; --ok-bg: #e7f4e8; --warn: #8d5b00; --warn-bg: #fff3cd; --bad: #9c0006; --bad-bg: #fde4e4;
  --radius: 8px; --shadow: 0 1px 2px rgba(16,24,32,.05);
  --side: 252px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .2rem; font-weight: 700; }
h2 { font-size: 1.02rem; letter-spacing: -.005em; margin: 0 0 .6rem; font-weight: 650; }
h3 { font-size: .92rem; margin: 0 0 .4rem; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
table, .kpi .value, .num { font-variant-numeric: tabular-nums; }

/* ---------- shell: side menu + app bar ---------- */
/* rear-of-apparatus chevrons: the one decorative touch */
.chevrons { height: 5px; background: repeating-linear-gradient(-45deg, var(--red) 0 10px, var(--gold) 10px 20px); flex-shrink: 0; }
.shell { min-height: 100vh; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.side { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side); background: var(--ink); color: #c3cad1; display: flex; flex-direction: column; z-index: 40; }
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 1rem 1rem .9rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.07); }
.side-brand:hover { text-decoration: none; }
.side-brand b { display: block; font-size: .95rem; line-height: 1.2; letter-spacing: -.005em; }
.side-brand small { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #8a949e; margin-top: .15rem; }
.side-nav { flex: 1; overflow-y: auto; padding: .5rem 0 1rem; scrollbar-width: thin; scrollbar-color: #2c343d transparent; }
.navgroup { padding: .35rem 0; }
.navlabel { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; color: #6f7a85; padding: .55rem 1.25rem .3rem; }
.navitem { display: flex; align-items: center; gap: .7rem; margin: 1px .6rem; padding: .48rem .65rem; border-radius: 6px; color: #c3cad1; font-size: .9rem; font-weight: 500; position: relative; }
.navitem:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.navitem .ic { color: #8a949e; }
.navitem:hover .ic { color: #fff; }
.navitem.active { background: rgba(255,255,255,.08); color: #fff; }
.navitem.active .ic { color: #fff; }
.navitem.active::before { content: ""; position: absolute; left: -.6rem; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.navsub { margin: .15rem .6rem .35rem 2.15rem; border-left: 1px solid #2c343d; }
.navsub a { display: block; padding: .3rem .75rem; margin-left: -1px; border-left: 1px solid transparent; color: #98a2ac; font-size: .84rem; }
.navsub a:hover { color: #fff; text-decoration: none; }
.navsub a.active { color: #fff; border-left-color: var(--gold); font-weight: 600; }
.side-user { display: flex; align-items: center; gap: .55rem; padding: .75rem .8rem .75rem 1rem; border-top: 1px solid rgba(255,255,255,.07); background: var(--ink2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2f3842; color: #fff; display: grid; place-items: center; font-size: .75rem; font-weight: 700; letter-spacing: .03em; flex-shrink: 0; }
.side-user .who { flex: 1; min-width: 0; line-height: 1.2; }
.side-user .who b { display: block; color: #fff; font-size: .84rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who small { color: #8a949e; font-size: .72rem; }
.sidebtn { color: #8a949e; padding: .35rem; border-radius: 6px; display: grid; place-items: center; }
.sidebtn:hover { color: #fff; background: rgba(255,255,255,.07); }
.mainwrap { margin-left: var(--side); min-width: 0; }
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; height: 56px; padding: 0 1.5rem; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.menubtn { display: none; background: none; border: 0; padding: .4rem; margin-left: -.4rem; color: var(--text); cursor: pointer; border-radius: 6px; }
.menubtn .ic { width: 22px; height: 22px; }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: .45rem; font-size: .84rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
.crumbs .sep { color: #c3c9cf; }
.crumbs .here { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.scanbox { display: flex; gap: .4rem; width: 340px; max-width: 45vw; }
.scanfield { flex: 1; display: flex; align-items: center; gap: .45rem; margin: 0; padding: 0 .65rem; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--muted); font-weight: 400; cursor: text; }
.scanfield:focus-within { border-color: var(--char2); background: #fff; }
.scanfield input { border: 0; background: transparent; padding: 0; height: 100%; outline: 0 !important; font-size: .9rem; min-width: 0; }
.iconbtn { display: grid; place-items: center; width: 36px; height: 36px; background: #fff; border: 1px solid var(--line); color: var(--char2); border-radius: 8px; cursor: pointer; }
.iconbtn:hover { background: var(--bg); }
.inscan { display: flex; gap: .35rem; flex: 1; min-width: 220px; max-width: 360px; }
.inscan input { flex: 1; min-width: 0; }
.scrim { display: none; }
.subnav { display: none; background: #fff; border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 .75rem; }
.subnav a { color: var(--char2); padding: .6rem .7rem; white-space: nowrap; font-size: .86rem; border-bottom: 2px solid transparent; }
.subnav a:hover { text-decoration: none; color: #000; }
.subnav a.active { color: var(--text); border-bottom-color: var(--red); font-weight: 600; }
@media (max-width: 1023px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  body.navopen .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  body.navopen .scrim { display: block; position: fixed; inset: 0; background: rgba(10,14,18,.45); z-index: 35; }
  .mainwrap { margin-left: 0; }
  .menubtn { display: grid; place-items: center; }
  .appbar { padding: 0 1rem; }
  .subnav:not(.hidden) { display: block; }
}
.doclist { list-style: none; padding: 0; margin: 0; }
.doclist li { display: flex; align-items: center; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.doclist li:last-child { border-bottom: 0; }
.doclist .ico { font-size: 1.2rem; width: 1.6rem; text-align: center; }
.doclist .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dropzone { border: 2px dashed #b0bec5; border-radius: 8px; padding: .9rem; text-align: center; color: var(--muted); cursor: pointer; margin-top: .5rem; }
.dropzone.over { border-color: var(--red); background: #fff5f5; }
.attbtns { display: inline-flex; border: 1px solid #c3cad0; border-radius: 8px; overflow: hidden; }
.attbtns button { border: 0; background: #fff; padding: .35rem .55rem; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; border-right: 1px solid #c3cad0; min-width: 34px; }
.attbtns button:last-child { border-right: 0; }
.attbtns button.on[data-s="Present"] { background: #2e7d32; color: #fff; }
.attbtns button.on[data-s="Late"], .attbtns button.on[data-s="Left Early"] { background: #f9a825; color: #000; }
.attbtns button.on[data-s="Excused"] { background: #546e7a; color: #fff; }
.attbtns button.on[data-s="Absent"] { background: #c62828; color: #fff; }
.session { display: flex; gap: .75rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.session:last-child { border-bottom: 0; }
.datebox { width: 52px; text-align: center; border-radius: 6px; background: #fff; color: var(--text); border: 1px solid var(--line); border-top: 3px solid var(--char); padding: .2rem 0; flex-shrink: 0; }
.datebox b { display: block; font-size: 1.3rem; line-height: 1.1; }
.datebox small { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; }
.datebox.today { border-top-color: var(--red); color: var(--red); }
.bar { height: 10px; background: #e0e0e0; border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: var(--slate); }
.pre { white-space: pre-wrap; }

main { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.pagehead .muted { font-size: .9rem; }
.pagehead .grow { flex: 1; min-width: 200px; }

/* ---------- cards / grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card.tight { padding: 0; overflow: hidden; }
.card > .cardhead { display: flex; align-items: center; gap: .5rem; padding: .8rem 1.2rem; border-bottom: 1px solid var(--line); }
.card > .cardhead h2 { margin: 0; flex: 1; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem 1rem; border-top: 3px solid var(--char); }
.kpi .label { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.kpi .value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; margin-top: .15rem; }
.kpi.red { border-top-color: var(--red); } .kpi.red .value { color: var(--red); }
.kpi.green { border-top-color: #2e7d32; } .kpi.green .value { color: #2e7d32; }
button.kpi { font: inherit; color: inherit; border: 1px solid var(--line); border-top: 3px solid var(--char); width: 100%; text-align: left; cursor: pointer; }
button.kpi.red { border-top-color: var(--red); }
.kpi.on { outline: 2px solid var(--char); outline-offset: 2px; }
.kpi.orange { border-top-color: #ef6c00; } .kpi.orange .value { color: #ef6c00; }
.kpi.alert { border-top-color: #c62828; background: #fff7f7; } .kpi.alert .value { color: #c62828; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: #f7f8f9; color: var(--slate); text-align: left; font-weight: 700; padding: .55rem .7rem; white-space: nowrap; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
td { padding: .55rem .7rem; border-bottom: 1px solid var(--line2); vertical-align: middle; }
tbody tr:hover td { background: #fafbfc; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fff8e6; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.center, th.center { text-align: center; }
tfoot td { font-weight: 700; background: #f7f8f9 !important; border-top: 1px solid var(--line); }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: .08rem .5rem; border-radius: 4px; font-size: .74rem; font-weight: 600; white-space: nowrap; background: #eef0f2; color: var(--char2); }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: #e3f2fd; color: #0d47a1; }
.b-grey { background: #eeeeee; color: #616161; }
.age-ok { color: var(--ok); font-weight: 600; } .age-warn { color: #ef6c00; font-weight: 700; } .age-bad { color: #c62828; font-weight: 700; }

/* ---------- forms ---------- */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--char2); margin-bottom: .2rem; }
input, select, textarea { width: 100%; font: inherit; padding: .5rem .65rem; border: 1px solid #cdd3d9; border-radius: 6px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(29,79,145,.18); border-color: var(--link); }
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: .75rem; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; }
.btn { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid transparent; border-radius: 6px; padding: .5rem .9rem; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; background: #eaecef; color: var(--text); text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(.95); text-decoration: none; }
.btn.primary { background: var(--red); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.btn.primary:hover { background: var(--red-dark); filter: none; }
.btn.dark { background: var(--ink2); color: #fff; }
.btn.gold { background: var(--gold); color: #000; }
.btn.ghost { background: #fff; border: 1px solid #d3d8dd; }
.btn.ghost:hover { background: #f6f7f8; filter: none; }
.btn.small { padding: .28rem .58rem; font-size: .8rem; }
.btn.danger { background: #fff; color: #c62828; border: 1px solid #e0a0a0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .7rem 1.2rem; border-bottom: 1px solid var(--line); background: #fcfcfd; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.toolbar input[type=checkbox] { min-width: 0; }
.err { color: var(--bad); background: var(--bad-bg); padding: .5rem .7rem; border-radius: 8px; margin-bottom: .75rem; font-size: .9rem; }
.note { background: var(--gold-bg); border: 1px solid #f3e1a6; border-left: 3px solid var(--gold); padding: .6rem .85rem; border-radius: 6px; font-size: .9rem; margin-bottom: 1rem; }
.alertbox { background: var(--bad-bg); border: 1px solid #f3c4c4; border-left: 3px solid var(--red); padding: .6rem .85rem; border-radius: 6px; font-size: .9rem; margin-bottom: 1rem; }

/* ---------- sign-in ---------- */
.loginwrap { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 44%) 1fr; background: #fff; }
.loginpanel { background: var(--ink); color: #c3cad1; display: flex; flex-direction: column; }
.lp-inner { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 3rem clamp(2rem, 6vw, 5rem); }
.lp-inner small { font-size: .7rem; text-transform: uppercase; letter-spacing: .16em; color: #8a949e; }
.lp-inner b { color: #fff; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; letter-spacing: -.02em; margin: .35rem 0 1.5rem; }
.lp-inner ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid rgba(255,255,255,.08); }
.lp-inner li { padding: .6rem 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .9rem; }
.loginbox { align-self: center; justify-self: center; width: 100%; max-width: 400px; padding: 2rem 1.5rem; }
.loginbox h2 { font-size: 1.5rem; letter-spacing: -.015em; margin-bottom: .25rem; }
.loginbox .card { border: 0; box-shadow: none; padding: 0; }
.loginbox .btn.primary { padding: .65rem 1rem; }
@media (max-width: 760px) {
  .loginwrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .lp-inner { padding: 1.5rem 1.25rem; flex-direction: row; align-items: center; gap: .9rem; flex-wrap: wrap; }
  .lp-inner b { margin: 0; font-size: 1.2rem; width: 100%; }
  .lp-inner ul, .lp-inner small { display: none; }
  .loginbox { align-self: start; }
}

/* ---------- gear cards (member) ---------- */
.setcard .pieces { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.piece { border: 1px solid var(--line); border-radius: 8px; padding: .75rem; }
.piece .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.piece .serial { font-size: 1.15rem; font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; font-size: .88rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }

/* ---------- inspection checklist ---------- */
.checkitem { border-bottom: 1px solid var(--line); padding: .75rem 0; }
.checkitem .q { font-weight: 600; }
.checkitem .help { font-size: .82rem; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid #c3cad0; border-radius: 8px; overflow: hidden; margin-top: .4rem; }
.seg button { border: 0; background: #fff; padding: .5rem 1.05rem; font: inherit; font-weight: 600; cursor: pointer; border-right: 1px solid #c3cad0; min-width: 72px; }
.seg button:last-child { border-right: 0; }
.seg button.on.pass { background: #2e7d32; color: #fff; }
.seg button.on.fail { background: #c62828; color: #fff; }
.seg button.on.na { background: #78909c; color: #fff; }
.checkitem.failed { background: #fff5f5; }
.progress { height: 8px; background: #e0e0e0; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: #2e7d32; }

/* ---------- modal / toast ---------- */
.modalbg { position: fixed; inset: 0; background: rgba(10,14,18,.5); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 620px; box-shadow: 0 18px 50px rgba(10,14,18,.28); }
.modal.wide { max-width: 900px; }
.modal header { display: flex; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; flex: 1; }
.modal .body { padding: 1rem; }
.modal footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--line); background: #f8f9fa; border-radius: 0 0 10px 10px; }
.x { background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--muted); line-height: 1; }
#toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: var(--ink2); color: #fff; padding: .65rem 1rem; border-radius: 8px; z-index: 60; box-shadow: 0 4px 14px rgba(0,0,0,.3); max-width: 90vw; }
#toast.bad { background: #c62828; }
.video { width: 100%; border-radius: 8px; background: #000; max-height: 60vh; }
.pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; background: #f1f3f4; padding: .1rem .4rem; border-radius: 4px; }

/* ---------- chart ---------- */
.chart svg { width: 100%; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .8rem; margin-top: .4rem; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; background: var(--c); vertical-align: -1px; }

/* ---------- labels (barcode printing) ---------- */
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.625in, 1fr)); gap: .1in; }
.blabel { border: 1px dashed #b0bec5; border-radius: 6px; padding: .08in .1in; height: 1in; display: flex; flex-direction: column; justify-content: center; align-items: center; overflow: hidden; background: #fff; }
.blabel svg { width: 100%; height: .5in; }
.blabel .t { font: 700 11px/1.15 Arial, sans-serif; text-align: center; }
.blabel .s { font: 9px/1.15 Arial, sans-serif; color: #333; text-align: center; }

/* teach a PDF layout: the PDF's text laid out like the page, click to pick */
.teachgrid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1rem; align-items: start; }
.teachside { position: sticky; top: .5rem; }
.tgt { display: flex; gap: .4rem; align-items: center; padding: .4rem .5rem; border: 1px solid #e0e0e0; border-radius: 6px; margin-bottom: .35rem; cursor: pointer; background: #fff; }
.tgt.on { border-color: #c62828; box-shadow: 0 0 0 2px rgba(198, 40, 40, .2); }
.tgt .grow { min-width: 0; overflow-wrap: anywhere; }
.pdfscroll { overflow: auto; max-height: 75vh; }
.pdfpage { position: relative; background: #fff; border: 1px solid #cfd8dc; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); margin-bottom: .5rem; color: #222; }
.pc { position: absolute; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; padding: 0 1px; border-radius: 2px; line-height: 1.2; font-family: Arial, sans-serif; }
.pc:hover { background: #fff3cd; outline: 1px solid #f0ad4e; }
.pc.picked { background: #e3f2fd; outline: 2px solid #1565c0; overflow: visible; z-index: 2; }
.pc.picked::after { content: attr(data-tag); position: absolute; left: 0; top: -1.25em; font-size: 10px; line-height: 1.2; background: #1565c0; color: #fff; padding: 0 4px; border-radius: 3px; white-space: nowrap; }
.phrases { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }

@media (max-width: 720px) {
  .teachgrid { grid-template-columns: 1fr; }
  .teachside { position: static; }
  .scanbox { width: auto; max-width: none; flex: 0 1 220px; }
  .crumbs span:not(.here), .crumbs .sep { display: none; }
  .inscan { max-width: none; width: 100%; }
  main { padding: 1rem .85rem 2.5rem; }
  h1 { font-size: 1.3rem; }
  .kpi .value { font-size: 1.4rem; }
  .hide-sm { display: none; }
  .session { flex-wrap: wrap; }
  .session > .actions { width: 100%; padding-left: 66px; }
}

@media print {
  .side, .appbar, .subnav, .scrim, .noprint, #toast { display: none !important; }
  .mainwrap { margin-left: 0; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; padding: 0; }
  @page { size: letter; margin: 0.5in 0.19in; }
  .labels { grid-template-columns: repeat(3, 2.625in); column-gap: 0.125in; row-gap: 0; justify-content: center; }
  .blabel { border: 0; border-radius: 0; break-inside: avoid; }
  th { background: #ddd !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

#previewBar { background: var(--gold); color: #000; position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 6px rgba(0,0,0,.2); font-size: .9rem; }
#previewBar .topbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; }
body:has(#previewBar) .appbar { top: 42px; }
body:has(#previewBar) .side { top: 42px; }
.itemcheck { display: flex; align-items: center; gap: .7rem; border: 2px solid var(--line); border-radius: 10px; padding: .7rem .8rem; margin-bottom: .5rem; cursor: pointer; background: #fff; }
.itemcheck input { width: 22px; height: 22px; }
.itemcheck.on { border-color: #2e7d32; background: #f1f8f1; }
.itemcheck .ic { font-size: 1.5rem; }

.attbtns button.on[data-r="Pass"] { background: #2e7d32; color: #fff; }
.attbtns button.on[data-r="Fail"] { background: #c62828; color: #fff; }

.brandlogo { height: 38px; width: auto; flex-shrink: 0; }
.loginlogo { display: block; width: 84px; height: auto; margin-bottom: 1.5rem; }
@media (max-width: 760px) { .loginlogo { width: 46px; margin: 0; } }
.ahead .alogo { height: 34px; width: auto; vertical-align: middle; margin-right: .45rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.printlogo { height: 60px; float: right; }
#types button.on { background: var(--char); color: #fff; }

/* call report form (callform.js) - used on the station iPad and in the app; big targets for gloves */
.cf .card h2 { display: flex; align-items: center; gap: .5rem; }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; }
.cf-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 1rem; }
.cf-row { display: flex; gap: .4rem; align-items: center; }
.cf-row input { flex: 1; min-width: 0; }
.cf-seg { display: flex; gap: .4rem; }
.cf-seg button { flex: 1; min-height: 44px; border: 1px solid #cfd8dc; border-radius: 8px; background: #fff; font: inherit; cursor: pointer; }
.cf-seg button.on { background: #1565c0; border-color: #1565c0; color: #fff; }
.cf-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; margin-top: .6rem; }
.cf-person { min-height: 48px; border: 1px solid #cfd8dc; border-radius: 8px; background: #fff; font: inherit; text-align: left; padding: .35rem .6rem; cursor: pointer; display: flex; flex-direction: column; justify-content: center; }
.cf-person small { font-size: .7rem; opacity: .85; }
.cf-person.on { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.cf-person.standby { background: #fff3e0; border-color: #ef6c00; color: #e65100; }
.cf-checks { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.cf-checks .check { min-height: 36px; }
.cf-photos { display: flex; flex-wrap: wrap; gap: .5rem; }
.cf-photo { position: relative; width: 96px; height: 96px; border-radius: 6px; overflow: hidden; background: #eceff1; }
.cf-photo img { width: 100%; height: 100%; object-fit: cover; }
.cf-photo button { position: absolute; top: 2px; right: 2px; border: 0; border-radius: 50%; width: 26px; height: 26px; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.cf-photo small { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(46,125,50,.85); color: #fff; font-size: .7rem; text-align: center; }
/* station iPad page (calls.js) */
.cbar { padding: .6rem .9rem; font-size: .9rem; border-bottom: 1px solid rgba(0,0,0,.08); }
.cbar.ok { background: #e8f5e9; color: #1b5e20; } .cbar.off { background: #eceff1; color: #37474f; }
.cbar.wait { background: #fff3e0; color: #e65100; } .cbar.busy { background: #e3f2fd; color: #0d47a1; }
.arow { display: flex; gap: .6rem; align-items: center; padding: .7rem .5rem; border: 0; border-bottom: 1px solid #eceff1; background: none; font: inherit; color: inherit; cursor: pointer; }
.arow:hover { background: #fafafa; }
.arow .grow { flex: 1; min-width: 0; }
/* call report: headings inside details, repeatable entries (vehicles, people) */
.cf-h { margin: .9rem 0 .2rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #546e7a; border-bottom: 1px solid #eceff1; padding-bottom: .15rem; }
.cf-wide { grid-column: 1 / -1; }
.cf-entry { border: 1px solid #cfd8dc; border-radius: 10px; padding: .5rem .75rem; margin-bottom: .6rem; background: #fafcfd; }
.cf-entryhead { display: flex; align-items: center; gap: .5rem; min-height: 40px; }
.cf-entryhead .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-entry.folded .cf-entrybody { display: none; }
.cf-entry h4.cf-h:first-child { margin-top: .3rem; }
.cf-priv dl.kv { margin-bottom: .5rem; }
.cf-priv .cf-pentry { border-top: 1px solid #eceff1; padding-top: .5rem; margin-top: .5rem; }
/* call hours: month bars + top firefighters on Home */
.cbars { display: grid; grid-template-columns: repeat(12, 1fr); gap: .3rem; height: 150px; align-items: end; }
.cbarcol { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; text-align: center; }
.cbarbar { width: 70%; background: #c62828; border-radius: 4px 4px 0 0; min-height: 1px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 9rem) 1fr auto auto; gap: .5rem; align-items: center; margin: .25rem 0; font-size: .9rem; }
.hbarname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbartrack { background: #eceff1; border-radius: 4px; height: 10px; overflow: hidden; }
.hbartrack span { display: block; height: 100%; background: #c62828; }
.cf-day { max-width: 150px; flex: 0 1 150px !important; font-size: .85rem; }
.cf-len { font-size: .9rem; min-height: 1.2em; }
/* audit log */
.auhead { display: flex; gap: .6rem; align-items: center; }
.auentry { margin-bottom: .4rem; }
.aubody { border-top: 1px solid #eceff1; margin-top: .5rem; padding-top: .5rem; }
.auchange { margin-bottom: .6rem; }
.autab { font-size: .85rem; margin-top: .25rem; }
.autab td { padding: .15rem .5rem; vertical-align: top; word-break: break-word; }
.autab td:first-child { color: var(--muted); white-space: nowrap; }
.aubefore { color: #b71c1c; text-decoration: line-through; text-decoration-color: rgba(183,28,28,.4); }
.auafter { color: #1b5e20; }
/* records (TOMRMS) */
.rcpick { display: flex; flex-direction: column; gap: .3rem; }
.rcsugs { display: flex; flex-wrap: wrap; gap: .4rem; }
.rcsug { border: 1px solid #cfd8dc; border-radius: 8px; background: #fff; padding: .35rem .6rem; text-align: left; cursor: pointer; font: inherit; max-width: 320px; }
.rcsug small { display: block; color: var(--muted); font-size: .72rem; }
.rcsug.on { border-color: #1565c0; background: #e3f2fd; }
.rcpath code { word-break: break-all; }
.rcitem.done { background: #f1f8e9; }
.dropzone.over { background: #e3f2fd; }
/* cylinder fills: bottle tiles (tick or scan), recent fills grouped by day */
.seg button.on:not(.pass):not(.fail):not(.na) { background: var(--ink2); color: #fff; }
.fp-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.fp-tabs { margin-top: 0; }
.fp-tabs button { min-width: 0; padding: .4rem .9rem; }
.fp-n { display: inline-block; min-width: 1.4em; padding: 0 .35em; margin-left: .25rem; border-radius: 99px; background: rgba(0,0,0,.08); font-size: .75rem; }
.seg button.on .fp-n { background: rgba(255,255,255,.2); }
.fp-tools { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.fp-tools #fq { width: auto; flex: 0 1 180px; }
.fillgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; max-height: 52vh; overflow: auto; padding: 2px; }
.filltile { position: relative; display: flex; flex-direction: column; gap: .15rem; margin: 0; padding: .6rem .7rem .55rem 2.1rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 400; color: var(--text); min-height: 58px; }
.filltile input { position: absolute; left: .7rem; top: .75rem; width: 18px; height: 18px; margin: 0; }
.filltile .ft-main b { font-size: .98rem; }
.filltile .ft-main small { display: block; color: var(--muted); font-size: .74rem; }
.filltile .ft-dept { color: var(--link); font-size: .74rem; font-weight: 600; }
.filltile .ft-why { font-size: .72rem; font-weight: 600; }
.filltile.warn { border-left: 3px solid var(--gold); }
.filltile.warn .ft-why { color: var(--warn); }
.filltile.stop { border-left: 3px solid var(--red); background: #fffafa; }
.filltile.stop .ft-why { color: var(--bad); }
.filltile:hover { border-color: #c9ced4; }
.filltile.on { border-color: #2e7d32; background: #f1f8f1; box-shadow: 0 0 0 1px #2e7d32 inset; }
.fp-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: .5rem; margin: .75rem -1.2rem -1.1rem; padding: .7rem 1.2rem; border-top: 1px solid var(--line); background: #fcfcfd; border-radius: 0 0 var(--radius) var(--radius); }
.filllog .dayrow td { background: #f7f8f9; font-weight: 700; font-size: .78rem; color: var(--slate); padding: .4rem .7rem; letter-spacing: .02em; }
@media (max-width: 720px) {
  .fillgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
  .fp-tools .inscan { min-width: 0; flex: 1 1 100%; }
  .fp-tools #fq { flex: 1; }
}
@media print { #report { border: 0; } #report .cardhead img { display: inline-block !important; } }
@media screen { #report .printlogo { display: none; } }
.show-sm { display: none; }
@media (max-width: 720px) { .show-sm { display: block; } .filllog .actions .btn { padding: .28rem .45rem; } }
/* phones and tablets: iPhone / iPad Safari zooms the page in when a box with text under 16 px is tapped */
@media (pointer: coarse), (max-width: 1023px) { input, select, textarea, .cf-day { font-size: 16px; } }
/* call report: times fit the narrowest phones; bigger tick boxes and Now buttons for gloves */
.cf-times { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.cf-checks .check input { width: 22px; height: 22px; flex-shrink: 0; }
@media (pointer: coarse) { .cf-row .btn.small { min-height: 42px; padding: .4rem .75rem; } .cf-checks .check { min-height: 44px; } }
/* "The app has been updated" bar (app.js appBuildCheck) */
#updateBar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100vw - 32px); padding: .6rem .8rem .6rem 1rem; background: var(--ink); color: #fff; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(16,24,32,.25); font-size: .92rem; }
/* Messages (station chat) */
.navbadge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; }
.navbadge[hidden] { display: none; }
.chatcard { padding: 0; display: flex; flex-direction: column; }
.chatlist { height: calc(100vh - 340px); min-height: 280px; overflow-y: auto; padding: .75rem 1.1rem; background: #fafbfc; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.chatday { display: flex; align-items: center; gap: .6rem; margin: .9rem 0 .5rem; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.chatday::before, .chatday::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.chatmsg { max-width: min(640px, 88%); margin: 0 0 .55rem; padding: .5rem .75rem; background: #fff; border: 1px solid var(--line); border-radius: 10px 10px 10px 3px; }
.chatmsg.mine { margin-left: auto; background: #f1f5fb; border-color: #d7e1ee; border-radius: 10px 10px 3px 10px; }
.chatmsg.private { border-left: 3px solid var(--gold); }
.chatmeta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .85rem; }
.chatbody { margin-top: .2rem; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.chatacts { display: flex; gap: .8rem; margin-top: .25rem; }
.chatacts:empty { display: none; }
.chatacts a { color: var(--link); font-size: .8rem; }
.chatacts button { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-size: .8rem; cursor: pointer; }
.chatacts button.danger { color: var(--bad); }
.chatmore { text-align: center; margin-bottom: .5rem; }
.chatempty { text-align: center; margin-top: 2rem; }
.chatcompose { padding: .75rem 1.1rem 1rem; }
.chatto { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.chatto label { margin: 0; font-weight: 600; }
.chatto select { width: auto; max-width: 100%; }
.chatrow { display: flex; gap: .5rem; align-items: flex-end; }
.chatrow textarea { flex: 1; resize: vertical; min-height: 46px; }
.chatrow .btn { min-height: 46px; }
.chatcompose .small { margin-top: .35rem; }
/* v2.47: one conversation per person - the list beside the open conversation (computers), one or the other (phones) */
.chatwrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; align-items: start; }
.chatwrap:not(.has-conv) { grid-template-columns: minmax(0, 520px); }
.chatconvs { padding: .35rem; max-height: calc(100vh - 230px); overflow-y: auto; }
.cvitem { display: flex; align-items: center; gap: .65rem; padding: .6rem .6rem; border-radius: 8px; color: var(--text); }
.cvitem:hover { background: var(--bg); text-decoration: none; }
.cvitem.active { background: #eef2f7; }
.cvav { flex-shrink: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--char2); color: #fff; font-size: .8rem; font-weight: 700; }
.cvav.all { background: var(--red); }
.cvav.admins { background: var(--gold); color: var(--ink); font-size: 1rem; }
.cvav.thread { background: var(--slate); }
.cvav .ic { width: 18px; height: 18px; }
.cvtxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.cvtop { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.cvtop b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cvlast { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cvitem.unread .cvtop b, .cvitem.unread .cvlast { color: var(--text); font-weight: 700; }
.cvcount { flex-shrink: 0; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--red); color: #fff; font-size: .75rem; line-height: 22px; text-align: center; }
.chathead { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--line); }
.chathead .small { margin-top: .1rem; }
.chatback { display: none; font-size: 1.9rem; line-height: 1; padding: 0 .5rem 0 0; color: var(--text); }
.chatback:hover { text-decoration: none; }
.chatcard .chatlist { border-radius: 0; height: calc(100vh - 360px); }
.chatnotify { margin: -.4rem 0 .8rem; }
.chatnotify:empty { display: none; }
.chatnotify .linkbtn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-size: .85rem; cursor: pointer; margin-left: .5rem; }
/* the message button in the top bar, with the unread count */
.chatbtn { position: relative; flex-shrink: 0; color: var(--char2); }
.chatbtn:hover { text-decoration: none; }
.chatcount { position: absolute; top: -7px; right: -8px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; line-height: 19px; text-align: center; border: 2px solid #fff; box-sizing: content-box; }
.chatcount[hidden] { display: none; }
@media (max-width: 1023px) {
  .chatwrap, .chatwrap:not(.has-conv) { grid-template-columns: minmax(0, 1fr); }
  .chatwrap.has-conv .chatconvs { display: none; }
  .chatconvs { max-height: none; }
  .chatback { display: block; }
  body:has(.chatwrap.has-conv) #chatPH, body:has(.chatwrap.has-conv) #chatNotifyBox { display: none; }
  .chatcard .chatlist { height: calc(100vh - 250px); height: calc(100dvh - 250px); min-height: 200px; }
}
.menubtn { position: relative; }
.menubtn.hasdot::after { content: ''; position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
/* new-message pop-up (messages.js chatPopup) */
#chatPop { position: fixed; top: 68px; right: 16px; z-index: 70; display: flex; align-items: flex-start; gap: .7rem; width: min(380px, calc(100vw - 32px)); padding: .8rem .9rem; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(16,24,32,.18); animation: cpIn .25s ease-out; }
#chatPop[hidden] { display: none; }
#chatPop .cp-ic { color: var(--red); flex-shrink: 0; margin-top: 2px; }
#chatPop .cp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; font-size: .9rem; }
#chatPop .cp-txt span { color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#chatPop .cp-acts { display: flex; flex-direction: column; gap: .35rem; }
@keyframes cpIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
/* ---------- fire inspection checklist (fiform.js: main app + quick page /fi) ---------- */
.fi-form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.fi-progress { position: sticky; top: 56px; z-index: 5; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .6rem .9rem; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.fi-bar { flex: 1 1 120px; height: 8px; background: var(--line2); border-radius: 4px; overflow: hidden; }
.fi-bar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .2s; }
.fi-ptext { font-size: .88rem; }
.fi-red { color: var(--bad); }
.fi-save { font-size: .8rem; color: var(--muted); min-width: 4.5rem; text-align: right; }
.fi-save.ok { color: var(--ok); } .fi-save.bad { color: var(--bad); }
.fi-card, .fi-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.fi-card h3, .fi-sechead h3 { margin: 0 0 .7rem; font-size: 1rem; }
.fi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: .2rem 1rem; }
.fi-field { margin-bottom: .55rem; }
.fi-field.wide { grid-column: 1 / -1; }
.fi-field label, .fi-more label, .fi-by label { display: block; font-size: .8rem; font-weight: 600; color: var(--slate); margin-bottom: .2rem; }
.fi-help { font-size: .88rem; color: var(--muted); padding: 0 .2rem; }
.fi-small { font-size: .8rem; color: var(--muted); margin: .2rem 0 0; }
.fi-sec { padding: 0; overflow: hidden; }
.fi-sechead { display: flex; align-items: center; gap: .6rem; padding: .75rem 1.1rem; background: #f7f8f9; border-bottom: 1px solid var(--line); position: sticky; top: 108px; z-index: 4; }
.fi-sechead h3 { margin: 0; flex: 1; }
.fi-secn { font-size: .8rem; color: var(--muted); font-weight: 600; }
.fi-rest { background: none; border: 1px solid var(--line); border-radius: 6px; padding: .3rem .6rem; font: inherit; font-size: .78rem; color: var(--ok); cursor: pointer; }
.fi-item { padding: .8rem 1.1rem; border-bottom: 1px solid var(--line2); border-left: 4px solid transparent; }
.fi-item:last-child { border-bottom: 0; }
.fi-item.is-pass { border-left-color: #8fc79a; } .fi-item.is-fail { border-left-color: var(--red); background: #fff8f8; } .fi-item.is-na { border-left-color: #c9ced3; }
.fi-q { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .5rem; margin-bottom: .55rem; line-height: 1.35; }
.fi-text { flex: 1 1 260px; }
.fi-ref { font-size: .74rem; font-weight: 600; color: var(--slate); background: var(--line2); border-radius: 4px; padding: .05rem .4rem; white-space: nowrap; }
.fi-urgent { font-size: .72rem; color: var(--bad); font-weight: 600; }
.fi-carried { font-size: .72rem; color: var(--ok); font-weight: 600; }
.fi-btns { display: flex; gap: .4rem; }
.fi-b { flex: 1; max-width: 150px; min-height: 42px; border: 1.5px solid var(--line); background: #fff; border-radius: 8px; font: inherit; font-weight: 600; font-size: .9rem; color: var(--char2); cursor: pointer; }
.fi-b:disabled { cursor: default; opacity: .75; }
.fi-b-pass.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.fi-b-fail.on { background: var(--red); border-color: var(--red); color: #fff; }
.fi-b-na.on { background: var(--slate); border-color: var(--slate); color: #fff; }
.fi-more { margin-top: .6rem; display: grid; gap: .35rem; }
.fi-more textarea { width: 100%; }
.fi-by { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.fi-by label { margin: 0; }
.fi-by select, .fi-by input { width: auto; }
.fi-note { margin-top: .45rem; background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-size: .82rem; cursor: pointer; }
@media (max-width: 1023px) { .fi-progress { top: 56px; } .fi-sechead { position: static; } .fi-b { max-width: none; } }
/* form editor (Setup → Fire inspection forms) */
.ffs-head { display: flex; gap: .4rem; align-items: center; margin-bottom: .6rem; }
.ffs-head input { flex: 1; font-weight: 700; }
.ffi { display: flex; gap: .5rem; padding: .6rem 0; border-top: 1px solid var(--line2); }
.ffi-main { flex: 1; display: grid; gap: .35rem; }
.ffi-row { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; }
.ffi-row input[data-x="ref"] { flex: 1 1 220px; }
.ffi-tools { display: flex; flex-direction: column; gap: .25rem; }
/* quick page /fi */
.fi-page { background: var(--bg); min-height: 100vh; }
.fi-page .fi-progress { top: 64px; }
.fi-page .fi-sechead { top: 116px; }
.fi-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .7rem; min-height: 64px; padding: .5rem max(1rem, env(safe-area-inset-right)) .5rem max(1rem, env(safe-area-inset-left)); background: var(--ink); color: #fff; }
.fi-top img { height: 40px; }
.fi-top .t { flex: 1; min-width: 0; line-height: 1.2; }
.fi-top .t b { display: block; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-top .t small { color: #b8c0c8; font-size: .78rem; }
.fi-top .btn { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); }
.fi-wrap { max-width: 860px; margin: 0 auto; padding: 1rem max(1rem, env(safe-area-inset-right)) 6rem max(1rem, env(safe-area-inset-left)); }
.fi-start { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: .7rem; margin-bottom: 1.2rem; }
.fi-start button { text-align: left; padding: 1rem; border: 1px solid var(--line); border-left: 4px solid var(--red); background: #fff; border-radius: var(--radius); font: inherit; cursor: pointer; box-shadow: var(--shadow); }
.fi-start button b { display: block; font-size: 1rem; margin-bottom: .2rem; }
.fi-start button span { font-size: .82rem; color: var(--muted); }
.fi-list a { display: flex; gap: .7rem; align-items: center; padding: .75rem .9rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .45rem; color: inherit; text-decoration: none; }
.fi-list a .g { flex: 1; min-width: 0; }
.fi-list a .g b { display: block; }
.fi-list a .g span { font-size: .82rem; color: var(--muted); }
.fi-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: .5rem; justify-content: center; padding: .7rem max(1rem, env(safe-area-inset-right)) max(.7rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); }
.fi-bottom .btn { min-height: 46px; flex: 1; max-width: 260px; }
.fi-done { text-align: center; padding: 1.5rem 1rem; }
.fi-done .big { font-size: 1.3rem; font-weight: 700; margin: .4rem 0; }
.fi-done .actions { justify-content: center; margin-top: 1rem; }
.fi-login { max-width: 380px; margin: 2rem auto; }
.fi-sync { position: sticky; top: 64px; z-index: 9; padding: .5rem 1rem; background: var(--warn-bg); color: var(--warn); font-size: .85rem; border-bottom: 1px solid #f0dca0; text-align: center; }
.fi-sync.bad { background: var(--bad-bg); color: var(--bad); }
.fi-start button span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
