/* ============================================================
   ClunkMate recipient portal — styles
   Matched to docs/clunkmate-portal.html (approved design system).
   Desktop = service-advisor view (split hero gate, two-column brief).
   Mobile  = technician view (stacked, compact).
   ============================================================ */

@font-face {
  font-family: "Plus Jakarta Sans";
  src:
    url("/fonts/PlusJakartaSans-VF.ttf") format("truetype-variations"),
    url("/fonts/PlusJakartaSans-VF.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand — rebranded teal -> blue; refined to #2463EA (2026-07-08). Var names kept for now. */
  --teal: #2463ea;
  --teal-deep: #1e40af;
  --amber: #ee7f2a;
  --bg: #eef2f2;
  --brief-bg: #f4f6f6;
  --card: #ffffff;
  --ink: #16302f;
  --ink-soft: #475569;
  --muted: #5e6e6e;
  --muted-2: #7c8c8c;
  --muted-3: #92a0a0;
  --muted-4: #a6b4b4;
  --hairline: #eff3f3;

  /* Borders */
  --line: #e9efef;
  --line-2: #e5ecec;
  --line-3: #e2eaea;
  --line-strong: #d8e2e2;

  /* Chips */
  --chip-bg: #eef3f3;
  --chip-text: #475569;

  /* Severity */
  --safe-dot: #2e9e6b;
  --safe-bg: #e4f3ea;
  --safe-text: #1e7a4e;
  --caution-dot: #e0a526;
  --caution-bg: #fbefd6;
  --caution-text: #946a0e;
  --danger-dot: #d14545;
  --danger-bg: #fcf2f2;
  --danger-text: #d14545;

  /* PIN segments */
  --pin-empty-border: #d8e2e2;
  --pin-empty-text: #b6c4c4;

  /* Shadows */
  --shadow-card: 0 6px 18px rgba(20, 60, 60, 0.05);
  --shadow-amber: 0 8px 22px rgba(238, 127, 42, 0.3);
  --shadow-amber-sm: 0 6px 16px rgba(238, 127, 42, 0.28);

  --mono: ui-monospace, Menlo, "SF Mono", monospace;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --hatch: repeating-linear-gradient(135deg, #e1e8e8 0 11px, #e9efef 11px 22px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- reset / base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
/* Robust: an author display rule must never resurrect a [hidden] element
   (this was the bug — .empty/.loading set display:flex over [hidden]). */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#main {
  min-height: 100dvh;
}
img,
video {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
}

.icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: currentColor;
  display: inline-block;
  vertical-align: -0.14em;
}

/* Brand mark (the "C with a hex-nut centre"): a currentColor-tinted mask, so it flips
   blue-on-white / white-on-blue with the tile context exactly like the old inline SVG did. */
.brandmark {
  width: 1.2em;
  height: 1.2em;
  vertical-align: middle;
  background-color: currentColor;
  -webkit-mask: url("/brandmark.png?v=3") center / contain no-repeat;
  mask: url("/brandmark.png?v=3") center / contain no-repeat;
}

/* ---- buttons ---- */
.btn {
  font-family: inherit;
  font-weight: 700;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  transition:
    transform var(--ease) 140ms,
    box-shadow var(--ease) 140ms,
    background 140ms,
    opacity 140ms;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn:focus-visible {
  outline: 3px solid rgba(12, 91, 97, 0.35);
  outline-offset: 2px;
}
.btn--primary {
  background: var(--amber);
  color: #fff;
  box-shadow: var(--shadow-amber);
  font-size: 16px;
}
.btn--primary:hover {
  box-shadow: 0 10px 26px rgba(238, 127, 42, 0.4);
}
.btn--block {
  width: 100%;
  height: 56px;
}
.btn--ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--teal);
}
.btn--ghost:hover {
  background: #fbfdfd;
  border-color: var(--teal);
}
.btn--sm {
  height: 42px;
  padding: 0 18px;
  font-size: 14px;
  border-radius: 11px;
  box-shadow: var(--shadow-amber-sm);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}
.btn .icon {
  font-size: 19px;
}

/* ============================================================
   PIN GATE
   ============================================================ */
.gate {
  min-height: 100dvh;
  display: flex;
  background: #fff;
}

/* left teal hero */
.gate__hero {
  width: 46%;
  flex: 0 0 46%;
  background:
    radial-gradient(110% 70% at 90% 0%, rgba(255, 255, 255, 0.08), transparent 58%),
    var(--teal);
  color: #fff;
  padding: 54px 56px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hero__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
/* Bare mark, no tile: the rounded-square backdrop belongs to the iOS app icon only. On the dark
   hero the mark takes white (matching the wordmark). */
.hero__logo {
  width: 42px;
  height: 42px;
  color: #fff;
  display: grid;
  place-items: center;
}
.hero__logo .icon {
  font-size: 35px;
}
.hero__pitch {
  margin-top: auto;
}
.hero__eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}
.hero__headline {
  font-size: clamp(28px, 2.4vw, 34px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 14px 0 0;
  text-wrap: pretty;
  max-width: 12ch;
}
.hero__sub {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  margin: 16px 0 0;
  font-weight: 500;
  max-width: 420px;
}
.hero__features {
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
  display: flex;
  gap: 26px;
}
.hero__features li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.hero__features .icon {
  font-size: 21px;
}

/* right entry */
.gate__entry {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.entry {
  width: 380px;
  max-width: 100%;
}
.entry__brand {
  display: none; /* shown on mobile only */
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
/* Bare mark (no tile). The mobile entry sits on the light body bg, so the mark takes brand blue. */
.entry__brand .hero__logo {
  color: var(--teal);
  width: 46px;
  height: 46px;
}
.entry__brand-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--teal);
}
.entry__title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}
.entry__sub {
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
  margin: 8px 0 0;
  line-height: 1.5;
}
.pin-form {
  margin-top: 28px;
}

/* Welcome-screen link/code field. Deliberately shares .pin-form spacing and the same
   height and radius as .pin__seg so the root screen reads as the same family as the PIN
   gate rather than a bolted-on second design. */
.codeinput {
  width: 100%;
  height: 62px;
  padding: 0 18px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid var(--pin-empty-border);
  font-family: inherit;
  font-size: 16px; /* >=16px so iOS Safari does not zoom on focus */
  font-weight: 600;
  color: var(--ink);
  box-sizing: border-box;
}
.codeinput::placeholder {
  color: var(--muted);
  font-weight: 500;
}
/* Matches .btn:focus-visible — there is no `--brand` token; the brand colour lives in
   `--teal` (a misnomer kept from before the blue rebrand). */
.codeinput:focus-visible {
  outline: 3px solid rgba(12, 91, 97, 0.35);
  outline-offset: 2px;
  border-color: var(--teal);
}

/* 6-segment PIN box: a transparent input overlays six display cells */
.pin {
  position: relative;
}
.pin__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  -webkit-text-fill-color: transparent;
  text-align: center;
  font-size: 16px;
  outline: none;
  z-index: 2;
  cursor: pointer;
}
.pin__segs {
  display: flex;
  gap: 11px;
  position: relative;
  z-index: 1;
}
.pin__seg {
  flex: 1;
  height: 62px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid var(--pin-empty-border);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 800;
  color: var(--pin-empty-text);
  transition:
    border-color 120ms,
    box-shadow 120ms;
}
.pin__seg.is-filled {
  border: 2px solid var(--teal);
  color: var(--ink);
}
.pin__seg.is-active {
  border: 2px solid var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 91, 97, 0.14);
}
.pin.is-invalid .pin__seg {
  border-color: var(--danger-text);
}

.formerror {
  min-height: 20px;
  margin: 12px 2px 0;
  color: var(--danger-text);
  font-size: 13.5px;
  font-weight: 600;
}
.pin-form .btn--primary {
  margin-top: 12px;
}
.entry__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 20px 0 0;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 500;
}
.entry__note .icon {
  font-size: 16px;
}

/* ============================================================
   BRIEF
   ============================================================ */
.brief {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--brief-bg);
}
.topbar {
  height: 64px;
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
/* Bare mark, no tile (square = iOS app icon only). On the light topbar the mark takes brand blue,
   matching the wordmark. Print overrides to ink below. */
.topbar__logo {
  width: 34px;
  height: 34px;
  color: var(--teal);
  display: grid;
  place-items: center;
}
.topbar__logo .icon {
  font-size: 28px;
}
.topbar__name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--teal);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
}
.chip .icon {
  font-size: 15px;
}
.topbar__actions {
  display: flex;
  gap: 10px;
}

.brief__body {
  display: flex;
  gap: 24px;
  padding: 28px 32px 40px;
  max-width: 1340px;
  width: 100%;
  margin: 0 auto;
  align-items: flex-start;
}

/* left vehicle column */
.vehicle-col {
  width: 340px;
  flex: 0 0 auto;
}
.vcard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.vcard__photo {
  position: relative;
  height: 180px;
  background: var(--hatch);
  display: flex;
  align-items: flex-end;
  padding: 12px;
}
.vcard__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vcard__photo-tag {
  position: relative;
  font-family: var(--mono);
  font-size: 10px;
  color: #8b9d9d;
  background: rgba(255, 255, 255, 0.85);
  padding: 3px 7px;
  border-radius: 6px;
}
.vcard__body {
  padding: 18px;
}
.vcard__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.vcard__name .icon {
  font-size: 18px;
  color: var(--teal);
}
.vcard__sub {
  font-size: 13px;
  color: var(--muted-2);
  font-weight: 600;
  margin-top: 2px;
}
.vcard__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}
.vchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--chip-bg);
  color: var(--chip-text);
  border: 1px solid var(--line);
}
.vchip--ok {
  background: var(--safe-bg);
  color: var(--safe-text);
  border-color: transparent;
}
.vcard__divider {
  height: 1px;
  background: var(--hairline);
  margin: 15px 0;
}
.spec {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}
.spec__k {
  font-size: 13px;
  color: var(--muted-2);
  font-weight: 600;
}
.spec__v {
  font-size: 13px;
  color: var(--ink);
  font-weight: 700;
  text-align: right;
  /* Auto margin packs the value (and anything after it, e.g. the VIN copy button) hard right,
     so a three-child row doesn't space-between the copy icon away from its value. */
  margin-left: auto;
}
.spec__v--mono {
  font-family: var(--mono);
}
/* tiny inline copy button (VIN row) */
.spec__copy {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: none;
  padding: 0 2px;
  cursor: pointer;
  color: var(--muted-2);
  flex: 0 0 auto;
}
.spec__copy:hover {
  color: var(--teal);
}
.spec__copy .icon {
  font-size: 15px;
}
.vehicle-col__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 0 4px;
  color: var(--muted-4);
  font-size: 12px;
  font-weight: 600;
}
.vehicle-col__foot .icon {
  font-size: 16px;
}

/* right problem column */
.problem-col {
  flex: 1;
  min-width: 0;
}
.pcard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--shadow-card);
}
.pcard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--caution-bg);
  color: var(--caution-text);
}
.pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--caution-dot);
}
.pill[data-severity="safe"] {
  background: var(--safe-bg);
  color: var(--safe-text);
}
.pill[data-severity="safe"] .pill__dot {
  background: var(--safe-dot);
}
.pill[data-severity="dontDrive"] {
  background: var(--danger-bg);
  color: var(--danger-text);
}
.pill[data-severity="dontDrive"] .pill__dot {
  background: var(--danger-dot);
}
.logged {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-3);
  font-size: 13px;
  font-weight: 600;
}
.logged .icon {
  font-size: 16px;
}
.pcard__title {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 16px 0 0;
}
.fieldgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
  margin-top: 22px;
}
.fieldgrid__row {
  padding: 13px 0;
  border-bottom: 1px solid var(--hairline);
  min-width: 0;
}
.fieldgrid__k {
  font-size: 13px;
  color: var(--muted-2);
  font-weight: 600;
}
.fieldgrid__v {
  font-size: 14px;
  color: var(--ink);
  font-weight: 700;
  margin-top: 3px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.note {
  background: #f4f8f8;
  border-radius: 13px;
  padding: 15px 17px;
  margin-top: 18px;
}
.note__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--muted-2);
}
.note__text {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.55;
  margin-top: 6px;
}

/* attachments */
.attach__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  margin-top: 24px;
}
.attach {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}
.tile {
  margin: 0;
}
.tile--photo {
  width: 150px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tile--photo > a {
  display: block;
  width: 150px;
  height: 108px;
  border-radius: 13px;
  overflow: hidden;
  background: var(--hatch);
  position: relative;
}
.tile--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* "Captured …" caption under a media tile (F1.1 quick-capture timestamps). */
.tile__cap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 11px;
  color: var(--muted-2);
}
.tile__cap .icon {
  font-size: 13px;
  color: var(--muted-2);
}
.tile--photo .tile__tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-family: var(--mono);
  font-size: 9px;
  color: #8b9d9d;
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 6px;
  border-radius: 5px;
}
.tile--audio {
  flex: 1 1 260px;
  min-width: 240px;
  border-radius: 13px;
  background: #f4f8f8;
  border: 1px solid var(--line-3);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.tile--audio .tile__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tile__kind {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.tile__kind .icon {
  font-size: 18px;
  color: var(--amber);
}
.tile__dur {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-2);
  font-family: var(--mono);
}
.tile--audio audio {
  width: 100%;
  height: 38px;
}
.tile--video {
  flex: 1 1 100%;
  border-radius: 13px;
  overflow: hidden;
  background: #000;
}
.tile--video video {
  width: 100%;
  border-radius: 13px;
}
.media-item--broken {
  width: 150px;
  height: 108px;
  border-radius: 13px;
  border: 1px dashed var(--line-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted-2);
  background: #fbfdfd;
}
.media-broken__icon {
  font-size: 22px;
}
.media-broken__text {
  font-size: 11px;
  font-weight: 600;
  margin: 0;
  text-align: center;
  padding: 0 8px;
}

.problem-col__foot {
  text-align: center;
  font-size: 12px;
  color: var(--muted-4);
  font-weight: 600;
  margin-top: 18px;
}

/* F1.3 — post-share updates timeline (clearly separated from the frozen brief above) */
.updates {
  margin-top: 22px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}
.updates__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.updates__icon {
  color: var(--teal);
}
.updates__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}
.updates__badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--teal);
  background: rgba(12, 91, 97, 0.1);
  padding: 4px 9px;
  border-radius: 999px;
}
.update {
  position: relative;
  margin-top: 16px;
  padding-left: 16px;
  border-left: 2px solid var(--line-strong);
}
.update::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
}
.update__time {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.update__text {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.55;
  margin: 5px 0 0;
}
.attach--update {
  margin-top: 10px;
}

/* F1.4 print-only evidence access (link + PIN + QR). Hidden on screen; shown when printing. */
.evidence-print {
  display: none;
}
.evidence__title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px;
}
.evidence__note {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
.evidence__row {
  display: flex;
  gap: 16px;
  align-items: center;
}
.evidence__qr svg,
.evidence__qr img {
  width: 108px;
  height: 108px;
  display: block;
}
.evidence__details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.evidence__label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.evidence__value {
  font-size: 13px;
  color: var(--ink);
  font-family: var(--mono);
  word-break: break-all;
}
.evidence__value--pin {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 3px;
}

/* mobile-only bottom copy / print buttons */
.brief__print-mobile,
.brief__copy-mobile {
  display: none;
}

/* ============================================================
   EMPTY / ERROR STATES
   ============================================================ */
.state {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.state__card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 40px 34px;
  max-width: 420px;
  text-align: center;
}
.state__icon {
  font-size: 40px;
  line-height: 1;
  display: inline-block;
}
.state[data-tone="warn"] .state__card {
  border-top: 4px solid var(--caution-dot);
}
.state[data-tone="danger"] .state__card {
  border-top: 4px solid var(--danger-dot);
}
.state__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 14px 0 0;
  outline: none;
}
.state__body {
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.55;
  margin: 8px 0 0;
}
/* Every error state offers a route back to code entry rather than dead-ending. */
.state__action {
  margin-top: 22px;
  text-decoration: none;
}

/* ============================================================
   RESPONSIVE — technician on a phone
   ============================================================ */
@media (max-width: 860px) {
  /* gate: hide the big teal hero, center the entry, show compact brand */
  .gate {
    flex-direction: column;
  }
  .gate__hero {
    display: none;
  }
  .gate__entry {
    padding: 28px 24px calc(28px + env(safe-area-inset-bottom));
    min-height: 100dvh;
  }
  .entry {
    width: 100%;
    max-width: 420px;
  }
  .entry__brand {
    display: flex;
  }

  /* brief: single column, sticky bar condensed */
  .topbar {
    padding: 0 18px;
    height: 56px;
  }
  .topbar__name {
    font-size: 16px;
  }
  .topbar__actions {
    display: none;
  }
  .brief__body {
    flex-direction: column;
    gap: 16px;
    padding: 16px 16px 28px;
  }
  .vehicle-col {
    width: 100%;
  }
  /* P1 advisor skim-order (spec f2-1-f2-6 §1.2): when the columns stack on a phone, lead with the
     problem — severity, complaint, symptoms, evidence, then the resolve/reply loop — and drop the
     vehicle card below it. The decision-relevant info reads first. Reorder by viewport width, not
     persona; desktop keeps both columns side by side. */
  .problem-col {
    order: -1;
  }
  .pcard {
    padding: 18px;
  }
  .pcard__title {
    font-size: 22px;
  }
  .fieldgrid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .tile--photo {
    flex: 1 1 calc(50% - 7px);
    width: auto;
  }
  /* The sized box is now the inner link (the figure wraps link + caption), so the phone
     override must target it, not the figure — otherwise the 150x108 image overflows. */
  .tile--photo > a {
    width: auto;
    height: 92px;
  }
  .tile--audio {
    flex: 1 1 100%;
  }
  .brief__print-mobile,
  .brief__copy-mobile {
    display: flex;
    width: 100%;
    height: 50px;
    margin-top: 4px;
    border-radius: 13px;
  }
}

@media (max-width: 380px) {
  .pin__seg {
    height: 54px;
    font-size: 24px;
    border-radius: 12px;
  }
  .pin__segs {
    gap: 8px;
  }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================
   PRINT — clean read-only brief (Print / Download PDF)
   ============================================================ */
@media print {
  body {
    background: #fff;
  }
  .topbar__actions,
  .brief__print-mobile,
  .brief__copy-mobile,
  .spec__copy,
  .skip-link {
    display: none !important;
  }
  .topbar {
    position: static;
    border-bottom: 1px solid #ccc;
  }
  /* Print drops background fills, so the white-on-teal logo tile would vanish. Render the mark in
     ink on the page instead (the design's Mono treatment) — reliable regardless of the print
     dialog's "background graphics" toggle. The teal wordmark is foreground text and prints as-is. */
  .topbar__logo {
    background: transparent;
    color: var(--ink);
    box-shadow: none;
  }
  .brief,
  .brief__body {
    background: #fff;
  }
  .brief__body {
    display: block;
  }
  .vehicle-col {
    width: 100%;
    margin-bottom: 16px;
  }
  .vcard,
  .pcard,
  .updates {
    box-shadow: none;
    break-inside: avoid;
  }
  .update {
    break-inside: avoid;
  }
  /* Photos/audio/video can't print — surface the link + PIN + QR to reach them. */
  .evidence-print:not([hidden]) {
    display: block;
    break-inside: avoid;
    margin-top: 20px;
    padding: 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
  }
  .tile--audio,
  audio,
  video {
    display: none !important;
  }
}

/* ============================================================
   F2.1 resolution + F2.6 replies (mechanic side)
   ============================================================ */
.loop {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.res-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
}
.res-chip .icon {
  font-size: 15px;
}
.res-chip--pending {
  background: var(--chip-bg);
  color: var(--ink-soft);
}
.res-chip--agreed {
  background: var(--safe-bg);
  color: var(--safe-text);
}
.res-chip--declined {
  background: var(--danger-bg);
  color: var(--danger-text);
}
.res-note {
  margin: -6px 0 0;
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}
.resolve {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resolve__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}
.resolve__sub {
  margin: -4px 0 2px;
  font-size: 13px;
  color: var(--muted);
}
.resolve__note,
.resolve__name,
.composer__text,
.composer__name {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  resize: vertical;
}
.resolve__note:focus,
.resolve__name:focus,
.composer__text:focus,
.composer__name:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: transparent;
}
.thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
}
.bubble--mech {
  align-self: flex-end;
  background: var(--teal);
  color: #fff;
}
.bubble--owner {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
}
.bubble__who {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.8;
  margin-bottom: 2px;
}
.bubble__text {
  line-height: 1.4;
  white-space: pre-wrap;
}
.bubble__time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 3px;
}
.composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.composer__row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.composer__text {
  flex: 1;
}
.composer__row .btn {
  flex: 0 0 auto;
  height: 44px;
}
.loop__err {
  margin: 0;
  font-size: 13px;
  color: var(--danger-text);
}
.loop__err:empty {
  display: none;
}
.loop__check {
  align-self: flex-start;
}
@media print {
  .loop {
    display: none !important;
  }
}
