/* Testing-page mockups. Builds on ../design/base.css. Phone-first: this page runs on a phone or tablet in the clinic. */
body { background: var(--paper-2); }
.wrap { max-width: 980px; margin: 0 auto; padding: 18px 16px 120px; }

/* patient header */
.patient { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.patient .avatar { width: 46px; height: 46px; font-size: 16px; background: #000; color: #fff; }
.patient h1 { font-size: 22px; }
.patient p { margin: 2px 0 0; color: var(--ink-3); font-size: 13.5px; }

/* sensor bar */
.sensorbar { background: #000; color: #fff; border-radius: var(--radius); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin-bottom: 16px; }
.sensorbar .dot { width: 10px; height: 10px; border-radius: 50%; background: #666; display: inline-block; margin-right: 8px; }
.sensorbar .dot.on { background: #35d07f; box-shadow: 0 0 0 4px rgba(53,208,127,.2); }
.sensorbar .dot.busy { background: #ffb020; }
.sensorbar .name { font-weight: 700; }
.sensorbar .meta { color: #bdbdbd; font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.sensorbar .meta b { color: #fff; font-weight: 700; }
.sensorbar .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.sensorbar .btn { border-color: #fff; background: #000; color: #fff; }
.sensorbar .btn:hover { background: #fff; color: #000; }
.sensorbar .btn.primary { background: var(--accent); border-color: var(--accent); }
.calchip { font-size: 12.5px; border-radius: 999px; padding: 3px 10px; font-weight: 700; }
.calchip.unknown { background: #2a2a2a; color: #d0d0d0; }
.calchip.ok { background: #1f8a4c; color: #fff; }
.calchip.bad { background: #c62828; color: #fff; }
.battery { display: inline-flex; align-items: center; gap: 6px; }
.battery i { width: 22px; height: 11px; border: 1.5px solid #bbb; border-radius: 3px; position: relative; display: inline-block; }
.battery i::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: #bbb; border-radius: 1px; }
.battery i span { position: absolute; left: 1px; top: 1px; bottom: 1px; background: #35d07f; border-radius: 1px; }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice.warn { background: var(--warn-soft); color: #6d4100; }
.notice.bad { background: var(--bad-soft); color: #8d1b1b; }
.notice.info { background: var(--accent-soft); color: #1d2c9e; }
.notice .spacer { flex: 1; }

/* group chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: thin; }
.chips button { font: inherit; font-size: 14px; white-space: nowrap; border: 1.5px solid var(--line-2); background: #fff; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.chips button.on { background: #000; color: #fff; border-color: #000; }

/* test rows */
.tests { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.test { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.test:last-child { border-bottom: 0; }
.test .tname { text-align: center; font-weight: 700; }
.test .tname small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.side { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 17px; cursor: pointer; position: relative; }
.side:disabled { background: #cfd4f9; cursor: not-allowed; }
.side.done { background: var(--good); }
.side.done::after { content: "✓"; position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: var(--good); font-size: 12px; line-height: 18px; border: 1px solid var(--good); }
.side.wide { width: auto; border-radius: 999px; padding: 0 22px; justify-self: center; grid-column: 1 / -1; }

/* recording sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; z-index: 50; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(640px, 100%); max-height: 96vh; overflow-y: auto; background: #fff; border-radius: 22px 22px 0 0; padding: 18px 18px 22px; display: none; z-index: 51; box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
.sheet.open, .sheet-bg.open { display: block; }
.sheet h2 { font-size: 22px; }
.sheet .sub { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }
.gauge-wrap { position: relative; max-width: 360px; margin: 6px auto 0; }
.bignum { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; }
.bignum b { font-size: 46px; font-variant-numeric: tabular-nums; line-height: 1; }
.bignum span { display: block; color: var(--ink-3); font-size: 13px; }
.livegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin: 10px 0 14px; }
.livegrid b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.livegrid span { font-size: 12px; color: var(--ink-3); }
.countdown { font-size: 80px; font-weight: 700; text-align: center; color: var(--accent); padding: 26px 0; }
.pain { margin: 10px 0; }
.pain .scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; margin-top: 6px; }
.pain .scale button { font: inherit; font-size: 13px; border: 1.5px solid var(--line-2); background: #fff; border-radius: 8px; padding: 7px 0; cursor: pointer; }
.pain .scale button.on { background: #000; color: #fff; border-color: #000; }
.result-head { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 4px; }
.result-head b { font-size: 44px; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 14px; margin: 8px 0; }
.kv span:nth-child(odd) { color: var(--ink-3); }
.sheet .row.end { justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.tiny { font-size: 12px; color: var(--ink-3); }
@media (max-width: 520px) { .sensorbar .actions { margin-left: 0; width: 100%; } .sensorbar .actions .btn { flex: 1; } }

/* stick figure next to the gauge */
.viz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 170px); gap: 10px; align-items: center; }
.viz .gauge-wrap { margin: 0; max-width: none; }
.viz .fig { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.viz .fig > div { width: 100%; }
@media (max-width: 480px) { .viz { grid-template-columns: minmax(0, 1fr) minmax(0, 120px); } }

/* one-view layout: the person (or the meter) alone, at a good size */
.viz.one { display: block; }
.fig.big { max-width: 360px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.fig.big > div { width: 100%; }
.gauge-wrap.big { max-width: 400px; margin: 0 auto; }
