@font-face { font-family: 'Poppins'; src: url('../fonts/Poppins-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/Poppins-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/Poppins-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/Poppins-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

/* Light only: the app is used outdoors, in full sun. Colors carry text labels too, never meaning alone. */
:root {
  --bg: #f1f2ee;
  --panel: #ffffff;
  --panel-2: #f6f7f3;
  --ink: #0a0a0a;
  --ink-2: #363934;
  --ink-3: #5c6159;
  --rule: #d6dad1;
  --rule-2: #c3c8bd;
  --ok: #2b7611;
  --ok-wash: #e2f0d6;
  --ok-text: #1d560a;
  --issue: #bd2416;
  --issue-wash: #fbe5e1;
  --issue-text: #9c1b10;
  --warn: #b17f00;
  --warn-wash: #fdefc5;
  --warn-text: #5f4300;
  --absent: #d9dcd5;
  --absent-text: #2c2f2a;
  --info: #22261f;
  --blue-wash: #e3eef8;
  --blue-text: #17466f;
  --tap: 48px;
  --r: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 Poppins, system-ui, -apple-system, sans-serif; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; font-weight: 600; color: var(--ink-3); }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 18px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--panel); border-bottom: 1px solid var(--rule); }
.top .mark { width: 42px; height: 42px; border-radius: 10px; background: #000; display: grid; place-items: center; flex: none; }
.top .mark img { width: 36px; height: 36px; filter: invert(1); }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: 10px; font-weight: 500; font-size: 17px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.nav a[aria-current="page"] { background: #000; color: #fff; font-weight: 600; }
.nav a .badge { margin-left: 8px; }
.pill { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: #eceee9; font-weight: 600; font-size: 15px; white-space: nowrap; border: 0; }
.pill i { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-3); flex: none; }
.pill.ok i { background: var(--ok); }
.pill.warn { background: var(--warn-wash); color: var(--warn-text); }
.pill.warn i { background: var(--warn); }
.pill.bad { background: var(--issue-wash); color: var(--issue-text); }
.pill.bad i { background: var(--issue); }
.who { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px 0 8px; border: 1.5px solid var(--rule-2); border-radius: 999px; background: var(--panel); font-weight: 500; font-size: 16px; white-space: nowrap; }
.who svg { flex: none; }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--issue); color: #fff; font-size: 12.5px; font-weight: 700; }

.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 18px; font-size: 15px; font-weight: 500; border-bottom: 1px solid var(--rule); }
.banner.warn { background: var(--warn-wash); color: var(--warn-text); }
.banner.bad { background: var(--issue-wash); color: var(--issue-text); }
.banner.info { background: var(--blue-wash); color: var(--blue-text); }
.banner .grow { flex: 1; min-width: 200px; }

main { padding: 22px 24px 60px; padding-bottom: max(60px, env(safe-area-inset-bottom)); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 20px; margin-bottom: 18px; }
.page-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; font-size: 18px; color: var(--ink-2); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 500; color: var(--ink-2); text-decoration: none; margin: -8px 0 4px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 12px; border: 2px solid var(--ink); background: var(--panel);
  font-weight: 600; font-size: 17px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn.primary { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.dark { background: #000; border-color: #000; color: #fff; }
.btn.danger { border-color: var(--issue); color: var(--issue-text); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn.ghost { border-color: var(--rule-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { flex: none; }
.link { background: none; border: 0; padding: 0 4px; min-height: 44px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- cards and panels ---------- */
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 18px 20px; }
.card + .card { margin-top: 14px; }
.card h2 { font-size: 21px; font-weight: 700; margin-bottom: 10px; }
.card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.note { font-size: 14.5px; color: var(--ink-3); }

.area { background: var(--panel-2); border: 1px solid var(--rule); border-radius: 14px; padding: 14px 14px 16px; margin-bottom: 14px; }
.area h2 { font-size: 22px; font-weight: 700; margin: 0 0 10px 2px; }
.ctl-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.ctl { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 12px 12px; text-decoration: none; color: var(--ink); min-height: 132px; }
.ctl b { font-size: 17px; font-weight: 600; }
.ctl small { font-size: 14px; color: var(--ink-3); }
.cond { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; border-radius: 8px; background: #eff0ec; font-weight: 600; font-size: 16px; margin-top: 6px; }
.cond .ic { width: 24px; height: 24px; flex: none; }
.cond.good { background: var(--ok-wash); }
.cond.fair { background: var(--warn-wash); }
.cond.poor, .cond.notop { background: var(--issue-wash); }
.cond.draft { background: var(--blue-wash); color: var(--blue-text); }
.tagline { display: inline-flex; align-self: flex-start; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: 14.5px; font-weight: 600; background: var(--issue-wash); color: var(--issue-text); margin-top: 6px; }
.tagline.warn { background: var(--warn-wash); color: var(--warn-text); }

.list { display: flex; flex-direction: column; gap: 8px; }
.row-link { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: 10px; background: #f5f6f3; text-decoration: none; color: var(--ink); font-size: 16px; border: 1px solid transparent; }
.row-link.urgent { background: var(--issue-wash); }
.row-link .grow { flex: 1; min-width: 0; }
.row-link .chev { flex: none; }
.row-link b { font-weight: 600; }
.urgent-word { color: var(--issue-text); font-weight: 600; }

.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.prop { display: block; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 18px; text-decoration: none; color: var(--ink); }
.prop b { display: block; font-size: 22px; font-weight: 700; }
.prop span { display: block; color: var(--ink-2); margin-top: 4px; }
.practice { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--warn-wash); color: var(--warn-text); font-size: 13.5px; font-weight: 600; vertical-align: middle; }

/* ---------- inspection editor ---------- */
.insp { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.rail { background: var(--panel); border-right: 1px solid var(--rule); padding: 14px 10px; }
.rail button { display: flex; width: 100%; align-items: flex-start; gap: 12px; min-height: 56px; border: 0; background: transparent; border-radius: 10px; padding: 10px 12px; text-align: left; font-size: 16px; font-weight: 500; line-height: 1.3; }
.rail button[aria-current="true"] { background: #eceee9; }
.rail .dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-size: 13.5px; font-weight: 700; flex: none; background: var(--panel); }
.rail .done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.rail .warn .dot { border-color: var(--issue); color: var(--issue); }
.rail small { display: block; font-size: 14px; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.pane { padding: 18px 22px 120px; min-width: 0; }
.ihead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; margin-bottom: 14px; }
.ihead h1 { font-size: 30px; font-weight: 700; }
.ihead p { margin: 2px 0 0; font-size: 18px; color: var(--ink-2); }
.ihead .meta { text-align: right; font-size: 17px; line-height: 1.6; }
.sec { background: var(--panel-2); border: 1px solid var(--rule); border-radius: 14px; padding: 4px 0 6px; }
.sec > h2 { font-size: 22px; font-weight: 700; padding: 14px 16px 10px; }
.sec-body { background: var(--panel); border-radius: 10px; margin: 0 6px; border: 1px solid var(--rule); }
.thead { display: grid; grid-template-columns: var(--cols); gap: 10px; padding: 12px 14px 6px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.line { display: grid; grid-template-columns: var(--cols); gap: 10px; align-items: start; padding: 12px 14px; border-top: 1px solid var(--rule); }
.line:first-of-type { border-top: 0; }
.sec-body { --cols: minmax(160px, 1fr) 312px minmax(140px, 0.9fr) 56px 124px; }
.line .q { display: flex; gap: 10px; font-size: 16px; line-height: 1.35; padding-top: 4px; }
.line .q .no { flex: none; min-width: 30px; font-weight: 500; }
.answers { display: flex; gap: 8px; }
.answers .ans { flex: 1 1 0; min-width: 0; max-width: none; }
.ans { min-height: 56px; min-width: 72px; padding: 4px 6px; border: 1.5px solid var(--rule-2); border-radius: 9px; background: var(--panel); font-size: 14.5px; font-weight: 500; line-height: 1.2; }
.ans[aria-pressed="true"] { font-weight: 600; }
.ans[aria-pressed="true"].ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.ans[aria-pressed="true"].issue { background: var(--issue); border-color: var(--issue); color: #fff; }
.ans[aria-pressed="true"].exception { background: var(--warn-wash); border-color: var(--warn); color: var(--warn-text); background-image: repeating-linear-gradient(135deg, transparent 0 7px, rgba(177,127,0,.13) 7px 14px); }
.ans[aria-pressed="true"].absent { background: var(--absent); border-color: #9da297; color: var(--absent-text); }
.ans[aria-pressed="true"].neutral { background: #eceee9; border-color: var(--ink-3); color: var(--ink); }
.ans[aria-pressed="true"].info { background: var(--info); border-color: var(--info); color: #fff; }
input.in, textarea.in, select.in { display: block; width: 100%; min-height: 56px; padding: 12px 14px; border: 1.5px solid var(--rule-2); border-radius: 10px; background: var(--panel); font-size: 17px; line-height: 1.35; }
textarea.in { min-height: 56px; resize: vertical; }
select.in { -webkit-appearance: none; appearance: none; padding-right: 40px;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23111' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center / 14px 9px; }
input.in:focus, textarea.in:focus, select.in:focus { border-color: var(--ink); outline: none; }
.in::placeholder { color: #8a8f86; }
label.f { display: block; font-size: 15px; font-weight: 500; color: var(--ink-2); }
label.f > .in { margin-top: 4px; }
.cam { position: relative; display: grid; place-items: center; width: 52px; height: 56px; border: 2px dashed var(--ink-3); border-radius: 10px; background: var(--panel); cursor: pointer; }
.cam input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; font-size: 16px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
.thumbs:empty { display: none; }
.thumb { position: relative; }
.thumb > .link { position: static; display: block; width: auto; height: auto; padding: 0; min-height: 0; border: 0; border-radius: 8px; background: none; }
.thumb img { width: 96px; height: 72px; max-width: none; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); }
.st-panel .thumbs, .known .thumbs { margin-top: 10px; }
.thumb > button[data-act="delphoto"] { position: absolute; top: -10px; right: -10px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #fff; background: #000; color: #fff; display: grid; place-items: center; padding: 0; }
.prio { font-weight: 500; }
.dash { color: var(--ink-3); padding-top: 14px; text-align: center; }
.defect { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; padding: 12px; background: var(--issue-wash); border-radius: 10px; }
.defect .wide { grid-column: 1 / -1; }
.geo-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 15px; }
.geo { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.geo.ok { color: var(--ok-text); }
.geo.rough { color: var(--warn-text); }
.geo.off, .geo.wait { color: var(--ink-2); font-weight: 500; }
.fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 12px; padding: 4px 0 2px 40px; }
.fields > .choice { grid-column: 1 / -1; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.seg button { min-height: 52px; padding: 0 16px; border: 1.5px solid var(--rule-2); border-radius: 10px; background: var(--panel); font-weight: 500; font-size: 16px; }
.seg button[aria-pressed="true"] { background: #000; border-color: #000; color: #fff; font-weight: 600; }
.seg.cond-seg button[aria-pressed="true"][data-v="Good"] { background: var(--ok); border-color: var(--ok); }
.seg.cond-seg button[aria-pressed="true"][data-v="Poor"], .seg.cond-seg button[aria-pressed="true"][data-v="Not operational"], .seg.cond-seg button[aria-pressed="true"][data-v="Significant Deficiencies Identified"] { background: var(--issue); border-color: var(--issue); }
.seg.cond-seg button[aria-pressed="true"][data-v="Fair"], .seg.cond-seg button[aria-pressed="true"][data-v="Needs Attention"] { background: var(--warn-wash); border-color: var(--warn); color: var(--warn-text); }
.block { padding: 14px 16px; border-top: 1px solid var(--rule); }
.block:first-child { border-top: 0; }
.block h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.hint { font-size: 14.5px; color: var(--ink-3); margin: 4px 0 0; }

.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin: 12px 0; }
.st { min-height: 64px; border: 1.5px solid var(--rule-2); border-radius: 9px; background: var(--panel); font-weight: 700; font-size: 18px; display: grid; place-items: center; align-content: center; line-height: 1.1; padding: 2px; }
.st small { font-size: 11.5px; font-weight: 600; display: block; margin-top: 3px; }
.st.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.st.issue { background: var(--issue); border-color: var(--issue); color: #fff; }
.st.exception { border-color: var(--warn); color: var(--warn-text); background: repeating-linear-gradient(135deg, var(--warn-wash) 0 6px, #fff 6px 12px); }
.st.absent { background: var(--absent); color: var(--absent-text); }
.st[aria-pressed="true"] { outline: 3px solid #000; outline-offset: 2px; }
.st-panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; }
.st-panel h3 { font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.st-panel .answers .ans { min-width: 120px; max-width: none; flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.count-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.count-row label.f { width: 220px; }
.check { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--rule-2); border-radius: 10px; background: var(--panel); font-weight: 500; }
.check[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-wash); color: var(--ok-text); font-weight: 600; }
.box { width: 26px; height: 26px; border: 2px solid currentColor; border-radius: 6px; display: grid; place-items: center; flex: none; }

.known { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: start; padding: 14px 16px; border-top: 1px solid var(--rule); }
.known:first-child { border-top: 0; }
.known .what b { font-weight: 600; }
.known .answers .ans { min-width: 110px; }
.known .more { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 10px; }

.finish { background: var(--panel); border: 2px solid #000; border-radius: 14px; padding: 18px 20px; margin-top: 16px; }
.finish h3 { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.exlist { margin: 8px 0 0; padding-left: 20px; font-size: 15.5px; }
.exlist li { margin: 3px 0; }
.actions-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.nextbar { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }

table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.t th { text-align: left; font-weight: 500; color: var(--ink-2); padding: 12px 10px; border-bottom: 1px solid var(--rule); background: var(--panel-2); white-space: nowrap; }
table.t td { padding: 12px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
.tablewrap { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; overflow-x: auto; }
.prio-tag { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 7px; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.prio-tag.urgent { background: #f6c9c2; color: var(--issue-text); }
.prio-tag.repair { background: #fbdcae; color: #6d3f00; }
.prio-tag.monitor { background: #dde0da; color: var(--ink-2); }
.prio-tag.none { background: #eef0ec; color: var(--ink-3); }
.status-tag { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.status-tag.open { background: var(--blue-wash); color: var(--blue-text); }
.status-tag.needs_estimate { background: #fcefc4; color: #5f4300; }
.status-tag.quoted, .status-tag.approved { background: #e7e2f6; color: #3d2a7a; }
.status-tag.repaired { background: var(--ok-wash); color: var(--ok-text); }
.status-tag.closed, .status-tag.dismissed { background: #e8e9e6; color: var(--ink-3); }
.ph-thumb { width: 82px; height: 66px; object-fit: cover; border-radius: 8px; }
.nophoto { width: 82px; height: 66px; border: 1.5px dashed var(--rule-2); border-radius: 8px; display: grid; place-items: center; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.cbx { width: 28px; height: 28px; accent-color: #000; }
.cbx-cell { width: 56px; }
.cbx-cell label { display: grid; place-items: center; min-width: 44px; min-height: 44px; }

.office { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
.filters select.in { width: auto; min-width: 210px; }
.rv-card { border: 1px solid var(--rule); border-radius: 12px; padding: 16px; background: var(--panel); }
.rv-card + .rv-card { margin-top: 12px; }
.rv-card b { font-size: 18px; }
.rv-card p { margin: 2px 0; font-size: 17px; color: var(--ink-2); }
.rv-card .actions-row { margin-top: 12px; }
.rv-card .actions-row .btn { flex: 1; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 7px; font-size: 15px; font-weight: 600; margin-top: 8px; }
.chip.good { background: var(--ok-wash); color: var(--ok-text); }
.chip.fair { background: var(--warn-wash); color: var(--warn-text); }
.chip.poor { background: var(--issue-wash); color: var(--issue-text); }
.chip.none { background: #eceee9; color: var(--ink-3); }

.state { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 14.5px; font-weight: 600; background: #eceee9; white-space: nowrap; }
.state i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); }
.state.saved i { background: #000; }
.state.waiting { background: var(--warn-wash); color: var(--warn-text); }
.state.waiting i { background: var(--warn); }
.state.received { background: var(--ok-wash); color: var(--ok-text); }
.state.received i { background: var(--ok); }
.state.reviewed { background: #e7e2f6; color: #3d2a7a; }
.state.reviewed i { background: #3d2a7a; }
.state.failed { background: var(--issue-wash); color: var(--issue-text); }
.state.failed i { background: var(--issue); }

.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: 10px 0; border-top: 1px solid var(--rule); }
.events li:first-child { border-top: 0; }
.kv { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 6px 16px; font-size: 16px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

.signin { max-width: 560px; margin: 8vh auto 0; padding: 0 18px; }
.signin .card { padding: 26px; }
.signin img.logo { width: 200px; margin-bottom: 18px; }
.signin h1 { font-size: 28px; margin-bottom: 8px; }
.code-in { font-size: 22px !important; letter-spacing: .08em; text-transform: uppercase; }
.codebox { font-family: ui-monospace, Menlo, monospace; font-size: 22px; font-weight: 600; letter-spacing: .06em; background: var(--panel-2); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; word-break: break-all; }
.steps { padding-left: 22px; }
.steps li { margin: 8px 0; }

/* overlays: PDF viewer, map, dialogs */
#overlay:empty { display: none; }
.layer { position: fixed; inset: 0; z-index: 60; background: rgba(10, 12, 10, .55); display: flex; align-items: stretch; justify-content: center; }
.viewer { display: flex; flex-direction: column; width: 100%; height: 100%; background: #3a3d38; }
.vbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--panel); border-bottom: 1px solid var(--rule); }
.vbar .title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vbody { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 14px; }
.vbody canvas { display: block; margin: 0 auto 14px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); max-width: 100%; height: auto; }
.vbody .msg { color: #fff; text-align: center; margin-top: 30px; }
.mapbody { flex: 1; overflow: auto; background: #222; touch-action: pan-x pan-y pinch-zoom; }
.mapbody img { max-width: none; transform-origin: 0 0; }
.dialog { align-self: center; background: var(--panel); border-radius: 16px; padding: 22px; width: min(560px, calc(100% - 32px)); max-height: calc(100% - 40px); overflow: auto; }
.dialog h2 { font-size: 22px; margin-bottom: 10px; }
.dialog .actions-row { justify-content: flex-end; }

#toasts { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(620px, calc(100% - 32px)); pointer-events: none; }
.toast { background: #000; color: #fff; padding: 14px 18px; border-radius: 12px; font-size: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.bad { background: var(--issue); }

/* ---------- narrower screens: iPad portrait, phones ---------- */
@media (max-width: 1100px) {
  .ctl-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .office { grid-template-columns: 1fr; }
}
@media (max-width: 1160px) {
  .sec-body { --cols: 312px minmax(140px, 1fr) 56px 124px; }
  .thead { display: none; }
  .line .q { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
  .insp { grid-template-columns: 1fr; }
  .rail { display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 8px 10px; align-items: center; }
  .rail button { width: auto; flex: none; align-items: center; min-height: 52px; white-space: nowrap; }
  .rail small { display: none; }
  .sec-body { --cols: 1fr; }
  .thead { display: none; }
  .line { grid-template-columns: minmax(0, 1fr) 52px; }
  .line .q { grid-column: 1 / -1; }
  .line .answers { grid-column: 1 / -1; }
  .line .answers .ans { flex: 1; max-width: none; }
  .line .notes { grid-column: 1; }
  .line .prio { grid-column: 1 / -1; }
  .line .dash { display: none; }
  .line .prio:has(.dash) { display: none; }
  .fields { padding-left: 0; }
}
@media (max-width: 900px) {
  .who span { display: none; }
  .who { padding: 0 8px; }
  .nav a { padding: 0 14px; }
}
@media (max-width: 700px) {
  main { padding: 16px 14px 60px; }
  .top { padding: 8px 10px; flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; }
  .nav a { min-height: 44px; padding: 0 12px; font-size: 16px; }
  .who { margin-left: auto; }
  .pill { font-size: 13.5px; }
  .page-head h1 { font-size: 28px; }
  .ihead h1 { font-size: 24px; }
  .ihead .meta { text-align: left; }
  .kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Deficiencies on a map (office) */
.viewseg button { min-width: 88px; }
.maplink { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-weight: 600; color: var(--blue-text); }
.defmap-wrap { position: relative; }
.defmap { height: min(68vh, 640px); min-height: 360px; border-radius: var(--r); border: 1px solid var(--rule-2); background: #e6e9e2; overflow: hidden; }
.defmap-wrap .banner { position: absolute; left: 72px; right: 12px; top: 12px; z-index: 500; border-radius: 10px; }
.leaflet-container { font: 400 15px/1.4 Poppins, system-ui, -apple-system, sans-serif; }
.leaflet-container img { max-width: none !important; display: inline; }
.leaflet-container a.leaflet-popup-close-button { width: 32px; height: 32px; font-size: 22px; }
.leaflet-bar a { width: 44px !important; height: 44px !important; line-height: 44px !important; font-size: 22px !important; }
.defpin { background: none; border: 0; }
.defpin span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--ink-3); border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45); }
.defpin b { transform: rotate(45deg); color: #fff; font-size: 15px; font-weight: 700; }
.defpin.urgent span { background: var(--issue); }
.defpin.repair span { background: var(--warn); }
.defpin.monitor span { background: var(--blue-text); }
.defpop-item { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.defpop-item .prio-tag { margin-right: 6px; }
.defpop .maplink { margin-top: 6px; }
