:root { --ink: #1d2733; --muted: #5d6b7a; --line: #d9e0e7; --bg: #f4f6f9; --card: #fff; --blue: #1f5fbf; --green: #1e7b45;
  --red: #b3261e; --amber: #9a6100; --greenbg: #e7f5ec; --redbg: #fbe9e7; --amberbg: #fff4dd; --bluebg: #e8f0fc; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
header { background: #16324f; color: #fff; padding: 12px 20px; display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
header h1 { font-size: 18px; margin: 0; font-weight: 600; }
header span { opacity: .8; font-size: 14px; }
header .right { margin-left: auto; }
header button { background: transparent; color: #fff; border: 1px solid #ffffff80; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
main.narrow { max-width: 520px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 17px; margin: 0 0 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }
label { display: block; font-size: 14px; color: var(--muted); margin: 8px 0 3px; }
input, select { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; width: 100%; background: #fff; }
button { font: inherit; padding: 9px 16px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.ok { background: var(--green); border-color: var(--green); color: #fff; }
button.danger { background: var(--red); border-color: var(--red); color: #fff; }
button:disabled { opacity: .5; cursor: default; }
button.big { width: 100%; padding: 14px; font-size: 17px; margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 14px; }
.error { background: var(--redbg); color: var(--red); border-radius: 7px; padding: 10px 12px; margin: 10px 0; }
.note { background: var(--bluebg); border-radius: 7px; padding: 10px 12px; margin: 10px 0; }
.aid { background: var(--amberbg); border: 1px dashed var(--amber); border-radius: 7px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.aid b { color: var(--amber); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 7px 6px; }
td { border-bottom: 1px solid var(--line); padding: 7px 6px; vertical-align: middle; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.pill.green { background: var(--greenbg); color: var(--green); }
.pill.red { background: var(--redbg); color: var(--red); }
.pill.amber { background: var(--amberbg); color: var(--amber); }
.pill.blue { background: var(--bluebg); color: var(--blue); }
.qrbox { text-align: center; }
.qrbox svg { width: min(360px, 80vw); height: auto; background: #fff; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.count { font-size: 15px; color: var(--muted); margin-top: 6px; }
video, .shot { width: 100%; max-height: 52vh; border-radius: 10px; background: #000; object-fit: cover; }
.faces { display: flex; gap: 10px; }
.faces figure { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.faces img { width: 96px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #eee; }
.arrival { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); padding: 10px 0; }
.arrival:last-child { border-bottom: 0; }
.arrival .who b { font-size: 16px; }
.arrival .act { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
@media (max-width: 680px) { .arrival { grid-template-columns: 1fr; } }
.steps { display: flex; gap: 4px; margin: 0 0 12px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--green); }
.steps span.now { background: var(--blue); }
.big-ok { font-size: 56px; text-align: center; }
.center { text-align: center; }
.links a { display: block; padding: 14px; margin: 8px 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.links a b { color: var(--blue); }
.grid2.showroom { grid-template-columns: minmax(300px, 2fr) 3fr; }
@media (max-width: 820px) { .grid2.showroom { grid-template-columns: 1fr; } }
.arrival { grid-template-columns: auto minmax(160px, 1fr) auto; }
/* T-138 CK-16: the manager's ID check on a no-match */
.idcheck { display: flex; flex-direction: column; gap: 6px; min-width: 240px; background: var(--amberbg); border: 1px solid var(--amber); border-radius: 8px; padding: 10px; }
.idcheck b { color: var(--amber); font-size: 14px; }
.idcheck .tick { display: flex; gap: 6px; align-items: center; color: var(--ink); margin: 2px 0; }
.arrival .act:has(.idcheck) { grid-column: 1 / -1; }
.idcheck { min-width: 0; }

/* T-140: the guided head turn: an oval to aim at, the instruction on the picture, ticked steps */
.livecam { position: relative; }
.livecam video { display: block; }
.livecam .oval { position: absolute; left: 50%; top: 46%; width: 46%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%);
  border: 4px dashed rgba(255, 255, 255, 0.85); border-radius: 50%; pointer-events: none; transition: border-color 0.2s; }
.livecam[data-stage="OPEN"] .oval { border-color: #22c55e; border-style: solid; }
.livecam[data-stage="TURN1"] .oval, .livecam[data-stage="TURN2"] .oval, .livecam[data-stage="BACK"] .oval, .livecam[data-stage="DONE"] .oval { border-color: #22c55e; border-style: solid; }
.livestep { position: absolute; left: 0; right: 0; bottom: 8px; margin: 0 8px; padding: 8px 10px; border-radius: 8px; text-align: center;
  font-size: 1.25rem; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.6); }
.livestep:empty { display: none; }
.livecam[data-stage="TURN1"] .livestep, .livecam[data-stage="TURN2"] .livestep { background: #1d4ed8; font-size: 1.35rem; }
.livecam[data-stage="BACK"] .livestep, .livecam[data-stage="DONE"] .livestep { background: #15803d; }
.livesteps { margin: 8px 0; padding-left: 22px; color: #6b7280; }
.livesteps li.now { color: inherit; font-weight: 700; }
.livesteps li.done { color: #15803d; }
.livesteps li.done::after { content: " \2714"; }
