/* =============================================================================
   ct-prism-ui.css — Prism bar card (APCT / SPCT), the prism drawn over the
   eye, and the "watch this eye" ring on the exam field.
   Source: Cover-Test Clinical Reference §2.5, §6.7; Krimsky instrument
   reference §2 (the manufactured bar ladder).
   ============================================================================= */

.ct-prism {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-soft); border-radius: 14px;
  background: var(--surface-sunken);
}
.ct-prism .ct-seg { background: var(--surface); }
.ct-prism .ct-seg-btn[aria-checked="true"] { background: var(--accent-tint); box-shadow: none; }
.ct-prism-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@container ctc (max-width: 520px) { .ct-prism-grid { grid-template-columns: minmax(0, 1fr); } }

.ct-axis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.ct-axis-tab {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  min-width: 0; padding: 7px 10px;
  border: 1px solid var(--border-soft); border-radius: 9px;
  background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--text-soft);
  cursor: pointer;
}
.ct-axis-tab b { font-family: var(--ct-mono); font-size: 11.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.ct-axis-tab[aria-selected="true"] { border-color: var(--accent); color: var(--accent-strong); box-shadow: 0 0 0 1px var(--accent) inset; }

.ct-power { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.ct-round {
  width: 44px; height: 44px;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface);
  font-size: 24px; line-height: 1; color: var(--accent-strong);
  box-shadow: 0 1px 2px hsl(var(--shadow-color) / 0.08);
  cursor: pointer;
  transition: transform 100ms ease, border-color 140ms ease;
}
.ct-round:hover { border-color: var(--accent); }
.ct-round:active { transform: scale(0.94); }
.ct-power-read { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.ct-power-num { display: flex; align-items: baseline; gap: 2px; font-family: var(--ct-mono); color: var(--text); }
.ct-power-num output { font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ct-power-unit { font-size: 17px; color: var(--text-soft); }
.ct-power-sub { font-size: 11px; color: var(--text-soft); text-align: center; }

.ct-ladder { display: flex; flex-wrap: wrap; gap: 4px; }
.ct-rung {
  min-width: 32px; padding: 5px 6px;
  border: 1px solid var(--border-soft); border-radius: 7px;
  background: var(--surface);
  font-family: var(--ct-mono); font-size: 11px; color: var(--text-soft);
  cursor: pointer;
}
.ct-rung:hover { border-color: var(--accent); color: var(--accent-strong); }
.ct-rung[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }

/* ── Prism drawn over the eye (exam field) ───────────────────────────────── */
.ct-prism-bar {
  position: absolute; left: 0; top: 0;
  z-index: 95;               /* under the occluder (100), over the eyes */
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(10, 30, 30, 0.18));
  transition: opacity 180ms ease;
}
.ct-prism-bar svg { display: block; width: 100%; height: 100%; }
.ct-prism-bar[data-mode="spct"][data-live="false"] { opacity: 0.35; }
.ct-pb-label {
  position: absolute; left: 50%; top: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(20, 24, 26, 0.78);
  font: 600 11px/1.4 "IBM Plex Mono", ui-monospace, monospace;
  color: #fff;
  white-space: nowrap;
}

/* ── Watch ring: which eye to look at right now (Learning Mode) ──────────── */
.ct-watch-cue {
  position: absolute; left: 0; top: 0;
  z-index: 96;
  pointer-events: none;
  border: 2px solid rgba(58, 110, 168, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(58, 110, 168, 0.45);
  animation: ct-watch 1.4s ease-out infinite;
}
.ct-watch-cue[data-kind="cover"] { border: 2px dashed rgba(31, 75, 76, 0.75); box-shadow: none; animation: none; }
.ct-watch-label {
  position: absolute; left: 50%; top: 0;
  transform: translate(-50%, -55%);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--note);
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}
.ct-watch-cue[data-kind="cover"] .ct-watch-label { background: var(--accent); }
@keyframes ct-watch { 70% { box-shadow: 0 0 0 12px rgba(58, 110, 168, 0); } 100% { box-shadow: 0 0 0 0 rgba(58, 110, 168, 0); } }

/* ── Teaching annotations (ui/ct-guide-layer.js) ─────────────────────────── */
.ct-guide-svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 101;              /* over the occluder (100): DVD is pointed out on the covered eye */
  overflow: visible;
  pointer-events: none;
}
.ct-guide-mark { opacity: 0; transition: opacity 280ms ease; --ct-guide: #3a6ea8; }
.ct-guide-mark.is-in { opacity: 1; }
.ct-guide-mark.ct-refix   { --ct-guide: #d9722e; }
.ct-guide-mark.ct-recover { --ct-guide: #3a6ea8; }
.ct-guide-mark.ct-swing   { --ct-guide: #1f7a78; }
.ct-guide-mark.ct-special { --ct-guide: #8a5cc2; }
.ct-guide-line {
  stroke: var(--ct-guide); stroke-width: 4; stroke-linecap: round;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.95)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}
.ct-guide-mark.is-in .ct-guide-line { stroke-dasharray: 400; stroke-dashoffset: 400; animation: ct-draw 520ms ease-out forwards; }
#ct-arrow-refix .ct-arrowhead   { fill: #d9722e; }
#ct-arrow-recover .ct-arrowhead { fill: #3a6ea8; }
#ct-arrow-swing .ct-arrowhead   { fill: #1f7a78; }
.ct-guide-origin { fill: #fff; stroke: var(--ct-guide); stroke-width: 2.5; }
.ct-guide-pill { fill: rgba(20, 24, 26, 0.84); stroke: var(--ct-guide); stroke-width: 1.5; }
.ct-guide-text { fill: #fff; font: 700 11.5px/1 "IBM Plex Sans", system-ui, sans-serif; letter-spacing: 0.01em; }
@keyframes ct-draw { to { stroke-dashoffset: 0; } }

.ct-caption {
  position: absolute; left: 50%; top: 10px;
  z-index: 102;
  display: flex; flex-direction: column; gap: 4px;
  width: min(580px, 92%);
  padding: 10px 16px 12px;
  transform: translateX(-50%);
  border-radius: 16px;
  background: rgba(20, 24, 26, 0.86);
  box-shadow: 0 10px 28px -12px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  pointer-events: none;
}
.ct-caption[hidden],
.ct-watch-cue[hidden] { display: none; }
.ct-caption-stages { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 2px; padding: 0; list-style: none; }
.ct-caption-stages li {
  padding: 1px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.08);
}
.ct-caption-stages li[data-state="done"] { color: rgba(255, 255, 255, 0.8); }
.ct-caption-stages li[data-state="now"] { color: #14181a; background: #fff; }
.ct-caption-title { font-size: 14.5px; line-height: 1.3; }
.ct-caption-text { font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, 0.9); }

/* "Show the PRISM tool" — filter only: drag.js owns this element's transform. */
.krimsky-prism.ct-attention { animation: ct-attention 0.85s ease-in-out 3; }
@keyframes ct-attention {
  50% { filter: drop-shadow(0 0 12px rgba(31, 75, 76, 0.95)) drop-shadow(0 0 3px #fff); }
}
