/* =============================================================================
   ct-controls.css — Cover Test console: occluder pad, buttons, segmented
   controls, settings (AC/A, control score, traits), dock launcher.
   ============================================================================= */

/* ── Occluder pad: OD on the left, OS on the right — as the eyes are drawn ─ */
.ctc-pad { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1fr); gap: 8px; }
.ctc-pad-eye,
.ctc-pad-open {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 66px; padding: 8px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 100ms ease;
}
.ctc-pad-eye:hover,
.ctc-pad-open:hover { border-color: var(--accent); }
.ctc-pad-eye:active,
.ctc-pad-open:active { transform: scale(0.98); }
.ctc-pad-top { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.ctc-pad-name { font-family: var(--ct-mono); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.ctc-pad-open span { font-size: 13px; font-weight: 600; }
.ctc-pad kbd { position: absolute; top: 6px; right: 7px; }
/* Covered = the dark paddle itself. */
.ctc-pad-eye[aria-pressed="true"] { border-color: #1b2124; background: #1b2124; color: #fff; }
.ctc-pad-eye[aria-pressed="true"] .ctc-pad-top { color: rgba(255, 255, 255, 0.72); }
.ctc-pad-open[aria-pressed="true"] { background: var(--surface-sunken); color: var(--text-soft); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.ctc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ctc-actions .ct-btn { flex: 1 1 170px; }
.ct-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 0; min-height: 38px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--text);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.ct-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.ct-btn-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.ct-btn-primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); color: #fff; }
.ct-btn-ghost { flex: none; min-height: 30px; padding: 4px 10px; background: var(--surface); }
.ctc-next { align-self: flex-end; border-color: var(--accent); background: var(--accent); color: #fff; }
.ctc-next:hover { background: var(--accent-strong); color: #fff; }

/* ── Segmented control ───────────────────────────────────────────────────── */
.ct-seg { display: flex; gap: 3px; min-width: 0; padding: 3px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface-sunken); }
.ct-seg-btn {
  flex: 1 1 auto; min-width: 0;
  padding: 6px 9px;
  border: 0; border-radius: 7px; background: none;
  font-size: 12px; font-weight: 600; color: var(--text-soft); white-space: nowrap;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.ct-seg-btn:hover { color: var(--text); }
.ct-seg-btn[aria-checked="true"] { background: var(--surface); color: var(--accent-strong); box-shadow: 0 1px 2px hsl(var(--shadow-color) / 0.14); }

/* ── Settings drawer ─────────────────────────────────────────────────────── */
.ct-aca { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ct-stepper { display: flex; align-items: center; gap: 4px; }
.ct-step { width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 16px; line-height: 1; color: var(--accent-strong); cursor: pointer; }
.ct-step:hover { border-color: var(--accent); }
.ct-step-value { min-width: 32px; font-family: var(--ct-mono); font-size: 13px; font-weight: 600; text-align: center; }
.ct-unit { margin-right: 2px; font-size: 11px; color: var(--text-soft); }
.ct-aca-note { flex-basis: 100%; font-size: 11.5px; color: var(--text-soft); }

.ct-control { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; border-radius: 12px; background: var(--warn-tint); }
.ct-control .ct-label,
.ct-control .ct-ref { color: var(--warn-strong); }
.ct-grades { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.ct-grade {
  padding: 6px 0;
  border: 1px solid rgba(180, 85, 43, 0.3); border-radius: 8px;
  background: var(--surface);
  font-family: var(--ct-mono); font-size: 13px; font-weight: 600; color: var(--warn-strong);
  cursor: pointer;
}
.ct-grade:hover { border-color: var(--warn); }
.ct-grade[aria-checked="true"] { border-color: var(--warn); background: var(--warn); color: #fff; }
.ct-grade-desc { margin: 0; font-size: 11.5px; color: var(--warn-strong); }

.ct-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-chip { padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 11.5px; font-weight: 600; color: var(--text-soft); cursor: pointer; }
.ct-chip:hover { border-color: var(--accent); color: var(--accent-strong); }
.ct-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }

/* ── Automatic exam · speed · Explain switch ─────────────────────────────── */
.ctc-auto { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ctc-auto-btn { min-height: 34px; padding: 6px 14px 6px 11px; border-radius: 999px; }
.ctc-auto-btn svg { width: 14px; height: 14px; flex: none; }
.ctc-auto-btn[aria-pressed="true"] { border-color: var(--warn-strong); background: var(--warn-strong); }
.ctc-auto-btn:disabled { cursor: not-allowed; opacity: 0.5; }
.ctc-speed .ct-seg-btn { padding: 4px 8px; font-family: var(--ct-mono); font-size: 11px; }

.ctc-switch {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 6px; border: 0; border-radius: 999px; background: none;
  font-size: 12px; font-weight: 600; color: var(--text-soft);
  cursor: pointer;
}
.ctc-switch-track {
  position: relative; width: 32px; height: 18px; flex: none;
  border-radius: 999px; background: var(--border);
  transition: background 160ms ease;
}
.ctc-switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 160ms ease;
}
.ctc-switch[aria-checked="true"] { color: var(--accent-strong); }
.ctc-switch[aria-checked="true"] .ctc-switch-track { background: var(--accent); }
.ctc-switch[aria-checked="true"] .ctc-switch-thumb { transform: translateX(14px); }

/* ── Gaze position pad (examiner's view: patient's right is on the left) ─── */
.ctc-gaze {
  display: grid; grid-template-columns: repeat(3, 16px); gap: 3px;
  padding: 3px;
  border: 1px solid var(--border-soft); border-radius: 8px;
  background: var(--surface-sunken);
}
.ctc-gaze-cell {
  display: grid; place-items: center;
  width: 16px; height: 16px; padding: 0;
  border: 0; border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
}
.ctc-gaze-cell::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--border); }
.ctc-gaze-cell:hover::after { background: var(--accent); }
.ctc-gaze-cell[aria-checked="true"] { background: var(--accent); }
.ctc-gaze-cell[aria-checked="true"]::after { background: #fff; }
.ctc-gaze-label { min-width: 70px; font-size: 11.5px; font-weight: 600; color: var(--accent-strong); }

/* ── Dock launcher ───────────────────────────────────────────────────────── */
#coverTestBtn[hidden] { display: none; }
/* On phones the console already sits right under the eyes and the dock is full. */
@media (max-width: 640px) { #coverTestBtn { display: none; } }
