/* ============================================================
   Hangar 54 foreman app — mobile-first.
   Big tap targets, 16px+ text (no iOS zoom on focus), single
   column. Designed for one-handed thumb use in a noisy hangar.
   ============================================================ */

:root {
  /* OnPoint design system — refreshed June 2026.
     Replaces the bright red/black with a deep slate + muted clay palette
     for a contractor-credible B2B look. Shared with documents.html and
     the launch screen via styles.css. */
  --slate:      #1F2D3D;  /* dark navy — header background */
  --slate-ink:  #14202C;  /* darker navy — active states on slate */
  --charcoal:   #33343F;  /* primary body text */
  --concrete:   #F2F2F0;  /* page background (soft warm gray) */
  --line:       #C7CED4;  /* borders, dividers */
  --clay:       #C46A4A;  /* primary CTA (warm industrial orange) */
  --clay-dark:  #A85A3D;  /* CTA active */
  --clay-soft:  #F4E2D8;  /* clay tint for active chips/highlights */
  --sand:       #D8B98A;  /* warm accent / iconography */

  /* Compat aliases — existing rules still reference these names */
  --brand:      var(--clay);
  --brand-ink:  var(--clay-dark);
  --ink:        var(--charcoal);
  --muted:      #6b7280;
  --bg:         var(--concrete);
  --card:       #ffffff;
  --border:     var(--line);

  --ok:         #16a34a;
  --warn:       #f59e0b;
  --err:        #dc2626;
  --r:          12px;
  --pad:        14px;
  --tap:        48px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  padding-bottom: 20px;
}

/* ===== Header ===== */
.app-header {
  background: var(--slate);
  color: #fff;
  padding: calc(env(safe-area-inset-top) + 12px) var(--pad) 12px;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.brand-logo {
  height: 28px;
  width: auto;
}
.brand-back {
  margin-left: auto;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.25);
}
.brand-back:active { background: rgba(255,255,255,.08); }
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 17px;
}
.title-row strong { letter-spacing: .2px; }
.draft-status {
  font-size: 12px;
  opacity: .85;
}
.sub-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.sub-row input[type="date"] {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 16px;
}
/* ===== Main content ===== */
main {
  padding: var(--pad);
  max-width: 720px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border-radius: var(--r);
  padding: var(--pad);
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  border: 1px solid var(--border);
}
.card.highlight {
  border-left: 4px solid var(--clay);
  background: var(--clay-soft);
}

h2 {
  margin: 0 0 10px 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.hint {
  margin: -4px 0 10px 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 10px 0 4px 0;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="email"],
select,
textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
textarea {
  min-height: 80px;
  resize: none;
  overflow: hidden;
  font-family: inherit;
}
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%236b7280' d='M4 6l4 4 4-4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 380px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ===== Checkbox rows (tap-friendly) ===== */
.cbx {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 4px 0;
  cursor: pointer;
}
.cbx input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--brand);
  flex-shrink: 0;
}
.cbx span {
  font-size: 15px;
  line-height: 1.3;
}
.cbx.big span { font-weight: 600; }
.cbx.row {
  border-bottom: 1px solid var(--border);
}
.cbx.row:last-child {
  border-bottom: none;
}

.row-stamp {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.row-stamp .cbx { flex: 1; }

/* ===== Chip groups (multi-select) ===== */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  min-height: 40px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 80ms, color 80ms, border-color 80ms;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip.is-on {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.chip:not(.is-on):active { background: #fef0f0; }

.hint-inline {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.row-stamp input[type="time"] { width: 110px; }

/* ===== Buttons ===== */
.btn-secondary {
  display: inline-block;
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  min-height: var(--tap);
  margin-top: 8px;
  cursor: pointer;
}
.btn-secondary:active { background: #fef0f0; }

.btn-stamp {
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  min-height: 38px;
  cursor: pointer;
}
.btn-stamp:active { background: #e5e7eb; }

/* ===== Toolbox talk script ===== */
.script-block {
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
}
.script-block summary {
  padding: 12px var(--pad);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
}
.script-block summary::after {
  content: "▾";
  position: absolute;
  right: var(--pad);
  color: var(--muted);
}
.script-block[open] summary::after { content: "▴"; }
.script {
  padding: 0 var(--pad) 12px;
  font-size: 15px;
  line-height: 1.5;
}
.script p { margin: 0 0 10px 0; }
.script em {
  background: #fff4d6;
  padding: 1px 6px;
  border-radius: 4px;
  font-style: normal;
  font-weight: 600;
}

/* ===== Collapsible work sections ===== */
details {
  border-top: 1px solid var(--border);
  padding: 10px 0;
}
details:first-of-type { border-top: none; }
details summary {
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
  padding: 4px 0;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
details summary::after {
  content: "▾";
  position: absolute;
  right: 0;
  color: var(--muted);
}
details[open] summary::after { content: "▴"; }

/* ===== Crew group sections ===== */
.crew-group {
  margin-bottom: 14px;
}
.crew-group:last-child {
  margin-bottom: 0;
}
.crew-group-h {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  padding: 6px 0 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 4px;
}
.crew-briefed-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.crew-briefed-list li {
  padding: 4px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.crew-briefed-list li:last-child { border-bottom: none; }
.crew-briefed-list li.hint { color: var(--muted); }
.crew-add-btn {
  margin-top: 8px;
  width: 100%;
}

/* ===== Crew rows ===== */
.crew-row {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.crew-row:last-child { border-bottom: none; }
.crew-row .crew-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.crew-row-in {
  background: rgba(255,255,255,.5);
  border-radius: 8px;
  padding: 10px 8px;
  margin: 4px 0;
  border-bottom: 1px solid var(--border);
}
.crew-row-in .crew-name input { font-weight: 600; }
.crew-sig-wrap { margin-top: 8px; }
.crew-sig-wrap .sig-slot { margin: 0; }
.crew-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--brand);
}
.crew-row .crew-name {
  flex: 1;
  font-size: 15px;
}
.crew-row .crew-name input {
  min-height: 36px;
  padding: 6px 8px;
}
.crew-row .crew-time {
  width: 90px;
  font-size: 14px;
  min-height: 36px;
  padding: 6px 8px;
}
.crew-row .crew-remove {
  background: none;
  border: none;
  color: var(--err);
  font-size: 20px;
  width: 32px;
  cursor: pointer;
}

/* ===== OSHA-30 inline badge in crew row ===== */
.crew-osha-badge-inline {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ok);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 2px 8px;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: middle;
}

/* ===== Readings ===== */
.reading-row {
  display: grid;
  grid-template-columns: 70px 1fr 1fr 1fr 1fr 36px 32px;
  gap: 6px;
  padding: 6px 0;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.reading-row:last-child { border-bottom: none; }
.reading-row input {
  min-height: 36px;
  padding: 4px 6px;
  font-size: 14px;
}
.reading-row .reading-remove,
.reading-row .reading-fetch {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
}
.reading-row .reading-remove { color: var(--err); }
.reading-row .reading-fetch {
  color: var(--brand);
  font-size: 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  min-height: 36px;
  line-height: 1;
}
.reading-row .reading-fetch:active { background: #fef0f0; }
.reading-row .reading-fetch:disabled { opacity: .5; cursor: wait; }
.reading-row .reading-head {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 480px) {
  /* Hide the column-header row on mobile — placeholders inside each input
     carry the label instead, so labels never drift from their values. */
  .reading-row[aria-hidden] { display: none; }

  .reading-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 0;
  }
  .reading-row > * { min-width: 0; }
  /* Time input spans the full width as a header for the row */
  .reading-row > input[data-k="time"] { grid-column: 1 / -1; }
  .reading-row .reading-fetch  { grid-column: 1; justify-self: stretch; }
  .reading-row .reading-remove { grid-column: 2; justify-self: end; align-self: center; }
}

/* ===== Send bar ===== */
.send-bar {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom));
}
.btn-send {
  width: 100%;
  min-height: 56px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.btn-send:active { background: var(--brand-ink); }
.btn-send:disabled { opacity: .6; cursor: not-allowed; }
.btn-spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.send-msg {
  margin-top: 8px;
  font-size: 13px;
  min-height: 16px;
  text-align: center;
}
.send-msg.ok  { color: var(--ok); }
.send-msg.err { color: var(--err); }

.btn-reset {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 4px 0;
  margin-top: 2px;
  cursor: pointer;
  text-align: center;
}
.btn-reset:hover,
.btn-reset:active { color: var(--err); }

/* ============================================================
   v2 — runbook card deck additions
   ============================================================ */

/* ===== Quick Reference (pinned card 0) ===== */
.card-pinned {
  position: sticky;
  top: 0;
  z-index: 9;
  margin: var(--pad) var(--pad) 12px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding: 8px var(--pad);
  border: 1px solid var(--line);
  background: var(--slate);
  color: #fff;
}
/* Three independent action buttons across the pinned card */
.qr-pill-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.qr-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.qr-pill:active { background: rgba(255,255,255,.18); }
.qr-pill:disabled { opacity: .6; cursor: wait; }
.qr-pill-icon  { font-size: 16px; line-height: 1; }
.qr-pill-label { font-size: 13px; line-height: 1.1; }
.qr-pill-emergency {
  background: #B22B2B;
  border-color: #B22B2B;
}
.qr-pill-emergency:active { background: #931f1f; }
.qr-pill-emergency.is-open {
  background: #931f1f;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}
.qr-pill-muster {
  background: rgba(196,106,74,.18);  /* clay tint */
  border-color: rgba(196,106,74,.45);
}
.qr-pill-weather.is-filled {
  background: rgba(216,185,138,.20);  /* sand tint when weather is loaded */
  border-color: rgba(216,185,138,.45);
}
.quick-ref-body {
  background: rgba(255,255,255,.06);
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
}
.qr-section { margin-bottom: 14px; }
.qr-section:last-child { margin-bottom: 0; }
.qr-h {
  margin: 0 0 6px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
}
.qr-list { list-style: none; margin: 0; padding: 0; }
.qr-list li { margin: 0; }
.qr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  min-height: 44px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 14px;
}
.qr-list li:last-child .qr-row { border-bottom: none; }
.qr-emoji { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0; }
.qr-text  { flex: 1; line-height: 1.3; }
.qr-text strong { font-weight: 600; }
.qr-phone {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 14px;
  background: rgba(255,255,255,.10);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.qr-tel.is-primary {
  background: rgba(178,43,43,.25);
  border-radius: 8px;
}
.qr-tel:active { background: rgba(255,255,255,.10); }
.qr-roll-call {
  width: 100%;
  margin-top: 10px;
  background: var(--clay);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}
.qr-roll-call:active { background: var(--clay-dark); }

/* ===== Card collapse / expand ===== */
.card .card-h {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
}
.card .card-h h2 { margin: 0; flex: 1; }
.card .card-time {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 6px;
}
.card.highlight .card-time { background: rgba(255,255,255,.6); }
.card .card-chev {
  font-size: 14px;
  color: var(--muted);
  transition: transform 120ms;
}
.card.is-open .card-chev { transform: rotate(180deg); }
.card .card-body { display: none; padding-top: 10px; }
.card.is-open .card-body { display: block; }

/* ===== Roll-call banner ===== */
.rollcall-banner[hidden] { display: none; }
.rollcall-banner {
  position: sticky;
  top: 68px;
  z-index: 8;
  background: #B22B2B;
  color: #fff;
  padding: 12px var(--pad);
  margin: 0 var(--pad) 12px;
  border-radius: 8px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}
/* Also ensure native [hidden] is honored on the QR body even with flex children */
.quick-ref-body[hidden] { display: none; }
.btn-rc-done {
  margin-left: auto;
  background: #fff;
  color: #B22B2B;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}
body.mode-rollcall .card:not([data-card="crew"]) { opacity: .35; pointer-events: none; }
body.mode-rollcall .send-bar { opacity: .35; pointer-events: none; }

/* Roll-call crew row */
.crew-row-rc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
.crew-row-rc .crew-name { flex: 1; }
.rc-toggle-group { display: flex; gap: 6px; }
.rc-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.rc-safe.is-on    { background: var(--ok);  color: #fff; border-color: var(--ok); }
.rc-missing.is-on { background: var(--err); color: #fff; border-color: var(--err); }

/* ===== Sub-headings inside card body ===== */
.sub-h {
  margin: 14px 0 6px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
/* ===== Equipment inspection rows ===== */
.eq-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label toggle" "comment comment";
  gap: 6px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.eq-row:last-child { border-bottom: none; }
.eq-label    { grid-area: label; font-size: 14px; font-weight: 600; align-self: center; }
.eq-toggle   { grid-area: toggle; display: flex; gap: 4px; }
.eq-comment  { grid-area: comment; font-size: 13px; min-height: 36px; padding: 6px 8px; }
.eq-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
}
.eq-pass.is-on { background: var(--ok); color: #fff; border-color: var(--ok); }
.eq-fail.is-on { background: var(--err); color: #fff; border-color: var(--err); }

/* ===== JHA step picker ===== */
.step-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.step-nav {
  background: var(--clay);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 700;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}
.step-nav:active { background: var(--clay-dark); }
.step-current {
  flex: 1;
  text-align: center;
  font-size: 14px;
  line-height: 1.3;
}
.step-counter { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.step-title { font-weight: 600; color: var(--ink); }

.step-list {
  margin: 4px 0 0 18px;
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
}
.step-list li { margin-bottom: 4px; }
.step-ctrls { list-style: none; padding-left: 0; }
.ctrl-n {
  display: inline-block;
  font-weight: 700;
  color: var(--clay-dark);
  min-width: 22px;
}

.step-input { margin: 8px 0; }

.cl-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.cl-row:last-child { border-bottom: none; }
.cl-row .cbx.row { border-bottom: none; }
.cl-photo { min-width: 48px; }

/* ===== Signature canvas ===== */
.sig-slot {
  margin: 10px 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: #fafafa;
}
.sig-label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--ink);
}
.sig-canvas-wrap {
  position: relative;
}
.sig-canvas {
  width: 100%;
  height: 120px;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 6px;
  display: block;
  touch-action: none;
}
.sig-clear {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255,255,255,.85);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.sig-status {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ===== Photo grid ===== */
.photo-slot { margin: 6px 0; }
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.photo-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.photo-add {
  width: 80px;
  height: 80px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}
.photo-add:active { background: #f0f0f0; }

/* ===== Compact photo buttons (site walk) ===== */
.photo-grid-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.photo-add-compact {
  width: 36px;
  height: 36px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  background: #fafafa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.photo-add-compact:active { background: #f0f0f0; }

/* ===== Email recipients ===== */
.recipients-add-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: stretch;
}
.recipients-add-row input { flex: 1; }
.recipient-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.recipient-row:last-child { border-bottom: none; }
.recipient-email { flex: 1; word-break: break-all; }
.recipient-remove {
  background: none;
  border: none;
  color: var(--err);
  font-size: 22px;
  width: 32px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

/* ===== PPE confirm buttons ===== */
.ppe-confirm-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.ppe-confirm-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  border-radius: 22px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--charcoal);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 80ms, color 80ms, border-color 80ms;
  min-height: var(--tap);
}
.ppe-confirm-btn.is-on {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
  font-weight: 600;
}
.ppe-confirm-btn:not(.is-on):active { background: #f0f5f0; }
.ppe-check {
  font-size: 15px;
  line-height: 1;
}

/* ===== Lift selector ===== */
.lift-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0;
}
.lift-sel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
}
.lift-sel-label {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
}
.lift-sel-serial {
  font-size: 11px;
  color: var(--muted);
}
.lift-sel-serial-none {
  font-style: italic;
  color: var(--line);
}
.lift-sel-boxes {
  display: flex;
  gap: 6px;
}
.lift-sel-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 80ms, border-color 80ms;
  flex-direction: column;
  gap: 1px;
}
.lift-sel-box input { position: absolute; opacity: 0; pointer-events: none; }
.lift-sel-box:has(input:checked),
.lift-sel-box.is-on {
  background: var(--clay);
  border-color: var(--clay-dark);
  color: #fff;
}
.lift-sel-num {
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
}

/* ===== Side-by-side equipment inspection ===== */
.lift-inspect-cols {
  display: grid;
  gap: 12px;
  overflow-x: auto;
  margin: 8px 0;
}
.lift-inspect-cols-1 { grid-template-columns: 1fr; }
.lift-inspect-cols-2 { grid-template-columns: 1fr 1fr; }
.lift-inspect-cols-3 { grid-template-columns: repeat(3, 1fr); }
.lift-inspect-cols-4 { grid-template-columns: repeat(4, 1fr); }

.lift-inspect-col {
  min-width: 160px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.lift-col-header {
  background: var(--slate);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 8px 6px;
  letter-spacing: .3px;
}

.eq-row-compact {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}
.eq-row-compact:last-child { border-bottom: none; }
.eq-row-compact .eq-label { font-size: 13px; font-weight: 500; }
.eq-row-compact .eq-toggle { display: flex; gap: 4px; }

/* ===== Auto-grow textareas ===== */
textarea.auto-grow {
  min-height: 60px;
}

/* ===== Inline section comments ===== */
.inline-comment-wrap { margin-top: 14px; }

.btn-comment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
}
.btn-comment-toggle:active,
.inline-comment-wrap.is-open .btn-comment-toggle {
  background: #fff3f3;
  border-color: var(--red);
  color: var(--red);
}

.inline-comment-body {
  display: none;
  margin-top: 10px;
  padding: 12px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.inline-comment-wrap.is-open .inline-comment-body { display: block; }

/* ── Reset confirmation modal ─────────────────────────────────────────── */
.reset-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.78);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.reset-modal[hidden] { display: none; }
.reset-modal-box {
  background: var(--surface, #1a1a2e);
  border: 1px solid var(--border, rgba(255,255,255,.12));
  border-radius: 14px;
  padding: 24px 20px;
  max-width: 360px;
  width: 100%;
  color: var(--text, #fff);
}
.reset-modal-box p { margin: 0 0 10px; line-height: 1.5; }
.reset-modal-btns { display: flex; gap: 12px; margin-top: 18px; }

/* ── Toast notification (replaces alert(), blocked in iOS PWA) ────────── */
.app-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e3a1e;
  color: #86efac;
  border: 1px solid #4ade80;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  z-index: 9999;
  max-width: calc(100vw - 40px);
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.app-toast.app-toast-err {
  background: #3a1e1e;
  color: #fca5a5;
  border-color: #f87171;
}
.app-toast[hidden] { display: none; }

