/* E-70 receipts + E-86 existing-damage photo, and the office view.
   Built from web/near-miss.css's rules (tokens.css only - NO PER-SCREEN
   COLOUR; colour never carries meaning alone; --tap is the floor for every
   target, --tap-primary for the one primary action). Wet gloves, 6 AM. */


/* The hidden attribute wins over every display rule below (the DVIR lesson,
   2026-09-25): a hidden control must never quietly appear. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: var(--sp-2);
  background: var(--c-bg);
  color: var(--c-text);
  font: var(--fw-body) var(--fs-body)/var(--lh-body) var(--font-ui);
}

h1 {
  font-size: var(--fs-head);
  font-weight: var(--fw-head);
  line-height: var(--lh-tight);
  margin: 0 0 var(--sp-2) 0;
  padding-bottom: var(--sp-1);
  border-bottom: var(--bw-rule) solid var(--c-rule);
}

h2, .label {
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  color: var(--c-text-2);
  margin: var(--sp-3) 0 var(--sp-1) 0;
}

p { margin: 0 0 var(--sp-1) 0; }
.muted { color: var(--c-text-2); }
.big { font-size: var(--fs-head); font-weight: var(--fw-label); }

button,
a.primary {
  display: block;
  width: 100%;
  min-height: var(--tap);
  margin-bottom: var(--tap-gap);
  padding: 12px;
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  text-align: center;
  text-decoration: none;
  border: var(--bw) solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg);
  color: var(--c-text);
}

button.primary,
a.primary {
  min-height: var(--tap-primary);
  border-color: var(--c-accent);
  background: var(--c-accent);
  color: var(--c-on-accent);
  font-weight: var(--fw-head);
}

.choices { margin-bottom: var(--sp-2); }

button.chosen {
  background: var(--c-text);
  color: var(--c-bg);
  border-color: var(--c-text);
  font-weight: var(--fw-head);
}

/* The language pair sits side by side; each is still a full-height target. */
.lang { display: flex; gap: var(--tap-gap); }
.lang button { flex: 1 1 0; }

input, textarea, select {
  display: block;
  width: 100%;
  min-height: var(--tap);
  margin-bottom: var(--sp-2);
  padding: 12px;
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  font-weight: var(--fw-label);
  border: var(--bw) solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg);
  color: var(--c-text);
}

textarea { min-height: calc(var(--tap) * 2); }

label {
  display: block;
  margin-bottom: var(--sp-1);
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  color: var(--c-text-2);
}

/* A picked witness: his name and B-number on the left, Take off on the
   right - still a full-height target. */
.witness {
  display: flex;
  align-items: center;
  gap: var(--tap-gap);
  margin-bottom: var(--tap-gap);
}
.witness span { flex: 1 1 auto; font-weight: var(--fw-label); }
.witness button { flex: 0 0 auto; width: auto; margin: 0; }

img.photo {
  display: block;
  max-width: 100%;
  margin-bottom: var(--sp-2);
  border: var(--bw) solid var(--c-border);
  border-radius: var(--radius);
}

.alert,
.banner {
  padding: var(--sp-1);
  margin-bottom: var(--sp-2);
  background: var(--c-alert-bg);
  color: var(--c-alert-text);
  font-weight: var(--fw-label);
  border-radius: var(--radius);
}

/* One report on the office list: boxed, never coloured. */
section.rc-row {
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: var(--bw-rule) solid var(--c-rule);
}
section.rc-row .what { font-size: var(--fs-body); font-weight: var(--fw-label); }
section.rc-row .correction { border-left: 8px solid var(--c-border); padding-left: var(--sp-1); }

:focus-visible {
  outline: var(--bw-focus) solid var(--c-accent);
  outline-offset: 2px;
}

button.home {
  min-height: var(--tap);
  font-weight: var(--fw-body);
  color: var(--c-text-2);
}

/* the receipt type choice: three big buttons in a column */
.rc-types button { font-size: var(--fs-head); }

/* the stamp line: what this photo goes with, read-only words */
.rc-stamp { margin-bottom: var(--sp-2); font-weight: var(--fw-label); }
.rc-stamp select { margin-bottom: var(--sp-1); }

/* office list: a crew-and-day heading, then rows with the photo */
h2.rc-group { margin-top: var(--sp-4, 32px); }
section.rc-row img.photo { max-height: 60vh; cursor: zoom-in; }
section.rc-row.voided .rc-body { text-decoration: line-through; }
.rc-export { display: flex; flex-wrap: wrap; gap: var(--tap-gap); }
.rc-export button { flex: 1 1 30%; }
@media (min-width: 900px) {
  body.rc-office { max-width: 1100px; margin: 0 auto; }
  section.rc-row { display: grid; grid-template-columns: 360px 1fr; gap: var(--sp-2); }
}

/* Home and Back on EVERY state (app-lead 00:2x: never stuck in the app) */
.rc-nav { display: flex; gap: var(--tap-gap); margin-bottom: var(--sp-2); }
.rc-nav a { flex: 1 1 0; display: flex; align-items: center; justify-content: center;
  min-height: var(--tap); border: var(--bw) solid var(--c-border);
  border-radius: var(--radius); color: var(--c-text); text-decoration: none;
  font-weight: var(--fw-label); }
