/*
 * Quest Watersports house style. Tokens, type and component shapes are taken
 * from the winter services quote page and staff console so the two apps look
 * like one shop — copied deliberately, never imported: this project shares no
 * code with that repo.
 */
:root {
  --navy: #14293e;
  --navy-2: #1d3a57;
  --navy-deep: #0c1b2a;
  --ice: #ebf1f6;
  --frost: #4a81a6;
  --frost-soft: #d8e6ef;
  --gold: #00388e;
  --gold-soft: #e8f0fb;
  --paper: #fdfcf7;
  --ink: #1d2b38;
  --muted: #5c7185;
  --line: #c7d5e0;
  --green: #1e6b3a;
  --green-bg: #e2f1e7;
  --warn: #a6541f;
  --warn-bg: #fbeee2;
  /* A real red, kept apart from --warn. --warn is the burnt orange on a form
     field that still needs filling in — routine, and everywhere. This one is
     only ever the job alert, so it has to read as a different kind of thing
     from across a workshop. */
  --alert: #b3261e;
  --alert-dark: #8c1d18;
  --alert-bg: #fdecea;
  --radius: 12px;
  --disp: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  --body: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  background: var(--ice);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
}

a { color: var(--frost); }
a:hover { color: var(--navy); }

h1, h2, h3 { margin: 0; }

/* ------------------------------------------------------------- topbar --- */
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  box-shadow: 0 2px 10px rgba(20, 41, 62, 0.25);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 3px solid var(--gold);
}
.topbar .mark {
  height: 34px;
  width: auto;
  background: #fff;
  border-radius: 7px;
  padding: 3px 6px;
}
.topbar .ttl {
  font-family: var(--disp);
  font-weight: 700;
  letter-spacing: 0.07em;
  font-size: 19px;
  text-transform: uppercase;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar .ttl small {
  display: block;
  font-family: var(--body);
  font-weight: 400;
  color: #9fc3dc;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topbar .spacer { flex: 1; }
.topbar nav { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbtn {
  background: none;
  border: 1px solid #2c4e73;
  color: #b9cddd;
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 13px;
  font-family: var(--body);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.linkbtn:hover { background: var(--navy-2); color: #fff; }
.linkbtn.on { background: var(--navy-2); color: #fff; border-color: var(--frost); }
@media (max-width: 620px) {
  .topbar { padding: 10px 12px; gap: 10px; }
  .topbar .ttl { font-size: 16px; }
  .topbar .ttl small { display: none; }
}

/* ------------------------------------------------------------- layout --- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 22px 16px 72px; }
.wrap.narrow { max-width: 680px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.tight { gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* The open job. Even columns rather than 5/7: the left side is all form
   fields and the extra width takes lines off every one of them, which is
   half of what was making that column run so far past the other. The other
   half was which cards were in it — see the job page. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .split, .grid2 { grid-template-columns: 1fr; } }

.page-title {
  font-family: var(--disp);
  font-size: 34px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--navy);
  line-height: 1.05;
}
.lead { color: var(--muted); margin: 6px 0 18px; max-width: 62ch; }

/* --------------------------------------------------------------- card --- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(20, 41, 62, 0.06);
}
.card h2 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--frost);
  font-weight: 700;
}
.card.flat { box-shadow: none; }
.card.gold { border-color: var(--gold); background: var(--gold-soft); }

/* Documents on a job. The badge leads each row because which kind it is
   matters more than what it is called. */
.filelist { margin: 4px 0 14px; }
.filerow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ice);
  font-size: 14px;
}
.filerow:last-child { border-bottom: 0; }
.filerow .grow { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.filerow button {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  flex: none;
}
.filerow button:hover { color: var(--alert); }
.filerow .filesize {
  flex: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Re-stamping a work order that is already in the system. Set apart from the
   links above it: everything else on that card reads the paperwork, this one
   replaces it. */
.restamp {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ice);
}
.restamp input[type="file"] { font-size: 13.5px; max-width: 100%; }

/* Status chips on the left, the order on the right; they stack rather than
   crush each other on a narrow counter iPad. */
.filterbar { justify-content: space-between; align-items: center; gap: 12px; }
.sortby {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.sortby select {
  font-family: inherit;
  font-size: 14px;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
}

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile {
  display: block;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(20, 41, 62, 0.06);
}
.tile:hover { border-color: var(--frost); box-shadow: 0 3px 12px rgba(20, 41, 62, 0.14); }
.tile b { display: block; font-size: 15px; color: var(--navy); margin-bottom: 5px; }
.tile span { display: block; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ------------------------------------------------------------ buttons --- */
.btn {
  font-family: var(--body);
  border: 0;
  border-radius: 11px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.2;
}
.btn.navy { background: var(--gold); color: #fff; }
.btn.navy:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); color: #fff; }
.btn.gold:hover { filter: brightness(1.06); }
.btn.green { background: var(--green); color: #fff; }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.ghost:hover { background: var(--ice); }
.btn.danger { background: #fff; color: var(--warn); border: 1.5px solid var(--warn); }
.btn.red { background: var(--alert); color: #fff; }
.btn.red:hover { background: var(--alert-dark); }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn.big { padding: 18px 24px; font-size: 19px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ------------------------------------------------------------- fields --- */
label.fld {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 12px 0 4px;
  font-weight: 700;
}
input.txt, select.txt, textarea.txt {
  width: 100%;
  padding: 12px 13px;
  font-size: 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: var(--body);
  background: #fff;
  color: var(--ink);
}
input.txt:focus, select.txt:focus, textarea.txt:focus {
  outline: 2px solid var(--frost);
  border-color: var(--frost);
}
textarea.txt { display: block; line-height: 1.5; resize: vertical; min-height: 96px; }
input.txt.mono { font-family: var(--mono); letter-spacing: 0.04em; }
.field-flag {
  border-color: var(--warn) !important;
  background: #fef7f1;
}
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* -------------------------------------------------------------- pills --- */
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.pill.blue { background: #e2ecf4; color: var(--frost); }
.pill.frost { background: var(--frost-soft); color: var(--navy); }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.red { background: var(--warn-bg); color: var(--warn); }
.pill.grey { background: var(--ice); color: var(--muted); }

.msg { font-size: 14px; margin-top: 10px; min-height: 18px; }
.msg.ok { color: var(--green); font-weight: 700; }
.msg.err { color: var(--warn); font-weight: 700; }
/* Not a failure — something true about what the customer is going to get,
   which is worth reading before pressing send. */
.msg.note {
  color: #8a6516;
  background: var(--gold-soft);
  border-radius: 8px;
  padding: 9px 11px;
  line-height: 1.45;
}
.banner {
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.45;
  border: 1.5px solid var(--line);
  background: #fff;
}
.banner.warn { background: var(--warn-bg); border-color: #e4b48f; color: var(--warn); font-weight: 600; }
.banner.info { background: #f4f9fc; border-color: var(--frost); color: var(--ink); }
.banner.ok { background: var(--green-bg); border-color: #a9d3b9; color: var(--green); }

/* Filter chips. Their own class rather than a restyled .linkbtn: the navy
   bar's buttons and a filter row on a light page want opposite contrast. */
.chip {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--navy);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}
.chip:hover { border-color: var(--frost); color: var(--navy); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* --------------------------------------------------------------- list --- */
.joblist { display: flex; flex-direction: column; gap: 10px; }
.jobrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  text-decoration: none;
  color: inherit;
}
.jobrow:hover { border-color: var(--frost); box-shadow: 0 2px 10px rgba(20, 41, 62, 0.1); }
.jobrow .num { font-family: var(--mono); font-weight: 600; color: var(--navy); font-size: 15px; }
.jobrow .who { font-weight: 600; }
.jobrow .sub { font-size: 13px; color: var(--muted); }
/* A basis, not 0: with `flex: 1` the name column was handed whatever the id
   block and the pills left over, which on a phone is nothing at all — and
   `overflow: hidden` then erased the customer's name entirely. A real basis
   makes the row wrap the pills onto their own line instead. */
.jobrow .grow { flex: 1 1 190px; min-width: 0; }
.jobrow .grow > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobrow .jobmeta { flex: 0 1 auto; margin-left: auto; justify-content: flex-end; }

.kv { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: 14.5px; border-bottom: 1px dashed var(--ice); }
.kv:last-child { border: 0; }
.kv .k { color: var(--muted); }
.kv b { text-align: right; color: var(--navy); overflow-wrap: anywhere; }

.hourstotal {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  margin-bottom: 8px;
}
/* The same figure as a decimal, because BiT will not take "2h 30m". */
.forbit {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin: -4px 0 10px;
}
.dim { color: var(--muted); font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 620px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #fafcfe; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; text-align: center; text-decoration: none; }
.stat .v { font-family: var(--mono); font-weight: 700; font-size: 19px; color: var(--navy); }
.stat .k { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }

/* --------------------------------------------------------------- feed --- */
.feed { display: flex; flex-direction: column; gap: 12px; }
.entry {
  border: 1px solid var(--line);
  border-left: 4px solid var(--frost);
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
}
.entry.customer_note { border-left-color: var(--green); }
.entry.internal_note { border-left-color: var(--frost); }
.entry.labor { border-left-color: var(--navy); background: #fafcfe; }
.entry.part { border-left-color: var(--gold); background: #fffdf8; }
/* An entry the phone has put in the feed but the backend has not confirmed.
   Faded rather than hidden: the mechanic can carry on with the next one and
   still see where this got to. */
.entry.saving { opacity: .72; }
.entry.failed { border-left-color: var(--alert); background: #fff6f5; opacity: 1; }
.entry .savestate {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.entry .savestate.bad { color: var(--alert); }
.entry .savestate button {
  margin-left: 8px;
  border: 1px solid var(--alert);
  background: #fff;
  color: var(--alert);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
}
.entry .meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.entry .body { font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry .body.pending { color: var(--muted); font-style: italic; }
/* The words off a recording, kept visibly apart from what somebody typed:
   this is a machine's guess at what was said, and the shop is meant to read
   it as one. */
.entry .body.said {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 3px solid var(--ice);
  color: #3c5a70;
}
.entry .body.said .saidtag {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.entry .partline { font-family: var(--mono); font-size: 14px; color: var(--navy); font-weight: 600; }
.entry .hoursline {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--navy);
  font-weight: 600;
  margin-bottom: 4px;
}
.photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photos a { display: block; }
.photos img {
  width: 116px;
  height: 116px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--ice);
}
/* Move and delete on a log entry. The log is read many times a day and
   corrected rarely, so these sit quiet until somebody looks for them. */
.entryfix { margin-top: 10px; display: flex; gap: 14px; flex-wrap: wrap; }
.entryfix > button {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
.entryfix > button:hover { color: var(--navy); }
.entryfix > button[data-del]:hover { color: var(--alert); }
.entryfix .fld { margin-top: 0; }

.entry audio { width: 100%; margin-top: 10px; }
/* A voice note links out to Drive rather than embedding a player: the shop
   reads the transcript, and the recording is a fallback worth one click. */
.audiorow { margin-top: 10px; }
.audiorow a { display: inline-block; font-size: 13px; }

.empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 26px 10px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* ------------------------------------------------------------ tracker --- */
.tracker-head {
  background: #fff;
  border-bottom: 4px solid var(--gold);
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(20, 41, 62, 0.08);
}
.tracker-head .inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.tracker-head img { height: 46px; width: auto; }
.tracker-head .co {
  font-family: var(--disp);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
}
.tracker-head .sub { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }

.steps { display: flex; gap: 6px; margin: 4px 0 18px; }
.steps .step { flex: 1; text-align: center; }
.steps .bar { height: 7px; border-radius: 99px; background: var(--line); }
.steps .step.on .bar { background: var(--navy); }
.steps .step.here .bar { background: var(--gold); }
.steps .lab {
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 700;
}
.steps .step.here .lab { color: var(--gold); }
.steps .step.on .lab { color: var(--navy); }

.status-hero {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 24px;
}
.status-hero .h {
  font-family: var(--disp);
  font-size: 32px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.05;
}
.status-hero .d { color: #cfe0ec; margin-top: 6px; font-size: 15px; }

/* -------------------------------------------------------------- mech --- */
.mech-body { background: var(--navy-deep); }
.mech {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--navy-deep);
  color: #fff;
}
.mech .mech-top {
  padding: 14px 16px;
  border-bottom: 1px solid #22405f;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mech .mech-top .t {
  font-family: var(--disp);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 20px;
}
.mech .mech-top .who { font-size: 12px; color: #9fc3dc; }
/* The wordmark takes the slack, which puts Home hard against the right edge
   and leaves Back at the left whether or not it is showing. */
.mech .mech-top .topname { flex: 1; min-width: 0; }
.mech .mech-top .navbtn {
  flex: none;
  background: none;
  border: 1.5px solid #3d6285;
  border-radius: 9px;
  color: #fff;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mech .mech-top .navbtn:active { background: #22405f; }
.mech .mech-top .navbtn[hidden] { display: none; }
/* At the narrow end the wordmark is the first thing to go: a mechanic knows
   which app they are holding, and the two ways out matter more. */
@media (max-width: 400px) {
  .mech .mech-top .t { font-size: 17px; }
  .mech .mech-top { gap: 8px; padding: 12px; }
}
@media (max-width: 340px) {
  .mech .mech-top .topname { display: none; }
}
/* A save in flight, said where nobody can miss it.
   Sticky rather than fixed: it holds under the header while the mechanic
   scrolls the log, and takes no room from the form when there is nothing
   saving. It never covers the page or blocks a tap — the whole point of an
   optimistic save is that the next entry can be typed while this one goes. */
.mech .saving {
  position: sticky;
  top: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 16px;
  background: var(--frost-soft);
  color: var(--navy);
  font-size: 14.5px;
  font-weight: 600;
  border-bottom: 1px solid #b6ccdd;
}
.mech .saving[hidden] { display: none; }
.mech .saving .spinner { border-color: #b6ccdd; border-top-color: var(--navy); flex: none; }
/* Tapped Back or Home with a save still going. Same information, turned up:
   the answer to "why did nothing happen" has to be at the button. */
.mech .saving.holding {
  background: var(--alert);
  color: #fff;
  border-bottom-color: var(--alert);
}
.mech .saving.holding .spinner { border-color: rgba(255, 255, 255, 0.4); border-top-color: #fff; }

/* Notes from an earlier session that never reached the backend. Amber, not
   red: nothing is lost — it is on the phone — but somebody has to know. */
.mech .outstanding {
  position: sticky;
  top: 0;
  z-index: 149;
  background: var(--warn-bg);
  color: var(--warn);
  border-bottom: 1px solid #e0bb92;
  padding: 10px 14px;
  font-size: 14px;
}
.mech .outstanding[hidden] { display: none; }
.mech .outstanding .outrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 3px 0;
}
.mech .outstanding .outrow .grow { flex: 1 1 200px; min-width: 0; font-weight: 600; }
.mech .outstanding button {
  flex: none;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid var(--warn);
  background: #fff;
  color: var(--warn);
  border-radius: 9px;
  padding: 7px 11px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mech .outstanding button.drop { border-color: #c8ad90; color: var(--muted); }

.mech main { flex: 1; padding: 16px; max-width: 680px; width: 100%; margin: 0 auto; }
.mech .card { background: #fff; color: var(--ink); }
.mech a { color: #9fc3dc; }

.scanner {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 60vh;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #22405f;
}
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .reticle {
  position: absolute;
  inset: 14% 10%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
}
.scanner .hintline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 3px #000;
}

/* Sign-in: the roster as tap targets, sized for a gloved hand on an iPad. */
/* A tab holding something not yet saved. Small and on the corner: it says
   "this has your part number in it", not "look at me". */
.segmented button.filled::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.segmented button { position: relative; }

.namegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.namegrid button {
  font-family: var(--body);
  font-size: 18px;
  font-weight: 700;
  padding: 18px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  min-height: 60px;
}
.namegrid button:active { background: var(--frost-soft); border-color: var(--navy); }
.namegrid button:disabled { opacity: 0.5; }

.checkline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--ice);
  font-size: 14.5px;
  cursor: pointer;
}
.checkline input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--navy); flex: none; }
.checkline small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.checkline input:disabled { opacity: 0.45; }

/* One payment on the record-a-payment form. Several of these stack, and each
   is its own thing rather than more boxes in one long form, so the rule is
   what says where one payment ends and the next begins. */
.payline + .payline {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

/* Hours and minutes, side by side. Two boxes with their units under them
   beats one decimal box: nobody has to work out what .35 of an hour is, and
   the numeric keypad comes up on a phone for both. */
.hm { display: flex; gap: 10px; }
.hm > div { flex: 1 1 0; min-width: 0; }
.hm input { width: 100%; text-align: center; font-size: 20px; padding: 12px 4px; }

/* Minus, the number, plus. Sized for a thumb in a shop rather than a mouse:
   44px is the smallest target that is reliably hittable, and these get pressed
   with wet or gloved hands. */
.stepper { display: flex; align-items: stretch; gap: 6px; }
.stepper input { flex: 1 1 0; min-width: 0; }
.stepper button {
  flex: none;
  width: 44px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* A long press on a repeated tap otherwise selects the glyph and pops the
     copy/paste bubble over the field. */
  user-select: none;
}
.stepper button:active { background: var(--frost-soft); border-color: var(--frost); }
.hm span {
  display: block;
  margin-top: 4px;
  text-align: center;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Quick amounts — most jobs are logged in quarter-hour steps. */
.hourchips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.hourchips button {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
}
.hourchips button:active { background: var(--frost-soft); }

.segmented { display: flex; border: 1.5px solid var(--navy); border-radius: 11px; overflow: hidden; }
.segmented button {
  flex: 1;
  border: 0;
  background: #fff;
  color: var(--navy);
  padding: 12px 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--body);
}
.segmented button + button { border-left: 1.5px solid var(--navy); }
.segmented button.on { background: var(--navy); color: #fff; }

.reclevel { height: 8px; background: var(--ice); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.reclevel i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.1s linear; }

.thumbrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbrow figure { margin: 0; position: relative; }
.thumbrow img { width: 78px; height: 78px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }
.thumbrow button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--warn);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media print {
  .topbar, .btn, .linkbtn { display: none !important; }
  body { background: #fff; }
}

/* ------------------------------------------------------- static pages --- */
/* Added when the app moved from a Node server to static pages plus Apps
   Script: a few things the React version got from its framework. */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120%);
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(20, 41, 62, 0.3);
  transition: transform 0.25s ease;
  z-index: 200;
  max-width: 90vw;
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.hidden { display: none !important; }

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid var(--frost-soft);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  .toast { transition: none; }
}

.loading { color: var(--muted); font-style: italic; padding: 20px 0; }

/* A photo opened from a feed. */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(12, 27, 42, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox button {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #fff;
  border: 0;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
  color: var(--navy);
}

/* A popup preview of what is about to be mailed — the email itself, rendered
   in an iframe so its own table-based styling never fights this page's. */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 27, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}
.modal-card {
  background: #fff;
  border-radius: 14px;
  max-width: 720px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(12, 27, 42, 0.35);
  overflow: hidden;
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.modal-head button {
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 4px;
}
.modal-body { background: #EBF1F6; overflow: hidden; }
.modal-body iframe { width: 100%; height: 62vh; border: 0; display: block; }
/* The writer's note under the preview, as in the winter console: it goes in
   the email under "Hi name,", and the preview above redraws to show it. */
.modal-card.composing .modal-body iframe { height: 46vh; }
.modal-note { padding: 12px 20px 0; border-top: 1px solid var(--line); }
.modal-note textarea { width: 100%; }
.modal-note .hint { min-height: 1.2em; margin: 4px 0 0; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* The intake flow's three stages share one card. */
.stage { display: none; }
.stage.on { display: block; }

.dropzone {
  border: 2px dashed var(--frost);
  border-radius: 12px;
  background: #f4f9fc;
  padding: 26px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}
.dropzone.hot { background: #e2ecf4; border-color: var(--navy); }
.dropzone b { color: var(--navy); display: block; margin-bottom: 4px; }

/* ------------------------------------------------------------- parts --- */
.partlist { display: flex; flex-direction: column; gap: 10px; }
.partrow {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  background: #fff;
}
.partrow .sub { font-size: 13px; color: var(--muted); }
.partrow input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--navy); vertical-align: -3px; margin-right: 6px; }
.partrow .txt { font-size: 14px; padding: 8px 10px; }


/* ------------------------------------------------------------- alerts --- */
/* The job alert. One per job, set by the service writer, and the loudest
   thing on either screen — it is for "do not start this boat", not for
   ordinary notes. The mechanic's copy is deliberately not dismissible: it
   comes down when the office takes it down, not when the floor taps it away. */
.alertbanner {
  background: var(--alert);
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(179, 38, 30, 0.3);
}
.alertbanner .tag {
  font-family: var(--disp);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  opacity: .95;
}
.alertbanner .msg { font-size: 17px; line-height: 1.45; font-weight: 600; }
.alertbanner .when { font-size: 12.5px; opacity: .85; margin-top: 6px; }

/* The writer's side: the same message, in the card that sets it. */
.card.alerting { border-color: var(--alert); border-width: 1.5px; }
/* Two things in one card — an alert and an ordinary note — kept apart without
   spending a second card on it. The job page has a left column that runs long
   already. */
.subhead {
  font-family: var(--disp);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: 15px;
  font-weight: 600;
  color: var(--frost);
  margin: 18px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--ice);
}
.alertbox {
  background: var(--alert-bg);
  border-left: 4px solid var(--alert);
  border-radius: 8px;
  padding: 11px 13px;
}
.alertbox-tag {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
  color: var(--alert);
  margin-bottom: 4px;
}
.alertbox-text { color: var(--ink); font-size: 15.5px; line-height: 1.45; font-weight: 600; }
.alertbox-when { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* On a job in the open-jobs list, before it has even been opened. */
.joblist.flagged { border-color: var(--alert); background: #fff6f5; }
.alertflag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--alert);
  color: #fff;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
/* A job the office sent back to the floor on purpose — the customer added work
   when called to collect. Orange, so it is never mistaken for the red alert
   (which says "do not start") or the gold storage tag: this one says "this is
   not a mistake, there is more to do". Comes down by itself at Work finished. */
.reopenbanner {
  background: var(--warn);
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(166, 84, 31, 0.3);
}
.reopenbanner .tag {
  font-family: var(--disp);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 5px;
}
.reopenbanner .msg { font-size: 17px; line-height: 1.45; font-weight: 600; }
.reopenbanner .when { font-size: 12.5px; opacity: .9; margin-top: 6px; }
.joblist.reopened { border-color: var(--warn); background: var(--warn-bg); }
.reopenflag {
  display: inline-block;
  background: var(--warn);
  color: #fff;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.reopenbox {
  background: var(--warn-bg);
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  padding: 11px 13px;
  margin-bottom: 12px;
}
.reopenbox-tag {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
  color: var(--warn);
  margin-bottom: 4px;
}
.reopenbox-text { color: var(--ink); font-size: 15.5px; line-height: 1.45; font-weight: 600; }

/* Winterization still to do on a winter unit. Deliberately not .alertflag:
   the alert is what the office typed and is red; this is worked out from the
   ticks and is navy on frost, so the two are never mistaken for each other
   and neither hides the other. */
.winterpill {
  display: inline-block;
  background: var(--frost-soft);
  color: var(--navy);
  border-left: 4px solid var(--navy);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 13px;
  font-weight: 700;
}


/* Where the unit is being stored, for the tag the mechanic puts on it. Gold,
   so it is neither the red alert nor the navy winterize pill — three
   different things a mechanic reads at a glance, never one colour for two. */
.storetag {
  display: inline-block;
  background: var(--gold-soft);
  color: var(--ink);
  border: 1.5px solid var(--gold);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 13px;
  font-weight: 700;
}
.storetag.none { background: #fff; border-color: var(--muted); color: var(--muted); }
.storebox {
  background: var(--gold-soft);
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
  color: var(--ink);
}
.storebox.none { background: #fff; border-color: var(--muted); }
.storebox .big { font-size: 19px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }


/* -------------------------------------------------------------- props --- */
/* A prop that has left the building. The tag photo is the whole identity, so
   it leads the row — a prop has no part number to read instead. */
.proplist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.proprow {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.proprow img, .proprow .notag, .proprow a {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 7px;
  object-fit: cover;
  overflow: hidden;
  background: var(--ice);
  font-size: 9px;
  line-height: 1.15;
  color: var(--muted);
  text-decoration: none;
}
.proprow a img { width: 100%; height: 100%; }
.proprow .notag {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 9.5px;
  line-height: 1.25;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.proprow .grow { flex: 1 1 auto; min-width: 0; }
.proprow .who { font-weight: 600; color: var(--navy); font-size: 15px; }
.proprow .sub { font-size: 13px; color: var(--muted); }

/* The writer's side: the tag photo leads the row, big enough to read a
   handwritten name off without opening it.
   The tight font and the clipping are not decoration. When Drive does not
   serve the image — a hiccup, a permission, a preview server with no Drive
   behind it at all — the browser falls back to rendering the alt text, and at
   inherited link size that is three lines of blue that shove the prop's own
   details out of the row. Boxed and shrunk, a missing photo stays a small
   grey square and the row still reads. */
.tagshot {
  flex: none;
  display: block;
  width: 62px;
  height: 62px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--ice);
  font-size: 9px;
  line-height: 1.15;
  color: var(--muted);
  text-decoration: none;
}
.tagshot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tagshot.notag {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--ice);
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px;
}


/* ------------------------------------------------------- archive table --- */
/* The one real table in the app. Everything else here is a list of cards,
   because everything else is read one item at a time — but the archive is
   read by scanning down a column looking for a supplier or a name, which is
   what a table is for. */
.tablewrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table.grid { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.grid th, table.grid td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ice);
  vertical-align: top;
}
table.grid thead th { border-bottom: 1.5px solid var(--line); padding: 0; white-space: nowrap; }
/* The header is a button, not a th with a click handler: sorting a column is
   an action, and it should be reachable by keyboard like every other one. */
table.grid thead th button {
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--disp);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--frost);
}
table.grid thead th button:hover { color: var(--navy); background: var(--ice); }
table.grid thead th.on button { color: var(--navy); }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover { background: #f8fbfd; }
table.grid td.mono { font-family: var(--mono); font-size: 13.5px; }
table.grid .sub { font-size: 12.5px; color: var(--muted); }

/* The way out of a half-updated app: quiet, always there, never in the way. */
.mech-foot { text-align: center; margin: 22px 0 8px; }
.mech-foot button {
  background: none;
  border: 0;
  color: #6f93ad;
  font-family: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 12px;
}
.mech-foot button:disabled { opacity: .6; text-decoration: none; }
/* How long the last call took. Quiet enough to ignore, there when asked. */
.mech-foot #timing { display: block; color: #52738c; font-size: 12px; margin-top: 2px; }
.mech-foot #timing:empty { display: none; }

/* What is already on a job's ticket, above the box that adds to it. */
.ticketparts { margin-bottom: 14px; }
.ticketparts .kv { align-items: baseline; }

/* ------------------------------------------ the invoice a customer is texted --- */
/* An h2 inside a card is a section label everywhere else in this app — small,
   spaced out, in frost blue. On /i/ the first one is the whole point of the
   page, and the only thing the customer reads before deciding whether to pay
   it, so it gets the display face at a size worth reading on a phone. The
   cards below it still want the label. */
/* Named with .card in front of it because `.card h2` would otherwise win on
   specificity and this would quietly do nothing. */
.card h2.invoice-headline {
  font-family: var(--disp);
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--navy);
  margin: 0 0 8px;
}

/* The ticks on the Done and Archived lists. The box sits beside the row, not
   inside it: the row is a link, and a tick must not open the job. */
.pickbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.pickbar .pickall { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.pickbar .sub { font-size: 13px; color: var(--muted); flex: 1 1 auto; }
.pickbar input, .pickrow > input { width: 20px; height: 20px; accent-color: var(--navy); cursor: pointer; }
.pickrow { display: flex; align-items: center; gap: 10px; }
.pickrow > .jobrow { flex: 1 1 auto; min-width: 0; }

/* ------------------------------------------------ walk-in winterize --- */
/* The winterize checklist form (intake and job page) and its summary. */
.winterform { margin-top: 8px; }
.wf-level { flex: 1; min-width: 220px; display: flex; gap: 8px; align-items: flex-start;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; }
.wf-level input { width: 20px; height: 20px; accent-color: var(--navy); flex: none; }
.wf-level small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; font-weight: 400; }
.wf-level:has(input:checked) { border-color: var(--navy); background: var(--ice); }
.wf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.wf-item { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.wf-item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--navy); flex: none; }
.wf-item .wf-qty { width: 64px; padding: 4px 6px; margin-left: auto; }
.wf-list { list-style: none; padding: 0; margin: 0; }
.wf-list li { padding: 5px 0; border-bottom: 1px solid var(--ice); font-size: 14px; }
.wf-list li.done { color: var(--green); }
.wf-list li small { display: block; color: var(--muted); font-size: 12px; }

/* The walk-in winterize card on a job: the level's steps, and the engine
   prompt when the customer did not know. The prompt is gold and boxed — it is
   a question waiting on the mechanic, not a warning. */
.wsteps { background: var(--ice); border-left: 4px solid var(--navy); border-radius: 6px;
  padding: 8px 10px; font-size: 14px; line-height: 1.45; color: var(--ink); }
.enginepick { margin-top: 10px; background: var(--gold-soft); border: 2px solid var(--gold);
  border-radius: 10px; padding: 10px 12px; color: var(--ink); }
.enginepick .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.enginepick.nudge { outline: 3px solid var(--gold); outline-offset: 2px; }
