/* =========================================================
   Ionik+ — question formatting (ionik-q-format.js)
   One look for question text and model answers on every page:
   lines, centred equations, one table style, labelled parts.
   Load after ionik-cream.css.
   ========================================================= */

/* ---- lines and equations ------------------------------------------------ */
.stem-line, .model-line { display: block; }
.stem-gap { height: 8px; }
.stem-eq {
  display: block; text-align: center; margin: 9px 0;
  font-size: 1.03em; letter-spacing: .01em;
  font-family: inherit; background: none; border: 0; padding: 0; white-space: normal;
}
sub.chstate { font-style: normal; }
sub.chsub { font-style: italic; }

/* ---- one table style (stems, diagram tables, model answers) ---------------- */
.ionik-qtable-wrap { width: 100%; overflow-x: auto; margin: 10px 0; }
.ionik-qtable {
  border-collapse: collapse; width: 100%;
  font-family: var(--sans, 'Manrope', system-ui, sans-serif); font-size: 14px; color: var(--ink);
  background: var(--bg-2, transparent);
  border: 1px solid var(--rule, rgba(42,36,28,0.18)); border-radius: var(--r-sm, 8px); overflow: hidden;
}
.ionik-qtable .qt-caption { caption-side: top; text-align: left; font-weight: 600; font-size: 14px; color: var(--ink); padding: 0 2px 10px; line-height: 1.4; }
.ionik-qtable th.qt-cell, .ionik-qtable td.qt-cell {
  border: 1px solid var(--rule, rgba(42,36,28,0.18));
  padding: 9px 12px; text-align: left; vertical-align: top; line-height: 1.5;
}
.ionik-qtable thead th.qt-cell, .ionik-qtable th.qt-head { background: var(--bg-3, rgba(42,36,28,0.05)); font-weight: 600; font-style: normal; color: var(--ink); }
.ionik-qtable tbody tr:nth-child(even) td.qt-cell { background: rgba(42,36,28,0.022); }
/* Data tables written inside a stem or answer size to their content. */
.qf-table .ionik-qtable { width: auto; min-width: min(100%, 320px); }

/* ---- parts on read-only surfaces ------------------------------------------ */
.qf-intro { margin-bottom: 10px; }
.qf-part { display: grid; grid-template-columns: 30px 1fr auto; gap: 4px 6px; align-items: start; padding: 8px 0; border-top: 1px solid var(--rule-soft, rgba(42,36,28,0.08)); }
.qf-part:first-of-type { border-top: 0; }
.qf-intro + .qf-part { border-top: 1px solid var(--rule-soft, rgba(42,36,28,0.08)); }
.qf-part-l { font-weight: 600; color: var(--ink); }
.qf-part-b { min-width: 0; }
.qf-part-m { font-size: 12px; color: var(--ink-muted); white-space: nowrap; padding-top: 2px; }
.qf-part-draw { margin-top: 6px; display: inline-block; font-size: 11px; color: var(--ink-muted); border: 1px dashed var(--rule, rgba(42,36,28,0.2)); border-radius: 6px; padding: 2px 8px; }
.qf-trail { margin-top: 6px; text-align: right; }

/* ---- model answers ---------------------------------------------------------- */
.model-text-body { line-height: 1.7; }
.model-blocks > * + * { margin-top: 8px; }
.model-step { border-left: 2px solid var(--rule); padding: 2px 0 2px 12px; }
.model-step.final { border-left-color: var(--r-green, var(--r-green)); }
.model-step-lbl { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; color: var(--ink-muted); margin-bottom: 3px; }
.model-step-work { font-family: inherit; font-size: 14px; color: var(--ink-soft); line-height: 1.6; white-space: normal; }
.model-step-res { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 3px; }

/* Mock exam part rail (Question Maker) */
.exam-part-rail { justify-content: flex-start; margin: 0 0 10px; }
.qpart-dot.done:not(.on) { border-color: color-mix(in srgb, var(--r-green, var(--r-green)) 55%, var(--rule)); }

/* ---- spectroscopy: ink on the page ground, like the reviewed HSC papers ---- */
.spectro-host .spectro-grid { gap: 16px 18px; }
.spectro-host .spectro-card { background: transparent; border: 0; border-radius: 0; overflow: visible; }
.spectro-host .spectro-cap { font-size: 12px; font-weight: 600; color: var(--ink); letter-spacing: 0; text-transform: none; padding: 0 0 4px; border: 0; }
.spectro-host .spectro-canvas { background: transparent; }
