/* theoretical-capacity (CHM3005). Layout only: colours come from the palette at runtime. Built on the shared CHM3005 lesson stylesheet. */

.tq-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.tq-layout > * {
  min-width: 0;
}

/* Elements with their own display value would otherwise ignore the hidden attribute. */
.tq-layout [hidden] {
  display: none !important;
}

/* The key idea heads the results card. */
.tq-key {
  margin: 0 0 0.5rem;
  text-align: center;
  line-height: 1.2;
}

.tq-key-main {
  display: block;
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  font-weight: 800;
}

.tq-key-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: clamp(0.95rem, 2.1vw, 1.12rem);
  font-weight: 600;
}

.tq-key:empty {
  display: none;
}

.tq-stage {
  display: block;
  width: 100%;
  height: 470px;
}

/* The verdict sits directly above the picture it explains. */
.tq-verdict {
  min-height: 5.6rem;           /* about the same height whatever it says, so the page does not jump */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.8rem;
  text-align: center;
  border: 3px solid;
  border-radius: 10px;
}

.tq-verdict-main {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
}

.tq-verdict-sub {
  display: block;
  font-size: 1.02rem;
  margin-top: 0.2rem;
  line-height: 1.45;
}

.tq-verdict-sub:empty {
  display: none;
}

/* The controls: one coloured strip directly under the picture. */
.tq-strip {
  margin: 0.4rem 0 0;
  padding: 0.6rem 0.8rem;
  border: 3px solid var(--tq-red, red);
  border-radius: 12px;
  background: var(--tq-bg, #fff);
}

.tq-strip-head {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  text-align: center;
  text-wrap: balance;
}

/* The numbers substituted into each equation, updated live. */
.tq-calc {
  margin-top: 0.6rem;
  padding: 0.5rem 0.8rem;
  border: 2px solid var(--tq-grid, #ccc);
  border-radius: 10px;
  font-size: 1.02rem;
}

.tq-calc:empty {
  display: none;
}

.tq-calc-row {
  display: grid;
  grid-template-columns: 9.6rem minmax(0, 1fr);
  gap: 0.3rem;
  margin: 0.15rem 0;
  line-height: 1.45;
}

.tq-bridge {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.8rem;
  border: 2px solid var(--tq-red, red);
  border-radius: 10px;
  background: var(--tq-red-t, #fff3f3);
  line-height: 1.5;
}

.tq-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.tq-tab {
  flex: 1 1 9rem;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.45rem 0.5rem;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

.tq-process {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.tq-process:empty {
  display: none;
}

.tq-guide {
  margin: 0 0 0.7rem;
  line-height: 1.5;
}

.tq-guide:empty {
  display: none;
}

.tq-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tq-row--centre {
  justify-content: center;
}

.tq-strong {
  font-weight: 800;
}

.tq-go {
  display: block;
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-weight: 800;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

.tq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.3rem;
}

.tq-chips--centre {
  justify-content: center;
}

.tq-chip {
  font: inherit;
  font-size: 1rem;
  padding: 0.3rem 0.7rem;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

/* Slider: a dark outlined track, filled up to the thumb, and a large white thumb with a dark ring. */
.tq-slider {
  display: grid;
  grid-template-columns: 8.4rem minmax(0, 1fr) 5.6rem;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
}

.tq-slider label {
  font-weight: 800;
  font-size: 1.1rem;
}

.tq-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 30px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --p: 50%;
}

.tq-slider input[type="range"]::-webkit-slider-runnable-track {
  box-sizing: border-box;
  height: 16px;
  border: 2px solid var(--tq-fg, #000);
  border-radius: 8px;
  background: linear-gradient(to right, var(--tq-sl, #888) var(--p), var(--tq-trk, #ddd) var(--p));
}

.tq-slider input[type="range"]::-moz-range-track {
  box-sizing: border-box;
  height: 16px;
  border: 2px solid var(--tq-fg, #000);
  border-radius: 8px;
  background: linear-gradient(to right, var(--tq-sl, #888) var(--p), var(--tq-trk, #ddd) var(--p));
}

.tq-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  margin-top: -6px;
  border: 4px solid var(--tq-fg, #000);
  border-radius: 50%;
  background: var(--tq-bg, #fff);
}

.tq-slider input[type="range"]::-moz-range-thumb {
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  border: 4px solid var(--tq-fg, #000);
  border-radius: 50%;
  background: var(--tq-bg, #fff);
}

.tq-slider input[type="range"]:focus-visible {
  outline: 3px solid var(--tq-fg, #000);
  outline-offset: 3px;
  border-radius: 8px;
}

.tq-val {
  font-weight: 800;
  font-size: 1.1rem;
  text-align: right;
  white-space: nowrap;
}

.tq-small {
  margin: 0.5rem 0 0.1rem;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.4;
}

.tq-small--left {
  text-align: left;
}

.tq-notes {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.45;
}

.tq-notes li {
  margin: 0.25rem 0;
}

/* Test your knowledge */
.tq-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.tq-progress {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.tq-dot {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 2px solid;
  display: inline-grid;
  place-items: center;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.tq-dot[aria-current="true"] {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

.tq-score {
  font-weight: 800;
  font-size: 1rem;
}

.tq-task {
  margin: 0.6rem 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.tq-intro {
  margin: 0 0 0.6rem;
  line-height: 1.5;
}

.tq-step {
  margin-bottom: 0.4rem;
  padding: 0.35rem 0.5rem;
  border: 2px solid;
  border-radius: 8px;
}

.tq-sttq-q {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.tq-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.3rem;
}

.tq-options button {
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  padding: 0.4rem 0.6rem;
  border: 2px solid;
  border-radius: 8px;
  cursor: pointer;
}

.tq-feedback {
  margin: 0.6rem 0 0;
  min-height: 2.6em;
  line-height: 1.45;
}

@media (max-width: 820px) {
  .tq-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .tq-verdict-main {
    font-size: 1.2rem;
  }
}

@media (max-width: 560px) {
  .tq-slider {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "label value" "input input";
  }
  .tq-slider label { grid-area: label; }
  .tq-slider input { grid-area: input; }
  .tq-val { grid-area: value; }
  .tq-calc-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tq-tab,
  .tq-chip {
    transition: none;
  }
}


/* ---------------- 2026: the Butler–Volmer equation, live (right-hand column) ---------------- */
.tq-live {
  margin: 0 0 0.6rem;
  padding: 0.55rem 0.75rem 0.6rem;
  border: 3px solid var(--tq-fg, #000);
  border-radius: 12px;
  background: var(--tq-bg, #fff);
  font-size: 1.05rem;
}

.model-card--results .tq-live {
  margin: 0.6rem 0 0;
}

.tq-live-title {
  font-weight: 800;
  font-size: 1.15rem;
}

.tq-half {
  margin: 0.25rem 0 0.1rem;
  font-weight: 700;
}

/* symbols on top, this moment's numbers underneath each term */
.tq-eqwrap {
  overflow-x: auto;
}

.tq-eqtab {
  border-collapse: collapse;
  margin: 0.2rem auto 0.4rem;
}

.tq-eqtab td {
  padding: 0.05rem 0.4rem;
  text-align: center;
  white-space: nowrap;
}

.tq-eqtab .tq-sym td {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.25;
}

.tq-eqtab .tq-num td {
  font-size: 1.4rem;
  font-weight: 700;
  border-top: 1px dashed var(--tq-grid, #bbb);
  padding-top: 0.2rem;
}

.tq-eqtab .tq-unit td {
  font-size: 0.9rem;
  line-height: 1.1;
}

/* the working: one step per line, as in the lectures */
.tq-live .tq-calc {
  margin: 0;
  padding: 0.35rem 0 0;
  border: 0;
  border-top: 2px solid var(--tq-red, red);
  border-radius: 0;
  font-size: 1.04rem;
}

.tq-live .tq-calc-row {
  grid-template-columns: 5.2rem minmax(0, 1fr);
}

/* what has just changed */
.tq-flash {
  background: #fff1a8;
  color: inherit;
  border-radius: 3px;
  box-shadow: 0 0 0 2px #e0b800;
}

.high-contrast .tq-flash {
  background: transparent;
  box-shadow: 0 0 0 2px currentColor;
}

.tq-so {
  margin: 0.45rem 0 0;
  padding: 0.4rem 0.6rem;
  border-left: 4px solid var(--tq-grid, #999);
  background: var(--tq-red-t, #f6f6f6);
  line-height: 1.45;
}

/* text in drop-downs */
.tq-more {
  margin: 0.5rem 0 0;
  padding: 0.4rem 0.65rem;
  border: 2px solid var(--tq-grid, #ccc);
  border-radius: 10px;
  font-size: 1.04rem;
}

.tq-more > summary {
  font-weight: 800;
  cursor: pointer;
}

.tq-more ul {
  margin: 0.35rem 0 0.2rem;
  padding-left: 1.1rem;
  line-height: 1.45;
}

.tq-more li {
  margin: 0.25rem 0;
}

.tq-more-text {
  margin: 0.35rem 0 0.15rem;
  line-height: 1.5;
}

.tq-go {
  font-size: 1.05rem;
}

.tq-intro,
.tq-sttq-q,
.tq-feedback {
  font-size: 1.04rem;
}

@media (max-width: 560px) {
  .tq-eqtab .tq-sym td,
  .tq-eqtab .tq-num td {
    font-size: 1rem;
  }
  .tq-live .tq-calc-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}


/* round 2: the forward and back terms, i0, and the full working in a drop-down */
.tq-terms p {
  margin: 0.25rem 0;
  font-size: 1.08rem;
  line-height: 1.4;
}

.tq-terms {
  border-top: 2px solid var(--tq-red, red);
  padding-top: 0.3rem;
}

.tq-i0 {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  line-height: 1.4;
}

.tq-work {
  margin-top: 0.45rem;
  font-size: 1rem;
}

.tq-work .tq-calc {
  margin: 0.3rem 0 0;
  padding: 0;
  border: 0;
}

.tq-work .tq-calc-row {
  grid-template-columns: 5.2rem minmax(0, 1fr);
}


/* ---------------- CHM3005: five stages (Start, Meet, Explore, Predict, Exam prep) ---------------- */
.tq-stage { height: 470px; }

.tq-tabs { flex-wrap: nowrap; gap: 0.25rem; }
.tq-tab { flex: 1 1 auto; font-size: 0.9rem; padding: 0.4rem 0.35rem; white-space: nowrap; }

.tq-key-main { font-size: clamp(1.1rem, 2.4vw, 1.55rem); }

.tq-scale {
  margin: 0.25rem 0 0;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.4;
}
.tq-scale:empty { display: none; }

/* Start */
.tq-hook {
  margin: 0.1rem 0 0.7rem;
  padding: 0.7rem 0.9rem;
  border: 3px solid var(--tq-red, red);
  border-radius: 12px;
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.35;
}
.tq-h { margin: 0.7rem 0 0.25rem; font-size: 1.08rem; font-weight: 800; color: var(--tq-red, red); }
.tq-h--top { margin-top: 0; }
.tq-p { margin: 0 0 0.4rem; font-size: 1.05rem; line-height: 1.5; }
.tq-list { margin: 0.2rem 0 0.4rem; padding-left: 1.2rem; font-size: 1.05rem; line-height: 1.5; }
.tq-list li { margin: 0.25rem 0; }

/* Meet: the steps listed in the panel, the current one marked; nothing covers the picture */
.tq-steps { list-style: none; margin: 0.2rem 0 0.5rem; padding: 0; counter-reset: fcs; }
.tq-steps li {
  counter-increment: fcs;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
  margin: 0.25rem 0;
  padding: 0.3rem 0.5rem;
  border: 2px solid var(--tq-grid, #ccc);
  border-radius: 10px;
  font-size: 1.03rem;
  line-height: 1.45;
}
.tq-steps li::before {
  content: counter(fcs);
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  border: 2px solid var(--tq-fg, #000);
  font-weight: 800;
}
.tq-steps li[aria-current="step"] { border: 3px solid var(--tq-red, red); }
.tq-steps li[aria-current="step"]::before { background: var(--tq-red, red); border-color: var(--tq-red, red); color: var(--tq-bg, #fff); }

/* Predict */
.tq-pq { margin: 0.3rem 0 0.5rem; font-size: 1.12rem; font-weight: 700; line-height: 1.45; }
.tq-sttq--plain { border-color: var(--tq-grid, #ccc); }

@media (max-width: 560px) {
  .tq-tabs { flex-wrap: wrap; }
  .tq-tab { flex: 1 1 30%; }
}

/* ---------------- Lesson 2: the four per-kg and per-m³ values in the live box ---------------- */
.tq-grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.3rem 0.8rem;
  margin: 0.45rem 0 0.2rem;
  padding-top: 0.4rem;
  border-top: 2px solid var(--tq-red, red);
  font-size: 1.02rem;
  line-height: 1.3;
}
.tq-grid2 b { font-size: 1.12rem; }
.tq-strip .tq-slider label { font-size: 1.05rem; }

/* ---------------- the roles-swapped tag in the banner ---------------- */
.tq-swap {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.05rem 0.6rem;
  border-radius: 999px;
  background: var(--tq-red, red);
  color: var(--tq-bg, #fff);
  font-weight: 800;
}

/* The verdict (CHM2001 style): the main result, the largest text on the page, in a box bordered and tinted
   in the colour of the process, or neutral. The script sets the colours. */
.tq-key {
  min-height: 4.6rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.5rem 0.8rem;
  border: 3px solid;
  border-radius: 10px;
}

.tq-key-main {
  font-size: 1.45rem;
}

.tq-key-sub {
  font-size: 1.02rem;
}

@media (max-width: 560px) {
  .tq-key-main {
    font-size: 1.3rem;
  }
}
