/* RadioCheck: Sections and the group sheet, Progress, the exam result
 * (brief section 4). Owned by the Sections/Progress builder (sections.js,
 * progress.js). Tokens and the shared components (.rc-row, .rc-switch,
 * .rc-card, .rc-tag) are in app.css; they are used here, not redefined.
 */

/* ------------------------------------------------------------ shared pieces */
/* Sections and Progress scroll in a column that stops 8 px short of the tab bar and 4 px under
   the header (whose back button sits 4 px above its bottom), so a target that is whole in view
   is never closer than 8 px to the chrome's buttons (section 5). */
.rc-screen--gapped { margin: 4px 0 8px; }
.rc-card--rows { padding: 0; overflow: hidden; }
.rc-sub-id { flex: none; margin-right: 8px; color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* A switch inside a bigger button (the visual track mirrors the button's aria-checked):
   .rc-switch-row is a whole row; .rc-switch-hit is a 64 x 56 target at a row's right end. */
.rc-switch-row { justify-content: space-between; }
.rc-switch-row .rc-row-main { display: block; }
.rc-switch-row .rc-row-title { display: block; }
.rc-switch-row small { margin-top: 2px; font-weight: 400; }
.rc-switch-hit { flex: none; width: 64px; height: 56px; margin-left: 8px; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.rc-switch-row:active, .rc-switch-hit:active { background: var(--surface-2); }
.rc-switch-row .rc-switch, .rc-switch-hit .rc-switch { pointer-events: none; }

/* The known / learning / new bar: solid, striped, empty */
.rc-kln { position: relative; display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.rc-kln > i { display: block; height: 100%; flex: none; }
.rc-kln-known, .rc-sw--known { background: var(--accent); }
.rc-kln-learning, .rc-sw--learning {
  background: repeating-linear-gradient(135deg, var(--accent) 0 2px, transparent 2px 5px);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.rc-kln--big { height: 14px; border-radius: 7px; margin-top: 12px; }
.rc-sw { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.rc-sw--new { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }

/* Level tiles (Progress and the group sheet): the bars, then the count */
.rc-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 60px; border-radius: 10px; background: var(--surface-2); }
.rc-tile b { font: 600 17px/22px var(--font); font-variant-numeric: tabular-nums; }
.rc-tile-new { height: 14px; display: flex; align-items: center; font: 600 15px/14px var(--font); color: var(--text-2); }
.rc-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.rc-tiles-h { margin-top: 16px; margin-bottom: 8px; font: 600 15px/20px var(--font); color: var(--text-2); }

/* ------------------------------------------------------------ Sections */
.rc-sections { display: flex; flex-direction: column; gap: 12px; }
.rc-sec-auto .rc-switch-row { min-height: 72px; padding-top: 8px; padding-bottom: 8px; }
.rc-sec-cols { display: flex; flex-direction: column; gap: 12px; }
.rc-sections--side { max-width: 1040px; }
.rc-sections--side .rc-sec-cols { flex-direction: row; align-items: flex-start; gap: 24px; }
.rc-sections--side .rc-sec-list { flex: 1; min-width: 0; }

/* Rows hold two targets (the body and the switch). Each body is inset 4 px top and bottom, and the
   switch stands 8 px from it, so every target is 8 px or more from its neighbors (section 5). */
.rc-sub { display: flex; align-items: center; min-height: 72px; padding: 0 4px; }
.rc-sec-list > * + * { border-top: 1px solid var(--line); }
.rc-sub-body {
  flex: 1; min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  margin: 4px 0; padding: 6px 4px 6px 12px; border-radius: 12px; text-align: left;
}
.rc-sub-body:active, .rc-group-body:active { background: var(--surface-2); }
.rc-sub-title { display: flex; align-items: baseline; min-width: 0; font: 600 17px/22px var(--font); }
.rc-sub-name { min-width: 0; }
/* Line 2: the counts, then the state marks after them when they fit (the iPad); else the marks wrap under. */
.rc-sub-l2 { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 4px; }
.rc-sub-line { display: block; font: var(--t-small); color: var(--text-2); }
.rc-sub-marks { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-sub.is-open { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }

.rc-group { display: flex; align-items: center; min-height: 64px; padding: 0 4px; }
.rc-group-body { flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: 12px; margin: 4px 0; padding: 6px 4px 6px 24px; border-radius: 12px; text-align: left; }
.rc-group-body .rc-mark { flex: none; }
.rc-group-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rc-group-title { display: flex; align-items: baseline; min-width: 0; font: 400 17px/22px var(--font); }
.rc-group-id { flex: none; margin-right: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rc-group-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-group.is-off .rc-group-body > * { opacity: .6; }

/* the group sheet */
.rc-sheet-group .rc-sheet-body > p:first-child { color: var(--text); }
/* The sheet's body scrolls, so it clips anything outside it: the row keeps to the body's width. */
.rc-sheet-sw { margin: 16px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rc-sheet-sw .rc-switch-row { padding: 8px 0; }

/* ------------------------------------------------------------ Progress */
.rc-progress { display: flex; flex-direction: column; gap: 12px; }
.rc-progress--side { max-width: 1040px; flex-direction: row; align-items: flex-start; gap: 24px; }
.rc-pcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.rc-pcard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 24px; }
.rc-pcard-head h2 { font: 600 17px/22px var(--font); }
.rc-pcard-right { font: var(--t-body); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc-pcard-right b { color: var(--text); font-weight: 600; }
.rc-pcard-note { margin-top: 12px; font: var(--t-small); color: var(--text-2); }
.rc-chance { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; font: var(--t-body); color: var(--text-2); }
.rc-chance b { color: var(--text); font-weight: 600; }
.rc-chart-wrap { margin-top: 12px; }
.rc-chart { display: block; overflow: visible; }
.rc-chart-axis { display: flex; justify-content: space-between; margin-top: 4px; font: var(--t-small); color: var(--text-2); }

.rc-grid6 {
  margin-top: 12px; display: grid; column-gap: 6px; row-gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 4px repeat(2, minmax(0, 1fr)) 4px minmax(0, 1fr);
}
.rc-gh { grid-row: 1; display: flex; flex-direction: column; min-width: 0; font: var(--t-small); color: var(--text-2); }
.rc-gh span { display: flex; align-items: center; white-space: nowrap; }
.rc-gh b { font: 600 17px/22px var(--font); color: var(--text); }
.rc-grid6 .rc-tile { grid-row: 2; }
.rc-pace { margin-top: 8px; font: var(--t-body); }

.rc-days { display: flex; justify-content: space-between; margin-top: 14px; }
.rc-days .rc-day { flex: none; }

.rc-psub { padding: 12px 0; }
.rc-psub + .rc-psub { border-top: 1px solid var(--line); }
.rc-p-subs .rc-pcard-head + .rc-psub { margin-top: 4px; }
.rc-psub-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; font: var(--t-body); }
.rc-psub-name { display: flex; align-items: baseline; min-width: 0; font-weight: 600; }
.rc-psub-pts { flex: none; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc-psub-pts b { color: var(--text); font-weight: 600; }
.rc-p-subs { padding-bottom: 4px; }
.rc-last-exam { margin-top: 16px; }

/* ------------------------------------------------------------ the exam result */
.rc-resscreen { display: flex; flex-direction: column; }
.rc-res-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.rc-res-col { max-width: 640px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.rc-res-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rc-res-title { display: flex; align-items: center; gap: 10px; font: var(--t-title); }
.rc-res-title .rc-mk { position: static; }
.rc-res-score { white-space: nowrap; color: var(--text-2); font: var(--t-body); }
.rc-res-score b { font: var(--t-display); color: var(--text); font-variant-numeric: tabular-nums; }
.rc-res-line { margin-top: 4px; font: var(--t-small); color: var(--text-2); }
.rc-res-ready { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; font: var(--t-body); color: var(--text-2); }
.rc-res-ready-v { display: flex; align-items: center; gap: 8px; }
.rc-res-ready-v b { color: var(--text); font-weight: 600; }
.rc-rmarks { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 16px; }
.rc-rmark-group { display: flex; gap: 4px; }
.rc-rmark { display: block; }
.rc-res-sub {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; align-items: center; column-gap: 12px;
  min-height: 48px; padding: 6px 16px; font: var(--t-body);
}
.rc-res-sub + .rc-res-sub { border-top: 1px solid var(--line); }
.rc-res-sub-name { display: flex; align-items: baseline; min-width: 0; }
.rc-res-sub-t { min-width: 0; }
.rc-res-sub-score { color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc-res-sub-score b { color: var(--text); font-weight: 600; }
.rc-res-foot { flex: none; width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 16px; display: flex; gap: 8px; }
.rc-res-foot .rc-done { flex: 0 0 calc(40% - 4px); }
.rc-res-foot .rc-review { flex: 1; }
.rc-res-foot--one .rc-done { flex: 1; }
.rc-res-foot .rc-btn { width: auto; }
