/* =========================================================
   Practice page (units/practice.html)
   ========================================================= */

.uhero--small { padding-bottom: 3rem; }
.uhero--small h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.uhero__sub .katex { font-size: 1em; }

.practice { padding-top: 3rem; }

/* ---------- Question tabs ---------- */
.qtabs { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.qtab {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .6rem 1rem;
  border-radius: 999px;
  border: 2px solid #e4e1f5;
  background: var(--white);
  font: inherit; font-weight: 800; font-size: .92rem; color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, background .2s ease, color .2s ease;
}
.qtab:hover { transform: translateY(-2px); border-color: var(--c); }
.qtab b {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px;
  background: var(--c-soft); color: var(--c); font-size: .8rem;
}
.qtab.is-active { background: var(--c); border-color: var(--c); color: var(--white); }
.qtab.is-active b { background: rgba(255,255,255,.25); color: var(--white); }
.qtab.is-done b { background: var(--teal); color: var(--white); }

/* ---------- Question card ---------- */
.pcard {
  position: relative;
  background: var(--white);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 2rem 2.2rem;
  border: 2px solid #efecfb;
  animation: cardIn .5s cubic-bezier(.22,1,.36,1);
}
.pcard.is-swapping { animation: none; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }

.pcard__top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.pcard__top h2 { font-size: 1.6rem; }
.pcard__marks { font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.pcard__marks.is-full { color: var(--teal); }

.pcard__prompt { font-size: 1.15rem; margin-bottom: 1.2rem; }
.pcard .katex { font-size: 1.12em; }

/* ---------- Diagrams ---------- */
.diagram { width: 100%; max-width: 520px; display: block; margin: 0 auto 1.4rem; }
.diagram text { font-family: var(--font-body); }
.d-axis { stroke: var(--ink); stroke-width: 2; }
.d-line { fill: none; stroke: var(--c); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: dline 1.4s .2s ease forwards; }
@keyframes dline { to { stroke-dashoffset: 0; } }
.d-fill { fill: var(--c-soft); }
.d-dash { stroke: var(--ink-soft); stroke-width: 1.2; stroke-dasharray: 4 4; }
.d-label { font-size: 13px; font-weight: 700; fill: var(--ink); }
.d-small { font-size: 11px; font-weight: 800; fill: var(--ink-soft); }
.d-beam { fill: var(--c); }
.d-support { fill: var(--ink); }
.d-mass { fill: var(--orange); }
.d-load, .d-weight { stroke: var(--ink); stroke-width: 2.5; }
.d-weight { stroke: var(--pink); }
.d-head { fill: var(--ink); }
.d-dim { stroke: var(--ink-soft); stroke-width: 1.5; }
.d-dimbg { fill: var(--white); }

/* ---------- Parts ---------- */
.parts { display: grid; gap: 1rem; }
.part {
  display: grid; grid-template-columns: 44px 1fr; gap: .4rem 1rem; align-items: start;
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  background: #faf9ff;
  border: 2px solid #efecfb;
  transition: border-color .3s ease, background .3s ease;
}
.part.is-right { border-color: var(--teal); background: #effcf8; }
.part.is-wrong { border-color: var(--pink); background: #fff3f6; animation: shake .45s ease; }
.part__label { font-family: var(--font-head); font-size: 1.2rem; color: var(--c); padding-top: .1rem; }
.part__text { font-weight: 600; }
.part__text .tip { display: block; font-size: .85rem; color: var(--ink-soft); font-weight: 600; margin-top: .2rem; }
.part__answer { grid-column: 2; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-top: .4rem; }
.part__marks { font-size: .8rem; font-weight: 800; color: var(--ink-soft); }

.ans {
  width: 170px;
  padding: .7rem .9rem;
  border: 2px solid #ddd9f1;
  border-radius: 12px;
  font: inherit; font-size: 1.1rem; font-weight: 700;
  color: var(--ink);
  background: var(--white);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ans:focus { outline: none; border-color: var(--c); box-shadow: 0 0 0 4px var(--c-soft); }
.ans__unit { font-weight: 700; color: var(--ink-soft); }

.choices { display: flex; gap: .5rem; flex-wrap: wrap; }
.choice {
  padding: .6rem 1.1rem; border-radius: 12px;
  border: 2px solid #ddd9f1; background: var(--white);
  font: inherit; font-weight: 800; color: var(--ink); cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.choice:hover { transform: translateY(-2px); border-color: var(--c); }
.choice.is-picked { background: var(--c); border-color: var(--c); color: var(--white); }

.verdict {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  font-weight: 800; color: var(--white);
  transform: scale(0);
}
.verdict.is-right { background: var(--teal); animation: popIn .4s cubic-bezier(.34,1.56,.64,1) forwards; }
.verdict.is-wrong { background: var(--pink); animation: popIn .4s cubic-bezier(.34,1.56,.64,1) forwards; }
@keyframes popIn { to { transform: scale(1); } }
.part.is-partial { border-color: var(--orange); background: #fff8ec; }
.verdict.is-partial {
  width: auto; min-width: 30px; padding: 0 .5rem; border-radius: 999px;
  background: var(--orange); font-size: .8rem;
  animation: popIn .4s cubic-bezier(.34,1.56,.64,1) forwards;
}

/* Mark-scheme breakdown under a part */
.scheme {
  grid-column: 2; list-style: none; display: grid; gap: .35rem;
  margin-top: .5rem; padding: .7rem .8rem; border-radius: 12px;
  background: rgba(255,255,255,.75); border: 1px dashed #dcd8ef;
  font-size: .9rem; animation: cardIn .35s ease;
}
.scheme li { display: flex; align-items: baseline; gap: .5rem; }
.scheme__tick { font-weight: 800; width: 1rem; flex-shrink: 0; }
.scheme li.is-ok .scheme__tick { color: var(--teal); }
.scheme li.is-miss .scheme__tick { color: var(--pink); }
.scheme__label {
  flex-shrink: 0; font-size: .72rem; font-weight: 800; letter-spacing: .03em;
  padding: .05rem .45rem; border-radius: 6px; background: var(--c-soft); color: var(--c);
}
.scheme__desc em { color: var(--ink-soft); font-style: normal; font-size: .82rem; }
.scheme .katex { font-size: 1em; }
/* What went wrong, at the top of the mark scheme */
.scheme li.scheme__why { display: block; padding: .45rem .6rem; margin-bottom: .15rem; border-radius: 9px; background: #fff1f4; color: #7a1f37; line-height: 1.45; }
.scheme li.scheme__why .scheme__next { display: block; margin-top: .3rem; color: #4a3a12; }
.scheme li.scheme__why .scheme__next > b { color: #8a5a00; }
.scheme__tag { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: .05rem .45rem; margin-right: .3rem; border-radius: 6px; background: #ffd9e2; color: #a3244a; }

/* Working lines that earned a method mark */
.wline.is-credited { background: #e8fbf6; box-shadow: inset 4px 0 0 var(--teal), inset 0 -1px 0 #e9e6f7; }
.wline.is-credited::after { content: "M ✓"; margin-left: auto; padding: 0 .6rem; font-size: .75rem; font-weight: 800; color: var(--teal); white-space: nowrap; }
.pager__dot.has-credit { border-color: var(--teal); }

/* Working lines with a problem */
.wline.is-flagged { background: #fff6e8; box-shadow: inset 4px 0 0 var(--orange), inset 0 -1px 0 #e9e6f7; }
.wline.is-flagged::after { content: "!"; margin-left: auto; margin-right: .6rem; width: 22px; height: 22px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: var(--white); font-weight: 800; font-size: .8rem; }
.wline.is-credited.is-flagged::after { content: "!"; }
.wline { flex-wrap: wrap; }
.wline__note {
  flex-basis: 100%;
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  margin: -.2rem .4rem .55rem .9rem; padding: .4rem .7rem;
  border-radius: 10px; background: #fff; border: 1px dashed #ffc078;
  font-size: .88rem; font-weight: 600; color: #8a4b00;
  animation: cardIn .3s ease;
}
.wline__copy { font-size: 1.05rem; color: var(--ink); }
.wline__why::before { content: "↳ "; }
.wline__why .katex { font-size: 1em; }
.issue__line {
  margin: .3rem 0 .4rem; padding: .45rem .8rem; border-radius: 10px;
  background: #fff8ec; font-size: 1.1rem; overflow-x: auto;
}
.wline.is-flash { animation: flashLine 1.2s ease; }
@keyframes flashLine { 0%, 60% { background: #ffe2b8; } }

/* Feedback panel */
.panel--feedback { background: #fffaf2; border: 2px solid #ffd9a3; }
.issues { list-style: none; display: grid; gap: .8rem; margin-top: .6rem; counter-reset: iss; }
.issue { background: var(--white); border-radius: 12px; padding: .85rem 1rem; border-left: 4px solid var(--orange); }
.issue--missing { border-left-color: var(--c); }
.issue__top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .35rem; }
.issue__where {
  border: 0; cursor: pointer; padding: .2rem .65rem; border-radius: 999px;
  background: #fff1dc; color: #a35c00; font: inherit; font-size: .78rem; font-weight: 800;
}
.issue__where:hover { background: #ffe2b8; }
.issue p { margin-top: .3rem; font-size: .95rem; }
.issue__tag { display: inline-block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: .1rem .45rem; border-radius: 6px; background: #ffe9cc; color: #a35c00; margin-right: .3rem; }
.issue__tag--next { background: #e3f8f2; color: #0b8a72; }
.issue .katex { font-size: 1em; }

.part__msg { grid-column: 2; font-size: .9rem; font-weight: 700; color: var(--pink); min-height: 0; }

/* ---------- Actions ---------- */
.pactions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; align-items: center; }
.pactions .btn--primary { background: var(--c); box-shadow: 0 6px 0 rgba(0,0,0,.2); }
.pactions .spacer { flex: 1; }
.btn--soft { background: var(--c-soft); color: var(--ink); border-color: transparent; }
.btn--soft:hover { background: var(--ink); color: var(--white); transform: translateY(-2px); }

/* ---------- Hint & solution panels ---------- */
.panel {
  margin-top: 1.2rem;
  border-radius: 16px;
  padding: 1.1rem 1.3rem;
  animation: cardIn .4s ease;
}
.panel h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.panel--hint { background: #fff8e6; border: 2px dashed var(--orange); }
.panel--solution { background: var(--c-soft); }
.steps-list { list-style: none; counter-reset: st; display: grid; gap: .6rem; }
.steps-list li {
  counter-increment: st;
  position: relative; padding-left: 2.3rem;
  opacity: 0; transform: translateX(-10px);
  animation: stepIn .45s ease forwards;
  animation-delay: calc(var(--i) * .35s);
}
.steps-list li::before {
  content: counter(st);
  position: absolute; left: 0; top: .1rem;
  width: 1.6rem; height: 1.6rem; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--c); color: var(--white); font-weight: 800; font-size: .8rem;
}
@keyframes stepIn { to { opacity: 1; transform: none; } }

.banner {
  margin-top: 1.2rem; padding: 1rem 1.2rem; border-radius: 14px;
  font-weight: 800; font-family: var(--font-head); font-size: 1.2rem;
  animation: cardIn .4s ease;
}
.banner--full { background: #e8fbf6; color: #0b8a72; }
.banner--part { background: #fff8e6; color: #b06a00; }

/* ---------- Question + workings side by side ---------- */
.pcard__grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 1.6rem; align-items: start; }
.pcard__workings { min-width: 0; }

/* ---------- Maths answer fields (MathLive) ---------- */
math-field.ans {
  min-width: 190px;
  padding: .45rem .7rem;
  font-size: 1.25rem;
  border: 2px solid #ddd9f1;
  border-radius: 12px;
  background: var(--white);
  --primary: var(--c);
  --caret-color: var(--c);
  --selection-background-color: var(--c-soft);
  --contains-highlight-background-color: transparent;
  --placeholder-color: #a9a6c4;
  --placeholder-opacity: 1;
}
math-field.ans:focus-within { outline: none; border-color: var(--c); box-shadow: 0 0 0 4px var(--c-soft); }
/* Expression answers (Differentiate … / Find ∫ … dx) are long: their box takes the whole row */
.part__answer .mf-wrap:has(> [data-kind="expr"]) { display: block; flex: 1 1 100%; min-width: 0; }
math-field.ans[data-kind="expr"], input.ans[data-kind="expr"] { display: block; width: 100%; box-sizing: border-box; }
math-field::part(menu-toggle) { display: none; }

/* No blue highlights: use the page's own colours in light AND dark mode */
math-field {
  color-scheme: light;
  --selection-background-color: var(--c-soft);
  --selection-color: var(--ink);
  --highlight-text: transparent;
  --text-highlight-background-color: transparent;
  --contains-highlight-background-color: transparent;
  --placeholder-color: var(--c);
}

/* Our own hint text for empty boxes (never highlighted) */
.mf-wrap { position: relative; display: inline-block; }
.mf-wrap--block { display: block; width: 100%; }
.mf-hint {
  display: none;
  position: absolute; left: 24px; top: 50%; transform: translateY(-50%); /* starts just after the typing cursor */
  color: #a9a6c4; font-weight: 600; font-size: 1.05rem;
  pointer-events: none; user-select: none; white-space: nowrap;
  max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; /* never past the box's edge */
}
.mf-wrap--block .mf-hint { left: 16px; font-size: 1.15rem; color: #c4c1da; white-space: normal; line-height: 1.2; }
/* Touch screens show the keyboard button just after the typing area: wrap the hint before it (Welsh is longer) */
@media not (pointer: fine) {
  .mf-wrap--block .mf-hint { white-space: normal; max-width: calc(100% - 130px); font-size: 1rem; line-height: 1.2; }
}
.mf-wrap.is-empty .mf-hint { display: block; }
@media (pointer: fine) { math-field::part(virtual-keyboard-toggle) { display: none; } }
.ans__reading { font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.ans__reading.is-bad { color: var(--orange); }

/* ---------- Workings ---------- */
.workings {
  border: 2px solid #efecfb;
  border-radius: 18px;
  background: #fdfcff;
  padding: 1rem;
}
.workings__head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .7rem; flex-wrap: wrap; }
.workings__tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .5rem .8rem; }
.workings__toggle {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .85rem; border-radius: 999px;
  border: 2px solid var(--c); background: var(--c); color: var(--white);
  font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; white-space: nowrap;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.workings__toggle:hover { transform: translateY(-1px); }
.workings__toggle-icon { font-family: var(--font-head); font-size: 1rem; line-height: 1; }
.symbols-hidden .workings__toggle { background: var(--white); color: var(--c); }

/* Collapsible symbol toolbar (grid-rows trick animates the height) */
.palette-wrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s cubic-bezier(.22,1,.36,1), opacity .25s ease; }
.palette-wrap__inner { overflow: hidden; min-height: 0; }
.symbols-hidden .palette-wrap { grid-template-rows: 0fr; opacity: 0; }
.workings__head h3 { font-size: 1.15rem; }
.workings__clear, .workings__add {
  border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 800; font-size: .85rem; color: var(--ink-soft);
}
.workings__clear:hover, .workings__add:hover { color: var(--c); }
.workings__add { margin-top: .5rem; }

.workings__lines {
  display: grid;
  border-radius: 12px;
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 59px, #e9e6f7 59px, #e9e6f7 60px),
    var(--white);
  border: 1px solid #e9e6f7;
  min-height: 480px;
  height: 480px;
  padding: 0 .6rem;
  align-content: start;
  overflow-y: auto;
  resize: vertical;   /* drag the bottom-right corner to make it taller */
  background-attachment: local; /* the ruled lines scroll with the working */
}
.symbols-hidden .workings__lines { height: 640px; min-height: 640px; }
/* Each row draws its own white background and bottom rule, so a tall row (a fraction) is never crossed by
   the ruled lines behind it. mathinput.js makes a tall row a whole number of lines tall (60, 120, 180px…),
   so the empty ruled lines below still line up. */
.wline { min-height: 60px; display: flex; align-items: center; margin: 0 -.6rem; padding: 0 .6rem; background: var(--white); box-shadow: inset 0 -1px 0 #e9e6f7; }

/* ---------- Workings pages ---------- */
.pager {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  margin-bottom: .6rem;
}
.pager__btn {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 12px; border: 2px solid #e4e1f5; background: var(--white);
  font: 700 1.5rem/1 var(--font-head); color: var(--ink); cursor: pointer;
  transition: border-color .2s ease, transform .15s ease, background .2s ease, color .2s ease;
}
.pager__btn:hover:not(:disabled) { border-color: var(--c); transform: translateY(-1px); }
.pager__btn:active:not(:disabled) { transform: translateY(1px); }
.pager__btn:disabled { opacity: .35; cursor: default; }
.pager__btn.is-new { border-style: dashed; border-color: var(--c); color: var(--c); }
.pager__middle { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.pager__label { font-weight: 800; font-size: .85rem; color: var(--ink-soft); }
.pager__dots { display: flex; gap: .35rem; }
.pager__dot {
  width: 9px; height: 9px; padding: 0; border-radius: 50%;
  border: 2px solid #d9d5ee; background: var(--white); cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.pager__dot.has-work { background: #d9d5ee; }
.pager__dot.is-current { border-color: var(--c); background: var(--c); transform: scale(1.25); }

.workings__lines.slide-left  { animation: pageInLeft .3s cubic-bezier(.22,1,.36,1); }
.workings__lines.slide-right { animation: pageInRight .3s cubic-bezier(.22,1,.36,1); }
@keyframes pageInLeft  { from { opacity: 0; transform: translateX(24px); } }
@keyframes pageInRight { from { opacity: 0; transform: translateX(-24px); } }
.workings__lines[hidden] { display: none; }
.wline__field {
  width: 100%;
  font-size: 1.4rem;
  border: 0;
  background: transparent;
  padding: .35rem .3rem;
  --primary: var(--c);
  --caret-color: var(--c);
  --selection-background-color: var(--c-soft);
  --placeholder-color: #c4c1da;
  --placeholder-opacity: 1;
}
.wline__field:focus-within { outline: none; background: rgba(255,255,255,.7); border-radius: 8px; box-shadow: inset 3px 0 0 var(--c); }
.workings__plain {
  width: 100%; border: 1px solid #e9e6f7; border-radius: 12px; padding: .8rem;
  font: inherit; resize: vertical;
}

/* ---------- Symbol palette ---------- */
.palette { padding-bottom: .8rem; }
.palette__tabs { display: flex; flex-wrap: wrap; gap: .3rem; padding-bottom: .5rem; }
.palette__tab {
  flex-shrink: 0;
  padding: .35rem .7rem; border-radius: 999px;
  border: 0; background: #f1eff9; cursor: pointer;
  font: inherit; font-size: .78rem; font-weight: 800; color: var(--ink-soft);
  transition: background .2s ease, color .2s ease;
}
.palette__tab:hover { color: var(--ink); }
.palette__tab.is-active { background: var(--c); color: var(--white); }
.palette__tab--text { background: transparent; border: 2px solid #e4e1f5; }
.palette__tab--text.is-on { background: var(--ink); color: var(--white); border-color: var(--ink); }

.palette__keys { display: none; flex-wrap: wrap; gap: .35rem; padding: .5rem; border-radius: 12px; background: #f6f5fc; }
.palette__keys.is-active { display: flex; animation: cardIn .25s ease; }
.key {
  min-width: 42px; height: 42px; padding: 0 .55rem;
  display: inline-grid; place-items: center;
  border: 1px solid #e4e1f5; border-radius: 10px;
  background: var(--white); cursor: pointer;
  color: var(--ink); font-size: .95rem;
  box-shadow: 0 2px 0 #e4e1f5;
  transition: transform .12s ease, border-color .15s ease, box-shadow .12s ease;
}
.key:hover { border-color: var(--c); transform: translateY(-1px); }
.key:active, .key.is-pressed { transform: translateY(2px); box-shadow: 0 0 0 #e4e1f5; }
.key .katex { font-size: 1.05em; }
.key--tall { height: 54px; }
.key--tall .katex { font-size: .92em; }
.palette__note { font-size: .78rem; color: var(--ink-soft); font-weight: 600; margin-top: .35rem; }

@media (max-width: 1000px) {
  .pcard__grid { grid-template-columns: minmax(0, 1fr); }
}

.missing { text-align: center; padding: 3rem 1rem; }
.missing a { color: var(--c); font-weight: 800; }

@media (max-width: 640px) {
  .pcard { padding: 1.4rem 1.1rem; }
  .part { grid-template-columns: 1fr; }
  .part__answer, .part__msg, .scheme { grid-column: 1; }
  .ans { width: 100%; flex: 1; min-width: 0; }
  .part__answer .mf-wrap { flex: 1; min-width: 0; }
  .pactions .spacer { display: none; }
  .pactions .btn { flex: 1 1 auto; }
}

/* Keep the "M ✓" / "!" markers in the top-right corner of a line, even when a note sits underneath */
.wline { position: relative; }
.wline.is-credited::after, .wline.is-flagged::after { position: absolute; right: .6rem; top: 19px; margin: 0; }
.wline__field { padding-right: 3rem; }

/* Tables of data inside a question */
.qtable { overflow-x: auto; margin: 0.8rem 0; padding: 0.4rem 0; font-size: 0.9em; }

/* =========================================================
   Worked examples (before the questions)
   ========================================================= */
.qtab--learn { border-style: dashed; }
.qtab--learn b { background: transparent; width: auto; }
.qtab--learn.is-active b { background: transparent; }

.wt__top { align-items: flex-start; gap: 1rem; }
.wt__kicker { display: block; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c); margin-bottom: .25rem; }
.wt__skip { flex-shrink: 0; color: var(--c); border-color: var(--c); }

.wt { display: grid; gap: 1.1rem; margin: 1.2rem 0 1.4rem; }
.wt__label { display: block; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .35rem; }
.wt__q { background: var(--c-soft); border-radius: 18px; padding: 1.1rem 1.3rem; font-size: 1.08rem; line-height: 1.6; }

.wt__steps { list-style: none; display: grid; gap: .8rem; padding: 0; margin: 0; }
.wt__step { display: none; grid-template-columns: auto 1fr; gap: .9rem; align-items: start; }
.wt__step.is-shown { display: grid; animation: wtIn .45s cubic-bezier(.22,1,.36,1); }
@keyframes wtIn { from { opacity: 0; transform: translateY(10px); } }
.wt__num {
  width: 2rem; height: 2rem; border-radius: 10px; display: grid; place-items: center;
  background: var(--c); color: var(--white); font-weight: 800; font-size: .9rem; margin-top: .2rem;
}
.wt__body { border: 2px solid #efecfb; border-radius: 16px; overflow: hidden; }
.wt__work { padding: .85rem 1.1rem; font-size: 1.1rem; line-height: 1.7; background: var(--white); }
.wt__why { padding: .7rem 1.1rem; background: #fbfaff; border-top: 2px dashed #efecfb; color: var(--ink-soft); line-height: 1.55; }
.wt__tag { display: inline-block; margin-right: .35rem; padding: .1rem .55rem; border-radius: 999px; background: var(--c); color: var(--white); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }

.wt__end { display: grid; gap: .8rem; animation: wtIn .45s cubic-bezier(.22,1,.36,1); }
.wt__end[hidden] { display: none; }
.wt__ans { border: 2px solid var(--teal); background: #f2fcf9; border-radius: 16px; padding: .9rem 1.2rem; font-size: 1.1rem; }
.wt__ans .wt__label { color: var(--teal); }
.wt__tip { background: #fff8e6; border-radius: 16px; padding: .8rem 1.2rem; line-height: 1.55; }
.wt__tip > span { font-weight: 800; margin-right: .3rem; }

.wt__remember { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; font-size: .88rem; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.wt__remember input { width: 1.05rem; height: 1.05rem; accent-color: var(--c); }

@media (max-width: 640px) {
  .wt__top { flex-direction: column; }
  .wt__step { grid-template-columns: 1fr; gap: .4rem; }
}
.scheme__desc .scheme__where { color: var(--ink-soft); font-size: .82rem; }

/* ---------- Exam-style diagrams (diagrams.js) ---------- */
.d-curve { fill: none; stroke: var(--c); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: dline 1.3s .15s ease forwards; }
.d-curve2 { fill: none; stroke: var(--orange); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: dline 1.3s .35s ease forwards; }
.d-line2 { stroke: var(--orange); stroke-width: 2.5; stroke-linecap: round; }
.d-shade { fill: var(--c-soft); opacity: .9; }
.d-strip { fill: rgba(255, 159, 28, .16); stroke: var(--orange); stroke-width: 1.5; }
.d-point { fill: var(--ink); }
.d-pointH { fill: var(--white); stroke: var(--ink); stroke-width: 2; }
.d-axislabel { font-size: 14px; font-weight: 700; font-style: italic; fill: var(--ink); }
.d-curvelabel { font-size: 13px; font-weight: 800; fill: var(--ink-soft); font-style: italic; }
.d-vec { stroke: var(--pink); stroke-width: 2.5; }
.d-headA { fill: var(--pink); }
.d-headF { fill: var(--ink); }
.d-force { stroke: var(--ink); stroke-width: 2.4; }
.d-forceW { stroke: var(--pink); stroke-width: 2.4; }
.d-accel { stroke: var(--pink); stroke-width: 2.4; stroke-dasharray: 5 3; }
.d-tri { fill: var(--c-soft); stroke: var(--c); stroke-width: 2.5; stroke-linejoin: round; }
.d-vertex { font-size: 15px; font-weight: 800; fill: var(--ink); }
.d-arc { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; }
.d-anglelabel { font-size: 13px; font-weight: 800; fill: var(--c); }
.d-sector { fill: var(--c-soft); stroke: var(--c); stroke-width: 2.5; stroke-linejoin: round; }
.d-sector--open { fill: none; }
.d-chord { stroke: var(--ink); stroke-width: 2; }
.d-box { fill: none; stroke: var(--ink); stroke-width: 1.8; }
.d-setA { fill: rgba(108, 76, 245, .12); stroke: var(--purple); stroke-width: 2.4; }
.d-setB { fill: rgba(255, 92, 138, .12); stroke: var(--pink); stroke-width: 2.4; }
.d-region { font-size: 16px; font-weight: 800; fill: var(--ink); }
.d-branch { stroke: var(--ink-soft); stroke-width: 2; }
.d-prob { font-size: 13px; font-weight: 800; fill: var(--c); }
.d-ceiling, .d-wallh, .d-wallv { } /* filled with hatching by diagrams.js */
.d-rope { stroke: var(--ink); stroke-width: 2; }
.d-pulley { fill: var(--white); stroke: var(--ink); stroke-width: 2.4; }
.d-mass--2 { fill: var(--blue); }
.d-masslabel { font-size: 12px; font-weight: 800; fill: var(--white); }
.d-masslabel2 { font-size: 12px; font-weight: 800; fill: var(--ink); }
.d-ground { stroke: var(--ink); stroke-width: 2.5; }
.d-sea { stroke: var(--blue); stroke-width: 3; stroke-dasharray: 10 6; }
.d-table { fill: #d9c3a5; }
.d-rough { stroke: #a8865a; stroke-width: 1.5; } /* filled with hatching by diagrams.js */
.d-wedge { fill: #e6e3f3; stroke: var(--ink); stroke-width: 1.8; }
.d-leg { stroke: #a8865a; stroke-width: 6; }
.d-particle { fill: var(--orange); stroke: var(--ink); stroke-width: 1.5; }
.d-liftbox { fill: #f3f1fb; stroke: var(--ink); stroke-width: 2.4; }
.d-person { fill: var(--teal); }
.d-personleg { stroke: var(--teal); stroke-width: 7; stroke-linecap: round; }
.d-scales { fill: var(--ink-soft); }
.d-wheel { fill: var(--ink); }
.d-cliff { fill: #d8d0bd; stroke: #9c9178; stroke-width: 2; }
.d-trajectory { fill: none; stroke: var(--c); stroke-width: 2.5; stroke-dasharray: 7 5; }
.d-wall { } /* filled with hatching by diagrams.js */
.d-hinge { fill: var(--white); stroke: var(--ink); stroke-width: 2.4; }
.d-sheet { fill: var(--c-soft); stroke: var(--c); stroke-width: 2.5; }
.d-cut { fill: var(--white); stroke: var(--ink-soft); stroke-width: 1.5; stroke-dasharray: 4 3; }
.d-dashrect { fill: none; stroke: var(--c); stroke-width: 1.5; stroke-dasharray: 6 4; }
.d-cyl { fill: var(--c-soft); stroke: var(--c); stroke-width: 2.5; }
.d-cyltop { fill: #fff; stroke: var(--c); stroke-width: 2.5; }
.d-dimdark { stroke: var(--ink); stroke-width: 1.8; }
.d-fence { fill: none; stroke: var(--ink); stroke-width: 3; stroke-dasharray: 2 5; stroke-linecap: round; }
.d-penfill { fill: var(--c-soft); }
.d-none { display: none; }
.dtable-wrap { overflow-x: auto; margin: 0 auto 1.4rem; max-width: 100%; }
.dtable { border-collapse: collapse; margin: 0 auto; font-weight: 700; background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 2px #efecfb; }
.dtable th, .dtable td { padding: .55rem 1rem; text-align: center; border: 1px solid #ece9f6; }
.dtable thead th { background: var(--c-soft); }
.dtable tbody th { background: #faf9ff; text-align: left; }
.dtable caption { caption-side: top; font-size: .9rem; color: var(--ink-soft); padding-bottom: .4rem; }
.d-line3 { stroke: var(--blue); stroke-width: 2.5; stroke-linecap: round; }
.diagram .d-dash, .diagram .d-dim { fill: none; }
.d-vtline { stroke: var(--c); stroke-width: 3.5; stroke-linecap: round; }

/* Diagrams scale down on phones, so make their labels a little bigger there */
@media (max-width: 520px) {
  .diagram .d-label, .diagram .d-curvelabel, .diagram .d-anglelabel, .diagram .d-prob { font-size: 16px; }
  .diagram .d-small { font-size: 13.5px; }
  .diagram .d-vertex, .diagram .d-axislabel { font-size: 17px; }
  .diagram .d-masslabel, .diagram .d-masslabel2 { font-size: 14px; }
}

/* ---------- Key ideas (before the worked examples) ---------- */
.ki { display: grid; gap: 1rem; margin: 1.2rem 0 1.4rem; }
.ki__block { background: var(--c-soft); border-radius: 18px; padding: 1rem 1.3rem; line-height: 1.6; }
.ki__block h3 { font-size: 1.05rem; margin-bottom: .45rem; }
.ki__block--how { font-size: 1.06rem; }
.ki__block--warn { background: #fff4ec; }
.ki__list { margin: 0; padding-left: 1.2rem; display: grid; gap: .45rem; }
.ki__formulas { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.ki__formula { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr auto; align-items: center; gap: .4rem .9rem; background: var(--white); border-radius: 14px; padding: .6rem .9rem; }
.ki__flabel { font-weight: 800; font-size: .9rem; }
.ki__ftex { overflow-x: auto; overflow-y: hidden; padding: .15rem 0; min-width: 0; }
.ki__fbadge { font-size: .74rem; font-weight: 800; border-radius: 99px; padding: .2rem .6rem; white-space: nowrap; justify-self: end; }
.ki__fbadge.is-given { background: #e3f0ff; color: #1f5fbf; }
.ki__fbadge.is-learn { background: #fff0d6; color: #9a5b00; }
.ki__note { font-size: .8rem; color: var(--ink-soft); margin-top: .6rem; }
@media (max-width: 640px) {
  .ki__formula { grid-template-columns: 1fr; }
  .ki__fbadge { justify-self: start; white-space: normal; }
}

/* ---------- Drawing box (sketchpad.js) ---------- */
.workings__draw {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .85rem; border-radius: 999px;
  border: 2px solid var(--c); background: var(--white); color: var(--c);
  font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; white-space: nowrap;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.workings__draw:hover { transform: translateY(-1px); }
.workings__draw.is-on { background: var(--c); color: var(--white); }
.workings__sketch { margin-bottom: .9rem; }
.workings__sketch[hidden] { display: none; }

.sk { display: flex; flex-direction: column; gap: .5rem; }
.sk__bar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; }
.sk__group { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.sk__right { margin-left: auto; }
.sk__btn {
  min-width: 36px; height: 36px; padding: 0 .4rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #e6e2f6; border-radius: 10px; background: var(--white); color: var(--ink);
  font: inherit; font-size: 1rem; font-weight: 800; line-height: 1; cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.sk__btn:hover:not(:disabled) { border-color: var(--c); transform: translateY(-1px); }
.sk__btn:disabled { opacity: .35; cursor: default; }
.sk__btn.is-on { border-color: var(--c); background: var(--tint); color: var(--c); }
.sk__tool[data-tool="text"] { font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; }
.sk__swatch {
  width: 28px; height: 28px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 3px solid var(--white); background: var(--sw); box-shadow: 0 0 0 2px #e6e2f6;
  transition: transform .15s ease, box-shadow .15s ease;
}
.sk__swatch:hover { transform: scale(1.1); }
.sk__swatch.is-on { box-shadow: 0 0 0 2px var(--sw); transform: scale(1.1); }
.sk__size span { display: block; width: var(--dot); height: var(--dot); border-radius: 50%; background: currentColor; }
.sk__tpl {
  height: 36px; max-width: 11rem; padding: 0 .5rem;
  border: 2px solid var(--c); border-radius: 10px; background: var(--white); color: var(--c);
  font: inherit; font-size: .85rem; font-weight: 800; cursor: pointer;
}
.sk__sub {
  position: absolute; z-index: 1; top: .45rem; left: .45rem; max-width: calc(100% - .9rem);
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; padding: .35rem .5rem;
  border-radius: 10px; background: rgba(243, 240, 255, .96); box-shadow: 0 4px 14px rgba(29, 27, 58, .12);
}
.sk__sub[hidden] { display: none; }
.sk__symbar { right: .45rem; }
.sk__symbar > * { flex: none; }
.sk__subtext { font-size: .8rem; font-weight: 800; color: var(--ink-soft); margin-right: .2rem; }
.sk__chip {
  min-width: 32px; height: 30px; padding: 0 .55rem; border-radius: 8px; cursor: pointer;
  border: 1.5px solid #dcd6f5; background: var(--white); color: var(--ink);
  font: inherit; font-size: .85rem; font-weight: 800;
}
.sk__chip:hover { border-color: var(--c); color: var(--c); }
.sk__stage { position: relative; }
.sk__svg {
  display: block; width: 100%; height: auto; aspect-ratio: 8 / 5;
  border: 1px solid #e9e6f7; border-radius: 12px; background: #fff;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; outline: none;
}
.sk__svg:focus-visible { box-shadow: 0 0 0 3px var(--tint); border-color: var(--c); }
.sk[data-tool="move"] .sk__svg { cursor: grab; }
.sk[data-tool="text"] .sk__svg { cursor: text; }
.sk[data-tool="eraser"] .sk__svg { cursor: cell; }
.sk__empty {
  position: absolute; inset: 0; display: none; place-items: center; padding: 1rem 2rem;
  text-align: center; font-weight: 700; font-size: .9rem; color: #a4a0c2; pointer-events: none;
}
.sk.is-empty .sk__empty { display: grid; }
.sk__note { margin: 0; font-size: .78rem; color: var(--ink-soft); }
.sk__input {
  position: absolute; z-index: 2; min-width: 8rem; padding: .1rem .3rem;
  border: 2px dashed var(--c); border-radius: 6px; background: rgba(255, 255, 255, .92);
  font-family: var(--font-body); font-weight: 700; line-height: 1.15; outline: none;
}
/* the pieces inside the drawing */
.sk-hit { fill: none; stroke: transparent; pointer-events: stroke; }
.sk-tplhit { fill: transparent; stroke: none; }
.sk-sel { fill: none; stroke: var(--c, #6c4cf5); stroke-width: 2; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; pointer-events: none; }
.sk-text { font-family: var(--font-body); font-weight: 700; }
.sk-tpl line, .sk-tpl path, .sk-tpl circle, .sk-tpl polygon.sk-shape { stroke: var(--ink); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sk-tpl .sk-fill { fill: var(--ink); stroke: none; }
.sk-tpl text { fill: var(--ink); font-family: var(--font-body); font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.sk-tpl .sk-big { font-family: var(--font-head); font-weight: 600; }
.sk__live { pointer-events: none; }
.sk__tool[data-tool="angle"] { font-size: 1.2rem; }
.sk__hint {
  position: absolute; left: 50%; bottom: .6rem; transform: translateX(-50%); z-index: 2; margin: 0;
  width: max-content; max-width: calc(100% - 1rem); padding: .4rem .8rem; border-radius: 999px; text-align: center;
  background: var(--ink); color: var(--white); font-size: .82rem; font-weight: 800;
  opacity: 0; pointer-events: none;
}
.sk__hint.is-on { animation: skHint 3s ease forwards; }
@keyframes skHint { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
.sk-snap { fill: rgba(108, 76, 245, .15); stroke: var(--c, #6c4cf5); stroke-width: 2.5; }

/* Full screen (handy on phones and tablets) */
html.sk-lock, html.sk-lock body { overflow: hidden; }
.sk--full {
  position: fixed; inset: 0; z-index: 1000; padding: .8rem; background: var(--bg);
}
.sk--full .sk__stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.sk--full .sk__svg { width: auto; height: auto; max-width: 100%; max-height: 100%; }
@supports (aspect-ratio: 1) {
  .sk--full .sk__svg { width: min(100%, calc((100dvh - 9rem) * 1.6)); }
}

/* On an upright phone in full screen, suggest turning it sideways */
.sk__turn { display: none; margin: 0; text-align: center; font-weight: 800; font-size: .85rem; color: var(--c); }
@media (orientation: portrait) and (max-width: 700px) { .sk--full .sk__turn { display: block; } }

@media (max-width: 640px) {
  .sk__right { margin-left: 0; }
  .sk__btn { min-width: 34px; height: 34px; }
  .sk__swatch { width: 26px; height: 26px; }
  .sk__empty { font-size: .8rem; padding: .5rem 1rem; }
  .sk__sub { top: .3rem; left: .3rem; padding: .25rem .3rem; gap: .2rem; }
  .sk__symbar { right: .3rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sk__symbar::-webkit-scrollbar { display: none; }
  .sk__selbar { right: .3rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sk__selbar::-webkit-scrollbar { display: none; }
  .sk__selbar > * { flex: none; }
  .sk__sub .sk__subtext { display: none; }
  .sk__chip { height: 28px; padding: 0 .4rem; font-size: .78rem; }
}
.sk-anglabel { paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }

/* Editing an angle mark: drag the dots */
.sk-handle { fill: #fff; stroke: var(--c, #6c4cf5); stroke-width: 3; cursor: grab; vector-effect: non-scaling-stroke; }
.sk-handle:hover { fill: var(--tint); }
.sk-vertex { fill: var(--c, #6c4cf5); pointer-events: none; }
.sk__chip[hidden] { display: none; }

/* =========================================================
   EXAM LOOK FOR DIAGRAMS (19 Nov 2026)
   WJEC papers draw diagrams in black and shades of grey: grey
   blocks, rods and pulleys with black outlines, thin black strings,
   hatched rough surfaces, black force arrows and a double arrowhead
   for acceleration. These rules override the colours above so the
   practice diagrams look like the ones pupils meet in the exam.
   Delete this whole block to go back to the coloured diagrams.
   ========================================================= */
.diagram { --dg-ink: #1d1d24; --dg-ink2: #55555f; --dg-grey: #d6d6da; --dg-grey2: #b4b4bb; --dg-pale: #f1f1f3; }
.diagram .d-axis { stroke: var(--dg-ink); stroke-width: 1.6; }
.diagram .d-line, .diagram .d-vtline { stroke: var(--dg-ink); stroke-width: 2.6; }
.diagram .d-line2 { stroke: var(--dg-ink2); stroke-width: 2.4; }
.diagram .d-line3 { stroke: var(--dg-ink2); stroke-width: 2; stroke-dasharray: 7 4; }
.diagram .d-curve { stroke: var(--dg-ink); stroke-width: 2.6; }
.diagram .d-curve2 { stroke: var(--dg-ink2); stroke-width: 2.6; }
.diagram .d-fill, .diagram .d-shade { fill: var(--dg-grey); opacity: 1; }
.diagram .d-strip { fill: rgba(0, 0, 0, .07); stroke: var(--dg-ink2); }
.diagram .d-trajectory { stroke: var(--dg-ink); stroke-width: 2; }
.diagram .d-anglelabel, .diagram .d-prob { fill: var(--dg-ink); }
.diagram .d-arc { stroke: var(--dg-ink); stroke-width: 1.3; }
.diagram .d-tri { fill: var(--dg-pale); stroke: var(--dg-ink); stroke-width: 2; }
.diagram .d-sector { fill: var(--dg-grey); stroke: var(--dg-ink); stroke-width: 2; }
.diagram .d-setA, .diagram .d-setB { fill: none; stroke: var(--dg-ink); stroke-width: 2; }
.diagram .d-branch { stroke: var(--dg-ink); stroke-width: 1.6; }
.diagram .d-sheet, .diagram .d-cyl, .diagram .d-penfill { fill: var(--dg-pale); stroke: var(--dg-ink); }
.diagram .d-cyltop { stroke: var(--dg-ink); }
.diagram .d-dashrect { stroke: var(--dg-ink2); }
/* mechanics */
.diagram .d-mass, .diagram .d-mass--2 { fill: var(--dg-grey); stroke: var(--dg-ink); stroke-width: 1.5; }
.diagram .d-mass--2 { fill: var(--dg-grey2); }
.diagram .d-masslabel, .diagram .d-masslabel2 { fill: var(--dg-ink); }
.diagram .d-beam { fill: var(--dg-grey); stroke: var(--dg-ink); stroke-width: 1.3; }
.diagram .d-support { fill: var(--dg-grey2); stroke: var(--dg-ink); stroke-width: 1.3; }
.diagram .d-force, .diagram .d-forceW, .diagram .d-load, .diagram .d-weight, .diagram .d-vec { stroke: var(--dg-ink); stroke-width: 2; }
.diagram .d-accel { stroke: var(--dg-ink); stroke-width: 2; stroke-dasharray: none; }
.diagram .d-head, .diagram .d-headF, .diagram .d-headA { fill: var(--dg-ink); }
.diagram .d-rope { stroke: var(--dg-ink); stroke-width: 1.5; }
.diagram .d-pulley { fill: var(--dg-grey); stroke: var(--dg-ink); stroke-width: 1.8; }
.diagram .d-ceiling, .diagram .d-wallh, .diagram .d-wallv, .diagram .d-wall { stroke: var(--dg-ink); stroke-width: 1; } /* filled with the hatching by diagrams.js */
.diagram .d-hatchbg { fill: #fff; }
.diagram .d-hatchline { stroke: var(--dg-ink2); stroke-width: 1.2; }
.diagram .d-ground, .diagram .d-surface { stroke: var(--dg-ink); stroke-width: 2; }
.diagram .d-wedge { fill: var(--dg-pale); stroke: none; }
.diagram .d-rough { stroke: none; } /* hatching: see diagrams.js */
.diagram .d-table { fill: var(--dg-pale); stroke: var(--dg-ink); stroke-width: 1.5; }
.diagram .d-table.d-rough, .diagram rect.d-rough { stroke: var(--dg-ink); stroke-width: 1.5; }
.diagram .d-leg { stroke: var(--dg-ink2); stroke-width: 4; }
.diagram .d-particle { fill: var(--dg-ink); stroke: none; }
.diagram .d-liftbox { fill: var(--dg-pale); stroke: var(--dg-ink); stroke-width: 2; }
.diagram .d-person { fill: var(--dg-grey2); }
.diagram .d-personleg { stroke: var(--dg-grey2); }
.diagram .d-scales { fill: var(--dg-ink2); }
.diagram .d-wheel { fill: var(--dg-ink); }
.diagram .d-cliff { fill: var(--dg-grey); stroke: var(--dg-ink); stroke-width: 1.5; }
.diagram .d-sea { stroke: var(--dg-ink2); stroke-width: 2; }
.diagram .d-hinge { fill: #fff; stroke: var(--dg-ink); stroke-width: 2; }
.diagram .d-north { stroke: var(--dg-ink); stroke-width: 1.3; }
.diagram .d-leg2 { stroke: var(--dg-ink); stroke-width: 2; }
/* tables in questions: plain ruled tables, as on the exam paper */
.dtable { border-radius: 0; box-shadow: none; border: 1.5px solid #1d1d24; }
.dtable th, .dtable td { border: 1px solid #1d1d24; }
.dtable thead th { background: #ececef; }
.dtable tbody th { background: #f7f7f8; }

/* ---------- Draw the forces (practice/forcetool.js) ---------- */
.ft { position: relative; max-width: 520px; margin: 0 auto 1.4rem; }
.ft > svg.diagram { margin-bottom: .5rem; }
.ft.is-editing > svg.diagram { touch-action: none; outline: 2px dashed #9aa4b2; outline-offset: 4px; border-radius: 6px; }
.ft.is-editing[data-mode="add"] > svg.diagram { cursor: crosshair; }
.ft.is-editing[data-mode="select"] > svg.diagram .ft__hit, .ft.is-editing[data-mode="select"] > svg.diagram .ft__label { cursor: pointer; }
.ft.is-editing[data-mode="delete"] > svg.diagram .ft__hit, .ft.is-editing[data-mode="delete"] > svg.diagram .ft__label { cursor: not-allowed; }
.ft__bar { display: flex; flex-wrap: wrap; gap: .45rem .6rem; align-items: center; font-size: .92rem; }
.ft__note { color: var(--muted, #5b6474); flex: 1 1 14rem; }
.ft__tools { display: flex; flex-wrap: wrap; gap: .35rem; width: 100%; }
.ft__tool { font: inherit; font-weight: 700; font-size: .9rem; min-height: 2.5rem; padding: .35rem .8rem; border: 2px solid #ccd3dd; border-radius: 10px; background: #fff; cursor: pointer; }
.ft__tool.is-on { border-color: #1f5fbf; background: #e8f0fc; color: #1f5fbf; }
.ft__tip { margin: 0; width: 100%; color: var(--muted, #5b6474); font-size: .88rem; }
.ft__btns { display: flex; flex-wrap: wrap; gap: .35rem; }
.ft .btn--sm { padding: .35rem .7rem; font-size: .88rem; min-height: 2.3rem; }
.ft__arrow { stroke: #1f5fbf; stroke-width: 2.6; }
.ft__arrow.is-selected { stroke: #e0662b; stroke-width: 3.2; }
.ft__head { fill: #1f5fbf; }
.ft__headS { fill: #e0662b; }
.ft__headG { fill: #8a929e; }
.ft__hit { stroke: transparent; stroke-width: 30; stroke-linecap: round; }
.ft__label { fill: #1f5fbf; font-size: 15px; font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.ft__label.is-empty { fill: #e0662b; }
.ft__model { stroke: #8a929e; stroke-width: 2.4; stroke-dasharray: 6 4; }
.ft__modellabel { fill: #6b7380; font-size: 14px; font-style: italic; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.ft__pop { margin: 0 0 .6rem; background: #fff; border: 1px solid #ccd3dd; border-radius: 10px; box-shadow: 0 6px 22px rgba(0,0,0,.12); padding: .6rem .7rem; }
.ft__poplabel { font-weight: 700; font-size: .92rem; margin: 0 0 .4rem; }
.ft__types { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .35rem; margin-bottom: .55rem; }
.ft__type { font: inherit; font-size: .88rem; display: flex; justify-content: space-between; align-items: center; gap: .4rem; min-height: 2.5rem; padding: .3rem .6rem; border: 2px solid #ccd3dd; border-radius: 9px; background: #f4f6f9; cursor: pointer; text-align: left; }
.ft__type b { font-style: italic; }
.ft__type.is-on { border-color: #1f5fbf; background: #e8f0fc; }
.ft__fields { display: flex; flex-wrap: wrap; gap: .5rem .8rem; margin-bottom: .55rem; font-size: .86rem; }
.ft__fields label { display: flex; flex-direction: column; gap: .2rem; flex: 1 1 8rem; }
.ft__fields input { font: inherit; font-size: 1rem; padding: .35rem .5rem; border: 1px solid #ccd3dd; border-radius: 8px; min-width: 0; }
.ft__row { display: flex; gap: .4rem; flex-wrap: wrap; }
.ft__out { margin-top: .6rem; padding: .6rem .8rem; border-radius: 10px; font-size: .92rem; background: #f4f6f9; }
.ft__out.is-good { background: #e7f6ec; }
.ft__out.is-try { background: #fff5e6; }
.ft__headline { font-weight: 700; margin: 0 0 .3rem; }
.ft__out ul { margin: 0; padding-left: 1.1rem; }
.ft__out li { margin: .15rem 0; }
.ft__out li.is-missing { color: #a23b1d; }
.ft__out li.is-extra { color: #7a5a00; }
.ft__given { margin: 0 0 .35rem; color: var(--muted, #5b6474); font-size: .88rem; }

/* Show solution stays locked until an answer has been checked (29 Nov 2026) */
.pactions #solBtn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
