/* RadioCheck: the question screen (all its states, figures, the iPad layouts)
 * and the session summary (brief section 4). Owned by the study builder
 * (question.js, summary.js). Tokens and the shared components (.rc-btn,
 * .rc-card, .rc-tag, .rc-mk, .rc-bars) are in app.css; they are not redefined
 * here. Lifted from design/mockups/mock.css (approved 2026-12-01).
 */

/* ------------------------------------------------------------ the frame: header 44, progress 4 + 8, the stage */
.rc-qhead { flex: none; height: 44px; display: grid; grid-template-columns: 76px minmax(0, 1fr) 76px; align-items: center; padding: 0 8px; }
.rc-close { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--text); border-radius: 12px; }
.rc-close:active { background: var(--surface-2); }
.rc-count { text-align: center; font: 600 17px/22px var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-qtag { display: flex; justify-content: flex-end; }
.rc-prog { flex: none; height: 4px; margin: 0 16px 8px; border-radius: 2px; background: var(--line); overflow: hidden; }
.rc-prog > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

.rc-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 16px 8px; }
.rc-box { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; margin: 0 auto; }
.rc-left, .rc-right { display: contents; }
.rc-spare { flex: 1 1 0; min-height: 0; }

/* ------------------------------------------------------------ the card */
.rc-q { flex: none; background: var(--surface); border-radius: 16px; padding: 12px 16px 16px; box-shadow: var(--shadow); }
.rc-cap { height: 20px; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font: var(--t-small); color: var(--text-2); }
.rc-cap .rc-tag { margin: -2px 0; }
.rc-cap .rc-bars { flex: none; display: block; }
.rc-qt { font-size: var(--qs, 20px); line-height: calc(var(--qs, 20px) * 1.3); font-weight: 600; overflow-wrap: break-word; text-wrap: pretty; }

/* figures: inside the card, under the question, in a --surface-2 inset */
.rc-fig {
  display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 10px; padding: 0;
  background: var(--surface-2); border-radius: 12px; color: var(--text); overflow: hidden;
}
.rc-fig svg { display: block; width: 100%; height: 100%; }
.is-asked .rc-fig-disc { fill: var(--text); }
.is-asked text { fill: var(--surface); }
.rc-figbig { color: var(--text); background: var(--surface-2); border-radius: 12px; }
.rc-figbig svg { display: block; width: 100%; height: auto; }
.rc-figbig--wide { overflow-x: auto; overflow-y: hidden; overscroll-behavior: contain; touch-action: pan-x; }
.rc-figbig--wide svg { width: auto; max-width: none; }
/* The wide figure scrolls sideways: a 24 px fade at each edge that hides part of it says so. */
.rc-figbig--wide.fade-left { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px); mask-image: linear-gradient(to right, transparent 0, #000 24px); }
.rc-figbig--wide.fade-right { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 24px); mask-image: linear-gradient(to left, transparent 0, #000 24px); }
.rc-figbig--wide.fade-left.fade-right { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); }

/* ------------------------------------------------------------ the choices */
/* The box runs into the 16 px gutters so the badges on the right border are never cut off,
   even when the choices scroll (rule 4 of the fit rule). */
.rc-choices { flex: none; margin: 12px -16px 0; padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.rc-choice {
  position: relative; display: flex; flex-direction: column; justify-content: center; flex: none; width: 100%; min-height: 56px; padding: 10px 14px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; text-align: left;
  font-size: var(--cs, 17px); line-height: calc(var(--cs, 17px) * 1.3); font-weight: 500; color: var(--text);
  transition: transform var(--d-press), filter var(--d-press);
}
.rc-ct { display: block; overflow-wrap: break-word; text-wrap: pretty; }
.rc-choice:active { filter: brightness(.96); }
/* The 2 px border of a lit choice is its 1.5 px border plus a 0.5 px inset ring, so the box,
   and the text inside it, keep exactly the width they had while asking (no re-wrap, no
   device-pixel rounding difference). */
.rc-choice.is-right { background: var(--right-tint); border-color: var(--right); box-shadow: inset 0 0 0 .5px var(--right); }
.rc-choice.is-wrong { background: var(--wrong-tint); border-color: var(--wrong); box-shadow: inset 0 0 0 .5px var(--wrong); }
.rc-choice.is-dim { background: var(--bg); border-color: var(--line); color: var(--text-dim); }
.rc-choice.is-picked { background: var(--accent-tint); border-color: var(--accent); box-shadow: inset 0 0 0 .5px var(--accent); }
.rc-choice.is-right:active, .rc-choice.is-wrong:active, .rc-choice.is-dim:active { filter: none; }
.rc-choice .rc-mk { position: absolute; right: -12px; top: 50%; margin-top: -12px; }
.rc-ref { display: block; margin-top: 4px; font: var(--t-small); color: var(--text-2); }

.rc-choices.rc-scrolls { flex: 0 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.rc-choices.rc-scrolls.fade-top { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24px); mask-image: linear-gradient(to bottom, transparent 0, #000 24px); }
.rc-choices.rc-scrolls.fade-bottom { -webkit-mask-image: linear-gradient(to top, transparent 0, #000 24px); mask-image: linear-gradient(to top, transparent 0, #000 24px); }
.rc-choices.rc-scrolls.fade-top.fade-bottom { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); }

/* motion: the badge scales in; a wrong pick moves 4 px left, right, back, once */
@keyframes rc-badge { from { transform: scale(.6); } to { transform: scale(1); } }
@keyframes rc-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.rc-choice.is-new-mk .rc-mk { animation: rc-badge var(--d-badge) ease-out; }
.rc-choice.is-shake { animation: rc-shake var(--d-shake) ease-in-out 1; }

/* ------------------------------------------------------------ the foot: 56 tall, always there */
.rc-foot { flex: none; height: 56px; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; font: var(--t-small); color: var(--text-2); }
.rc-foot .rc-btn { height: 52px; }
.rc-foot .rc-back { flex: 0 0 calc(40% - 4px); }
.rc-foot .rc-nextq { flex: 1; }
.rc-foot-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-hit { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: center; color: var(--right); }
.rc-hit b { font: 600 17px/22px var(--font); color: var(--right); }
.rc-hit .rc-mk--foot { flex: none; }
.rc-hit-bar { flex: 0 0 120px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.rc-hit-bar > i { display: block; height: 100%; background: var(--right); transform-origin: left; animation-name: rc-fill; animation-timing-function: linear; animation-fill-mode: both; }
@keyframes rc-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* the timer bar still fills under reduced motion (it is a timer, not decoration), in 8 steps */
.rc-foot .rc-hit-bar > i { animation-duration: var(--hit, 800ms) !important; }
@media (prefers-reduced-motion: reduce) { .rc-foot .rc-hit-bar > i { animation-timing-function: steps(8, end); } }
:root[data-reduced="1"] .rc-foot .rc-hit-bar > i { animation-timing-function: steps(8, end); }

/* ------------------------------------------------------------ the iPad */
[data-dev="up"] .rc-stage, [data-dev="side"] .rc-stage { justify-content: center; }
[data-dev="up"] .rc-box { flex: 0 1 760px; max-width: 640px; }
[data-dev="side"] .rc-box { flex: 0 1 640px; max-width: 1040px; flex-direction: row; gap: 24px; }
[data-dev="side"] .rc-left, [data-dev="side"] .rc-right { display: flex; flex-direction: column; justify-content: center; min-height: 0; min-width: 0; }
[data-dev="side"] .rc-left { flex: 0 0 calc(48% - 12px); }
[data-dev="side"] .rc-right { flex: 1; }
[data-dev="side"] .rc-left .rc-spare { display: none; }
[data-dev="side"] .rc-right .rc-choices { margin-top: 0; }

/* ------------------------------------------------------------ the session summary */
.rc-sumscreen { display: flex; flex-direction: column; }
.rc-sum-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.rc-sum-col { max-width: 640px; margin: 0 auto; padding: 24px 16px 16px; }
.rc-sum-title { font: var(--t-title); }
.rc-sum-line { margin-top: 4px; font: var(--t-body); color: var(--text-2); }
.rc-sum-card { margin-top: 16px; padding: 0 16px; }
.rc-sum-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; font: var(--t-body); }
.rc-sum-row + .rc-sum-row { border-top: 1px solid var(--line); }
.rc-sum-k { color: var(--text-2); }
.rc-sum-v { display: flex; align-items: center; gap: 8px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-sum-h { margin-top: 24px; font: 600 17px/22px var(--font); }
.rc-sum-missed { margin-top: 8px; padding: 0 16px; }
.rc-sum-miss { display: flex; align-items: center; gap: 12px; min-height: 48px; font: var(--t-body); }
.rc-sum-miss + .rc-sum-miss { border-top: 1px solid var(--line); }
.rc-sum-id { flex: none; font: var(--t-small); color: var(--text-2); font-variant-numeric: tabular-nums; }
.rc-sum-q { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-sum-foot { flex: none; width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 16px; display: flex; flex-direction: column; gap: 8px; }

/* the section sheet's second line */
.rc-sheet-note { color: var(--text-2); }

/* the review of misses: the question's id at the caption's right end */
.rc-cap-id { font: var(--t-small); color: var(--text-2); font-variant-numeric: tabular-nums; }
