/* Workshop-first styling: large touch targets, high contrast, nothing that needs precision.
   Staff use this standing next to a bike, sometimes with dirty hands and often in bright light. */

:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --line: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #2563eb;
  --accent-press: #1d4ed8;
  --ok: #16a34a;
  --bad: #dc2626;
  --warn: #d97706;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding-top: max(14px, env(safe-area-inset-top));
}

.brand { font-weight: 700; letter-spacing: 0.5px; }
.who { color: var(--muted); font-size: 14px; }

main {
  padding: 20px 18px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
}

h1 { font-size: 22px; margin: 0 0 6px; }

.hint { color: var(--muted); font-size: 15px; margin: 0 0 20px; }

label {
  display: block;
  margin: 16px 0 6px;
  font-size: 14px;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 14px;
  /* 17px, not smaller - iOS and some Android browsers zoom the page when focusing an input
     under 16px, which is jarring mid-task. */
  font-size: 17px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  width: 100%;
  margin-top: 18px;
  padding: 16px;
  font-size: 17px;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  /* 56px min so it stays hittable with a thumb, gloves, or a cracked screen protector. */
  min-height: 56px;
}

button.primary { background: var(--accent); color: #fff; }
button.primary:active { background: var(--accent-press); }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button:disabled { opacity: 0.5; }

.sep {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 16px;
  margin: 16px 0;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row span { color: var(--muted); }
.row strong { text-align: right; word-break: break-word; }

.status {
  margin-top: 20px;
  padding: 14px;
  border-radius: 10px;
  font-size: 15px;
}
.status.ok   { background: rgba(22,163,74,0.15);  border: 1px solid var(--ok);   color: #bbf7d0; }
.status.bad  { background: rgba(220,38,38,0.15);  border: 1px solid var(--bad);  color: #fecaca; }
.status.busy { background: rgba(37,99,235,0.15);  border: 1px solid var(--accent); color: #bfdbfe; }
.status.warn { background: rgba(217,119,6,0.15);  border: 1px solid var(--warn); color: #fed7aa; }

.hidden { display: none; }

/* --- Record list ------------------------------------------------------ */

.item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  min-height: 0;
}

.item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.item-sub { color: var(--muted); font-size: 14px; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 6px;
}
.tag.photos { background: rgba(37,99,235,0.25); color: #bfdbfe; }
.tag.none   { background: rgba(148,163,184,0.2); color: var(--muted); }
.tag.short  { background: rgba(220,38,38,0.25); color: #fecaca; }

/* --- Photos ----------------------------------------------------------- */

.photo {
  margin: 0 0 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.photo img,
.photo video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.photo-meta {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
}

.empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  margin-bottom: 16px;
}

/* --- Checklist --------------------------------------------------------- */

.checklist {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
}

.checklist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.checklist-note { color: var(--muted); font-size: 13px; margin-bottom: 4px; }

/* A whole row is the touch target, not just the tick - somebody holding a phone next to a bike
   should not have to aim. */
.slot {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 12px 4px;
  min-height: 52px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  text-align: left;
}

.slot:active { background: rgba(37,99,235,0.12); }

.slot-tick {
  flex: 0 0 26px;
  font-size: 19px;
  color: var(--muted);
  text-align: center;
}

.slot-done .slot-tick { color: var(--ok); }

/* Done stays legible rather than greyed away: the point of the list is to show at a glance what
   IS captured as much as what is not, and a strikethrough would make the record unreadable. */
.slot-done .slot-name { color: var(--muted); }

.slot-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.slot-name { word-break: break-word; }
.slot-meta { color: var(--muted); font-size: 13px; }

/* --- Caution sheet ----------------------------------------------------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  background: rgba(0,0,0,0.6);
}

/* .hidden is declared further up the file, so on equal specificity this display:flex would win
   and the sheet would be permanently on screen. Two classes beats one. */
.sheet.hidden { display: none; }

.sheet-panel {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 22px 18px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
}

.sheet-panel h2 { font-size: 19px; margin: 0 0 6px; }

.cautions {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 15px;
}

.cautions li { margin-bottom: 10px; }
.cautions strong { color: var(--text); }
