/* Chi-Square Checker: the Counting Bench inside the practice shell's stage (about 1066 x 628 at 1366 x 768). */
.csq { position: absolute; inset: 0; overflow: auto; display: grid; grid-template-columns: 304px minmax(0, 1fr); gap: 12px; padding: 10px 12px; font-size: 16px; line-height: 1.3;
  color: #1f2933; background: linear-gradient(#e6eef3, #d5e1e9);
  --csq-card: #ffffff; --csq-line: #a9b8c4; --csq-soft: #44525f; --csq-accent: #2a5f8a; --csq-head: #e4edf4; --csq-in: #ffffff;
  --csq-ok: #1f7a44; --csq-ok-bg: #e3f6e8; --csq-bad: #b42318; --csq-bad-bg: #fde7e4; --csq-mine: #fff3c4; }
html[data-theme="dark"] .csq { color: #eef2f6; background: linear-gradient(#1a222c, #141b23);
  --csq-card: #222c38; --csq-line: #56657a; --csq-soft: #c9d3de; --csq-accent: #9cc8ee; --csq-head: #2c3a4a; --csq-in: #121820;
  --csq-ok: #7fdca0; --csq-ok-bg: #173d27; --csq-bad: #ffb4a8; --csq-bad-bg: #4a1e1a; --csq-mine: #4d4215; }
.csq *, .csq *::before, .csq *::after { box-sizing: border-box; }
.csq p { margin: 0; }
.csq-example { position: static; display: block; padding: 0; background: none; overflow: visible; }

/* art */
.csq-pic { display: block; width: 100%; height: 100%; }
.csq-tile { display: block; background: radial-gradient(circle at 50% 35%, #fffdf6, #efe7d3); border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(90, 74, 54, .28), 0 1px 3px rgba(0, 0, 0, .12); overflow: hidden; }
.csq-tile--row { width: 40px; height: 40px; flex: none; border-radius: 8px; }

/* left: the data set */
.csq-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.csq-card { background: var(--csq-card); border: 1.5px solid var(--csq-line); border-radius: 12px; padding: 9px 11px; }
.csq-k { font-size: 16px; font-weight: 800; color: var(--csq-accent); margin-bottom: 3px !important; }
.csq-specs { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.csq-spec-card { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 6px; background: var(--csq-card); border: 1.5px solid var(--csq-line); border-radius: 12px; text-align: center; font-weight: 700; line-height: 1.2; }
.csq-spec-card .csq-tile { width: 96px; height: 96px; }
.csq-specs--4 .csq-spec-card .csq-tile { width: 62px; height: 62px; }
.csq-specs--4 .csq-spec-card { padding: 5px 4px; }
.csq-chamber-fig { margin: 0; }
.csq-chamber-pic { border-radius: 12px; overflow: hidden; border: 1.5px solid var(--csq-line); aspect-ratio: 360 / 208; }
.csq-chamber-cap { display: grid; grid-template-columns: 1fr 1fr; text-align: center; font-weight: 700; margin-top: 3px; }
.csq-note { font-size: 16px; color: var(--csq-soft); line-height: 1.25; }
.csq-why { padding-bottom: 8px; }
.csq-why-t { margin-top: 4px !important; line-height: 1.3; }
.csq-graph { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.csq-g-bg { fill: #fbfdff; stroke: #b8c6d2; stroke-width: 1.5; }
.csq-g-t { font: 16px/1 system-ui, sans-serif; fill: #1f2933; }
.csq-g-b { font-weight: 700; }
.csq-g-axis { stroke: #1f2933; fill: none; }
.csq-g-curve { stroke: #1d4f78; }
.csq-g-crit { stroke: #b23a08; fill: none; }
.csq-g-crittext { fill: #9a3206; }
.csq-g-mark { stroke: #14213d; fill: none; }
.csq-g-markfill, .csq-g-marktext { fill: #14213d; }
/* after Check the picture cards shrink to a strip so the "why" graph fits beside the worksheet */
.csq.is-revealed .csq-note, .csq.is-revealed .csq-data { display: none; }
.csq.is-revealed .csq-specs { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.csq.is-revealed .csq-specs--2 { grid-template-columns: 1fr 1fr; }
.csq.is-revealed .csq-spec-card { flex-direction: row; justify-content: center; padding: 4px; font-size: 16px; }
.csq.is-revealed .csq-spec-card .csq-tile { width: 44px; height: 44px; flex: none; }
.csq.is-revealed .csq-specs--4 .csq-spec-card figcaption { display: none; }
.csq.is-revealed .csq-chamber-pic { max-width: 170px; margin: 0 auto; }
.csq.is-revealed .csq-chamber-cap { max-width: 230px; margin: 3px auto 0; }
.csq.is-revealed .csq-null { order: 3; }

/* right: the worksheet */
.csq-sheet { min-width: 0; display: flex; flex-direction: column; gap: 6px; background: var(--csq-card); border: 1.5px solid var(--csq-line); border-radius: 14px; padding: 10px 12px; box-shadow: 0 6px 16px rgba(20, 35, 50, .12); }
.csq-step { display: flex; align-items: center; gap: 8px; line-height: 1.25; }
.csq-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--csq-accent); color: #fff; font-weight: 800; font-size: 16px; }
html[data-theme="dark"] .csq-num { color: #10202e; }
.csq-step-s { color: var(--csq-soft); }
.csq-tablewrap { min-width: 0; }
.csq-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.csq-table th, .csq-table td { border: 1.5px solid var(--csq-line); padding: 3px 8px; height: 50px; text-align: center; font-weight: 400; }
.csq-table thead th { background: var(--csq-head); font-weight: 800; height: 44px; line-height: 1.15; }
.csq-table thead i { font-weight: 600; }
.csq-table .csq-c-name { text-align: left; font-weight: 700; }
.csq-table tfoot th, .csq-table tfoot td { background: var(--csq-head); font-weight: 800; height: 40px; }
.csq-obs { font-weight: 800 !important; font-size: 18px; }
.csq-narrow { display: none; }
.csq-rowname { display: flex; align-items: center; gap: 8px; line-height: 1.15; }
.csq-tag { display: block; font-size: 16px; font-weight: 600; font-style: italic; color: var(--csq-soft); }
.csq-c-e { width: 150px; } .csq-c-w { width: 150px; } .csq-c-n { width: 84px; }
.csq-table tfoot .csq-foot-note { font-weight: 600; color: var(--csq-soft); line-height: 1.15; }
.csq-minis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.csq-mini { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1.5px solid var(--csq-line); border-radius: 10px; background: var(--csq-head); min-width: 0; }
.csq-mini-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.csq-mini-in { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; white-space: nowrap; }
.csq-cell { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.csq .csq-in { width: 82px; height: 44px; padding: 0 8px; font: inherit; font-size: 18px; font-weight: 700; text-align: center; color: inherit; background: var(--csq-in); border: 2px solid var(--csq-accent); border-radius: 8px; }
.csq .csq-in--work { border-style: dashed; border-color: var(--csq-line); font-weight: 500; }
.csq .csq-in:focus-visible, .csq .csq-chip:focus-visible { outline: 3px solid var(--tlg-focus, #b84c00); outline-offset: 2px; }
.csq .csq-in:disabled { opacity: 1; -webkit-text-fill-color: currentColor; }
.csq .csq-in.is-ok { border-color: var(--csq-ok); background: var(--csq-ok-bg); }
.csq .csq-in.is-bad { border-color: var(--csq-bad); background: var(--csq-bad-bg); text-decoration: line-through; }
.csq .csq-in.is-shown { border-style: solid; border-color: var(--csq-line); background: var(--csq-head); }
.csq-mark { min-width: 22px; font-weight: 800; white-space: nowrap; text-align: left; }
.csq-mark:empty { display: none; }
.csq-mark.is-ok { color: var(--csq-ok); } .csq-mark.is-bad { color: var(--csq-bad); }
.csq-critwrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.csq-crit { border-collapse: collapse; font-size: 16px; }
.csq-crit caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.csq-crit th, .csq-crit td { border: 1.5px solid var(--csq-line); padding: 4px 10px; min-width: 58px; text-align: center; }
.csq-crit th { background: var(--csq-head); font-weight: 800; }
.csq-crit th[scope="row"] { text-align: left; }
.csq-crit .is-mine { background: var(--csq-mine); box-shadow: inset 0 0 0 2px var(--csq-accent); font-weight: 800; }
.csq-crit .is-answer { background: var(--csq-ok-bg); box-shadow: inset 0 0 0 2.5px var(--csq-ok); font-weight: 800; }
.csq-critnote { color: var(--csq-soft); flex: 1 1 150px; line-height: 1.2; }
.csq-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.csq .csq-chip { min-height: 52px; padding: 6px 10px; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; line-height: 1.2; font-size: 16px; font-weight: 700; white-space: normal;
  border: 2px solid var(--csq-line); border-radius: 12px; background: var(--csq-in); color: inherit; cursor: pointer; }
.csq .csq-chip[aria-checked="true"] { border: 3px solid var(--csq-accent); background: var(--csq-head); }
.csq .csq-chip[aria-checked="true"] .csq-chip-m:empty::before { content: "●"; color: var(--csq-accent); }
.csq .csq-chip:disabled { opacity: 1; cursor: default; }
.csq .csq-chip.is-right { border: 3px solid var(--csq-ok); background: var(--csq-ok-bg); }
.csq .csq-chip.is-wrong { border: 3px solid var(--csq-bad); background: var(--csq-bad-bg); }
.csq-chip-m { font-weight: 800; }
.csq-chip.is-right .csq-chip-m { color: var(--csq-ok); } .csq-chip.is-wrong .csq-chip-m { color: var(--csq-bad); }
.csq-msg:empty { display: none; }
.csq--n4 .csq-table th, .csq--n4 .csq-table td { height: 48px; }
.csq--n4 .csq-table thead th { height: 44px; }
.csq--n4 .csq-table tfoot th, .csq--n4 .csq-table tfoot td { height: 38px; }

/* Briefing example */
.csq-example .csq-table { max-width: 720px; background: var(--csq-card); }
.csq-example .csq-c-n { width: auto; }

/* The assignment card sits at the foot of the customer column, so it never covers the worksheet. */
@media (min-width: 901px) { html.ps-locked .lga-card { right: auto !important; left: 12px; max-width: 276px; } }
/* The calculator opens over the customer column (left), not over the worksheet's conclusion buttons. */
@media (min-width: 901px) { .ps .ps-calc, .ps-calc { right: auto; left: 30px; bottom: 76px; } }

/* Narrower than a Chromebook (1024 wide and tablets): one column; the data set sits above the worksheet. */
@media (max-width: 1180px) {
  .csq { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .csq-left { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .csq-data { grid-column: 1; grid-row: 1; }
  .csq-null { grid-column: 1; grid-row: 2; }
  .csq-specs, .csq-chamber-fig { grid-column: 2; grid-row: 1 / span 2; }
  .csq-note { grid-column: 2; grid-row: 3; }
  .csq-why { grid-column: 1 / -1; }
  .csq-why:not([hidden]) { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; }
  .csq-why .csq-k { grid-column: 1 / -1; }
  .csq.is-revealed .csq-why { grid-row: 1; }
  .csq.is-revealed .csq-null { grid-column: 1; grid-row: 2; }
  .csq.is-revealed .csq-specs, .csq.is-revealed .csq-chamber-fig { grid-column: 2; grid-row: 2; align-self: center; }
}
@media (max-width: 900px) {
  .csq { position: static; overflow: visible; }
}
@media (max-width: 600px) {
  .csq { padding: 8px; }
  .csq-left { grid-template-columns: minmax(0, 1fr); }
  .csq-left > * { grid-column: 1 !important; grid-row: auto !important; }
  .csq-why:not([hidden]) { display: block; }
  .csq-sheet { padding: 8px 6px; }
  .csq-wide, .csq-tile--row { display: none; }
  .csq-table th, .csq-table td { padding: 3px 3px; }
  .csq-narrow { display: inline; }
  .csq-c-e, .csq-c-w { width: 76px; } .csq-c-n { width: 46px; }
  .csq-table .csq-c-name { width: auto; }
  .csq .csq-in { width: 66px; padding: 0 2px; }
  .csq-cell { flex-direction: column; gap: 0; }
  .csq-minis { grid-template-columns: 1fr; }
  .csq-chips { grid-template-columns: 1fr; }
  .csq-crit th, .csq-crit td { min-width: 0; padding: 4px 5px; }
  .csq-step { align-items: flex-start; }
}
@media (prefers-reduced-motion: no-preference) { .csq-why:not([hidden]) { animation: csq-in .35s ease; } }
@keyframes csq-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
