/* FRQ Studio inside the practice shell's stage (about 1066 × 628 at 1366 × 768): the stimulus on the left stays on
   screen; the parts are answered one at a time on the right. Nothing here is positioned over anything else. */
.ps { --frq-s1: #1b5fa0; --frq-s2: #b4480b; --frq-ink: #152c40; --frq-muted: #4a5f73; --frq-grid: #d5dee8; --frq-plot: #f6f9fc; --frq-surface: #ffffff;
  --frq-line: #b9c6d3; --frq-panel: #ffffff; --frq-soft: #eef3f8; --frq-auto-bg: #dcecff; --frq-auto-fg: #0f4479; --frq-self-bg: #fff1cf; --frq-self-fg: #6b4a05;
  --frq-ok: #17663a; --frq-ok-bg: #e3f6e8; --frq-bad: #a3241f; --frq-bad-bg: #fde8e7; }
html[data-theme="dark"] .ps { --frq-s1: #7cc0ff; --frq-s2: #ffb37a; --frq-ink: #eef2f6; --frq-muted: #b9c6d3; --frq-grid: #3a4858; --frq-plot: #1b2531; --frq-surface: #222c38;
  --frq-line: #4c5b6c; --frq-panel: #222c38; --frq-soft: #2a3644; --frq-auto-bg: #173a5c; --frq-auto-fg: #cfe6ff; --frq-self-bg: #4a3a12; --frq-self-fg: #ffe6a8;
  --frq-ok: #8fe0ad; --frq-ok-bg: #173d27; --frq-bad: #ffb4a8; --frq-bad-bg: #4a1e1a; }

.frq { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; padding: 12px; color: var(--frq-ink); font-size: 16px; line-height: 1.4;
  background: linear-gradient(180deg, color-mix(in srgb, var(--frq-s1) 7%, var(--tlg-bg, #f1f5f8)), var(--tlg-bg, #f1f5f8)); }
.frq *, .frq *::before, .frq *::after { box-sizing: border-box; }
.frq p, .frq h2, .frq h3, .frq ul, .frq figure { margin: 0; }
.frq-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.frq-stim, .frq-work { min-height: 0; min-width: 0; background: var(--frq-panel); border: 1px solid var(--frq-line); border-radius: 14px; box-shadow: 0 2px 8px rgba(10, 30, 50, .08); }

/* ── stimulus ── */
.frq-stim { container-type: inline-size; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; overflow-y: auto; border-top: 5px solid var(--frq-s1); }
.frq-stim-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.frq-tag { font-size: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: #1b5fa0; padding: 2px 10px; border-radius: 999px; }
.frq-stim-title { font-size: 18px; font-weight: 700; line-height: 1.25; }
.frq-scenario { font-size: 16px; line-height: 1.42; }
.frq-data { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.frq-tablewrap { flex: 0 1 auto; max-width: 100%; min-width: 0; }
.frq-table { border-collapse: collapse; font-size: 16px; background: var(--frq-panel); border: 1.5px solid var(--frq-line); }
.frq-table th, .frq-table td { border: 1px solid var(--frq-line); padding: 3px 10px; text-align: right; font-variant-numeric: tabular-nums; line-height: 1.3; }
.frq-table thead th { background: var(--frq-soft); text-align: center; font-weight: 700; max-width: 112px; vertical-align: bottom; }
.frq-data--wide .frq-table thead th { max-width: 96px; }
.frq-data { flex-wrap: nowrap; }
.frq-table tbody th { font-weight: 600; }
.frq-table tbody tr:nth-child(even) td, .frq-table tbody tr:nth-child(even) th { background: color-mix(in srgb, var(--frq-soft) 55%, transparent); }
.frq-fig { flex: 1 1 300px; min-width: 0; }
.frq-figbox { width: 100%; line-height: 0; }
.frq-graph { display: block; max-width: 100%; height: auto; }
.frq-cap { font-size: 16px; color: var(--frq-muted); margin-top: 2px; }
.frq-fig-hidden { flex: 1 1 260px; min-width: 240px; padding: 12px 14px; border: 2px dashed var(--frq-line); border-radius: 10px; color: var(--frq-muted); font-size: 16px; }
.frq [hidden] { display: none !important; }

/* ── answer side ── */
.frq-work { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; overflow-y: auto; }
.frq-tabs { display: flex; gap: 6px; }
.frq-tab { flex: 1 1 0; min-width: 0; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 2px; font: inherit; font-size: 16px; white-space: nowrap; font-weight: 700; color: var(--frq-ink);
  background: var(--frq-soft); border: 2px solid var(--frq-line); border-radius: 10px; cursor: pointer; }
.frq-tab.is-cur { background: var(--frq-panel); border-color: var(--frq-s1); box-shadow: inset 0 -4px 0 var(--frq-s1); }
.frq-tab-mark { font-size: 16px; font-weight: 700; color: var(--frq-muted); }
.frq-tab.is-done .frq-tab-mark { color: var(--frq-s1); }
.frq-tab.is-ok { background: var(--frq-ok-bg); border-color: var(--frq-ok); } .frq-tab.is-ok .frq-tab-mark { color: var(--frq-ok); }
.frq-tab.is-bad { background: var(--frq-bad-bg); border-color: var(--frq-bad); } .frq-tab.is-bad .frq-tab-mark { color: var(--frq-bad); }
.frq-key { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 16px; color: var(--frq-muted); line-height: 1.25; }
.frq-key-m { font-weight: 700; color: var(--frq-ink); }
.frq-part { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 2px 4px 2px 2px; margin: 0 -4px 0 -2px; }
.frq-part > * { flex-shrink: 0; }
.frq-prompt--small { font-size: 16px; font-weight: 400; color: var(--frq-muted); }
.frq-part-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.frq-part-title { font-size: 18px; font-weight: 700; }
.frq-badge { font-size: 16px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.frq-badge--auto { background: var(--frq-auto-bg); color: var(--frq-auto-fg); border: 1.5px solid var(--frq-auto-fg); }
.frq-badge--self { background: var(--frq-self-bg); color: var(--frq-self-fg); border: 1.5px dashed var(--frq-self-fg); }
.frq-prompt { font-size: 17px; font-weight: 600; line-height: 1.35; }
.frq-choices { display: flex; flex-direction: column; gap: 6px; }
.frq-opt { position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; min-height: 48px; padding: 7px 12px 7px 40px; text-align: left; font: inherit; font-size: 16px; line-height: 1.3; color: var(--frq-ink);
  background: var(--frq-panel); border: 2px solid var(--frq-line); border-radius: 10px; cursor: pointer; }
.frq-opt::before { content: ""; position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 2px solid var(--frq-muted); background: var(--frq-panel); }
.frq-opt[aria-checked="true"] { border-color: var(--frq-s1); background: var(--frq-auto-bg); color: var(--frq-auto-fg); font-weight: 600; }
.frq-opt[aria-checked="true"]::before { border-color: var(--frq-s1); background: radial-gradient(circle, var(--frq-s1) 0 5px, var(--frq-panel) 6px); }
.frq-opt:hover:not(:disabled) { border-color: var(--frq-s1); }
.frq-opt:disabled { cursor: default; opacity: 1; }
.frq-opt:disabled:not([aria-checked="true"]):not(.is-key) { color: var(--frq-muted); }
.frq-opt.is-key { border-color: var(--frq-ok); background: var(--frq-ok-bg); color: var(--frq-ink); }
.frq-opt.is-miss { border-color: var(--frq-bad); background: var(--frq-bad-bg); color: var(--frq-ink); }
.frq-opt-text { flex: 1 1 60%; min-width: 0; }
.frq-opt-flag { font-size: 16px; font-weight: 700; white-space: nowrap; }
.frq-opt.is-key .frq-opt-flag { color: var(--frq-ok); } .frq-opt.is-miss .frq-opt-flag { color: var(--frq-bad); }
.frq-tab:focus-visible, .frq-opt:focus-visible, .frq-num:focus-visible, .frq-text:focus-visible, .frq-quote:focus-visible, .frq-select:focus-visible, .frq-model summary:focus-visible, .frq-rubric input:focus-visible { outline: 3px solid var(--tlg-focus, #b84c00); outline-offset: 2px; }

.frq-choices--graphs { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.frq-choices--graphs .frq-opt { flex: 1 1 134px; width: auto; max-width: 180px; flex-direction: column; flex-wrap: nowrap; align-items: center; padding: 26px 3px 6px; text-align: center; gap: 4px; }
.frq-choices--graphs .frq-opt::before { left: 50%; top: 5px; margin: 0 0 0 -9px; }
.frq-choices--graphs .frq-opt-flag { white-space: normal; }
.frq-opt-fig { display: block; line-height: 0; }
.frq-mini { display: block; }
.frq-choices--graphs .frq-opt-text { flex: none; }

.frq-calc { display: flex; flex-direction: column; gap: 8px; }
.frq-field { display: flex; flex-direction: column; gap: 4px; }
.frq-field-label { font-size: 16px; font-weight: 700; color: var(--frq-muted); }
.frq-num { width: 180px; max-width: 100%; min-height: 48px; padding: 6px 12px; font: inherit; font-size: 20px; font-weight: 600; color: var(--frq-ink); background: var(--frq-panel); border: 2px solid var(--frq-line); border-radius: 10px; }
.frq-num:disabled { background: var(--frq-soft); }
.frq-choices--units { flex-direction: row; flex-wrap: wrap; }
.frq-choices--units .frq-opt { width: auto; flex: 0 1 auto; }

.frq-text { width: 100%; flex: 1 0 110px; min-height: 110px; padding: 8px 10px; font: inherit; font-size: 16px; line-height: 1.4; color: var(--frq-ink); background: var(--frq-panel); border: 2px solid var(--frq-line); border-radius: 10px; resize: none; }
.frq-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 16px; color: var(--frq-muted); }
.frq-count { font-weight: 700; }
.frq-lock { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.frq-lockbtn { min-height: 48px; }
.frq-lock-note { font-size: 16px; font-weight: 600; color: var(--frq-bad); }
.frq-lock-note:empty { display: none; }
.frq-muted { font-size: 16px; color: var(--frq-muted); }
.frq-quote { max-height: 56px; min-height: 52px; overflow-y: auto; padding: 6px 10px; background: var(--frq-soft); border-left: 4px solid var(--frq-s1); border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.frq-quote-k { display: block; font-size: 16px; font-weight: 700; color: var(--frq-muted); }
.frq-rubric-h { font-size: 16px; font-weight: 600; }
.frq-rubric { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.frq-rubric li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 10px; background: var(--frq-self-bg); color: var(--frq-self-fg); border: 1.5px dashed var(--frq-self-fg); border-radius: 10px; }
.frq-rubric input { flex: none; width: 26px; height: 26px; margin: 2px 0 0; accent-color: #1b5fa0; cursor: pointer; }
.frq-rubric label { flex: 1; min-width: 0; font-size: 16px; line-height: 1.32; cursor: pointer; }
.frq-rubric li:has(input:checked) { border-style: solid; }
.frq-pt { display: inline-block; margin-right: 6px; padding: 0 6px; font-weight: 700; border-radius: 6px; background: var(--frq-self-fg); color: var(--frq-self-bg); }
.frq-model { border: 1px solid var(--frq-line); border-radius: 10px; padding: 0 10px; background: var(--frq-panel); }
.frq-model summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.frq-model summary::before { content: "▸"; margin-right: 8px; } .frq-model[open] summary::before { content: "▾"; }
.frq-model summary::-webkit-details-marker { display: none; }
.frq-model p { padding: 0 0 10px; font-size: 16px; }

.frq-result { padding: 8px 12px; border-radius: 10px; border: 2px solid; font-size: 16px; display: flex; flex-direction: column; gap: 4px; }
.frq-result.is-ok { background: var(--frq-ok-bg); border-color: var(--frq-ok); }
.frq-result.is-bad { background: var(--frq-bad-bg); border-color: var(--frq-bad); }
.frq-result-h { font-weight: 700; } .frq-result.is-ok .frq-result-h { color: var(--frq-ok); } .frq-result.is-bad .frq-result-h { color: var(--frq-bad); }

.frq-nav { display: flex; justify-content: space-between; gap: 8px; }
.frq-nav .ps-btn { min-height: 46px; }
.frq-nav--status { justify-content: flex-start; align-items: center; gap: 12px; }
.frq-nav--status .frq-status { flex: 1; min-width: 0; }
.frq-next { margin-left: auto; border-color: var(--frq-s1); color: var(--frq-s1); font-weight: 700; background: var(--frq-panel); }
.frq-status { font-size: 16px; font-weight: 600; color: var(--frq-muted); min-height: 22px; line-height: 1.3; }

/* Start screen picker and Briefing example */
.frq-start-art { display: block; width: 100%; height: auto; }
.frq-picker { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 10px; }
.frq-courses { flex-wrap: wrap; }
.frq-select { display: block; width: 100%; max-width: 440px; min-height: 48px; padding: 6px 10px; font: inherit; font-size: 17px; color: var(--tlg-text); background: var(--tlg-surface); border: 2px solid var(--tlg-border-strong); border-radius: 10px; }
.frq-pick-note { margin: 6px 0 0; font-size: 16px; }
.frq-ex { width: 100%; max-width: 620px; margin: 0 auto; line-height: 0; background: var(--frq-panel); border: 1px solid var(--frq-line); border-radius: 10px; padding: 8px; }

/* the assignment card would sit on the answer column's corner: keep it at the foot of the customer column while playing */
@media (min-width: 901px) { html.ps-locked .lga-card { right: auto !important; left: 12px; max-width: calc(var(--ps-side-w) - 24px); } }

/* the stimulus column too narrow for table and graph side by side: stack them */
@container (max-width: 600px) { .frq-data { flex-wrap: wrap; } .frq-fig { flex-basis: 100%; } .frq-fig-hidden { flex-basis: 100%; } }
@media (min-width: 901px) and (max-width: 1200px) { .frq { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }

/* a narrower customer column leaves the stimulus room for its table and graph side by side */
@media (min-width: 901px) { .ps { --ps-side-w: 250px; } }

/* Narrow screens: the shell lets the page scroll, so the stimulus sits above the answers at full height. */
@media (max-width: 900px) {
  .frq { position: static; grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .frq-stim, .frq-work { overflow: visible; }
  .frq-data { flex-wrap: wrap; }
  .frq-fig { flex-basis: 320px; }
  .frq-text { min-height: 150px; }
  .frq-quote { max-height: none; }

}
@media (max-width: 480px) {
  .frq-table th, .frq-table td { padding: 3px 6px; }
  .frq-fig { min-width: 0; flex-basis: 100%; }
  .frq-num { width: 100%; }
}

/* shell and student.js controls on this page: 44 px tap targets and 16 px text (shell request logged to make it the default) */
html .ps .ps-say { min-width: 44px; min-height: 44px; }
html .tlg-student .tlg-btn { font-size: 16px; min-height: 44px; }
/* the floating sign-in chip steps aside while the Briefing drawer or the Done card is open (it would sit on their buttons);
   the Done card has its own sign-in link */
body:has(.ps-drawer:not([hidden])) > .tlg-student, body:has(.ps.has-done) > .tlg-student { visibility: hidden; }
/* the docked "Sign in to save your progress" note on the Start card: 44 px targets */
.ps .tlg-signin-note--inline a, .ps .tlg-signin-note--inline button { min-height: 44px; display: inline-flex; align-items: center; }
.ps .tlg-signin-note--inline button { min-width: 44px; justify-content: center; }
