/* Inquiry kit: predict → set up → test and repeat → results → reflect. Loaded after home.css.
   Uses the wattle field-notebook tokens from polish.css and home.css. */
.iq-announcer {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* Grid items size to their content by default; a wide results table must scroll inside its card. */
.lab-grid > .lab-card,
.iq-sim,
.iq-step {
  min-width: 0;
}
.iq-step {
  margin: 16px 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--line, #e3dccd);
  border-radius: var(--radius, 14px);
  background: var(--card, #fffdf8);
}
.iq-step.iq-locked {
  background: transparent;
  border-style: dashed;
  color: var(--muted, #5a6573);
}
.iq-step.iq-locked p {
  margin: 4px 0 0;
}
.iq-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 18px;
}
.iq-num {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue, #2f6b3a);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
.iq-q {
  display: block;
  margin: 10px 0 6px;
}
.iq-hint {
  color: var(--muted, #5a6573);
  font-weight: 500;
  font-size: 14px;
}
.iq-saved,
.iq-status {
  margin: 6px 0 0;
  font-weight: 650;
  color: var(--blue-dark, #234f2b);
}
.iq-status {
  min-height: 1.5em;
}
.iq-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.iq-step .state-buttons.iq-choices button {
  min-height: 48px;
  padding: 8px 14px;
  font-size: 15px;
  text-align: left;
  line-height: 1.25;
  max-width: 100%;
  white-space: normal;
}
.iq-choices button:disabled:not(.active) {
  opacity: 0.45;
}

/* The one variable: a big stepper plus a slider (both work with touch and keyboard) */
.iq-variable label {
  display: block;
  margin-bottom: 8px;
}
.iq-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}
.iq-stepper button {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--line-strong, #cfc5b1);
  background: #fff;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}
.iq-stepper button:disabled {
  opacity: 0.4;
}
.iq-stepper output {
  min-width: 96px;
  text-align: center;
  font-family: var(--heading-font);
  font-size: 26px;
  font-weight: 800;
}
.iq-range {
  width: 100%;
  height: 44px;
  margin: 8px 0 0;
  accent-color: var(--blue, #2f6b3a);
}
.iq-range-ends {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted, #5a6573);
}
.iq-control {
  display: grid;
  gap: 4px;
  margin: 8px 0;
}
.iq-control > span {
  font-weight: 700;
  font-size: 15px;
}
.iq-run {
  max-width: 100%;
  min-height: 52px;
  white-space: normal;
  line-height: 1.25;
  padding: 10px 22px;
}

/* Results */
.iq-table th[scope="row"] {
  background: #f3f7ef;
}
.iq-unfair {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #7a3b14;
  background: #fff0ca;
  border-radius: 6px;
  padding: 0 4px;
}
.iq-chart svg,
.iq-scene svg {
  width: 100%;
  height: auto;
  display: block;
}
.iq-chart svg text,
.iq-scene svg text {
  font-family: system-ui, sans-serif;
}
.iq-chart-note {
  font-size: 14px;
  color: var(--muted, #5a6573);
  margin: 6px 0 0;
}

/* Reflect */
.iq-text {
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong, #cfc5b1);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  background: #fff;
  resize: vertical;
}
.iq-text:focus-visible {
  outline: 3px solid var(--accent, #e0a21c);
  outline-offset: 2px;
}
.iq-save {
  display: block;
  margin: 14px 0 6px;
  min-height: 48px;
  padding: 0 22px;
  color: #fff;
}
.iq-summary p {
  margin: 4px 0;
}
.iq-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin: 12px 0 4px;
}
.iq-print {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong, #cfc5b1);
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
}
.iq-print::before {
  content: "🖨 ";
}
.iq-extra {
  margin-top: 8px;
}

/* Motion: only while a trial runs, and never when reduced motion is asked for */
.iq-anim-melt {
  transform-box: fill-box;
  transform-origin: center;
  animation: iq-melt 1.2s ease-in forwards;
}
@keyframes iq-melt {
  to {
    transform: scale(0.1);
    opacity: 0;
  }
}
.iq-anim-grow {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: iq-grow 1.2s ease-out both;
}
@keyframes iq-grow {
  from {
    transform: scaleY(0);
  }
}
.iq-anim-drain {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: iq-grow 1.2s ease-out reverse both;
}
.iq-anim-rise {
  animation: iq-rise 0.8s ease-in-out infinite alternate;
}
@keyframes iq-rise {
  to {
    transform: translateY(-8px);
    opacity: 0.4;
  }
}
.iq-swing {
  transform-box: view-box;
  transform-origin: 210px 32px;
  animation: iq-swing-small 0.8s ease-in-out infinite alternate;
}
.iq-swing-big {
  animation-name: iq-swing-big;
}
@keyframes iq-swing-small {
  from {
    transform: rotate(-20deg);
  }
  to {
    transform: rotate(20deg);
  }
}
@keyframes iq-swing-big {
  from {
    transform: rotate(-45deg);
  }
  to {
    transform: rotate(45deg);
  }
}
.iq-fall {
  animation: iq-fall 1.2s ease-in forwards;
}
@keyframes iq-fall {
  to {
    transform: translateY(var(--drop, 170px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .iq-anim-melt,
  .iq-anim-grow,
  .iq-anim-drain,
  .iq-anim-rise,
  .iq-swing,
  .iq-fall {
    animation: none !important;
  }
}

/* Phones: 390px wide with no sideways scrolling */
@media (max-width: 600px) {
  .iq-step {
    padding: 12px;
    margin: 12px 0;
  }
  .iq-step .state-buttons.iq-choices button {
    flex: 1 1 100%;
  }
  .iq-stepper output {
    font-size: 22px;
    min-width: 80px;
  }
  .iq-head {
    font-size: 17px;
  }
}

/* Print my results */
@media print {
  .iq-print-page .test-results {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
  }
  .iq-print-page .test-results td,
  .iq-print-page .test-results th {
    border: 1px solid #555;
    padding: 3pt 5pt;
  }
  .iq-print-page .print-chart svg {
    width: 13cm;
    height: auto;
  }
}

/* "Try it for real with:" cheap household items for schools without lab equipment */
.iq-real {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 4px solid var(--accent, #e0a21c);
  background: #fdf6e3;
  font-size: 15px;
}
.iq-time {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted, #5a6573);
}
