* { box-sizing: border-box; }

/* The `hidden` attribute must always win. A class that sets `display` (e.g. .btn,
   .card) otherwise overrides the browser's default [hidden]{display:none}, which
   silently leaks JS-gated elements (e.g. the "Override for a Tech" button) to
   unauthorized users. Root cause of the Motive grant-button leak, 2026-07-03. */
[hidden] { display: none !important; }

:root {
  /* Brand */
  --brand-dark: #1e3a5f;
  --brand: #2c5282;
  --brand-light: #ebf2fa;

  /* Surfaces */
  --bg: #f4f6f8;
  --card: #ffffff;

  /* Text */
  --text: #1f2937;
  --text-strong: #111827;
  --text-muted: #6b7280;

  /* Borders */
  --border: #d1d5db;
  --border-soft: #e5e7eb;

  /* Status — text + bg + accent (the bold version used for icons/borders) */
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --error-accent: #dc2626;
  --error-border: #fecaca;
  --success: #065f46;
  --success-bg: #f0fdf4;
  --success-accent: #00c875;
  --success-border: #bbf7d0;
  --warn: #92400e;
  --warn-bg: #fffbeb;
  --warn-accent: #f59e0b;
  --warn-border: #fcd34d;
  --info-bg: #dbeafe;
  --info: #1e40af;
  /* Added 2026-08-19 with `.pill.info`. The info family was the only one of the four missing a
     border token, so anything wanting an info-coloured border had to reach for --info-bg and
     render borderless — which is what `.status-badge.syncing` does and why it is the odd one
     out among the badges. Additive: nothing referenced --info-border before this line existed. */
  --info-accent: #2563eb;
  --info-border: #93c5fd;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 4px 12px rgba(44, 82, 130, 0.12);
  --shadow-header: 0 2px 6px rgba(0,0,0,0.1);
  --shadow-modal: 0 12px 30px rgba(0,0,0,0.3);
  --shadow-elevated: 0 10px 30px rgba(0,0,0,0.18);
  --shadow-sticky: 0 -4px 12px rgba(0,0,0,0.05);

  /* Motion */
  --t-fast: 0.12s;
  --t-base: 0.15s;
  --t-slow: 0.25s;

  /* Type */
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Montserrat', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

html, body { height: 100%; }
/* Kill the iOS rubber-band bounce on the root scroller. The overscroll bounce
   transiently shifts the visual viewport / safe-area, which moved the fixed
   bottom tab bar during an overscroll-up gesture at the bottom of a page.
   No pull-to-refresh depends on the native bounce, so suppressing it is safe. */
html, body { overscroll-behavior-y: none; }
/* ONE FRAME, EVERY PHONE (projects/one-frame-every-phone step 1, Josh 2026-10-27: the bar "pushed to the
   right" on Motive Cards). No page is ever wider than the screen. A page wider than the screen made
   Android line the fixed header, bell and bar up against the wider page while iPhone pinned them to the
   screen. `clip`, NEVER `hidden`: hidden turns html and body into scroll containers and breaks every
   sticky header. Long labels wrap instead (.pill and .mc-tile-head below); this rule is the floor for
   anything a page adds later. Proven by scripts/keyboard-tests/tabbar-page-census.mjs (page width). */
html, body { overflow-x: clip; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  margin: 0;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* Industrial mono small-caps — used for metadata strips, status pills, tower IDs */
.mono-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

header.app-header {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: white;
  /* A COMPACT BAR (Josh 2026-10-31: "make sure the top header isnt too big"). The band below the status bar is the
     padding plus one 38px button row: 8 + 38 + 8 = 54px, at most 56. The top padding is the safe-area inset (the
     iPhone notch) plus a small gap. Desktop and the phone's browser have no status bar to clear, so no floor. */
  padding: calc(0.5rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) 0.5rem calc(1rem + env(safe-area-inset-left));
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* The one floor: where the inset can report 0 while a status bar is drawn (the Capacitor Android app, edge to
   edge; an installed PWA). app-header.js adds .is-native-app in the app. 2.25rem = 36px clears a 24-28px bar. */
@media all and (display-mode: standalone) {
  header.app-header {
    padding-top: max(calc(0.5rem + env(safe-area-inset-top)), 2.25rem);
  }
}
html.is-native-app header.app-header {
  padding-top: max(calc(0.5rem + env(safe-area-inset-top)), 2.25rem);
}
header.app-header h1 { margin: 0; font-size: 1.15rem; font-weight: 600; }
header.app-header .sub { font-size: 0.78rem; opacity: 0.85; margin-top: 0.2rem; }
header.app-header .user-chip {
  font-size: 0.8rem;
  opacity: 0.92;
  min-width: 0;   /* may shrink, so the header never pushes the page wider than the screen */
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
header.app-header .logout-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
header.app-header .logout-btn:hover { background: rgba(255,255,255,0.22); }

header.app-header .dev-fill-btn {
  background: #f59e0b;
  border: 1px solid #d97706;
  color: #1f2937;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
header.app-header .dev-fill-btn:hover { background: #fbbf24; }
header.app-header .dev-fill-btn:disabled { opacity: 0.6; cursor: wait; }

main {
  max-width: 720px;
  margin: 1.5rem auto;
  padding: 0 1rem 4rem;
}

/* THE APP SHELL (projects/form-redesign-1-app-shell, Josh 2026-10-26): the header is fixed to the top and
   the bottom bar to the bottom, and every page is built to the space between them. app-header.js keeps
   --pulse-header-h at the header's measured height; --pulse-bar-h is the bottom bar plus the bottom
   safe-area inset (bottom-nav.js draws the bar at this height). The rule is docs/APP-SHELL.md. */
:root {
  --pulse-header-h: 4.5rem;
  --pulse-bar-h: calc(64px + var(--pulse-sab, env(safe-area-inset-bottom)));
}
body.has-app-header { padding-top: var(--pulse-header-h); }
header.app-header.pulse-shell {
  position: fixed; top: 0; left: 0; right: 0; z-index: 800;
  padding-bottom: 0.5rem;
}
header.app-header.pulse-shell .ah-left { display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex: 1 1 auto; }
header.app-header.pulse-shell .header-titles { min-width: 0; }
/* A long title wraps to at most two lines (Josh 10-31: "Wrap to two lines"), then clips. The header grows with it and
   app-header.js keeps --pulse-header-h at the real height, so main, the sticky offsets and .drawer follow. */
header.app-header.pulse-shell h1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
header.app-header.pulse-shell .header-back-btn,
header.app-header.pulse-shell #settings-back { color: white; background: none; border: 0; }
header.app-header.pulse-shell.is-home h1.home-wordmark {
  font-family: 'Montserrat', var(--font-sans, sans-serif); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 1.3rem; color: white;
}
header.app-header.pulse-shell .ah-actions { display: flex; align-items: center; gap: 0.35rem; flex: 0 0 auto; }
header.app-header.pulse-shell .ah-iconbtn,
header.app-header.pulse-shell #pulse-bell {
  position: relative; inset: auto; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(255,255,255,0.14); color: white; box-shadow: none;
  -webkit-tap-highlight-color: transparent; padding: 0;
}
header.app-header.pulse-shell .ah-iconbtn svg,
header.app-header.pulse-shell #pulse-bell svg { width: 20px; height: 20px; stroke: white; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
header.app-header.pulse-shell #pulse-bell:not(.show) { display: none; }
header.app-header.pulse-shell .ah-count {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: #f59e0b; color: #1f2937; font-size: 0.68rem; font-weight: 700; line-height: 18px; text-align: center;
}
header.app-header.pulse-shell .ah-count[hidden] { display: none; }
header.app-header.pulse-shell .ah-initials { font-weight: 700; font-size: 0.8rem; color: white; }
header.app-header.pulse-shell .ah-profile { position: relative; }
header.app-header.pulse-shell .ah-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 200px; z-index: 960;
  background: var(--card, #fff); color: var(--text, #1f2937); border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px; box-shadow: 0 10px 24px rgba(15,23,42,0.18); padding: 0.4rem; display: flex; flex-direction: column;
}
header.app-header.pulse-shell .ah-menu[hidden] { display: none; }
header.app-header.pulse-shell .ah-who { padding: 0.45rem 0.6rem 0.55rem; border-bottom: 1px solid var(--border, #e5e7eb);
  margin-bottom: 0.3rem; display: flex; flex-direction: column; gap: 0.2rem; }
header.app-header.pulse-shell .ah-name { font-weight: 600; font-size: 0.9rem; }
header.app-header.pulse-shell .ah-who .sub,
header.app-header.pulse-shell .ah-who .tab-topbar-sub { font-size: 0.75rem; color: var(--text-muted, #6b7280); opacity: 1; margin: 0; }
header.app-header.pulse-shell .ah-who .user-team-pill { color: var(--text, #1f2937); background: var(--brand-light, #eef2f7);
  border-color: var(--border, #e5e7eb); align-self: flex-start; }
header.app-header.pulse-shell .ah-menu .ah-item {
  display: block; width: 100%; text-align: left; padding: 0.55rem 0.6rem; border-radius: 6px; font-size: 0.88rem;
  background: none; border: 0; color: var(--text, #1f2937); text-decoration: none; cursor: pointer; font-family: inherit;
}
header.app-header.pulse-shell .ah-menu .ah-item:hover { background: var(--brand-light, #eef2f7); }
header.app-header.pulse-shell .ah-menu .ah-signout { color: #b91c1c; }
@media (max-width: 480px) {
  header.app-header.pulse-shell { padding-bottom: 0.5rem; }
  header.app-header.pulse-shell .ah-iconbtn,
  header.app-header.pulse-shell #pulse-bell { width: 34px; height: 34px; }
}

/* Auth pages — centered narrow card */
.auth-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(160deg, var(--brand-dark) 0%, var(--brand) 60%, #4a6b95 100%);
}
.auth-brand {
  text-align: center;
  margin-bottom: 1rem;
}
.auth-logo-wrap {
  background: white;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.auth-logo {
  display: block;
  width: 100%;
  height: auto;
}
.auth-card {
  background: var(--card);
  border-radius: 14px;
  padding: 1.5rem 1.5rem 1.75rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.auth-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}
.auth-card h2.brand {
  font-size: 1.7rem;
  margin: 0 0 1rem;
  color: var(--brand);
}
.auth-card .auth-desc {
  margin: 0 0 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  text-align: center;
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 1rem;
  font-weight: 600;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  margin: 0.85rem 0 0.3rem;
}
input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}
/* Reset width/padding for binary inputs — width: 100% on a checkbox stretches
   it across its flex parent, which broke the handoff modal and account prefs. */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  border-radius: 0;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.15);
}
textarea { min-height: 80px; resize: vertical; }

/* Monospace text style (originally from the S/N inputs) on every form field —
   inputs the tech types into AND dropdowns. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea,
select {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* Every select's closed value renders in the same dark text as a chosen
   option; the placeholder option is never grayed. This rule keeps the open
   dropdown panel readable. */
select option { color: #1f2937; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand);
  color: white;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}
.btn-secondary {
  background: white;
  color: var(--brand);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f9fafb; border-color: var(--brand); }

/* ---- DECISION BUTTONS — the review screens' Approve / Deny row ----------------------------
   Landed 2026-08-21 as the first cut of Josh's "same style of buttons" ruling. He chose THIS
   family's 8px radius and 0.75rem 1rem padding over the 10px / 0.7rem that nine review pages
   were already shipping, so the variants below inherit `.btn`'s box and add nothing but colour.
   Every one of them was a page-local rule repeated character for character on between two and
   six pages. `node scripts/control-census.mjs --against before.json` prints what moved.

   🔴 THE `:disabled` RULE IS NOT COSMETIC AND IT IS WHY THIS BLOCK EARNED ITS ROUND. All nine
   review pages disable these buttons for the length of the decision POST — verified in all nine
   review .js files, e.g. inventory-review.js:169, ppe-request-review.js:129,
   truck-inspection-review.js:127 — and only TWO of the nine shipped any `:disabled` styling. On
   the other seven the button went disabled in the DOM and looked completely live on screen,
   during exactly the second when somebody who thinks nothing happened taps it again. Same fault
   class as the two dead controls found on the Settings page on 2026-08-21, closed here for all
   of them at once.

   ⚠ THE GREEN IS A LITERAL AND THAT IS DELIBERATE. `--success-accent` is #00c875, which is NOT
   the #16a34a these nine pages ship. Using the token here would have quietly restyled six
   Approve buttons while claiming to change nothing. The red IS the token: `--error-accent` is
   #dc2626 exactly. So this app has two greens, and which one wins is a look, not a cleanup.

   ⚠ `.btn-return` IS NOT DECLARED HERE, ON PURPOSE. It ships red on /inventory-review, purple on
   /qc-installation-review and a white/orange outline on /jsa2-review — three appearances, no
   majority, so choosing one is Josh's call and not a consolidation. `.btn-reject` IS declared,
   at the value two of its three pages already agree on; /jsa2-review carried its own #b91c1c
   copy that won the cascade and kept that page off the shared value — closed 2026-09-03 (queue
   lane) by deleting the page's copy, so all three review pages now agree. */
.decide-row  { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.decide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.75rem; }
/* `.btn` is width:100%. In a flex row that basis has to be overridden or two buttons plus the
   gap overflow the row, so `flex: 1 1 0` zeroes the basis and the declared width is ignored.
   `min-width: 0` lets a long label ("Needs Revision", three-up) wrap instead of forcing the row
   wider than the card. */
.decide-row .btn  { flex: 1 1 0; width: auto; min-width: 0; }
.decide-grid .btn { width: auto; min-width: 0; }

.btn-approve, .btn-verify { background: #16a34a; color: #fff; }
.btn-approve:hover:not(:disabled),
.btn-verify:hover:not(:disabled) { background: #15803d; }
.btn-deny, .btn-fail, .btn-reject { background: var(--error-accent); color: #fff; }
.btn-deny:hover:not(:disabled),
.btn-fail:hover:not(:disabled),
.btn-reject:hover:not(:disabled) { background: var(--error); }
.btn-revise { background: #ea580c; color: #fff; }
.btn-revise:hover:not(:disabled) { background: #c2410c; }
.btn-dup { background: #6b7280; color: #fff; }
.btn-dup:hover:not(:disabled) { background: #4b5563; }
/* Matched to .btn-primary:disabled in KIND rather than in colour, the same reasoning the
   .btn-secondary:disabled note further down this file gives: a semantic button carries its
   meaning in its colour, so it dims and refuses the cursor rather than turning grey and
   throwing that meaning away. */
.btn-approve:disabled, .btn-verify:disabled, .btn-deny:disabled, .btn-fail:disabled,
.btn-reject:disabled, .btn-revise:disabled, .btn-dup:disabled,
.btn-return:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.85rem;
}
.auth-links a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}
.auth-links a:hover { text-decoration: underline; }

.auth-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  text-align: center;
  font-size: 0.8125rem;
}
.auth-footer a {
  color: var(--text-muted);
  text-decoration: none;
}
.auth-footer a:hover { color: var(--brand); text-decoration: underline; }

.alert {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}
.alert.error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #fecaca;
}
.alert.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #bbf7d0;
}
.alert.show { display: block; }

.help-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.divider {
  height: 1px;
  background: var(--border-soft);
  margin: 1.25rem 0;
}

/* Dashboard tiles */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.tile {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tile:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(44, 82, 130, 0.12);
  transform: translateY(-1px);
}
.tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}
.tile-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}
/* Brand-image variant: dropped-in PNG fills the whole chip with no tint. */
.tile-icon-img {
  background: transparent;
  padding: 0;
  overflow: hidden;
}
.tile-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.tile-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.tile-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .tile-grid { grid-template-columns: 1fr; }
}

.tile.placeholder {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
  background: #f9fafb;
}
.tile.placeholder .tile-icon {
  background: #e5e7eb;
  color: #6b7280;
}
.tile.placeholder .tile-sub {
  color: #b45309;
  font-weight: 500;
}

/* Install modal */
.install-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.install-modal[hidden] { display: none; }
.install-modal-card {
  background: white;
  border-radius: 14px;
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}
.install-modal-card h3 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  color: var(--text);
  text-align: center;
}
.install-modal-card p { margin: 0 0 0.85rem; font-size: 0.9rem; color: #374151; }
.install-modal-card ol, .install-modal-card ul {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.6;
}
.install-modal-card .install-modal-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}
.install-modal-card .install-modal-close { margin-top: 0.5rem; }

/* ---------- Onboarding section download tiles ---------- */
.install-tile {
  display: none;
  font: inherit;
  text-align: center;
}
.install-tile.show { display: flex; }
.drawer-body .download-tile .tile-icon {
  background: #00c875;
  color: white;
}
/* Brand-image download tiles (DingTalk, Monday) keep the chip transparent so
   the embedded PNG fills it instead of getting tinted green. Specificity has
   to beat the .drawer-body .download-tile .tile-icon rule above. */
.drawer-body .download-tile .tile-icon.tile-icon-img {
  background: transparent;
  color: inherit;
}

/* PWA install modal */
.install-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.install-modal[hidden] { display: none; }
.install-modal-card {
  background: white;
  border-radius: 14px;
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}
.install-modal-card h3 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  color: #1f2937;
  text-align: center;
}
.install-modal-card p { margin: 0 0 0.85rem; font-size: 0.9rem; color: #374151; }
.install-modal-card ol, .install-modal-card ul {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
  color: #374151;
  font-size: 0.9rem;
  line-height: 1.6;
}
.install-modal-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}
.install-modal-close {
  margin-top: 0.5rem;
  width: 100%;
  background: var(--brand);
  color: white;
  border: none;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.install-modal-close:hover { background: var(--brand-dark); }

/* ---------- Brand mark (PULSE wordmark) ---------- */
.brand {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- Dashboard hamburger + drawer ---------- */
.hamburger-btn,
.header-back-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  color: white;
  text-decoration: none;
  transition: background var(--t-base);
}
.hamburger-btn:hover,
.header-back-btn:hover { background: rgba(255,255,255,0.22); }
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: white;
  border-radius: 1px;
}
.header-back-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.25;
  display: block;
}
.header-titles { flex: 1; min-width: 0; }
.header-titles h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Team pill (inspect header) — small mono badge */
.user-team-pill {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.22rem 0.5rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.user-team-pill:empty { display: none; }

/* Keep the inspect/admin header in one row on phones (no vertical stacking) */
@media (max-width: 480px) {
  header.app-header { gap: 0.6rem; } /* the padding is the compact bar's, set once above (Josh 2026-10-31) */
  header.app-header .header-titles h1 { font-size: 0.95rem; }
  header.app-header .sub { font-size: 0.7rem; }
  header.app-header .user-chip { gap: 0.35rem; }
  header.app-header .logout-btn { padding: 0.3rem 0.55rem; font-size: 0.72rem; }
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 90;
  animation: drawerFade 0.2s ease;
}
@keyframes drawerFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: min(380px, 90vw);
  background: var(--bg);
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 16px rgba(0,0,0,0.18);
}
.drawer.open { transform: translateX(0); }
/* The app shell: a drawer opens below the fixed header, never under it (docs/APP-SHELL.md). */
body.has-app-header .drawer { top: var(--pulse-header-h); height: calc(100% - var(--pulse-header-h)); }
body.has-app-header .drawer-overlay { top: var(--pulse-header-h); }
.drawer-header {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: white;
  /* Match .app-header's safe-area floor — env(safe-area-inset-top) returns 0 on
     non-notched Android so we need an explicit floor to clear the status bar. */
  padding: max(calc(1rem + env(safe-area-inset-top)), 2.75rem) calc(1.25rem + env(safe-area-inset-right)) 1rem calc(1.25rem + env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.drawer-close {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.drawer-close:hover { background: rgba(255,255,255,0.22); }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  -webkit-overflow-scrolling: touch;
}
.drawer-body .card { margin-bottom: 1rem; }
.drawer-body .tile-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
.drawer-body .tile {
  min-height: 90px;
  padding: 0.55rem 0.4rem;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.4rem;
  overflow: hidden;
}
.drawer-body .tile .tile-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.85rem;
}
.drawer-body .tile .tile-title {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.drawer-body .tile .tile-sub { display: none; }

/* ---------- Admin user management table ---------- */
.admin-table-wrap {
  overflow-x: auto;
  margin: -0.25rem;
  padding: 0.25rem;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.admin-table td {
  padding: 0.6rem 0.6rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table select {
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: white;
  border: 1px solid var(--border);
  min-width: 100px;
}
.admin-table select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.admin-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 1rem;
}
.admin-hint {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- Dashboard activity lists ---------- */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.activity-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
a.activity-item:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(44, 82, 130, 0.1);
}
.activity-item.warn {
  background: var(--warn-bg);
  border-color: #fcd34d;
}
.activity-item.warn .activity-title { color: var(--warn); }
.activity-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.activity-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.activity-note {
  font-size: 0.85rem;
  color: #374151;
  margin-top: 0.3rem;
  font-style: italic;
}
.activity-empty {
  padding: 0.85rem 1rem;
  background: white;
  border-radius: 10px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}

/* ---------- Admin team override select (header, role=admin only, testing) ---------- */
header.app-header .admin-team-select {
  flex: 0 0 auto;
  width: auto;
  max-width: 8.5rem;
  padding: 0.25rem 0.4rem;
  font-family: var(--font-sans);
  letter-spacing: normal;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.12);
  color: white;
}
header.app-header .admin-team-select option { color: var(--text); background: white; }
/* Override the global "placeholder option" graying — the My Team (Real)
   option uses value="" but should still render in the same white as the others. */
header.app-header .admin-team-select:has(option[value=""]:checked) { color: white; }
/* In the profile popup (Josh 10-31: "Into the profile menu"): between the name lines and My Profile. */
header.app-header.pulse-shell .ah-menu .admin-team-select { display: block; width: calc(100% - 0.8rem); max-width: none; margin: 0.1rem 0.4rem 0.4rem;
  padding: 0.4rem 0.5rem; font-size: 0.82rem; color: var(--text, #1f2937); background: var(--card, #fff); border: 1px solid var(--border, #d1d5db); }
header.app-header.pulse-shell .ah-menu .admin-team-select:has(option[value=""]:checked) { color: var(--text, #1f2937); }

/* ---------- Daily To-Dos rows ---------- */
.todos-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.todo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
a.todo-row:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-card-hover);
}
.todo-row.disabled {
  opacity: 0.7;
  cursor: default;
}
.todo-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.todo-title { font-weight: 600; font-size: 0.95rem; }
.todo-sub { font-size: 0.8rem; color: var(--text-muted); }
.todo-badge {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}
.todo-badge.start { background: var(--brand-light); color: var(--brand); }
.todo-badge.done { background: var(--success-bg); color: var(--success); }
.todo-badge.muted { background: var(--bg); color: var(--text-muted); }

/* ---------- Stacked 3-month calendar ---------- */
/* Day-of-week header row sits above the clipped viewport. The first column
   matches the spine width inside each month block so the 7 day cells line
   up perfectly with the day labels. */
.cal-day-headers {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  column-gap: 0.5rem;
  /* Match the horizontal padding of .cal-month-block so the day labels
     line up with the cells in each month grid below. */
  padding: 0 0.5rem;
  margin-bottom: 0.4rem;
}
.cal-day-header-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}
.cal-viewport {
  position: relative;
  overflow: hidden;
  /* Roughly the same vertical real estate the old single-month grid took.
     Tuned to fit ~5 week rows + small block padding. */
  height: 22rem;
}
.cal-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.35s ease;
  will-change: transform;
}
.cal-month-block {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  column-gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--card);
}
.cal-month-spine {
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-month-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg); /* read bottom-to-top */
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}
.cal-full-link {
  display: block;
  margin: 0.75rem auto 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.cal-full-link:hover { color: var(--brand); }
.cal-head {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  padding: 0.3rem 0;
}
.cal-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
}
.cal-cell.empty {
  background: transparent;
  border: none;
}
.cal-cell.past {
  background: var(--bg);
  color: var(--text-muted);
}
.cal-cell.today {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  font-weight: 700;
  box-shadow: var(--shadow-card-hover);
}
.cal-cell.has-entries {
  cursor: pointer;
  color: var(--text);
  background: white;
  border-color: var(--brand);
  transition: background var(--t-fast), transform var(--t-fast);
}
.cal-cell.has-entries:hover,
.cal-cell.has-entries:focus-visible {
  background: var(--brand-light, #eef2f7);
  transform: translateY(-1px);
}
.cal-cell.has-entries.today { color: white; background: var(--brand); }
.cal-cell.has-entries::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
}
.cal-cell.has-entries.today::after {
  background: white;
}
.cal-day { line-height: 1; }

/* ---------- /calendar full-page browser ---------- */
.calendar-page-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.calendar-page-title {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}
.cal-nav-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: white;
  color: var(--brand);
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast);
}
.cal-nav-btn:hover { background: var(--brand-light, #eef2f7); }
.cal-page-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}
.calendar-page-footer {
  display: flex;
  justify-content: center;
  margin-top: var(--space-3);
}
.cal-jump-today {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.cal-jump-today:hover { background: var(--brand-light, #eef2f7); color: var(--brand); }

/* ---------- JSA form ---------- */
.contact-block {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-top: var(--space-2);
  background: var(--card);
}
.contact-block-head {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-2);
}
.ack-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--success-bg, #f0fdf4);
  border: 1px solid var(--success-border, #bbf7d0);
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
  cursor: pointer;
}
.ack-row input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--success-accent, #16a34a);
  transform: scale(1.2);
}
.ack-row span { font-weight: 500; color: var(--text); }

/* ---------- JSA signature action row + Other Methods modal ---------- */
.signer-row-actions {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.signer-add-btn { width: 100%; }
.signer-other-btn { width: 100%; }
.other-methods-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.signature-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: var(--space-3);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: all var(--t-fast);
  color: var(--text-muted);
  width: 100%;
}
.signature-mode-btn:hover { border-color: var(--brand); color: var(--text); background: var(--brand-light, #eef2f7); }
.signature-mode-btn strong { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.signature-mode-btn span { font-size: 0.78rem; }
#other-methods-modal .pulse-modal-card { text-align: center; }
#other-methods-modal .signature-mode-btn { align-items: center; text-align: center; }
#other-methods-modal .button-row { justify-content: center; }

/* ---------- Multi-signer panel (Sign on This Device mode) ---------- */
.signer-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.signer-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--card);
  position: relative;
}
.signer-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.signer-card-head h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.signer-remove {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.signer-remove:hover { background: var(--error-bg, #fef2f2); color: var(--error, #dc2626); border-color: var(--error, #dc2626); }
.signer-name-input { margin-bottom: var(--space-2); }

/* ---------- JSA signers list (detail page) ---------- */
.signers-list { display: flex; flex-direction: column; gap: var(--space-2); }
.signer-row {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--card);
}
.signer-name { font-weight: 600; color: var(--text); }
.signer-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.signer-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.signer-cta-row button { flex: 1 1 auto; }

/* ---------- Calendar day-detail modal ---------- */
.day-detail-card {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}
.day-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.day-detail-head h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-strong);
}
.day-detail-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 var(--space-2);
  font-family: inherit;
}
.day-detail-close:hover { color: var(--text); }
.day-detail-body {
  overflow-y: auto;
  flex: 1 1 auto;
  margin: 0 calc(-1 * var(--space-3));
  padding: 0 var(--space-3);
}
.day-event-section { margin-bottom: var(--space-4); }
.day-event-section:last-child { margin-bottom: 0; }
.day-event-section-head {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.day-event-count {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
}
.day-event-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.day-event-row {
  display: block;
  padding: var(--space-3);
  background: white;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: background var(--t-fast), border-color var(--t-fast);
}
a.day-event-row:hover {
  background: var(--brand-light, #eef2f7);
  border-color: var(--brand);
}
.day-event-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.15rem;
}
.day-event-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.day-event-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ---------- Timesheet form bits ---------- */
.seg-toggle {
  display: inline-flex;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
}
.seg-toggle .seg-btn {
  flex: 1 1 50%;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--t-base), color var(--t-base);
}
.seg-toggle .seg-btn.active {
  background: var(--brand);
  color: white;
}
.seg-toggle .seg-btn:not(.active):hover { color: var(--text); background: var(--border-soft); }

/* Multi-select toggle-button group: aria-pressed=true is the active state.
   Used on the timesheet for Tasks, Delays, Travel Method. */
.toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.4rem 0;
}
/* Fixed-column variant — buttons fill their cells and wrap text instead of
   sizing to content. Use for longer lists where uniform alignment beats
   content-driven width. */
.toggle-grid.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.toggle-grid.cols-2 .toggle-btn {
  flex: initial;
  width: 100%;
  text-align: center;
}
.toggle-btn {
  flex: 0 1 auto;
  padding: 0.5rem 0.85rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-base), border-color var(--t-base), color var(--t-base), box-shadow var(--t-base);
}
.toggle-btn:hover { border-color: var(--brand); color: var(--brand); }
.toggle-btn[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  box-shadow: var(--shadow-card-hover);
}
.toggle-btn[aria-pressed="true"]:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: white; }

.delay-section {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-md);
}
.delay-section h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warn);
}

/* ---------- Skeleton loaders (replaces "Loading…" text on activity feeds) ---------- */
.skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.skeleton-row {
  background: linear-gradient(
    90deg,
    var(--border-soft) 0%,
    #f3f4f6 50%,
    var(--border-soft) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  border: 1px solid transparent;
}
.skeleton-line {
  height: 12px;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
}
.skeleton-line.title { width: 65%; height: 14px; margin-bottom: 8px; }
.skeleton-line.meta { width: 40%; height: 10px; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-row { animation: none; }
}

/* ---------- Inspection page (lifted from inspect.html inline <style>) ---------- */
.inspect-meta-strip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: 0.65rem 0.9rem;
  margin-bottom: var(--space-4);
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.inspect-meta-strip .meta-key {
  color: var(--text-muted);
  margin-right: 0.35rem;
}
.inspect-meta-strip .meta-val {
  color: var(--text-strong);
  font-weight: 600;
  letter-spacing: 0.08em;
}
.inspect-meta-strip .meta-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border-soft);
}

/* Repair sub-cards inside Repairs Logged */
.repair {
  background: #fafbfc;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  position: relative;
}
.repair-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}
.repair-num {
  font-weight: 600;
  color: var(--brand);
  font-size: 0.9rem;
}
.remove-btn {
  background: none;
  border: none;
  color: var(--error-accent);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.remove-btn:hover { background: var(--error-bg); }

.add-btn {
  width: 100%;
  background: white;
  border: 2px dashed #cbd5e0;
  color: #4a5568;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  transition: all var(--t-base);
}
.add-btn:hover { border-color: var(--brand); color: var(--brand); background: #f7fafc; }

/* Inspection 2-col row & sn 3-col row */
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.sn-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-3); }
/* A grid item defaults to min-width:auto, so its intrinsic content can force its
   track wider than the row, overflowing the card, instead of shrinking to fit.
   WebKit's native <input type="date"> has a wider intrinsic minimum than Blink's,
   which is why the iPhone overflowed the Inspection Date field and Android (whose
   intrinsic minimum already fit) did not (Josh's two-phone test, 2026-09-21). Same
   fix, same reasoning, as .sn-input input below. Checked against every page that
   uses .row (27 files, ~56 uses, plus 9 JS template-string uses, 2026-09-21): every
   one is a plain label + input/select/textarea/readonly-pill/toggle-grid pair that
   already stretches to its track via width:100%, none keeps a fixed-width or
   nowrap child that depends on its own intrinsic minimum, so none is disturbed. */
.row > div { min-width: 0; }
@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; }
  .sn-row { grid-template-columns: 1fr; }
}

/* Bottom action bar — sticky on mobile, inline (button-row only) on wide */
.button-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
@media (max-width: 480px) { .button-row { grid-template-columns: 1fr; } }

/* Save / Submit buttons live inline at the bottom of the form (not fixed) so they
   don't take up screen real estate while the keyboard is open. The user scrolls to
   them when they're ready to save or submit. */
.inspect-actions-bar {
  margin: var(--space-6) 0 0;
  padding: var(--space-3) 0 max(var(--space-4), env(safe-area-inset-bottom));
}
.inspect-actions-bar .button-row {
  margin: 0;
}

.submit-btn, .save-btn {
  width: 100%;
  border: none;
  padding: 0.875rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t-base), border-color var(--t-base), color var(--t-base);
}
.submit-btn { background: var(--brand); color: white; }
.submit-btn:hover:not(:disabled) { background: var(--brand-dark); }
.submit-btn:disabled { background: #9ca3af; cursor: not-allowed; }
.save-btn {
  background: white;
  color: #4a5568;
  border: 1px solid #cbd5e0;
}
.save-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
  background: #f7fafc;
}
.save-btn:disabled { color: #9ca3af; cursor: not-allowed; }

/* Status banner inside the inspection page */
.status {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: 0.9rem;
  display: none;
}
.status.show { display: block; }
.status.loading { background: var(--info-bg); color: var(--info); }
.status.success { background: var(--success-bg); color: var(--success); }
.status.error { background: #fee2e2; color: #991b1b; }

/* Inspection-specific small bits */
.q-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-style: italic;
}
.part-filters {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
@media (max-width: 480px) { .part-filters { grid-template-columns: 1fr; } }
.part-filters select, .part-filters input {
  padding: var(--space-2) 0.625rem;
  font-size: 0.875rem;
}
.search-wrap { position: relative; }
.search-wrap::before {
  content: '🔍';
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.5;
  pointer-events: none;
}
.search-wrap input { padding-left: 2rem; }
.no-results {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: var(--space-2) 0;
}

/* Faulty/Malfunctioning diagnostic block + auto-issue-ticket message */
.faulty-block {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn-accent);
  padding: 0.5rem 0.85rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-top: var(--space-2);
}
.faulty-block label { color: var(--warn); }
.cascade-block {
  margin-top: 0.4rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--warn-accent);
}
.field-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: -0.05rem 0 0.3rem;
  font-style: italic;
}
.ticket-message {
  margin: var(--space-3) 0 0;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--warn-accent);
  background: #fef3c7;
  color: var(--warn);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-align: center;
}

/* Inspection checklist counter & items */
.checklist-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.checklist-counter.complete { color: var(--success); }
.checklist-counter.incomplete { color: #b45309; }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem var(--space-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  margin-bottom: 0.4rem;
  background: white;
  cursor: pointer;
  transition: all var(--t-fast);
}
.check-item:hover { border-color: #cbd5e0; background: #f7fafc; }
.check-item.checked {
  border-color: var(--success-accent);
  background: var(--success-bg);
}
.check-item input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.125rem 0 0;
  flex-shrink: 0;
  accent-color: var(--success-accent);
  cursor: pointer;
}
.check-item label {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #374151;
  cursor: pointer;
  flex: 1;
  font-weight: 400;
}
.check-item .check-num {
  font-weight: 700;
  color: var(--brand);
  margin-right: 0.25rem;
  font-family: var(--font-mono);
}
.check-item.checked .check-num { color: var(--success); }

/* SN inputs with fixed alphabetic prefix to the left */
.sn-input { display: flex; align-items: stretch; }
.sn-input input {
  flex: 1;
  min-width: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.sn-prefix {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 0 0.65rem;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
  color: #4b5563;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  user-select: none;
}
input[readonly] { background: #f9fafb; color: #4b5563; cursor: not-allowed; }

/* Photo upload slots */
.photo-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-2); }
.photo-slot {
  border: 2px dashed #cbd5e0;
  border-radius: var(--radius-md);
  padding: var(--space-2);
  background: white;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-base);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.photo-slot:hover { border-color: var(--brand); background: #f7fafc; }
.photo-slot.has-file { border-style: solid; border-color: var(--success-accent); padding: 0; }
.photo-slot input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.photo-slot .photo-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.photo-slot .photo-hint {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 0.2rem;
}
.photo-slot img {
  max-width: 100%;
  max-height: 110px;
  border-radius: var(--radius-sm);
  display: block;
}
.photo-slot .photo-clear {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 1.4rem;
  height: 1.4rem;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  z-index: 2;
}
.photo-slot.has-file .photo-clear { display: block; }
.photo-multi { display: flex; flex-direction: column; }
.photo-thumbs:empty { display: none; }
.photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}
/* THE SHARED THUMBNAIL. Ruled on by Josh 2026-08-24, both halves, and this is now the single
   source of both size and border for every form that draws one.

   84px, because four of the eight photo forms already used it and half the app therefore does
   not move at all. The other four DID move -- ppe-inspection and qc-installation from 72px,
   inventory and truck-inspection from 76px -- and that is visible and approved.

   THE BORDER WAS GREEN AND THAT WAS THE DRIFT, NOT THE PAGES. It read
   `1px solid var(--success-accent)` (#00c875) while all eight forms overrode it to the grey
   #d1d5db that `--border` already holds. Eight pages disagreeing with one shared rule is the
   shared rule being wrong. Now grey, so the pages have nothing left to override.

   WARNING: ONE PAGE TOOK THIS RULE UNOPPOSED AND SO IT IS THE ONE THIS EDIT MOVES ON ITS OWN.
   /inspect declares no `.photo-thumb` of its own and says so in its own style block. It went
   78px -> 84px and green -> grey with nobody editing that page. That is the intended reach of a
   shared rule, but it is a VISIBLE change to a page outside the eight, and it is pinned in
   scripts/qc-tests/shadow-invisibility.mjs as a WATCHED class rather than left to be noticed.

   THE CORNER, RULED ON BY JOSH 2026-08-24, IS WHY THIS ONE LINE IS A LITERAL AND NOT THE TOKEN.
   It read `var(--radius-sm)`, which is 6px, while eight of the nine consumers each carried a
   local `border-radius: 8px` to overrule it -- the same shape of disagreement as the border,
   and settled the same way: the shared rule was the one that was wrong. All eight local rules
   are now deleted and this line is the only corner in the app's thumbnails.

   DO NOT "TIDY" THIS BACK INTO `var(--radius-sm)`. That token is 6px and is read by 19 OTHER
   shared rules in this file and 26 more places outside it; moving the token to 8px to save this
   literal would move all of them, which is not what was ruled. 8px belongs to `.photo-thumb`,
   not to the token. /inspect is the one consumer that never had a local 8px, so it -- and only
   it -- moves 6px -> 8px here. Josh was told that and accepted it. */
.photo-thumb {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--border);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* THE CLOSE BUTTON, AND THE ONE THAT IS STILL OUT OF STEP. Read this before changing a number.
   /inspect is the ONLY page that renders its remove button as `.thumb-x`; all eight photo forms
   render a bare `<button>` and style it page-side as `.photo-thumb button`. Those eight were
   realigned to 22px / font 15px on 2026-08-24, because four of them had been left at 20px / 13px
   -- sized to the 72-76px tile they had BEFORE the thumbnail became 84px.
   THIS RULE WAS NOT MOVED WITH THEM. It is 1.25rem (20px) at font 0.85rem (13.6px), so /inspect
   now has an 84px tile with the small button, which is the same defect the eight just had. It was
   left alone deliberately: /inspect has no local rule, so editing this line moves a page nobody
   asked to move, and that is a ruling, not a tidy-up. Reported, not fixed.
   AND THE TRAP IF SOMEONE UNIFIES THIS: `.photo-thumb .thumb-x` is specificity (0,2,0) and
   `.photo-thumb button` is (0,1,1), so adding a shared `.photo-thumb button` rule would NOT
   reach /inspect -- this rule would keep winning, silently. Change this rule itself, or nothing. */
.photo-thumb .thumb-x {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  background: rgba(0,0,0,0.65);
  color: white;
  border: none;
  border-radius: 50%;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.required-photos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-2);
  margin-top: 0.25rem;
}
@media (max-width: 480px) { .required-photos-grid { grid-template-columns: 1fr 1fr; } }
.required-photos-grid .photo-slot { min-height: 110px; }
.required-photos-grid .photo-label { font-size: 0.72rem; }
.photo-slot.missing {
  border-color: var(--error-accent);
  background: var(--error-bg);
}
.photo-slot.missing .photo-label { color: var(--error-accent); }
/* Slot has a photo on Monday but no local blob (record came from /api/inspection/get).
   The user can still tap the slot to re-shoot, which replaces on save. */
.photo-slot.has-server-photo {
  border-style: solid;
  border-color: var(--brand);
  background: var(--brand-light);
}
.photo-slot.has-server-photo .photo-hint::before { content: "Uploaded earlier · "; opacity: 0.85; }
.photo-server-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--brand);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  pointer-events: none;
}
/* Chunk E (schema/0154): "Can't take this photo" — a required photo waived
   with a reason instead of missing. z-index: 2, same as .photo-clear, so the
   click lands on this button and not the absolutely-positioned file input
   that otherwise covers the whole slot. */
.photo-slot .photo-waive-btn {
  position: absolute;
  bottom: 0.2rem;
  right: 0.2rem;
  background: rgba(0,0,0,0.55);
  color: white;
  border: none;
  border-radius: 50%;
  width: 1.3rem;
  height: 1.3rem;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.photo-slot.waived {
  border-style: solid;
  border-color: var(--warn-accent);
  background: #fffbea;
}
.photo-slot.waived .photo-label { color: var(--warn-accent); }
.photo-waived-note {
  position: absolute;
  bottom: 0.2rem;
  left: 0.3rem;
  right: 1.6rem;
  font-size: 0.6rem;
  color: #92600a;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- Photos card: divider + optional multi-file blocks ---------- */
.photos-divider {
  border: none;
  border-top: 1px dashed #d1d5db;
  margin: 1rem 0 0.75rem;
}
#extra-multi-photos { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.75rem; }
.extra-multi-block { display: flex; flex-direction: column; }
.extra-multi-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.4rem;
}
.req-mark {
  color: #dc2626;
  margin-left: 0.15rem;
  font-weight: 600;
}

/* Read-only "pill" for fields auto-filled from another board (Customer, etc.). */
.readonly-pill {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f9fafb;
  color: #4b5563;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  font-size: 1rem;
  min-height: 2.85rem;
  display: flex;
  align-items: center;
}

/* ---------- Crew row (Submitter / Team / Teammate) — read-only ---------- */
.crew-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #e5e7eb;
}
@media (max-width: 480px) { .crew-row { grid-template-columns: 1fr; } }
.crew-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.15rem;
}
.crew-cell:nth-child(2) { text-align: center; align-items: center; }
.crew-cell:nth-child(3) { text-align: right; align-items: flex-end; }
@media (max-width: 480px) {
  .crew-cell, .crew-cell:nth-child(2), .crew-cell:nth-child(3) {
    text-align: left;
    align-items: flex-start;
  }
}
.crew-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.crew-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #374151;
}

/* ---------- Signature pad ---------- */
.signature-wrap { position: relative; }
.signature-pad {
  display: block;
  width: 100%;
  height: 160px;
  background: #fafbfc;
  border: 2px dashed #cbd5e0;
  border-radius: var(--radius-md);
  touch-action: none;        /* keep finger draws from scrolling the page */
  cursor: crosshair;
}
.signature-pad.has-ink { border-style: solid; border-color: var(--success-accent); background: white; }
.signature-pad.missing { border-color: var(--error-accent); background: var(--error-bg); }
.signature-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #9ca3af;
  font-size: 0.85rem;
  pointer-events: none;
  font-style: italic;
}
.signature-pad.has-ink + .signature-hint { display: none; }
.signature-clear {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: white;
  border: 1px solid var(--border);
  color: #4a5568;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.signature-clear:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Part combobox (search + select unified) ---------- */
.combo-wrap { position: relative; }
.combo-row { display: flex; gap: 0.4rem; align-items: stretch; }
.combo-row > input { flex: 1; min-width: 0; }
.filter-wrap { position: relative; flex-shrink: 0; }
.filter-btn {
  width: 2.5rem;
  height: 100%;
  min-height: 2.5rem;
  background: white;
  border: 1px solid var(--border);
  color: #4a5568;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--t-base);
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); background: #f7fafc; }
.filter-btn.active { border-color: var(--brand); color: var(--brand); background: #eff6ff; }
.filter-dot {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--brand);
}
.filter-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  min-width: 12rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  z-index: 60;
  padding: 0.25rem 0;
}
.filter-item {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: #374151;
}
.filter-item:hover { background: #f7fafc; }
.filter-item.selected { background: #eff6ff; color: var(--brand); font-weight: 500; }
.combo-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  max-height: 280px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  z-index: 50;
}
.combo-item {
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  border-bottom: 1px solid #f1f5f9;
}
.combo-item:last-child { border-bottom: none; }
.combo-item:hover { background: #f7fafc; }
.combo-item.selected { background: #eff6ff; font-weight: 500; }
.combo-cat {
  font-size: 0.72rem;
  color: #6b7280;
  background: #f3f4f6;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}
.combo-empty {
  padding: 0.65rem 0.75rem;
  color: #9ca3af;
  font-size: 0.88rem;
  font-style: italic;
}
.photo-thumb.is-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.photo-thumb .video-badge {
  position: absolute;
  bottom: 0.15rem;
  left: 0.2rem;
  color: white;
  font-size: 0.7rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* ---------- Industrial status pills (used for Returned / Ticketed / Synced) ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  /* A long label wraps to a second line rather than pushing the page wider than the screen (Josh,
     2026-10-27: "Wrap to a second line"; Motive Cards' "Needs a Tier 1 approver ($300 or less)").
     min-width:0 lets it shrink inside a flex row; a short pill still sits on one line. */
  white-space: normal;
  overflow-wrap: break-word;
  min-width: 0;
}
.pill.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: var(--warn-border);
}
.pill.error {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}
.pill.success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}
.pill.muted {
  background: var(--bg);
  color: var(--text-muted);
  border-color: var(--border-soft);
}
/* ⚠ THERE IS A FIFTH VARIANT AND IT IS NOT HERE. `.pill.info` was added 2026-08-19 and lives in
   the LANDING PAGE FOUNDATION block at the end of this file, because that is where the round
   that added it was working. If you are reading this list to find out what variants exist, it is
   five, not four. Do not add a sixth in a third place. */

/* ---------- Card section header refinement (industrial) ---------- */
.card h2 {
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
}

/* =====================================================================
   ACCOUNT SETTINGS — preference rows, toggle switches, time picker
   ===================================================================== */
.form-hint {
  margin: var(--space-2) 0 var(--space-4);
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
.form-hint a { color: var(--brand); text-decoration: underline; }
/* 🔴 SO A `.form-hint` CAN BE A RESULT LINE. Added 2026-08-21 with the Settings merge, and it is
   the rule whose absence was already written down: the note beside the Team Info button on the
   absorbed page explained that the status line had to stay an inline `<span>` with `margin:0`
   BECAUSE there was no `.form-hint:empty` rule, and `.form-hint` carries a bottom margin, so a
   block element would hold a permanent gap under the button while empty. That is true, and the
   honest fix is the missing rule rather than an inline style on every result line. `:empty` was
   defined for exactly three classes before this - `.user-team-pill`, `.photo-thumbs` and
   `.biometric-sub` - which is why three settings cards each solved it their own way. */
.form-hint:empty { display: none; }

.pref-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-soft);
}
.pref-row:last-of-type { border-bottom: none; }
/* 🔴 A ROW SWITCHED OFF BY ITS MASTER. Added 2026-08-21 with the Settings merge. `.switch` had
   SEVEN rules and not one of them was a disabled state, so a dimmed inert row was only expressible
   on the page-local `.notif-row` this class replaced - which is the whole reason the notification
   rows were a second toggle vocabulary instead of this one. Without it the master switch stops
   looking like a master switch: the rows below it go inert with no visible reason. */
.pref-row.is-disabled { opacity: 0.5; }
.pref-row.is-disabled .switch-track { cursor: not-allowed; }

.pref-text { flex: 1; min-width: 0; }
.pref-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 2px;
}
.pref-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.pref-time {
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  width: auto;
  min-width: 110px;
  flex: 0 0 auto;
}
.pref-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-soft);
}

/* Toggle switch — iOS-style, accessible */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 28px;
  transition: background var(--t-fast);
  cursor: pointer;
}
.switch-track::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform var(--t-fast);
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::before { transform: translateX(20px); }
.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.25);
}

/* =====================================================================
   INSPECTION DETAILS — locked once the checklist has started
   setInspectionDetailsLocked() (inspect.js) toggles `.details-locked` on
   main > .card[data-section="details"] and disables every input/select/textarea
   in it. Native `:disabled` rendering differs between iOS Safari and Android
   Chrome (Josh's two-phone test, 2026-09-21: "not all the top portions are
   grayed out ... make sure the styles are uniform"), so the locked look is
   defined once here, in PULSE's own tokens, instead of being left to each
   browser's default.
   ===================================================================== */
.details-locked input:disabled:not([type="checkbox"]),
.details-locked select:disabled {
  background: var(--bg);
  color: var(--text-muted);
  /* iOS Safari fades a disabled control's text on top of `color`, independent of
     it; this is the standard override, and it does nothing (so is harmless) on
     engines that don't have that quirk. */
  -webkit-text-fill-color: var(--text-muted);
  opacity: 1;
  cursor: not-allowed;
}
/* The checkbox itself still gets `disabled` (native rendering there is a minor,
   accepted difference), but the whole row dims as one unit so the LOCKED state
   reads the same regardless of how each browser paints a disabled checkbox. */
.details-locked .geo-stamp-row {
  opacity: 0.55;
  cursor: not-allowed;
}
.details-locked .geo-stamp-label,
.details-locked .geo-stamp-label input[type="checkbox"] {
  cursor: not-allowed;
}

/* =====================================================================
   STAMP MY LOCATION — toggle on inspection form
   ===================================================================== */
.geo-stamp-row {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}
.geo-stamp-label {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: var(--space-2);
  cursor: pointer;
  user-select: none;
}
.geo-stamp-label input[type="checkbox"] {
  grid-row: 1 / 3;
  align-self: start;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
}
.geo-stamp-title {
  grid-column: 2;
  grid-row: 1;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.geo-stamp-sub {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.geo-stamp-result {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--success-bg, #ecfdf5);
  border: 1px solid var(--success-border, #a7f3d0);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text);
}

/* ---------- Inspection landing page (Recently Submitted + Saved for Later) ---------- */
.landing-actions {
  display: flex;
  justify-content: center;
  margin: var(--space-5) 0 var(--space-6);
}
.new-checklist-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: 1rem;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  cursor: pointer;
}
.new-checklist-btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}

.pulse-table-wrap {
  overflow-x: auto;
  margin: 0 calc(var(--space-4) * -1);
}
.pulse-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.pulse-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.pulse-table tbody tr {
  transition: background var(--t-fast);
  cursor: pointer;
}
.pulse-table tbody tr:hover {
  background: var(--brand-light);
}
.pulse-table tbody td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.pulse-table tbody tr:last-child td { border-bottom: none; }

.pulse-table .col-date {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.pulse-table .col-tower {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-strong);
}
.pulse-table .col-site { color: var(--text); }
.pulse-table .col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.pulse-table-empty {
  padding: var(--space-6) var(--space-3);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.pulse-table-empty strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.draft-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: color var(--t-fast), background var(--t-fast);
}
.draft-delete-btn:hover {
  color: var(--error);
  background: var(--error-bg);
}

/* Status badges shared by both tables. D4 will formalize the full enum;
   this is the v1 mapping. */
.status-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-badge.synced            { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.status-badge.pending           { color: var(--text-muted); background: var(--bg); border-color: var(--border-soft); }
.status-badge.syncing           { color: var(--info); background: var(--info-bg); border-color: var(--info-bg); }
.status-badge.failed            { color: var(--error); background: var(--error-bg); border-color: var(--error-border); }
.status-badge.editing           { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.status-badge.metadata-only     { color: var(--text-muted); background: var(--bg); border-color: var(--border-soft); font-style: italic; }
.status-badge.mine              { color: var(--text-muted); background: var(--bg); border-color: var(--border-soft); }
.status-badge.waiting-teammate  { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
/* Needs Revision (form-redesign-3-review-sheet-truck, Josh 2026-10-26): amber, sent back to the crew, never green. */
.status-badge.revision          { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.status-badge.teammate-received { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.status-badge.conflict-detected { color: var(--error); background: var(--error-bg); border-color: var(--error-border); }
.status-badge.sync-failed       { color: var(--error); background: var(--error-bg); border-color: var(--error-border); }
.status-badge.duplicate-tower   { color: var(--error); background: var(--error-bg); border-color: var(--error-border); }
.status-badge.under-review      { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
/* ENGINEERING-REVIEW STEP 7 — matches Engineering Review's own red tile for Sent Back. */
.status-badge.sent-back         { color: var(--error); background: var(--error-bg); border-color: var(--error-border); }

/* ---------- Generic dialog (conflict, Submit Anyway, etc.) ---------- */
.pulse-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
}
.pulse-modal[hidden] { display: none; }
.pulse-modal-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
}
.pulse-modal-card h3 {
  margin: 0 0 var(--space-3);
  font-size: 1.15rem;
  color: var(--text-strong);
}
.pulse-modal-card p {
  margin: 0 0 var(--space-3);
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.5;
}
.pulse-modal-card .conflict-list {
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  list-style: none;
}
.pulse-modal-card .conflict-list li {
  padding: var(--space-1) 0;
}
.pulse-modal-card textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  resize: vertical;
  margin-bottom: var(--space-2);
}
.pulse-modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.pulse-modal-btn {
  padding: var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--t-fast);
}
.pulse-modal-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.pulse-modal-btn-primary   { background: var(--brand);     color: white; }
.pulse-modal-btn-primary:hover { background: var(--brand-dark); }
.pulse-modal-btn-secondary { background: white;            color: var(--text); border-color: var(--border); }
.pulse-modal-btn-secondary:hover { background: var(--bg); }
.pulse-modal-btn-warn      { background: var(--warn-bg);   color: var(--warn);  border-color: var(--warn-border); }
.pulse-modal-btn-warn:hover { background: #fde68a; }
.pulse-modal-btn-danger    { background: var(--error-bg);  color: var(--error); border-color: var(--error-border); }
.pulse-modal-btn-danger:hover { background: #fecaca; }

/* Handoff (Request from teammate) — C2 */
.handoff-row {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-3);
}
.handoff-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.handoff-btn:hover { color: var(--brand); border-color: var(--brand); }
.handoff-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.handoff-btn .handoff-icon {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}

/* Field-selection modal: wider card to fit grouped checkbox lists comfortably. */
.pulse-modal-card-wide { max-width: 640px; }

.handoff-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-3);
}
.handoff-group legend {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 var(--space-2);
}
.handoff-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.4;
}
.handoff-check input[type="checkbox"] { margin-top: 0.25rem; flex-shrink: 0; }
.handoff-details {
  margin: 0 0 var(--space-3);
}
.handoff-details > summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  list-style: none;
}
.handoff-details > summary::-webkit-details-marker { display: none; }
.handoff-details > summary::before {
  content: '▸ ';
  display: inline-block;
  margin-right: var(--space-2);
  transition: transform var(--t-fast);
}
.handoff-details[open] > summary::before { content: '▾ '; }
.handoff-details[open] > summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
}
.handoff-details > .handoff-group {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: 0;
}
.handoff-note-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.handoff-note-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.handoff-note-label textarea {
  display: block;
  margin-top: var(--space-2);
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  resize: vertical;
  min-height: 70px;
}

/* Teammate Mode (C3) — recipient-side handoff form. */
.teammate-context-card .teammate-from {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.teammate-context-card .teammate-from .mono-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.teammate-context-card .teammate-from strong { font-weight: 600; }
.teammate-note {
  margin: var(--space-2) 0 0;
  padding: var(--space-3) var(--space-4);
  background: var(--info-bg, #eef6ff);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}
.teammate-photo-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.teammate-photo-row {
  display: grid;
  grid-template-columns: 1fr 80px;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.teammate-photo-row .teammate-photo-label {
  grid-column: 1 / span 2;
  font-weight: 600;
}
.teammate-photo-row input[type="file"] {
  grid-column: 1;
}
.teammate-photo-row .teammate-photo-thumb {
  grid-column: 2;
  grid-row: 2;
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.teammate-photo-row .teammate-photo-status {
  grid-column: 1 / span 2;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
}
.teammate-photo-status.pending     { color: var(--text-muted); }
.teammate-photo-status.compressing { color: var(--info, #2563eb); }
.teammate-photo-status.ready       { color: var(--success); }
.teammate-photo-status.failed      { color: var(--error); }
.teammate-fatal {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-6) 0;
}

/* Dashboard handoff card (C4) */
.handoffs-section { margin-top: var(--space-3); }
.handoffs-section:first-child { margin-top: 0; }
.handoffs-section + .handoffs-section { margin-top: var(--space-4); }
.handoffs-subhead {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.handoffs-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0 0.4rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--brand);
  color: white;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
}
.handoffs-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.handoff-row-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
a.handoff-row-item:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-card);
}
.handoff-row-main {
  flex: 1 1 auto;
  min-width: 0;
}
.handoff-row-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.handoff-row-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.handoff-row-note {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--info-bg, #eef6ff);
  border-left: 2px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}
.handoff-row-cta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}
.handoff-row-action {
  border: 1px solid var(--border);
  background: white;
  color: var(--warn);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.handoff-row-action:hover { border-color: var(--warn-border); background: var(--warn-bg); }
.handoff-row-action:disabled { opacity: 0.5; cursor: wait; }

/* ---------- Outbox card (dashboard) ---------- */
.outbox-list { display: flex; flex-direction: column; gap: var(--space-2); }
.outbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
}
.outbox-row-main { flex: 1; min-width: 0; }
.outbox-row-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  word-break: break-word;
}
.outbox-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.outbox-row-kind { text-transform: uppercase; font-weight: 600; }
.outbox-row-hint { font-style: italic; }
.outbox-row-error {
  margin-top: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: var(--error-bg);
  color: var(--error-accent);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.outbox-row-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.outbox-row-action {
  border: 1px solid var(--warn-border);
  background: white;
  color: var(--warn);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.outbox-row-action:hover { border-color: var(--warn); background: var(--warn-bg); }
.outbox-row-action:disabled { opacity: 0.5; cursor: wait; }
.outbox-row-cancel {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
}
.outbox-row-cancel:hover { color: var(--error-accent); background: var(--error-bg); }

/* ---------- Biometric sign-in (login page) ---------- */
.biometric-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}
.btn-biometric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  background: var(--brand-dark);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
}
.btn-biometric:hover { background: var(--brand); }
.btn-biometric:active { transform: scale(0.98); }
.btn-biometric:disabled { opacity: 0.6; cursor: wait; }
.biometric-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.biometric-label {
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}
.biometric-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.75;
  letter-spacing: 0.04em;
}
.biometric-sub:empty { display: none; }
.biometric-divider {
  position: relative;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.biometric-divider::before,
.biometric-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 5rem);
  height: 1px;
  background: var(--border);
}
.biometric-divider::before { left: 0; }
.biometric-divider::after { right: 0; }
.biometric-divider span {
  background: var(--card);
  padding: 0 0.6rem;
  position: relative;
}

/* ---- Field Photos — FAB, capture modal, gallery ---- */

/* Floating action button */
.fphoto-fab {
  position: fixed;
  bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 1rem));
  right: 1.5rem;
  z-index: 80;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
  transition: background var(--t-fast), transform var(--t-fast);
}
.fphoto-fab:hover { background: var(--brand-dark); }
.fphoto-fab:active { transform: scale(0.92); }

/* Capture modal — full-screen overlay, bottom sheet card */
.fphoto-capture-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: flex-end;
}
.fphoto-capture-modal.is-open { display: flex; }
.fphoto-capture-card {
  background: var(--card);
  width: 100%;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 1.5rem 1.5rem max(1.5rem, env(safe-area-inset-bottom));
  max-height: 92dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
}
.fphoto-capture-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.fphoto-capture-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
}
.fphoto-capture-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.2rem;
  width: auto;
}

/* Take Photo / Select from Gallery buttons */
.fphoto-source-btns {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.fphoto-source-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  color: var(--brand);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.fphoto-source-btn:hover { border-color: var(--brand); background: var(--brand-light); }
.fphoto-source-btn:active { transform: scale(0.97); }
.fphoto-source-btn-error { border-color: var(--error-accent) !important; background: var(--error-bg) !important; color: var(--error) !important; }

/* Photo slot in capture modal */
.fphoto-slot-wrap {
  margin-bottom: 1rem;
}
.fphoto-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 120px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: #f9fafb;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.fphoto-slot:hover { border-color: var(--brand); background: var(--brand-light); }
.fphoto-slot.fphoto-slot-error { border-color: var(--error-accent); background: var(--error-bg); }
.fphoto-preview {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--radius-md);
}
.fphoto-preview:not([hidden]) { display: block; }

/* Form fields inside capture modal */
.fphoto-fields label { margin-top: 0.85rem; }
.fphoto-location-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
}
.fphoto-location-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  margin: 0;
}
.fphoto-loc-display {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-family: var(--font-mono);
}
.fphoto-capture-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.fphoto-capture-actions .btn { flex: 1; }

/* /photos page header row */
.fphoto-page-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.fphoto-page-hdr h2 { margin: 0; }
.fphoto-page-add-btn { white-space: nowrap; }

/* Gallery grid */
.fphoto-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.fphoto-gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0 1rem;
}

/* Thumbnail card */
.fphoto-thumb {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: box-shadow var(--t-fast);
}
.fphoto-thumb:hover { box-shadow: var(--shadow-card-hover); }
.fphoto-thumb-img-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: #e5e7eb;
}
.fphoto-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.fphoto-thumb-meta {
  padding: 0.45rem 0.5rem 0.5rem;
}
.fphoto-thumb-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fphoto-thumb-date {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Detail modal */
.fphoto-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}
.fphoto-detail-modal.is-open { display: flex; }
.fphoto-detail-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
}
.fphoto-detail-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0;
}
.fphoto-detail-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  width: auto;
  padding: 0;
}
.fphoto-detail-delete {
  background: none;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--error);
  cursor: pointer;
  width: auto;
  padding: 0;
}
.fphoto-detail-img {
  width: 100%;
  display: block;
  margin-top: 0.75rem;
  max-height: 55vh;
  object-fit: contain;
  background: #000;
}
.fphoto-detail-meta {
  padding: 0.85rem 1rem 1.25rem;
}
.fphoto-detail-row {
  display: flex;
  gap: 0.75rem;
  font-size: 0.875rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.fphoto-detail-row:last-child { border-bottom: none; }
.fphoto-detail-lbl {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 5rem;
  flex-shrink: 0;
}

/* Photo picker sheet */
.fphoto-picker-sheet {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: flex-end;
}
.fphoto-picker-sheet.is-open { display: flex; }
.fphoto-picker-card {
  background: var(--card);
  width: 100%;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 1.25rem 1.25rem max(1.25rem, env(safe-area-inset-bottom));
  box-shadow: var(--shadow-modal);
}
.fphoto-picker-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1rem;
}
.fphoto-picker-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.fphoto-picker-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: white;
  color: var(--text-strong);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.fphoto-picker-option:hover { background: var(--brand-light); border-color: var(--brand); }
.fphoto-picker-option svg { flex-shrink: 0; color: var(--brand); }
.fphoto-picker-option-text { display: flex; flex-direction: column; gap: 0.1rem; }
.fphoto-picker-option-text span { font-size: 0.95rem; font-weight: 600; line-height: 1.2; }
.fphoto-picker-option-text small { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
.fphoto-picker-cancel {
  width: 100%;
  padding: 0.75rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
}
.fphoto-picker-cancel:hover { background: var(--bg); color: var(--text-strong); }

/* Picker — app gallery sub-view */
.fphoto-picker-app-gallery {
  max-height: 55vh;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}
.fphoto-picker-app-hdr {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.fphoto-picker-app-hdr span { font-size: 0.95rem; font-weight: 600; color: var(--text-strong); }
.fphoto-picker-back {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  padding: 0.2rem 0;
  width: auto;
}
.fphoto-picker-app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.fphoto-picker-app-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #e5e7eb;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--t-fast);
}
.fphoto-picker-app-thumb:hover { border-color: var(--brand); }
.fphoto-picker-app-thumb-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fphoto-picker-app-thumb-lbl {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.2rem 0.3rem;
  background: rgba(0,0,0,0.55);
  color: white;
  font-size: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fphoto-picker-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1.5rem 1rem;
  line-height: 1.6;
}

/* Picker — teammate slot selection view */
.fphoto-picker-teammate-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
  line-height: 1.45;
}
.fphoto-picker-teammate-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 42vh;
  overflow-y: auto;
}
.fphoto-picker-teammate-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: white;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-strong);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.fphoto-picker-teammate-item:hover { background: var(--brand-light); border-color: var(--brand); }
.fphoto-picker-teammate-item input[type=checkbox] {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

/* ==========================================================================
   MOTIVE CARDS MODULE
   Shared by /motive-cards, /motive-manage-cards and /motive-requests.

   Lived in motive-cards.html's inline <style> until 2026-08-04, then briefly in its own
   /assets/motive.css when the module split across three pages. It is HERE now because a
   separate stylesheet gave the module a way to render completely unstyled that it never had
   before: the page loads, styles.css applies, and if that ONE extra request is stale, 404s in a
   post-deploy window, or is held wrong by a service worker, every mc- rule vanishes at once —
   giant raw SVG icons, stacked full-width buttons. That is what Josh hit within minutes of the
   split shipping.

   styles.css is loaded by all 70 pages and has been reliable for 84 versions, so folding the
   module into it removes the extra request AND keeps exactly one copy of these rules, which was
   the point of extracting them in the first place. Every selector is mc-/fr-/motive-/btn-
   prefixed and scoped to the module's own markup.
   ========================================================================== */

  /* A class that sets `display` (e.g. .btn { display:inline-flex }) overrides the browser's
     default [hidden]{display:none}, which leaks JS-gated buttons like "Override for a Tech"
     and "Inactive Cards" to unauthorized users. Force the hidden attribute to always win. */
  [hidden] { display: none !important; }
  .motive-msg { margin:.6rem 0 0; padding:.5rem .7rem; border-radius:var(--radius-md); font-size:.84rem; }
  .motive-msg.error { background:var(--error-bg); color:var(--error); border:1px solid var(--error-border); }
  .motive-msg.success { background:#ecfdf5; color:#047857; border:1px solid #a7f3d0; }
  .mc-tile { padding:.7rem 0; border-top:1px solid var(--border-soft); }
  .mc-tile:first-child { border-top:0; }
  .mc-tile-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem; }
  .mc-tile-head > * { min-width:0; overflow-wrap:break-word; }
  .mc-tile-title { font-weight:600; color:var(--brand); font-size:.92rem; }
  .mc-tile-meta { font-size:.78rem; color:var(--text-muted); margin-top:.15rem; }
  .mc-actions { display:flex; flex-wrap:wrap; gap:.4rem; margin-top:.5rem; }
  .mc-mini { padding:.35rem .7rem; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--text); font-size:.76rem; font-weight:600; cursor:pointer; }
  .mc-mini:active { transform:translateY(1px); }
  .mc-mini.warn { background:var(--warn-bg); color:var(--warn); border-color:var(--warn-border); }
  .mc-empty { padding:1rem; text-align:center; color:var(--text-muted); font-size:.85rem; }
  .mc-lbl { color:var(--text); font-weight:600; }
  /* Sort/filter toolbar shared by the Cards, My Requests, and All Overrides lists */
  .mc-toolbar { display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:.6rem; }
  .mc-toolbar input, .mc-toolbar select { flex:1 1 8rem; min-width:0; padding:.5rem .6rem; border:1px solid var(--border); border-radius:8px; font:inherit; font-size:.84rem; background:#fff; color:var(--text); }
  /* Manager card tile: info (left) | right column = status box stacked above the icons */
  #cards-grid { border-top:1px solid var(--border-soft); }
  .mc-card-tile { display:flex; align-items:stretch; gap:.6rem; }
  .mc-card-tile .mc-info { flex:1; min-width:0; }
  .mc-tile-side { display:flex; flex-direction:column; align-items:flex-end; justify-content:space-between; gap:.5rem; }
  .mc-tile-icons { display:flex; flex-direction:row; gap:.4rem; }
  .mc-statebox { text-align:right; padding:.35rem .5rem; border-radius:8px; background:#f8fafc; border:1px solid var(--border-soft); font-size:.72rem; line-height:1.2; min-width:92px; }
  .mc-sb-cat { font-weight:700; text-decoration:underline; }
  .mc-sb-val { margin:.05rem 0 .3rem; color:var(--text); }
  .mc-sb-val:last-child { margin-bottom:0; }
  .mc-sb-val.success { color:#047857; }
  .mc-sb-val.warn { color:var(--warn); }
  .mc-sb-val.error { color:var(--error); }
  .mc-icon-btn { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; padding:0; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--text-muted); cursor:pointer; }
  .mc-icon-btn:active { transform:translateY(1px); }
  .mc-icon-btn svg { width:19px; height:19px; }
  .mc-tile.mc-flash { animation:mcFlash 2.2s ease-out; }
  @keyframes mcFlash { 0% { background:#e6f0ff; } 100% { background:transparent; } }
  #other-photo-preview img { max-width:100%; max-height:140px; border-radius:var(--radius-md); }
  .receipt-drop { display:block; width:100%; margin-top:.9rem; padding:1.4rem 1rem; border:2px dashed var(--border); border-radius:var(--radius-md); background:#fafbfc; color:var(--text-muted); font-size:.86rem; text-align:center; cursor:pointer; }
  /* Dollar-sign prefix on the Total Spent input */
  .mc-money { position:relative; }
  .mc-money-sign { position:absolute; left:.7rem; top:50%; transform:translateY(-50%); color:var(--text-muted); font-weight:600; pointer-events:none; }
  .mc-money input { padding-left:1.5rem; }
  .receipt-drop.drag { border-color:var(--brand); background:#f0f6ff; color:var(--text); }
  /* Receiptless-unlock picker in the Upload Receipt modal */
  .fr-unlocks { display:flex; flex-direction:column; gap:.4rem; margin-top:.3rem; }
  .fr-unlock { display:flex; align-items:center; justify-content:space-between; gap:.5rem; width:100%; text-align:left; padding:.55rem .7rem; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--text); cursor:pointer; font:inherit; }
  .fr-unlock:active { transform:translateY(1px); }
  .fr-unlock .fr-when { font-weight:600; font-size:.86rem; }
  .fr-unlock .fr-stat { font-size:.76rem; color:var(--text-muted); }
  .fr-unlock .fr-stat.awaiting { color:var(--warn); font-weight:600; }
  .fr-empty { font-size:.82rem; color:var(--text-muted); padding:.3rem 0; }
  #receipt-preview img { max-width:100%; max-height:220px; border-radius:var(--radius-md); }
  /* Legal acknowledgment shown above signature pads */
  .mc-legal { font-size:.78rem; color:var(--text-muted); background:#f8fafc; border:1px solid var(--border-soft); border-radius:8px; padding:.5rem .7rem; margin:.5rem 0; }
  .mc-legal ul { margin:.3rem 0 0; padding-left:1.1rem; }
  .mc-legal li { margin:.12rem 0; }
  /* Next-step guidance in the review popup */
  .mc-next { font-size:.82rem; color:var(--text); background:#eff6ff; border:1px solid #bfdbfe; border-radius:8px; padding:.5rem .7rem; margin:.2rem 0 .5rem; }
  /* Disabled tier button in the review popup (too high, too low, or no permission) */
  .seg-toggle .seg-btn:disabled, .seg-toggle .seg-btn.seg-disabled { opacity:.38; cursor:not-allowed; }
  /* Bulleted reminder inside the receipt validation box */
  .mc-bullets { margin:.25rem 0 0; padding-left:1.1rem; }
  .mc-bullets li { margin:.12rem 0; }
  /* Detail rows in the review popup */
  .mc-detail-row { display:flex; gap:.5rem; justify-content:space-between; font-size:.82rem; padding:.28rem 0; border-top:1px solid var(--border-soft); }
  .mc-detail-row:first-child { border-top:0; }
  .mc-detail-row .mc-dk { color:var(--text-muted); flex:0 0 auto; }
  .mc-detail-row .mc-dv { color:var(--text); font-weight:600; text-align:right; }
  /* Collapsible section header (Cards) */
  .mc-collapse-btn { display:flex; align-items:center; gap:.5rem; background:none; border:0; padding:0; margin:0; cursor:pointer; color:inherit; text-align:left; }
  .mc-collapse-btn:active { transform:translateY(1px); }
  .mc-chevron { font-size:.8rem; color:var(--text-muted); line-height:1; }
  .mc-catlist { display:flex; flex-direction:column; gap:.4rem; margin:.3rem 0 .5rem; }
  .mc-cat { display:flex; align-items:center; gap:.5rem; font-size:.9rem; cursor:pointer; }
  .mc-cat input { width:18px; height:18px; }
  /* Embedded Tool/PPE Request inside the override forms (Part 4) */
  .mc-linked-forms { display:flex; flex-direction:column; gap:.6rem; margin:.2rem 0 .5rem; }
  .mc-embed { border:1px solid var(--border-soft); border-radius:10px; padding:.6rem .7rem; }
  .mc-embed-q { font-size:.85rem; font-weight:600; margin-bottom:.4rem; }
  .mc-embed-ans { margin-bottom:.2rem; }
  .mc-embed-body { display:flex; flex-direction:column; gap:.2rem; margin-top:.55rem; padding-top:.55rem; border-top:1px dashed var(--border-soft); }
  .mc-embed-title { font-size:.92rem; }
  .mc-embed-desig { flex-wrap:wrap; }
  .mc-embed-photo-preview img { max-width:100%; border-radius:8px; }
  /* "Yes - Select One" picker: the tech's own recent requests of that kind. Reuses the
     .fr-when/.fr-stat text styles from the receipt modal's unlock picker. */
  .mc-embed-pick { margin-top:.55rem; padding-top:.55rem; border-top:1px dashed var(--border-soft); }
  .mc-picks { display:flex; flex-direction:column; gap:.4rem; margin-top:.3rem; }
  .mc-pick { display:flex; flex-direction:column; align-items:flex-start; gap:.1rem; width:100%; text-align:left; padding:.55rem .7rem; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--text); cursor:pointer; font:inherit; }
  .mc-pick:active { transform:translateY(1px); }
  .mc-pick.active { border-color:var(--brand); background:#f0f6ff; }
  /* Supporting photos on the embedded vehicle report (up to 5) */
  .mc-embed-thumbs { display:flex; flex-wrap:wrap; gap:.4rem; margin-top:.4rem; }
  .mc-embed-thumb { position:relative; width:72px; height:72px; border-radius:8px; overflow:hidden; border:1px solid var(--border); }
  .mc-embed-thumb img { width:100%; height:100%; object-fit:contain; }
  .mc-embed-thumb button { position:absolute; top:2px; right:2px; width:20px; height:20px; border-radius:50%; border:0; background:rgba(0,0,0,.6); color:#fff; font-size:14px; line-height:20px; cursor:pointer; padding:0; }
  /* Pager for the All Override Requests + My Requests cards */
  .mc-pager { display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin-top:.75rem; padding-top:.6rem; border-top:1px solid var(--border-soft); }
  .mc-pager .mc-mini:disabled { opacity:.4; cursor:default; }
  .mc-pager .mc-tile-meta { margin-top:0; }
  /* ---- Card Actions row (restyled 2026-08-04, Josh: "buttons are bigger than they need
     to be") ----
     Was the shared `.btn-row`: a single column of 100%-width `.btn`s at .75rem padding, so
     three actions filled most of a phone screen before any content and pushed My Requests
     below the fold. Now a 2-up auto-fit grid of compact buttons.

     Scoped to the module's own classes ONLY. `.btn` / `.btn-row` are shared by every page in the app
     (login, inspect, timesheet, JSA…), so the sizes are overridden here rather than changed
     at source — the same reasoning that keeps the [hidden] fix above local.

     auto-fit + a 9rem floor means two per row on any phone ≥ ~20rem and a single column on
     the narrowest, without a media query. */
  /* Scoped to the CLASS, not to #card-actions. The Request History section (#requests-nav)
     reuses this row for its two side-by-side buttons, and while the rule was id-scoped that
     section got no grid at all — its two full-width .btn anchors simply stacked. `.mc-action-row`
     is module-prefixed, so widening the selector cannot reach another page's markup. */
  .mc-action-row {
    display:grid; grid-template-columns:repeat(auto-fit, minmax(9rem, 1fr));
    /* stretch, not start: "Unlock My Motive Card" wraps to two lines and "Upload Receipt" does
       not, so with `start` the two buttons were different heights and their captions sat at
       different baselines. Stretching the cells and letting each button fill its own cell makes
       both buttons the height of the taller one and lines the captions up. */
    gap:.5rem; margin-top:.75rem; align-items:stretch;
  }
  /* Compact sizing for buttons inside a module action row, wherever that row appears. */
  .mc-action-row .btn {
    padding:.55rem .7rem; font-size:.86rem; border-radius:10px; min-height:0;
  }
  /* Some of these buttons are <a> (they navigate to a page), and an anchor carries a default
     underline that a <button> does not — side by side the two looked like different controls. */
  .mc-action-row a.btn { text-decoration:none; }
  .btn-other-wrap { display:flex; flex-direction:column; gap:.15rem; }
  /* Fill the stretched grid cell, leaving the caption at the bottom. */
  .mc-action-row .btn-other-wrap .btn { flex:1; }
  .btn-caption { font-size:.72rem; line-height:1.25; color:var(--text-muted); text-align:center; }
  /* Secondary actions (Override for a Tech, Spend Dashboard) read as a quieter tier than
     the two things a technician is here to do. Full-width across the grid, and text-sized
     rather than button-sized. */
  .mc-action-links {
    display:flex; flex-wrap:wrap; gap:.35rem 1rem; margin-top:.6rem;
    padding-top:.6rem; border-top:1px solid var(--border-soft);
    /* Centred (Josh, 2026-08-04). Both links are JS-gated, so the row can hold two, one, or
       none — centring keeps whatever survives balanced under the two buttons above instead of
       leaving a lone link hanging off the left edge. */
    justify-content:center;
  }
  .mc-action-link {
    display:inline-flex; align-items:center; gap:.3rem; padding:0; border:0; background:none;
    font:inherit; font-size:.82rem; font-weight:600; color:var(--brand);
    cursor:pointer; text-decoration:none;
  }
  .mc-action-link:hover { text-decoration:underline; }
  .mc-action-link svg { width:15px; height:15px; }
  /* Progressive disclosure in the unlock modal. A step is `hidden` (display:none, so it
     is out of the tab order) until its prerequisite is answered. Because [hidden] above
     is display:none !important, the `on` class must be added on the frame AFTER hidden
     is cleared, or there is no start state to transition FROM and nothing animates —
     see stepShow() in motive-cards.js. */
  .mc-step { opacity:0; transform:translateY(-4px); transition:opacity .22s ease, transform .22s ease; }
  .mc-step.mc-step-on { opacity:1; transform:none; }
  @media (prefers-reduced-motion: reduce) {
    .mc-step { transition:none; }
  }

/* ==========================================================================
   LANDING PAGE FOUNDATION
   Added 2026-08-19 by the lane holding the shared-core lock, so that the other
   landing pages can adopt the anatomy in docs/LANDING-BUTTON-STANDARD.md
   WITHOUT copying 200 lines of page-local CSS into each one. That copying is
   the exact drift the standard exists to stop: .empty-note is currently
   copy-pasted, byte for byte, into 21 pages and defined here zero times.

   EVERY RULE BELOW IS ADDITIVE. Nothing is renamed and nothing is deleted out
   from under a live page. A page <style> block loads AFTER this file, so where
   a page still carries its own copy of one of these rules the page still wins
   and nothing moves. Deleting those local copies is the follow-up work, done
   by whoever holds that page, not from here.
   ========================================================================== */

/* ---- Action row: the bottom margin that was seventeen inline attributes ----
   docs/LANDING-BUTTON-STANDARD.md asked for this by name: .mc-action-row
   carries margin-top and no margin-bottom, because on motive-cards every row
   sits inside a .card whose padding handles it. A row that is a DIRECT CHILD
   of <main> is followed by a .card, and .card has margin-bottom but no
   margin-top, so the row sat flush against the next card. 17 rows work around
   it with style="margin-bottom:0.75rem".

   `main >` is the whole point of the selector. The 8 rows that carry no inline
   margin are all inside a .card and must NOT get one; being direct children is
   exactly what separates the two groups. An inline style also still beats this
   rule, so today this changes nothing. It just means the next page does not
   need the attribute, and the 17 can drop it when their owners are next in. */
main > .mc-action-row { margin-bottom: 0.75rem; }

/* ---- The fifth status pill: .pill.info ----
   Asked for by two lanes across two rounds. Only the lane holding this file may add it, which
   is why it waited; that is the shared-core lock working rather than a delay to apologise for.

   ⚠ ITS FOUR SIBLINGS ARE ~1,500 LINES ABOVE, in the industrial pill section, and this one is
   here because that is where the round that added it was working. A pointer comment sits beside
   them. If a sixth is ever needed, put it with the four and move this one up to join them — do
   not create a third location.

   WHAT IT MEANS, so it does not become "the blue one": IN PROGRESS, or WAITING ON SOMEONE ELSE.
   Not good news (`success`), not bad news (`error`), not something the reader must act on
   (`warn`), and not inert history (`muted`). "Sent for approval" is info; "Approved" is success;
   "Returned" is warn. That distinction is the only reason a fifth variant is worth its bytes.

   Uses the same three-token shape as warn / error / success. `--info-border` did not exist and
   was added with it — see the note in the token block. Deliberately NOT copied from
   `.status-badge.syncing`, which sets its border to `--info-bg` and so renders borderless: that
   is a workaround for the missing token, not a design decision, and it would have made this the
   one coloured pill with no visible edge. */
.pill.info {
  background: var(--info-bg);
  color: var(--info);
  border-color: var(--info-border);
}

/* ---- Empty / sparse state, the quiet one ----
   Promoted VERBATIM from the 21 pages that each carry their own identical copy,
   so promoting it cannot change a pixel on any of them.
   Reads var(--text-muted), the real token (#6b7280). The 21 pages that each carry a
   local copy now read it the same way; they once asked for an undefined "muted" name and
   fell through to a hard-coded backup (a ruling changed: Josh, 2026-09-29).

   .empty-note vs .activity-empty, because both exist and they are not the same:
   .empty-note is a line of muted text where a list would be; .activity-empty is
   a dashed card saying the same thing more loudly. Use .empty-note inside a card
   that already has a heading, .activity-empty when the empty state IS the card. */
.empty-note { color:var(--text-muted); font-size:0.9rem; padding:0.5rem 0; }

/* ---- Known gap 1, closed: .btn-secondary had no disabled state ----
   This file defined .btn-primary:disabled and NOT .btn-secondary:disabled, so a
   disabled secondary button looked identical to a live one. Found while
   converting /timesheets, whose row buttons genuinely disable while a request is
   in flight, and recorded in the standard as a real hole waiting on this lock.

   Matched to .btn-primary:disabled in KIND rather than in colour: primary greys
   its fill, secondary has no fill to grey, so it mutes its text and border. A
   page that needs a different opacity can still target the ELEMENT
   (.editreq-actions button:disabled), which is what timesheets.html does and
   which still wins on specificity. That page is unchanged except that its busy
   buttons now also refuse the cursor. */
.btn-secondary:disabled {
  color: #94a3b8;
  border-color: var(--border-soft);
  background: #f9fafb;
  cursor: not-allowed;
}

/* ---- Known gap 2, closed: there was no shared "working on it" state ----
   Nothing in this file expressed it, so every page did the same thing by hand:
   set `disabled` and rewrite the label in JS. That is why the standard told
   people to ask for this lock rather than add a page-local .btn-loading.

   Set BOTH `disabled` and this class. `disabled` is what actually stops the
   second tap and what assistive technology reads; this class is only the look.
   The label is NOT replaced. A button that keeps its label and dims is
   readable, and swapping the text to "Saving..." is what made every page's
   version different from every other page's. */
.btn.is-busy { opacity: 0.65; cursor: progress; }
.btn.is-busy::after {
  content: "";
  width: 0.85em; height: 0.85em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-busy-spin 0.7s linear infinite;
}
@keyframes btn-busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  /* No spin, but the dimming and the cursor still say it is working. */
  .btn.is-busy::after { animation: none; }
}

/* ---- At-a-glance tracker ----
   "Did I do this?", answered without reading a list. Lifted from the pay-period
   tracker on /timesheets, which stays where it is and keeps winning on its own
   page; this copy is so the next page does not have to reinvent it.

   THE 14-DAY PAY PERIOD IS NOT PART OF THIS. The generic shape is a fixed
   window of cells with ONE state each, and the number of columns is set by the
   page. .pt-wrap below is the 7-column week shape /timesheets uses; a form with
   a different window sets grid-template-columns itself and keeps every cell,
   state and legend rule underneath.

   AND THERE ARE SIX STATES HERE, NOT THE FIVE /timesheets HAS. A timesheet is
   owed every workday, so on that page a blank past day is `missing` and reads
   red-adjacent. NO OTHER FORM IS OWED DAILY. A Good Catch is filed when there is
   one to file, and a tracker that paints an empty Tuesday as a gap accuses a
   technician of missing a form nobody asked for. .pt-cell.na is that sixth
   state: a day in the window on which nothing was owed. It is the state most
   pages will use most of the time, which is why it is here rather than being
   invented six times. */
.pt-wrap { display:grid; grid-template-columns:auto repeat(7, 1fr); gap:0.2rem;
           align-items:center; }
.pt-head { text-align:center; font-size:0.6rem; font-weight:700; letter-spacing:.05em;
           text-transform:uppercase; color:var(--text-muted); padding-bottom:0.15rem; }
/* The row label sits in the gutter column so the day columns stay equal. */
.pt-wk { font-size:0.6rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
         color:var(--text-muted); padding-right:0.3rem; text-align:right; white-space:nowrap; }
.pt-cell { position:relative; display:flex; flex-direction:column; align-items:center;
           justify-content:center; gap:1px; aspect-ratio:1/1; min-height:38px;
           border-radius:9px; border:1px solid var(--border-soft); background:var(--card,#fff);
           font:inherit; padding:0; cursor:default; }
button.pt-cell { cursor:pointer; }
button.pt-cell:active { transform:scale(0.96); }
.pt-day { font-size:0.58rem; font-weight:700; color:var(--text-muted); line-height:1; }
.pt-icon { font-size:0.82rem; line-height:1; font-weight:700; }
/* Done, and accepted. */
.pt-cell.ok { background:#dcfce7; border-color:#86efac; }
.pt-cell.ok .pt-icon, .pt-cell.ok .pt-day { color:#166534; }
/* Filed, still moving through review. */
.pt-cell.pending { background:#fef3c7; border-color:#fcd34d; }
.pt-cell.pending .pt-icon, .pt-cell.pending .pt-day { color:#92400e; }
/* Returned for correction, the one state that needs the technician to act. */
.pt-cell.returned { background:#fee2e2; border-color:#fca5a5; }
.pt-cell.returned .pt-icon, .pt-cell.returned .pt-day { color:#991b1b; }
/* A past day on which something WAS owed and nothing was filed. Only use this
   where the form is genuinely owed on a schedule. */
.pt-cell.missing { background:#f8fafc; border-style:dashed; }
.pt-cell.missing .pt-icon { color:#cbd5e1; }
/* Nothing was owed that day. Quiet, solid, and NOT dashed: dashed is the shape
   the eye reads as a gap, and this is not a gap. */
.pt-cell.na { background:var(--bg,#f8fafc); border-color:var(--border-soft); }
.pt-cell.na .pt-icon, .pt-cell.na .pt-day { color:#cbd5e1; }
/* Today, and days not yet reached. */
.pt-cell.future { background:var(--card,#fff); opacity:0.5; }
.pt-cell.today { box-shadow:0 0 0 2px var(--brand,#2c5282); }
/* Count badge, drawn only when a cell carries more than one record. */
.pt-n { position:absolute; right:-2px; bottom:-2px; min-width:14px; height:14px;
        border-radius:999px; background:var(--brand,#2c5282); color:#fff;
        font-size:0.55rem; font-weight:700; line-height:14px; text-align:center;
        padding:0 3px; }
.pt-legend { display:flex; flex-wrap:wrap; gap:0.5rem; margin-top:0.55rem;
             font-size:0.66rem; color:var(--text-muted); }
.pt-legend span { display:inline-flex; align-items:center; gap:0.25rem; }
.pt-key { width:9px; height:9px; border-radius:3px; border:1px solid var(--border-soft);
          display:inline-block; }

/* ---- Window pager ----
   Arrows either side of the window's title. INCIDENTAL in the anatomy: a form
   with no period worth walking back through does not need one, and adding a
   pager to a list that has no windows is worse than leaving it off.
   44px targets so a thumb hits the arrow and not a cell.
   DISABLED, NEVER HIDDEN, at the ends of the range. An arrow that vanishes
   leaves the header visibly lopsided and makes the technician wonder where the
   control went; a greyed one says "this is as far as it goes", which is the rule. */
.pt-nav { display:flex; align-items:center; gap:0.4rem; margin:0 0 0.7rem; }
.pt-nav h2 { margin:0; font-size:1rem; }
.pt-nav-mid { flex:1 1 auto; min-width:0; text-align:center; }
.pt-nav-sub { font-size:0.74rem; color:var(--text-muted); margin-top:0.1rem; }
.pt-navbtn { flex:0 0 auto; width:44px; height:44px; display:grid; place-items:center;
             border:1px solid var(--border-soft); border-radius:11px; background:var(--card,#fff);
             color:var(--text); cursor:pointer; -webkit-tap-highlight-color:transparent; }
.pt-navbtn svg { width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2.2;
                 stroke-linecap:round; stroke-linejoin:round; }
.pt-navbtn:disabled { opacity:0.32; cursor:default; }
.pt-navbtn:not(:disabled):active { transform:scale(0.94); }

/* ---- Exceptions, ONE card ----
   Everything that wants a tap, whatever feed it came from, in a single
   catch-all list. On /timesheets this replaced six separate cards.

   THE LEFT ACCENT AND THE EYEBROW ARE NOT DECORATION. Merging separate lists
   puts a request to DELETE a record in the same column as a request to change a
   number by a trivial amount, and those had their own cards precisely so the
   heavier one could not be tapped with the attention of the lighter. The accent
   and the spelled-out eyebrow are what carry that difference now, which is why
   the label is words and not left to colour alone.

   THE ACCENTS HERE ARE SEVERITIES, NOT FEED NAMES. /timesheets names its six
   modifiers after its own feeds (.attn-returned, .attn-delreq and the rest) and
   keeps them page-local, which is right: they mean nothing on another form. A
   page adopting this picks the severity that matches what a row is asking for,
   so that "this will destroy something" looks the same on every page in PULSE
   instead of being re-chosen per page. */
.attn-list { display:flex; flex-direction:column; gap:0.6rem; }
.attn-item { display:block; padding:0.65rem 0.8rem 0.75rem; background:var(--card,#fff);
             border:1px solid var(--border-soft,#e8ebef); border-left-width:3px;
             border-left-color:#cbd5e1; border-radius:10px;
             text-decoration:none; color:inherit; }
a.attn-item:hover { border-color:var(--brand,#2c5282); }
/* A row nothing can be pressed on. It explains a lock rather than offering an exit. */
.attn-quiet { opacity:0.7; }
/* Destructive, or otherwise not undoable. The only accent with its own tint. */
.attn-critical { border-left-color:#b91c1c; background:#fffbfb; }
.attn-critical .attn-eyebrow { color:#b91c1c; }
/* Needs the technician to act, and nothing is lost if they do not act today. */
.attn-warn { border-left-color:#f59e0b; }
/* Waiting on someone else, shown so nobody assumes it was forgotten. */
.attn-info { border-left-color:#2563eb; }
/* Housekeeping. Present for completeness, never for urgency. */
.attn-muted { border-left-color:#64748b; }
.attn-eyebrow { font-size:0.62rem; font-weight:700; letter-spacing:.06em;
                text-transform:uppercase; color:var(--text-muted); margin-bottom:0.15rem; }
.attn-head { display:flex; justify-content:space-between; gap:.5rem; align-items:baseline; }
.attn-pill { font-size:.7rem; font-weight:700; padding:2px 8px; border-radius:999px;
             white-space:nowrap; }
.attn-sub { font-size:.8rem; color:var(--text-muted,#6b7280); margin-top:.2rem; }
.attn-note { font-size:.82rem; margin-top:.3rem; }
/* The empty state for the exceptions card, which is a GOOD result and says so.
   Deliberately not .empty-note: "nothing needs you" is worth a green card. */
.attn-done { padding:0.85rem 1rem; background:#f6fbf7; border:1px solid #cbead6;
             border-radius:10px; color:#166534; font-size:0.88rem; text-align:center; }

/* =========================================================================
   JSA TRACKER GRID
   =========================================================================
   The technician-by-day fortnight, drawn by assets/jsa-tracker-grid.js on TWO pages:
   the Tracker tab of /jsa-approval-review, and the whole of /jsa-live since the grid
   replaced its six today-only group cards on 2026-08-21.

   MOVED HERE FROM public/jsa-approval-review.html ON 2026-08-21, page-local until then,
   and it had to move rather than be copied. A second page-local copy is a DEAD copy:
   timesheets.html still carries 18 button rules nothing can reach, and editing the
   shared sheet does not move that page at all. One grid, one set of rules, so the two
   pages cannot drift into meaning different things by the same colour.

   Kept as ONE CONTIGUOUS BLOCK on purpose, so it can be moved or resolved whole.
   ========================================================================= */

/* ---- The tracker tab pair, part 1 of the anatomy ----
   MOVED HERE 2026-08-25, when /jsa-live gained a second tab and became the THIRD page needing
   these three rules. They were byte-identical page-local copies on
   timesheet-approval-review.html and jsa-approval-review.html, and the honest move at three
   consumers is to share rather than to author a third copy - the same reasoning that brought the
   grid frame here on 2026-08-21.

   ⚠️ THE TWO ORIGINAL COPIES ARE STILL IN THOSE PAGES and are now dead: identical to these, later
   in the cascade, so they are computed and then overwritten with themselves. Deleting them is a
   one-line job for each page's owner and is reported rather than done here, because
   jsa-approval-review.html belongs to another lane this round. Until then this is a THREE-copy
   situation that reads as one, which is exactly what `docs/TRACKER-SHELL-DESIGN.md` counted 33 of
   on the timesheet page.

   Tracker LEFT, second tab RIGHT, and the Tracker opens - Josh, 2026-08-03. Nothing here expresses
   that: no `active` state is set in markup on any tracker, so the default lives only in each
   page's JS, which is what assertions (c1) and (c2) of admin/test_tracker_shell.mjs keep true. */
.ts-tabs { display:flex; gap:0.35rem; background:#eef1f4; border-radius:12px; padding:4px; margin-bottom:0.9rem; }
.ts-tab { flex:1; border:0; background:transparent; padding:0.55rem 0.7rem; border-radius:9px;
          font:700 0.86rem inherit; color:var(--text-muted); cursor:pointer; -webkit-tap-highlight-color:transparent; }
.ts-tab.active { background:var(--card,#fff); color:var(--brand-dark); box-shadow:0 1px 2px rgba(15,23,42,0.12); }

.pr-periodbar { display:flex; align-items:center; justify-content:space-between; gap:0.6rem; margin-bottom:0.9rem; }
.pr-periodbar .pr-range { text-align:center; flex:1; }
.pr-periodbar .pr-range-main { font-weight:700; font-size:0.98rem; color:var(--text); }
.pr-periodbar .pr-range-sub { font-size:0.72rem; color:var(--text-muted); margin-top:0.1rem; }
.pr-navbtn { flex:0 0 auto; width:38px; height:38px; border-radius:11px; border:1px solid #e5e9ee;
             background:var(--card,#fff); color:var(--brand); display:grid; place-items:center; cursor:pointer;
             -webkit-tap-highlight-color:transparent; }
.pr-navbtn:hover { background:var(--brand-light); }
.pr-navbtn:disabled { opacity:0.4; cursor:default; }
.pr-navbtn svg { width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }

.pr-controls { display:flex; gap:0.6rem 1rem; flex-wrap:wrap; align-items:center; margin-bottom:0.85rem; }
.pr-seg { display:inline-flex; background:#eef1f4; border-radius:10px; padding:3px; gap:2px; }
.pr-seg-btn { border:0; background:transparent; padding:0.42rem 0.85rem; border-radius:8px; font:600 0.8rem inherit; color:var(--text-muted); cursor:pointer; -webkit-tap-highlight-color:transparent; }
.pr-seg-btn.active { background:var(--card,#fff); color:var(--brand-dark); box-shadow:0 1px 2px rgba(15,23,42,0.12); }

.pr-summary { display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap; margin-bottom:0.8rem; }
.pr-chip { font-size:0.74rem; font-weight:700; padding:0.32rem 0.6rem; border-radius:999px; display:inline-flex; align-items:center; gap:0.35rem; }
.pr-chip .dot { width:9px; height:9px; border-radius:50%; }
.pr-chip.sub { background:#fff6e0; color:#92640a; }
.pr-chip.sub .dot { background:#f5b301; }
.pr-chip.appr { background:#e3f9ee; color:#067a4a; }
.pr-chip.appr .dot { background:#00c875; }
.pr-chip.ret { background:#fee2e2; color:#991b1b; }
.pr-chip.ret .dot { background:#dc2626; }
/* Approved in PULSE but the board copy never landed. Its own chip because a systemic
   push failure has to be visible from the grid, not only inside one cell's modal. */
.pr-chip.offboard { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }
.pr-chip.offboard .dot { background:#991b1b; }
/* Work that was never authorised: a task step is still High after controls. The darkest
   chip on the row, because it is the only one that means somebody is blocked right now. */
.pr-chip.stop { background:#fdf2f8; color:#831843; border:1px solid #f9a8d4; }
.pr-chip.stop .dot { background:#9d174d; }
/* Clocked in with no JSA in PULSE. NOT a compliance finding: PULSE cannot see a paper
   JSA, so this is a prompt to check and is styled as information, never as an error. */
.pr-chip.nojsa { background:#eff6ff; color:#1e40af; border:1px solid #bfdbfe; }
.pr-chip.nojsa .dot { background:#2563eb; }

/* THE GRID IS ITS OWN BOUNDED SCROLL FRAME, ON EVERY TRACKER, AND THAT IS WHAT MAKES THE
   HEADER ROW STAY PUT (Josh, 2026-07-31 for the timesheet page; carried here 2026-08-25).

   🔴 THIS RULE WAS BROKEN FROM THE DAY IT MOVED HERE AND ONE PAGE HID IT. `position:sticky`
   resolves against the nearest scrollport. `overflow-x:auto` alone already made this element
   one - CSS computes overflow-y to auto when the other axis is not visible - but with NO
   HEIGHT CAP it could never scroll vertically, so the `top:0` on `table.pr-grid thead th`
   below had nothing to stick to and the header simply scrolled away with the page. The
   timesheet page carried this exact fix locally, which is why the fault was invisible there
   and live on /jsa-live and the /jsa-approval-review Tracker the whole time. The sticky LEFT
   column always worked, because `overflow-x` gives it a scrollport of its own.

   ⚠ THE VALUE IS THE TIMESHEET PAGE'S, UNCHANGED, and it is the only one this repo has ever
   run in a browser: 12rem is the chrome above the grid on THAT page. It is a cap and not a
   height, so a page with less chrome loses nothing by it - the frame is simply shorter than
   its ceiling. max() keeps a usable grid on a short landscape viewport instead of a 3-row slot.
   A tracker that needs a different allowance overrides this one rule and says why.

   ⚠ `overscroll-behavior:contain` stops the page scrolling on from the end of the grid, so a
   thumb that reaches the last row does not carry the whole document with it. */
.pr-tablewrap { overflow:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
                max-height:max(260px, calc(100dvh - 12rem));
                border:1px solid #e5e9ee; border-radius:14px; background:var(--card,#fff); }
table.pr-grid { border-collapse:separate; border-spacing:0; width:max-content; min-width:100%; font-size:0.78rem; }
table.pr-grid th, table.pr-grid td { padding:0; text-align:center; }
table.pr-grid .pr-name { position:sticky; left:0; z-index:3; background:var(--card,#fff);
                         text-align:left; padding:0.5rem 0.7rem; min-width:148px; max-width:148px;
                         border-right:1px solid #e5e9ee; box-shadow:2px 0 4px -2px rgba(15,23,42,0.12); }
table.pr-grid thead .pr-name { z-index:4; }
table.pr-grid thead th { position:sticky; top:0; z-index:2; background:#f5f7fa; color:var(--text-muted);
                         font-weight:700; padding:0.4rem 0.35rem; border-bottom:1px solid #e5e9ee; white-space:nowrap; }
table.pr-grid thead th.wk-start { border-left:2px solid #d6dee8; }
table.pr-grid .col-dow { font-size:0.62rem; text-transform:uppercase; letter-spacing:0.03em; opacity:0.8; }
table.pr-grid .col-dm { font-family:var(--font-mono); font-size:0.8rem; color:var(--text); }
table.pr-grid td.wk-start { border-left:2px solid #eef1f5; }
table.pr-grid tbody tr:nth-child(even) td { background:#fafbfc; }
table.pr-grid tbody tr:nth-child(even) .pr-name { background:#fafbfc; }
table.pr-grid td.cell { border-bottom:1px solid #f1f3f6; height:40px; min-width:40px; position:relative; }
.pr-cnt { position:absolute; bottom:2px; right:3px; min-width:15px; height:15px; padding:0 3px; background:var(--brand,#2c5282); color:#fff; border-radius:8px; font:700 9px/15px system-ui, sans-serif; text-align:center; pointer-events:none; }
/* THE TOP-RIGHT CORNER MARK. TWO MEANINGS, SO TWO CLASSES (2026-08-25).
   `.pr-star` used to be one class saying two unrelated things: #991b1b here for "approved but
   the board copy never landed", and #dc2626 in timesheet-approval-review.html's own <style>
   for "had delays". Whichever page loaded last was not the question - they never load
   together - but ONE NAME FOR TWO FACTS is how a later reader unifies the colour and silently
   makes one of them lie. Naming them for what they MEAN is the fix; the colours are unchanged
   from what each page already showed, on purpose, because this is a naming repair and not a
   look change. Both live here so the pair cannot drift apart again.
   Geometry is shared: same corner, same size, same pointer-events:none. */
.pr-star-offboard,
.pr-star-delay { position:absolute; top:3px; right:4px; font-size:11px; line-height:1; pointer-events:none; }
/* Approved in PULSE, board copy missing. Drawn by assets/jsa-tracker-grid.js. Same #991b1b as
   the `.pr-chip.offboard` that counts them at the top of the same page. */
.pr-star-offboard { color:#991b1b; }
/* The timesheet day had delays. Drawn by assets/timesheet-approval-review.js. */
.pr-star-delay { color:#dc2626; }
.pr-name .nm { font-weight:600; color:var(--text); line-height:1.15; }
.pr-name .tm { font-size:0.66rem; color:var(--text-muted); margin-top:0.1rem; }

.pr-mark { width:24px; height:24px; border-radius:7px; display:inline-grid; place-items:center; margin:0 auto; cursor:pointer; }
.pr-mark svg { width:15px; height:15px; stroke:#fff; fill:none; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.pr-mark.pending  { background:#f5b301; }
.pr-mark.approved { background:#00c875; }
.pr-mark.returned { background:#dc2626; }
.pr-mark.rejected { background:#64748b; }
/* Stopped: a task step is still High after controls, so briefing is blocked and work did
   not start. Its own mark since 2026-08-21 - it used to draw as amber "awaiting review",
   which described a safety document as a paperwork queue. Deeper than the returned red so
   the two are not confused at a glance. */
.pr-mark.stopped  { background:#9d174d; }
/* Still collecting crew signatures - not a reviewable document yet, so it is faint
   rather than amber; an unfinished JSA is not an unreviewed one. */
.pr-mark.unsigned { background:#f5b301; opacity:0.4; cursor:help; }
/* Clocked in with no JSA in PULSE. THE ONLY OUTLINE MARK ON THE GRID, because it is the
   only cell that is not a document: an absence cannot be tapped and must not look like a
   filing. It is a prompt to check, never a finding - a paper JSA is invisible to PULSE. */
.pr-mark.noJsa { background:transparent; border:2px dashed #2563eb; cursor:help; }
.pr-mark.noJsa svg { stroke:#2563eb; stroke-width:2.2; }
/* A retired-form mark on a page with no v1 sheet to open. Drawn, because the day did have
   a JSA, but plainly not a control. */
.pr-mark.pr-mark-inert { cursor:help; }
.pr-empty { color:#d3d8de; }
/* A deep link landed on this cell (/jsa-live?id=N, the back link from /jsa2-review). */
table.pr-grid td.cell.pr-target { box-shadow:inset 0 0 0 2px var(--brand,#2c5282); border-radius:6px; }

.pr-note { font-size:0.72rem; color:var(--text-muted); margin-top:0.7rem; line-height:1.4; }
.pr-legend { display:flex; gap:1rem; flex-wrap:wrap; font-size:0.74rem; color:var(--text-muted); margin:0.7rem 0 0.2rem; }
.pr-legend span { display:inline-flex; align-items:center; gap:0.35rem; }
.pr-legend .sw { width:13px; height:13px; border-radius:4px; }
/* The legend swatch for the one mark that is an outline rather than a fill. */
.pr-legend .sw-outline { width:13px; height:13px; border-radius:4px; border:2px dashed #2563eb; }
.pr-empty-state { padding:2rem 1rem; text-align:center; color:var(--text-muted); font-size:0.9rem; }

/* Today's column - a gray vertical bar down both sides. Declared AFTER the zebra and
   .wk-start rules on purpose: those set the same properties. */
table.pr-grid thead th.today,
table.pr-grid tbody td.today { border-left:2px solid #9aa5b1; border-right:2px solid #9aa5b1; }
table.pr-grid thead th.today { background:#eef1f4; }
table.pr-grid thead th.today .col-dow,
table.pr-grid thead th.today .col-dm { color:var(--text); font-weight:700; opacity:1; }

@media (max-width: 640px) {
  table.pr-grid .pr-name { min-width:116px; max-width:116px; }
}

/* ---- DESKTOP: FIT THE WHOLE 14-DAY PERIOD IN ONE GRID, ON EVERY TRACKER ----
   Site-wide `main` is 720px with 1rem of padding each side, so 688px of content - 20px short
   of the 148 + 14x40 = 708 the grid needs, and a computer had to scroll sideways to reach the
   last two days. Timesheet-only until 2026-08-25, which is why the two JSA grids scrolled and
   the timesheet one did not.

   ⚠ ONLY `main`'s CAP MOVES. The cell min-widths stay at 40px: they set the table's minimum,
   and raising them would reintroduce sideways scrolling in the 800-870px band where the extra
   width does not exist yet. The table already spends any surplus on the columns
   (`width:max-content; min-width:100%`), so at 1040px each day gets ~57px with no other rule.
   Below 800px there is no width to win and phones keep the horizontal scroll.

   🔴 THREE SEPARATE RULES, NOT ONE SELECTOR LIST, AND THAT IS DELIBERATE. A selector list
   containing a `:has()` a browser does not know is dropped WHOLE, which would take the
   timesheet page's widening down with it on the browser least able to afford it. Split, each
   rule stands or falls alone. */
@media (min-width: 800px) {
  /* The tabbed reference implementation, which toggles the class per tab in
     assets/timesheet-approval-review.js so the Queue keeps its reading width. */
  body.pr-wide main { max-width:1040px; }
  /* /jsa-live: the whole page IS the tracker, so the period bar is a direct child of main and
     there is no tab whose width this could be wrong for. Matched on the anatomy rather than on
     a page name - a second queue-less tracker gets it by being one. */
  main:has(> .pr-periodbar) { max-width:1040px; }
  /* /jsa-approval-review: widen only while the Tracker panel is the one showing, which is the
     same rule `body.pr-wide` expresses on the timesheet page - the Queue and History lists keep
     their reading width. Read off the panel's own `hidden`, so it follows whatever the page's
     tab code does without a second copy of the default living here.
     ⚠ THE TIMESHEET PAGE SATISFIES THIS ONE TOO, and that is left alone rather than excluded:
     its #panel-tracker is also a direct child of main, so it reaches the same 1040px by a second
     route. The two agree in every state - `pr-wide` is toggled on exactly when that panel is the
     visible one - so the redundancy costs nothing and covers the day the class toggle breaks. */
  main:has(> [role="tabpanel"]#panel-tracker:not([hidden])) { max-width:1040px; }
}
/* ===================== end JSA TRACKER GRID ===================== */

/* ---------- Weak Signal chip (weak-signal-works-like-airplane-mode step 1b) ----------
   pulse-net.js puts one .weak-signal-chip in the page's header bar while PULSE is falling back to the phone, and adds
   .has-weak-chip to that header. The header gains a thin band at its bottom edge that holds the chip, so it never sits
   over the header's buttons, the form or the save bar. Gone again after the next fast answer. */
header.has-weak-chip:not(.pulse-shell), .home-topbar.has-weak-chip { position: relative; }
header.has-weak-chip { padding-bottom: 1.45rem; }
header.app-header.pulse-shell.has-weak-chip { padding-bottom: 1.45rem; }
.home-topbar.has-weak-chip { padding-bottom: 1.55rem; }
.weak-signal-chip {
  position: absolute; left: 50%; bottom: 0.25rem; transform: translateX(-50%);
  max-width: calc(100% - 2rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0.05rem 0.6rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 600; line-height: 1.25; letter-spacing: 0.01em;
  background: #fff4d6; color: #6b4a00; border: 1px solid #e6c36a;
  pointer-events: none;
}
