/* Client page — phone first. Light only; every text/background pair is >= 4.5:1. */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1b2430;
  --muted: #4a5565;
  --line: #c9d1dc;
  --brand: #12406b;
  --brand-ink: #ffffff;
  --ok-bg: #e3f4e8;
  --ok-ink: #14532d;
  --warn-bg: #fdf0d5;
  --warn-ink: #6b3f00;
  --bad-bg: #fde8e8;
  --bad-ink: #8a1c1c;
  --todo-bg: #e8edf3;
  --todo-ink: #243447;
  --focus: #0b57d0;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
.top { background: var(--brand); color: var(--brand-ink); padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top)); }
.brand { font-weight: 700; letter-spacing: .01em; }
main { max-width: 640px; margin: 0 auto; padding: 16px; }
.pad { padding: 16px; }
h1 { font-size: 1.4rem; line-height: 1.25; margin: 8px 0 8px; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 12px 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { justify-content: space-between; }
button, .btn {
  font: inherit; font-weight: 600; min-height: 48px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); cursor: pointer;
}
button.secondary, .btn.secondary { background: var(--card); color: var(--brand); }
button.link { background: none; border: none; color: var(--brand); text-decoration: underline; min-height: 44px; padding: 8px 4px; }
button[disabled] { opacity: .55; cursor: default; }
.block { display: block; width: 100%; }
input[type=text], input[type=date], textarea, input[type=tel] {
  font: inherit; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #5f6b7a; border-radius: 10px;
  background: #fff; color: var(--ink);
}
textarea { min-height: 96px; }
input.code { font-size: 1.6rem; letter-spacing: .35em; text-align: center; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.chip.open { background: var(--todo-bg); color: var(--todo-ink); }
.chip.received { background: var(--ok-bg); color: var(--ok-ink); }
.chip.accepted { background: var(--ok-bg); color: var(--ok-ink); }
.chip.needs_attention { background: var(--warn-bg); color: var(--warn-ink); }
.req { font-size: .85rem; color: var(--muted); }
.note { font-size: .95rem; color: var(--muted); }
.msg { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.err { background: var(--bad-bg); color: var(--bad-ink); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.good { background: var(--ok-bg); color: var(--ok-ink); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.suggest { background: #eef4fb; border: 1px dashed #4b6f99; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.files { list-style: none; padding: 0; margin: 8px 0; }
.files li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.bar { height: 10px; background: var(--todo-bg); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); }
input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* DV camera capture */
body.cam-open { overflow: hidden; }
.cam { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: flex; flex-direction: column; }
.cam-title { padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); font-weight: 700; background: #0b0f14; }
.cam-video, .cam-shot { flex: 1 1 auto; min-height: 0; width: 100%; object-fit: contain; background: #000; }
.cam-msg { margin: 0; padding: 6px 16px; min-height: 28px; color: #e6e9ee; }
.cam-bar { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 12px 16px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); background: #0b0f14; }
.cam-bar button { min-height: 52px; flex: 1 1 0; }
.cam-bar button.secondary { background: #1b2430; color: #fff; border-color: #5f6b7a; }
.cam-bar button.snap { background: #fff; color: #0b0f14; border: 4px solid #8fb4e3; flex: 1.4 1 0; }
.qrbox { display: flex; justify-content: center; padding: 8px 0; background: #fff; border-radius: 12px; }
.qr { max-width: 100%; height: auto; image-rendering: pixelated; }
