/* The desktop app's look: a neutral dark theme for reading ultrasound (no green / magenta in the chrome,
   so nothing competes with the ClipGuide overlay colours). */
:root {
  --bg: #1c1e22; --panel: #25282d; --border: #3a3e45; --text: #e4e6ea; --muted: #9aa0a8;
  --accent: #3a72c8; --accent-hover: #4683e0; --warn: #e0a63a; --error: #f07171; --image-bg: #000;
  --crosshair: #ffc61a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
#app { height: 100%; }
.loading { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.warn { color: var(--warn); font-weight: 600; }
.error { color: var(--error); font-weight: 600; }
h1 { font-size: 28px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 20px; font-weight: 600; margin: 0 0 6px; }

/* screens: one centred card */
.screen { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.card { width: min(760px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 28px 32px; }
.card .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.card .spacer { flex: 1; }
.step { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 16px; }
.points { margin: 14px 0 0; padding-left: 20px; }
.points li { margin: 0 0 12px; line-height: 1.55; }

button { font: inherit; color: var(--text); background: #353941; border: 1px solid var(--border);
  border-radius: 6px; padding: 9px 20px; cursor: pointer; }
button:hover:not(:disabled) { background: #3f444d; }
button:disabled { background: #26292e; color: #5d636b; border-color: #2f3238; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.primary:disabled { background: #2a3446; color: #6f7a8c; border-color: #2a3446; }
button.big { font-size: 18px; padding: 13px 28px; }

progress { width: 100%; height: 12px; appearance: none; -webkit-appearance: none; border: 1px solid var(--border);
  border-radius: 6px; background: #17191c; overflow: hidden; }
progress::-webkit-progress-bar { background: #17191c; }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

/* the first page, the start page, Loading, the end of the training / a session: everything centred */
.card.center { text-align: center; padding: 40px 40px 34px; }
.card.center h1 { margin-bottom: 14px; }
.card.center p { margin: 12px auto; max-width: 580px; }
.card.center .row { justify-content: center; margin-top: 24px; }
.card.center .note { font-size: 14px; margin-top: 26px; }
.card.center progress { max-width: 540px; margin-top: 12px; }

/* the first page: the statement (left-aligned in the centred card) and the passcode */
.card.center .statement-intro { margin-top: 22px; font-weight: 600; }
.statement { text-align: left; max-width: 580px; margin: 10px auto 0; }
.statement label { display: flex; gap: 12px; align-items: flex-start; padding: 9px 12px; margin: 6px 0;
  background: #2b2f35; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; line-height: 1.45; }
.statement input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent-hover); }
.code-label { display: block; margin-top: 20px; color: var(--muted); }
.code-label .code { display: block; margin: 8px auto 0; width: 230px; padding: 10px 12px; text-align: center;
  font: 600 24px/1.2 Consolas, "Courier New", monospace; letter-spacing: 3px; color: var(--text);
  background: #17191c; border: 1px solid var(--border); border-radius: 6px; text-transform: uppercase; }
.code-label .code:focus { outline: 2px solid var(--accent-hover); outline-offset: 1px; }

.titles { text-align: center; margin-bottom: 14px; }
.titles h2 { font-weight: 400; }
.centred { text-align: center; }

/* countdown */
.countdown-box { text-align: center; }
.countdown { font-size: 150px; font-weight: 300; min-height: 1.3em; }
.caption { color: var(--muted); font-size: 17px; }

/* confidence */
.question { text-align: center; margin-bottom: 4px; }
.ratings { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 22px 0 6px; }
.ratings button { min-width: 118px; min-height: 92px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; padding: 6px; }
.ratings button b { font-size: 26px; }
.ratings button.chosen { background: var(--accent); border-color: #8fb4ef; }

/* the viewer: image, side panel, slider */
.viewer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: 1fr 340px;
  grid-template-rows: 1fr auto; gap: 10px; padding: 10px; background: var(--bg); }
.viewer .stage { grid-column: 1; grid-row: 1; position: relative; background: var(--image-bg); min-height: 200px;
  overflow: hidden; touch-action: none; cursor: crosshair; }
.viewer canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.viewer .side { grid-column: 2; grid-row: 1 / span 2; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 18px 16px; display: flex; flex-direction: column; gap: 20px; }
.viewer .side .title { font-size: 22px; font-weight: 600; white-space: pre-line; line-height: 1.3; }
.viewer .side .hint { white-space: pre-line; font-size: 18px; line-height: 1.45; color: #c3c8cf; }
.viewer .side button { width: 100%; }
.viewer .side button.big { font-size: 21px; padding: 16px 12px; }
.viewer .side .flash { font-size: 18px; }
.viewer .side .tips { font-size: 17px; padding: 11px 12px; }
.viewer .bar { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: 14px; padding: 0 4px; }
.viewer .frame-label { min-width: 170px; font-size: 20px; font-weight: 600; }
.viewer input[type=range] { flex: 1; height: 64px; accent-color: var(--accent-hover); cursor: pointer; }
.viewer .message { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center;
  justify-content: center; color: #c8ccd2; font-size: 20px; pointer-events: none; }
.viewer .side-spacer { flex: 1; }

/* the training's tips (coach.js): the page dimmed but the element a tip is about, a bubble next to it */
.coach { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1000; }
.coach-ring { position: fixed; border: 4px solid var(--accent-hover); border-radius: 8px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.67); }
.coach-bubble { position: fixed; background: var(--panel); border: 1px solid #5b6270; border-radius: 10px;
  padding: 16px 18px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
.coach-text { margin: 0 0 14px; font-size: 17px; line-height: 1.5; }
.coach-row { display: flex; align-items: center; justify-content: space-between; }
.coach-count { color: var(--muted); font-size: 14px; }
.coach-next { min-width: 120px; }

/* the first page's speed estimate, the start page's wait */
.card.center .speed { font-size: 15px; }
.card.center .gate { font-variant-numeric: tabular-nums; }
