/* ============================================================
   SwiftLife — Webcam & mic test (/tools/webcam-mic-test/)
   Sits on the placeholder's sheet and the tools section's kit
   (../tools.css, tk-), in the warm brown of .tk-warm. Here only
   what is this tool's own: the start panel, the picture, the
   sound meter, the clip, the speaker buttons and the help lists.
   Palette variables only, so light and dark both follow
   placeholder.css. Nothing here moves for decoration: the meter
   moves because the sound does.
   ============================================================ */

/* ---- before Start ---- */
.cam-start { text-align: center; }
.cam-start-i { display: block; width: 48px; height: 48px; margin: 0 auto 10px; color: var(--tk); }
.cam-start-t { margin: 0 0 8px; font: 400 1.375rem/1.25 var(--serif); letter-spacing: -.01em; color: var(--ink); }
.cam-start-p { margin: 0 auto 18px; max-width: 40ch; line-height: 1.55; color: var(--ink-2); }

/* The status line and Stop sit just under the start panel. */
.cam .tk-bar[data-on="1"] { margin: 18px 0 0; }

/* ---- what went wrong ---- */
.cam-err .tk-verdict-t { outline-offset: 4px; }
.cam-err .tk-verdict-p p { margin: 6px 0 0; }
.cam-err .tk-verdict-p p:first-child { margin-top: 2px; }
.cam-err .tk-btn { margin-top: 14px; }
.cam-steps { margin: 8px 0 0; padding-left: 1.2em; }
.cam-steps li { line-height: 1.55; color: var(--ink-2); }
.cam-steps li + li { margin-top: 6px; }
.cam-steps strong, .cam-help strong { color: var(--ink); }

/* ---- the camera and the microphone ---- */
.cam-live { display: grid; gap: 16px; margin-top: 18px; }
.cam-live:focus { outline: none; }
.cam-card { margin-top: 16px; }
.cam-lab { margin: 0 0 12px; font-weight: 500; }

.cam-frame {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 9; max-height: 70vh; margin: 0 auto;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--cream);
}
.cam-video { display: block; width: 100%; height: 100%; object-fit: contain; }
.cam-video.cam-mirror { transform: scaleX(-1); }
.cam-dark {
  position: absolute; left: 10px; right: 10px; bottom: 10px; margin: 0; padding: 10px 12px;
  border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); box-shadow: var(--shadow);
  font-size: .9375rem; line-height: 1.45; color: var(--ink);
}
.cam-meta { margin: 10px 0 0; font: 400 .8125rem/1.55 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.cam-meta:empty { display: none; }

/* No picture, only the list to pick a camera from. */
.cam .cam-vnone { margin: 0; }

.cam-ctl { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-top: 14px; }
.cam-pick { flex: 1 1 14rem; min-width: 0; }
.cam-pick-a { margin-top: 14px; }
.cam-pick label {
  display: block; margin: 0 0 6px;
  font: 500 .6875rem/1.35 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
.cam-pick select:disabled { opacity: .6; cursor: default; }

/* The meter: how loud, -60 to 0 dB across; the faint mark is where
   "We can hear you" begins (-45 dB, a quarter of the way). */
.cam-meter {
  position: relative; height: 18px; overflow: hidden;
  border: 1px solid var(--rule-2); border-radius: 999px; background: var(--cream);
}
.cam-meter-fill { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0); background: var(--tk); }
.cam-meter-mark { position: absolute; top: 0; bottom: 0; left: 25%; width: 2px; background: var(--rule-2); }
.cam-reading { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; font-weight: 600; line-height: 1.45; color: var(--ink); }
.cam-reading svg { flex: none; width: 22px; height: 22px; color: var(--lv, var(--ink-3)); }
.cam-echo { margin-top: 12px; }

/* ---- the clip and the speakers ---- */
.cam-text { margin: 0 0 14px; max-width: 60ch; line-height: 1.55; color: var(--ink-2); }
.cam-clip { margin-top: 14px; }
.cam-clipv { display: block; width: 100%; max-height: 60vh; border-radius: 12px; background: var(--cream); }
audio.cam-clipv { background: none; }
.cam .tk-note { max-width: 60ch; }
/* Record while it records: it keeps the keyboard, but can't be pressed
   (its words say "Recording… 4"), so it doesn't answer the pointer. */
.cam .tk-btn[aria-disabled="true"] { cursor: default; }
.cam .tk-btn-go[aria-disabled="true"]:hover { border-color: var(--tk); background: var(--tk); }
.cam-sides .tk-btn { min-width: 6.5rem; }
/* Kept in the page even when empty, so screen readers hear it change. */
.cam-spk-say { margin: 12px 0 0; min-height: 1.35em; }

/* ---- the help lists under Good to know ---- */
.cam-help li { line-height: 1.6; }
