/* Scoped Maths scene, Watch card and two-part worksheet continuity. */
.maths-transfer .maths-definition {
  margin: .8rem 0 1rem;
  font-size: 1.08rem;
  line-height: 1.6;
}
.maths-transfer .maths-hero {
  margin: 1rem 0 1.4rem;
  text-align: center;
}
.maths-transfer .maths-hero picture {
  display: block;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}
.maths-transfer .maths-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
  margin-inline: auto;
}
.maths-transfer .maths-hero figcaption {
  max-width: 42rem;
  margin: .65rem auto 0;
  color: var(--ink-soft);
  line-height: 1.55;
}
.maths-transfer .maths-watch-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
  margin: 1rem 0;
}
.maths-transfer .maths-video-cover {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: #101923;
  line-height: 0;
}
.maths-transfer .maths-video-cover > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}
.maths-transfer .maths-video-play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #10232de6;
  color: #fff;
  box-shadow: 0 2px 12px #0006;
}
.maths-transfer .maths-video-play svg { display: block; }
.maths-transfer .maths-watch-copy p { margin: .65rem 0; }
.maths-transfer .maths-watch-copy .primary-watch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .7rem 1rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 700;
  line-height: 1.5;
}
.maths-transfer .maths-video-cover:focus-visible,
.maths-transfer .maths-watch-copy .primary-watch a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}
/* The illustration uses the title area's height, preserving all writing fields. */
.worksheet-page .maths-expansion-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  column-gap: 1rem;
  align-items: start;
}
.worksheet-page .maths-expansion-title > :first-child {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
.worksheet-page .maths-expansion-title > .print-student-name {
  grid-column: 1;
  grid-row: 2;
}
.worksheet-page .maths-worksheet-scene {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  display: block;
  margin: 0;
}
.worksheet-page .maths-worksheet-scene img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
@media (max-width: 640px) {
  .maths-transfer .maths-watch-card { grid-template-columns: minmax(0, 1fr); gap: .65rem; }
  .maths-transfer .maths-hero img { max-height: none; }
  .worksheet-page .maths-expansion-title { grid-template-columns: minmax(0, 1fr) 76px; gap: .65rem; }
}
@media print {
  html, body.worksheet-page { margin: 0 !important; padding: 0 !important; }
  .worksheet-page #app { margin: 0 !important; padding: 0 !important; min-height: 0 !important; }
  .worksheet-page #worksheet-form { margin: 0; padding: 0; }
  /* Give the two longer explanations real writing room. Keep normal block
     pagination so longer typed work can continue without a blank flex page. */
  .worksheet-page .print-sheet:nth-of-type(2) output[id$="work"] {
    min-height: 45mm;
    line-height: 1.6;
  }
}
@media print {
  .worksheet-page .maths-expansion-title {
    grid-template-columns: minmax(0, 1fr) 25mm;
    column-gap: 4mm;
    break-inside: avoid;
  }
  .worksheet-page .maths-worksheet-scene { width: 25mm; }
}
/* Keep the practice choices distinct, including the labels inside each link. */
.maths-transfer #practice-stage .primary-action{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:.75rem 1rem;border:1px solid var(--line);border-radius:.7rem;background:var(--accent);color:var(--accent-on);font-weight:700;line-height:1.45;text-decoration:none}
.maths-transfer .practice-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin:1rem 0 0}
.maths-transfer .practice-links>a{display:block;min-width:0;padding:1rem;border:1px solid var(--line);border-radius:.8rem;background:var(--card);color:var(--ink);font-weight:700;text-decoration:none;line-height:1.5}
.maths-transfer .practice-links>a>span{display:block;margin-top:.4rem;color:var(--ink-soft);font-size:.93rem;font-weight:400}
.maths-transfer .practice-links>a:hover{border-color:var(--accent-text)}
.maths-transfer #practice-stage a:focus-visible{outline:3px solid var(--accent-text);outline-offset:4px}
@media(max-width:640px){.maths-transfer .practice-links{grid-template-columns:minmax(0,1fr)}}
