/* ==========================================================================
   S536-19 report app — Mainline Hub design system (dark-first).
   All values come from tokens.css (loaded before this file). No hardcoded
   colors/radii/spacing here beyond the tokens. See Handoff for Vlad/.
   ========================================================================== */

/* ---- fonts (bundled; PP Neue Montreal has 400 + 700 only, map 500/600→700) */
@font-face { font-family: 'PP Neue Montreal'; src: url('/static/fonts/PPNeueMontreal-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'PP Neue Montreal'; src: url('/static/fonts/PPNeueMontreal-Bold.otf') format('opentype'); font-weight: 500 700; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/static/fonts/IBMPlexMono-Medium.ttf') format('truetype'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/static/fonts/IBMPlexMono-Bold.ttf') format('truetype'); font-weight: 600 700; font-display: swap; }

* { box-sizing: border-box; }
body {
  font: 15px/1.5 var(--font-ui);
  margin: 0; color: var(--text-1); background: var(--ink-0);
}
.mono { font-family: var(--font-mono); }
/* micro-label: the recurring mono uppercase label used across the system */
.mlabel { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-3); }

/* ---- top bar (v0.6 standard look; topbar.css supplies .tb-icon/.tb-btn/
   .tb-primary/.tb-sep atoms — the S536 header keeps its richer button set) --- */
header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(26,24,23,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--text-1); min-height: 52px; padding: 6px 12px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  border-bottom: 1px solid var(--hairline);
}
header .title { font-weight: 700; font-size: 14px; letter-spacing: -.01em; margin-right: 6px; }
header .spacer { flex: 1; }
/* icon buttons: zero out the global button padding; size the stroke icons */
header .tb-icon { padding: 0; }
header .tb-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a.tb-icon { text-decoration: none; }
header .status { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); min-width: 0; text-align: right; }
/* sync pill (text set by app.js) */
#syncBox { border: 1px solid var(--hairline-strong); border-radius: 999px; padding: 5px 11px;
  background: var(--ink-0); color: var(--text-2); letter-spacing: .06em; text-transform: uppercase; }
#syncBox:empty { display: none; }
/* overall report progress (fed by applySectionColors) */
.tb-progress { display: inline-flex; align-items: center; gap: 8px; }
.tb-progress .bar { width: 120px; height: 5px; background: var(--ink-3); border-radius: 999px; overflow: hidden; display: inline-block; }
.tb-progress .bar i { display: block; height: 100%; width: 0; background: var(--flame); border-radius: 999px; transition: width .3s; }
.tb-progress #tbPct { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }

/* ---- buttons ------------------------------------------------------------ */
button {
  font-family: var(--font-ui); font-size: 14px; font-weight: 600;
  padding: 8px 14px; border: 0; border-radius: var(--r-md);
  background: var(--ink-3); color: var(--text-1); cursor: pointer;
  transition: background .15s ease-out;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button:hover { background: #363231; }
button.ghost { background: transparent; border: 1px solid var(--hairline-strong); color: var(--text-2); }
button.ghost:hover { color: var(--text-1); border-color: var(--text-3); background: transparent; }
.hdr-link { color: var(--text-2); background: transparent; border: 1px solid var(--hairline-strong);
  padding: 7px 13px; border-radius: var(--r-md); text-decoration: none; font-size: 14px; font-weight: 600; }
.hdr-link:hover { color: var(--text-1); border-color: var(--text-3); }
button.danger { background: var(--fail-subtle); color: var(--fail); }
button.danger:hover { background: rgba(229,72,77,.25); }
button.small { padding: 4px 10px; font-size: 12.5px; }
button:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--flame); outline-offset: 2px; }
/* Submit: the one primary action on the screen */
#btnSubmit { background: var(--flame); color: #fff; }
#btnSubmit:hover { background: var(--flame-hover); }
#btnSubmit:active { background: var(--flame-pressed); }

/* ---- inputs / fields ---------------------------------------------------- */
select, input, textarea {
  font-family: var(--font-ui); font-size: 16px;  /* 16px+ prevents iOS zoom */
  padding: 8px 12px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md);
  background: var(--ink-0); color: var(--text-1); max-width: 100%;
}
select:focus, input:focus, textarea:focus {
  outline: none; border-color: var(--flame); box-shadow: 0 0 0 3px var(--flame-subtle);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--flame); padding: 0; box-shadow: none; }
header select { min-width: 240px; }

/* building type-to-search picker */
.bldg-picker { position: relative; display: inline-block; }
#buildingSearch { min-width: 260px; }
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: 280px; max-width: 460px;
  max-height: 320px; overflow: auto; background: var(--ink-2); color: var(--text-1);
  border: 1px solid var(--hairline-strong); border-radius: var(--r-md);
  box-shadow: 0 16px 48px rgba(0,0,0,.5); z-index: 70;
}
.search-item { padding: 8px 12px; cursor: pointer; font-size: 13.5px; border-bottom: 1px solid var(--hairline); }
.search-item:last-child { border-bottom: 0; }
.search-item:hover { background: var(--ink-3); }
.search-item.muted { color: var(--text-3); cursor: default; }
.modal .report-search { width: 100%; margin-bottom: 10px; }

/* ---- header dropdown menus (mobile top-menu; hidden on desktop) ---------- */
.hdr-menu { position: relative; display: none; }
.menu-panel {
  position: absolute; top: calc(100% + 4px); right: 0; min-width: 190px;
  background: var(--ink-2); border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md); box-shadow: 0 16px 48px rgba(0,0,0,.5);
  z-index: 70; padding: 4px;
}
.menu-panel[hidden] { display: none; }   /* keep the hidden attr authoritative */
.menu-panel button, .menu-panel a {
  display: block; width: 100%; text-align: left; background: transparent; border: 0;
  border-radius: var(--r-sm); padding: 12px; min-height: var(--touch-min);
  font: 600 14px var(--font-ui); color: var(--text-1);
  text-decoration: none; cursor: pointer;
}
.menu-panel button:hover, .menu-panel a:hover { background: var(--ink-3); }
.menu-panel .mi-danger { color: var(--fail); }
.menu-panel .mi-danger:hover { background: var(--fail-subtle); }
.menu-panel .menu-info { padding: 10px 12px 12px; margin-bottom: 4px;
  border-bottom: 1px solid var(--hairline); font-family: var(--font-mono);
  font-size: 11px; color: var(--text-2); letter-spacing: .05em; word-break: break-all; }
.user-chip { width: 38px; height: 38px; padding: 0; border-radius: 999px;
  background: var(--ink-3); border: 1px solid var(--hairline-strong);
  color: var(--text-1); font: 700 12.5px var(--font-mono); letter-spacing: .05em; }

#app { max-width: 1100px; margin: 16px auto; padding: 0 16px 80px; }

/* ---- section panels ------------------------------------------------------ */
details.panel {
  background: var(--ink-1); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  margin-bottom: 12px; overflow: hidden;
}
/* section-frame progress: hairline (untouched) -> warn (edited, incomplete)
   -> pass (every required field filled, or its N/A escape satisfied) */
details.panel.sec-partial { border-color: var(--warn); border-width: 2px; }
details.panel.sec-done { border-color: var(--pass); border-width: 2px; }
details.panel > summary {
  cursor: pointer; padding: 13px 16px; font-weight: 600; font-size: 16px; letter-spacing: -.01em;
  list-style: none; display: flex; align-items: center; gap: 10px;
  -webkit-tap-highlight-color: transparent;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: "\25B6"; font-size: 9px; color: var(--text-3); transition: transform .15s ease-out; }
details.panel[open] > summary::before { transform: rotate(90deg); }
.panel-body { padding: 4px 16px 16px; }

details.panel > summary .p-title { flex: 1; }
/* v0.6 conic progress ring in the panel header (filled by applySectionColors) */
details.panel > summary .p-ring { width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 99px; position: relative; background: var(--ink-3); }
details.panel > summary .p-ring i { position: absolute; inset: 3px; border-radius: 99px;
  background: var(--ink-1); }

/* per-section N/A control, next to "+ Add" */
.sec-ack { display: inline-flex; gap: 6px; font-weight: 400; }
.sec-ack-opt { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600;
  color: var(--text-3); padding: 5px 12px; border: 1px solid var(--hairline-strong);
  border-radius: 999px; background: transparent; cursor: pointer; min-height: 32px;
  -webkit-tap-highlight-color: transparent; }
.sec-ack-opt input { margin: 0; }
.sec-ack-na.sel { background: var(--na-subtle); border-color: var(--na); color: var(--na); }
/* nudge toward sections that are still empty and unmarked */
.sec-ack.unset { box-shadow: 0 0 0 2px var(--warn); border-radius: 999px; }

/* ---- layout grids / fields ---------------------------------------------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.field > label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-3); font-weight: 500; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline > label { font-family: var(--font-ui); font-size: 13.5px; color: var(--text-1);
  text-transform: none; letter-spacing: 0; }
.mini-radio-group { display: flex; flex-wrap: wrap; gap: 6px; min-height: 36px; align-items: center; }
.mini-radio { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-1); }
.mini-radio input { margin: 0; }

/* ---- cards --------------------------------------------------------------- */
.card {
  border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 12px 14px;
  margin-bottom: 10px; background: var(--ink-2);
}
.card .card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card .card-head .h { font-weight: 600; }
.card .card-head .spacer { flex: 1; }
/* auto-derived rows (created live from a failed device / linked control unit) */
.card.auto-def { border-left: 3px solid var(--warn); }
.card .card-head .auto-badge { font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; font-family: var(--font-mono); color: var(--warn);
  background: var(--warn-subtle); border: 0; border-radius: 999px; padding: 3px 9px; cursor: help; }

/* ---- checklists (Y/N/NA questionnaire rows) ------------------------------ */
.checklist { margin: 4px 0; }
.checklist .item {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--hairline);
}
.checklist .item .qid { font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--text-3); text-align: right; }
.checklist .item .txt { font-size: 13.5px; color: var(--text-1); }
.checklist .item .opts { display: flex; gap: 5px; white-space: nowrap; }
.checklist .subhead { font-weight: 700; padding: 10px 0 4px; color: var(--text-2); font-size: 13px; }
.checklist .valrow input { width: 160px; font-family: var(--font-mono); text-align: center; }
.na-remaining { display: flex; justify-content: flex-end; margin-top: 8px; }

/* Y/N/NA pills — checklist items (.opts label) and device Y/N/NA fields.
   Status colors per the design system: Yes=pass, No=fail, N/A=na. */
.yn-opt { display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 12.5px; font-weight: 700; color: var(--text-3);
  padding: 0 12px; min-height: 44px; min-width: 52px;
  border: 1px solid var(--hairline-strong); border-radius: var(--r-md);
  background: transparent; cursor: pointer; transition: background .15s ease-out;
  -webkit-tap-highlight-color: transparent; }
.yn-opt input { margin: 0; }
.yn-opt:hover { background: var(--ink-3); }
.yn-opt.v-y.sel  { background: var(--pass-subtle); border-color: var(--pass); color: var(--pass); }
.yn-opt.v-n.sel  { background: var(--fail-subtle); border-color: var(--fail); color: var(--fail); }
.yn-opt.v-na.sel { background: var(--na-subtle); border-color: var(--na); color: var(--na); }
/* inverted-meaning fields (e.g. "Requires service" — Yes is the failure) */
.inv .yn-opt.v-y.sel { background: var(--fail-subtle); border-color: var(--fail); color: var(--fail); }
.inv .yn-opt.v-n.sel { background: var(--pass-subtle); border-color: var(--pass); color: var(--pass); }

/* ---- tables --------------------------------------------------------------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { border-bottom: 1px solid var(--hairline); padding: 6px 8px; text-align: left; vertical-align: top; }
table.tbl th { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-3); font-weight: 500; background: transparent; }
table.tbl td input, table.tbl td select, table.tbl td textarea { width: 100%; border: 1px solid var(--hairline); font-size: 14px; padding: 6px 8px; }
table.tbl td input.wide { min-width: 180px; }
table.tbl td.num { width: 34px; text-align: center; color: var(--text-3); font-family: var(--font-mono); }
.table-scroll { overflow-x: auto; }
table.tbl tr.dragging { opacity: .4; }
.drag { color: var(--text-3); user-select: none; text-align: center; white-space: nowrap; width: 64px; }
.drag .draghandle { cursor: grab; margin-right: 2px; }
.drag .ord { padding: 3px 6px; line-height: 1; }
@media (max-width: 700px) { .drag .draghandle { display: none; } .drag { width: 56px; } }

/* ---- field devices (23.2): grouped rows with P/F/N-A taps ------------------ */
.dev-toolbar { display: flex; gap: 8px; margin: 4px 0 12px; flex-wrap: wrap; align-items: center; }
.dev-search { flex: 1 1 220px; min-width: 0; display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 12px; background: var(--ink-0);
  border: 1px solid var(--hairline-strong); border-radius: var(--r-md); color: var(--text-3); }
.dev-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; box-shadow: none; }
.dev-search input:focus { box-shadow: none; border: 0; }
.filter-chip { height: 44px; padding: 0 16px; border-radius: var(--r-md);
  border: 1px solid var(--hairline-strong); background: var(--ink-0); color: var(--text-2);
  font-weight: 600; font-size: 13.5px; }
.filter-chip:hover { background: var(--ink-3); }
.filter-chip.on { border-color: var(--flame); color: var(--flame); background: var(--flame-subtle); }

.dcard { background: var(--ink-2); border: 1px solid var(--hairline); border-radius: 12px;
  margin-bottom: 8px; overflow: hidden; }
.grp-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer;
  user-select: none; -webkit-user-select: none; }
.grp-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.grp-head .cnt { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-3); }
.grp-head .spacer { flex: 1; }
.grp-head .bulk { background: transparent; border: 0; color: var(--flame); font-weight: 600;
  font-size: 13px; padding: 6px 10px; }
.grp-head .bulk:hover { background: var(--flame-subtle); }
.sec-chev { color: var(--text-3); width: 12px; }

.drow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 56px;
  cursor: pointer; border-top: 1px solid var(--hairline); }
.drow:hover { background: var(--ink-3); }
.drow.recorded { opacity: .6; }
.drow.recorded:hover { opacity: 1; }
.drow .num { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3);
  width: 30px; text-align: right; flex-shrink: 0; }
.drow .dinfo { flex: 1; min-width: 0; }
.drow .dinfo b { display: block; font-size: 14.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drow .dinfo span { display: block; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-top: 1px; }
.taps { display: flex; gap: 6px; flex-shrink: 0; }
.tap { width: 48px; height: 44px; border-radius: var(--r-md); border: 1px solid var(--hairline-strong);
  background: transparent; color: var(--text-3); font-weight: 700; font-size: 13px; padding: 0; }
.tap:hover { background: var(--ink-3); }
.tap.p.on { background: var(--pass-subtle); border-color: var(--pass); color: var(--pass); }
.tap.f.on { background: var(--fail-subtle); border-color: var(--fail); color: var(--fail); }
.tap.n.on { background: var(--na-subtle); border-color: var(--na); color: var(--na); }
.dev-sentinel { text-align: center; padding: 10px; }
.dev-type { width: 100%; }

/* device detail: fixed right overlay on wide screens, bottom sheet on phones */
.dev-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; z-index: 45;
  background: var(--ink-1); border-left: 1px solid var(--hairline-strong);
  box-shadow: -16px 0 48px rgba(0,0,0,.5); overflow-y: auto; }
.dp-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--hairline); }
.dp-titles { flex: 1; min-width: 0; }
.dp-titles b { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.dp-titles .mlabel { display: block; margin-top: 3px; }
.dp-close { flex-shrink: 0; width: 32px; height: 32px; padding: 0; border-radius: 8px;
  background: transparent; border: 1px solid var(--hairline-strong); color: var(--text-2); font-size: 13px; }
.dp-body { padding: 14px 16px 80px; }
@media (max-width: 700px) {
  .dev-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 74vh;
    border-left: 0; border-top: 1px solid var(--hairline-strong);
    border-radius: 20px 20px 0 0; box-shadow: 0 -16px 48px rgba(0,0,0,.55); }
}

/* ---- deficiency cards (20.2) ----------------------------------------------- */
.def-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--fail);
  transform: rotate(45deg); flex-shrink: 0; margin-right: 2px; }
.def-src { margin: -4px 0 10px; }
/* v0.6 read-only card bits */
.def-chip { font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 4px 10px;
  white-space: nowrap; font-family: var(--font-mono); letter-spacing: .04em; }
.def-chip.crit { background: var(--fail-subtle); color: var(--fail); }
.def-chip.imp { background: var(--warn-subtle); color: var(--warn); }
.def-chip.other { background: var(--na-subtle); color: var(--na); }
.def-title b { font-size: 14.5px; font-weight: 700; }
.def-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-3);
  letter-spacing: .05em; text-transform: uppercase; margin: 4px 0 0; }
.def-notes { font-size: 12.5px; color: var(--text-2); margin: 6px 0 0; }

/* ---- standard deficiency modal (v0.6 .overlay/.sheetm) ---------------------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none;
  align-items: flex-end; justify-content: center; z-index: 60; padding: 0; }
.overlay.on { display: flex; }
.sheetm { width: 100%; max-width: 560px; background: var(--ink-2);
  border: 1px solid var(--hairline-strong); border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto; }
@media (min-width: 640px) { .overlay { align-items: center; padding: 20px; } .sheetm { border-radius: 20px; } }
.sheetm h3 { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.sheetm .msub { font-family: var(--font-mono); font-size: 10px; color: var(--text-3);
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; display: block; }
.sheetm .field { margin-bottom: 13px; }
.sheetm .field input, .sheetm .field textarea { width: 100%; }
.mrow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bigseg { display: flex; gap: 8px; }
.bigseg button { flex: 1; height: 48px; border-radius: 11px; border: 1px solid var(--hairline-strong);
  background: transparent; color: var(--text-3); font-weight: 700; font-size: 13.5px;
  cursor: pointer; font-family: var(--font-ui); }
.bigseg button.crit.on { background: var(--fail-subtle); border-color: var(--fail); color: var(--fail); }
.bigseg button.imp.on { background: var(--warn-subtle); border-color: var(--warn); color: var(--warn); }
.bigseg button.other.on { background: var(--na-subtle); border-color: var(--na); color: var(--na); }
.macts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ---- sign-off cards (People) ------------------------------------------------ */
.sig-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.sig-wrap > .row-actions { grid-column: 1 / -1; }
.sig-card { margin-bottom: 0; }
.sig-preview { min-height: 64px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--hairline-strong); border-radius: var(--r-md);
  font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive;
  font-size: 26px; color: var(--text-1); padding: 8px 12px; overflow: hidden; }
@media (max-width: 700px) { .sig-wrap { grid-template-columns: 1fr; } }

/* ---- misc ----------------------------------------------------------------- */
.row-actions { margin-top: 10px; }
.hint { font-size: 12.5px; color: var(--text-3); margin: 2px 0 8px; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex;
  align-items: center; justify-content: center; z-index: 50;
}
.modal { background: var(--ink-2); border: 1px solid var(--hairline-strong);
  border-radius: var(--r-lg); max-width: 640px; width: 92%; max-height: 80vh;
  overflow: auto; padding: 20px; box-shadow: 0 24px 64px rgba(0,0,0,.5); }
.modal h3 { margin: 0 0 10px; font-size: 18px; letter-spacing: -.01em; }
.modal textarea { width: 100%; box-sizing: border-box; }
.report-list { list-style: none; padding: 0; margin: 0; }
.report-list li {
  display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--hairline);
}
.report-list li .meta { flex: 1; }
.report-list li .meta .b { font-weight: 600; }
.report-list li .meta .d { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3);
  letter-spacing: .05em; text-transform: uppercase; margin-top: 2px; }
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink-3); color: var(--text-1); border: 1px solid var(--hairline-strong);
  padding: 10px 16px; border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.45); z-index: 60; font-size: 13.5px;
}

/* section navigator (quick-jump on desktop) */
#sectionNav {
  display: flex; align-items: center; gap: 8px;
  background: var(--ink-1); border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 8px 12px; margin-bottom: 12px;
}
#sectionNav .snav-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-3); font-weight: 500; white-space: nowrap; }
#sectionNav select { flex: 1; min-width: 0; }

/* ---- login (full page) ---------------------------------------------------- */
.login-view { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background: var(--ink-0);
  background-image: linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center; }
.login-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-mark { text-align: center; margin-bottom: 18px; }
.login-mark img { width: 52px; filter: invert(1); mix-blend-mode: screen; }
.login-card h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; text-align: center; margin: 0 0 6px; }
.login-sub { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-3); text-align: center; margin-bottom: 32px; }
.login-panel { background: var(--ink-1); border: 1px solid var(--hairline-strong);
  border-radius: var(--r-xl); padding: 28px; box-shadow: 0 24px 64px rgba(0,0,0,.4); }
.login-panel .field { margin-bottom: 16px; }
.login-panel .field input { width: 100%; font-size: 16.5px; border-radius: 12px; padding: 14px 16px; height: 52px; }
.login-panel button[type="submit"], .login-panel .login-btn {
  width: 100%; font-size: 16px; font-weight: 700; border-radius: 12px; height: 52px;
  background: var(--flame); color: #fff; margin-top: 4px; }
.login-panel button[type="submit"]:hover { background: var(--flame-hover); }
.login-err { color: var(--fail); font-size: 13.5px; margin: 8px 0 0; min-height: 18px; }
.login-help { font-size: 13px; color: var(--text-3); text-align: center; margin-top: 18px; }
.login-foot { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-3); text-align: center; margin-top: 26px; }

/* ---- mobile ---------------------------------------------------------------- */
@media (max-width: 700px) {
  header { padding: 8px 10px; gap: 6px; }
  header .title { font-size: 14px; }
  header .bldg-picker { flex: 1 1 140px; min-width: 0; }
  header #buildingSearch { min-width: 0; width: 100%; }
  .search-results { min-width: 0; width: 92vw; max-width: 92vw; }
  header .spacer { display: none; }
  .tb-progress .bar { width: 52px; }
  #syncBox { display: none; }
  button { padding: 10px 14px; }            /* larger tap targets */
  #app { margin: 8px auto; padding: 10px 10px 90px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  /* all sections render stacked; the jump dropdown is redundant here */
  #sectionNav { display: none; }
  /* questionnaire rows wrap: prompt full-width, segment right-aligned below */
  .checklist .item { grid-template-columns: 24px 1fr; }
  .checklist .item .opts { grid-column: 1 / -1; justify-content: flex-end; }
  /* device rows wrap: info full-width, taps right-aligned below; hide # column */
  .drow { flex-wrap: wrap; }
  .drow .num { display: none; }
  .drow .dinfo { flex-basis: 100%; }
  .drow .taps { margin-left: auto; }
  .tap { width: 56px; height: 46px; }
  /* --- mobile top-menu --- */
  .hdr-menu#userMenuWrap { display: inline-block; }              /* avatar: both states */
  body.report-open #reportMenuWrap { display: inline-block; }    /* Report ▾: report open only */
  /* identity cluster lives inside the user menu on phones */
  #userBox, #adminLink, #btnLogout { display: none; }
  /* Submit/Delete always collapse into the Report menu; label is redundant on phones */
  #btnSubmit, #btnDelete, #currentLabel { display: none; }
  /* no report open: no editor controls */
  body:not(.report-open) #btnUndo, body:not(.report-open) #btnRedo,
  body:not(.report-open) #btnSave { display: none; }
  /* report open: picker + create/open actions collapse into the Report menu */
  body.report-open .bldg-picker, body.report-open #btnNewProperty,
  body.report-open #btnNew, body.report-open #btnOpen,
  body.report-open #homeLink { display: none; }
}

/* ---- motion ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
