/* Square roots: prototype reading rhythm, inline answers and area diagrams. */
/* A focused prototype: comfortable reading width, open diagrams, and colour
   attached to the two signs rather than to enclosing panels. */
.roots-lesson header {
    background: #fff;
    border-bottom: 2px solid #e6e8ef;
    padding: 26px 40px 12px;
    margin-bottom: 32px;
}
.roots-lesson header h1 {
    color: #243445;
    text-shadow: none;
    font-size: 34px;
    padding: 20px 0;
}
.roots-lesson header nav { top: 0; }
.roots-lesson .lesson-main { max-width: 760px; margin: 0 auto; padding: 0 48px 64px; }
.roots-lesson .lesson-main > section {
    margin: 0;
    padding: 32px 0;
}
.roots-lesson .lesson-main > section::after,
.roots-lesson .lesson-main > section > h1::before,
.roots-lesson .lesson-main > section > h2::before { display: none; }
.roots-lesson .lesson-flowbar { background: transparent; border: 0; padding: 12px 0; }
.roots-lesson .lesson-flowbar { display: flex; justify-content: flex-end; }
.roots-lesson .lesson-flowbar__status,
.roots-lesson .lesson-flowbar__track { display: none; }
.roots-lesson .lesson-flowbar[hidden] { display: none; }
.roots-lesson .page-nav { display: flex; flex-direction: column; }
.roots-lesson .page-nav .lesson-flowbar__toggle {
    align-self: flex-start;
    margin: 24px 12px 0;
    padding: 6px 0;
    color: #fff;
}
.roots-lesson .roots-revealed { animation: roots-reveal .45s ease-out both; }
.roots-lesson .page-nav .roots-reset { margin-top: 8px; }
.roots-reading-step[hidden], .roots-continue[hidden] { display: none; }
.roots-reading-step > p { margin: 18px 0; font-size: 1.04rem; line-height: 1.75; }
.roots-reading-step > .roots-instruction { margin-top: 32px; }
.roots-continue {
    display: block;
    margin: 28px auto 0;
    padding: 10px 24px;
    border: 0;
    border-radius: 22px;
    background: #7048c8;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    font-family: inherit;
    cursor: pointer;
}
.roots-continue:focus-visible { outline: 3px solid #7048c8; outline-offset: 4px; }
.roots-revisit { margin: 24px 0; }
.roots-revisit summary { color: #5531a9; cursor: pointer; font-size: 15px; line-height: 1.6; }
.roots-revisit > p { margin: 12px 0; font-size: 16px; line-height: 1.7; }
.roots-question-reminder { margin: 10px 0 0; }
.roots-revisit[hidden] { display: none; }
.roots-lesson .lesson-check__turn[hidden] { display: none; }
.roots-key-points { margin: 32px 0 0; padding-top: 24px; border-top: 2px solid #e3e8ed; }
.roots-key-points h2 { margin: 0 0 16px; color: #243445; font-size: 21px; }
.roots-key-points ul { margin: 0; padding-left: 22px; }
.roots-key-points li { padding-left: 6px; font-size: 1.04rem; line-height: 1.75; }
.roots-key-points li + li { margin-top: 12px; }
.roots-key-points li::marker { color: #009b8c; }
@keyframes roots-reveal {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.roots-lesson .lesson-main > section > h1 { font-size: 28px; margin: 0 0 24px; }
.roots-lesson .lesson-main > section > p { max-width: none; margin: 0 0 18px; line-height: 1.75; }
.roots-lesson .lesson-main > section > :last-child { margin-bottom: 0; }
.roots-lesson .lesson-main > .prereq { margin: 0 0 12px; background: #f5f7fa; border: 0; }
.roots-lesson .roots-instruction { color: #536873; font-size: 15px; }
.roots-lesson .lesson-check { max-width: none; margin: 18px 0; }
.roots-lesson .lesson-check__body { gap: 18px; }
.roots-lesson .lesson-check__turn + .lesson-check__turn { padding-top: 0; }
.roots-lesson .lesson-main > section > .lesson-check + p { margin-top: 18px; }
.roots-lesson .lesson-main > section > .roots-instruction { margin-top: 32px; margin-bottom: 0; }
.roots-lesson .lesson-check__entry input {
    width: 3.2em; min-width: 0; min-height: 0; padding: 1px 5px;
    box-sizing: border-box; height: 1.65em; font-family: inherit; font-size: 1em; font-weight: 700; line-height: 1.4;
    border: 0; border-bottom: 2px solid #7048c8; border-radius: 4px 4px 0 0; background: #f2edff;
}
.roots-lesson .lesson-check__check { display: none; }
.roots-lesson .lesson-check__prompt { display: block; max-width: none; line-height: 1.75; font-size: 1.04rem; }
.roots-lesson .lesson-check__response { display: inline; margin: 0; vertical-align: baseline; }
.roots-inline-equation { display: inline-block; white-space: nowrap; vertical-align: baseline; }
.roots-lesson .roots-inline-equation .lesson-check__expression {
    font-family: inherit;
    font-size: 1em;
    line-height: inherit;
    letter-spacing: normal;
}
.roots-lesson .roots-inline-equation .lesson-check__response { margin-left: .3em; }
.roots-lesson .lesson-check__answer,
.roots-lesson .lesson-check__entry { display: inline; font-size: inherit; vertical-align: baseline; }
.roots-lesson .lesson-check__entry input { vertical-align: baseline; }
.roots-lesson .lesson-check__entry input.roots-answer-retry {
    color: #a3293d;
    background: #fff0f2;
    border-bottom: 2px dashed #bb354c;
    box-shadow: none;
    animation: roots-retry .24s ease-in-out;
}
.roots-answer-notice {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
@keyframes roots-retry {
    25%, 75% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
}
.roots-lesson .lesson-check__entry input::placeholder { color: #7048c8; opacity: 1; }
.roots-lesson .lesson-check__entry input[hidden] { display: none; }
.roots-lesson .roots-accepted-answer {
    color: #0f6d40;
    font-weight: 700;
    background: none;
    border: 0;
    padding: 0;
}
.roots-lesson .roots-accepted-answer:focus {
    outline: none;
    box-shadow: none;
}
.roots-lesson .lesson-check__turn.is-correct .lesson-check__entry input {
    background: #e9f8ef; border-color: #15985b; color: #0f6d40; box-shadow: none;
}
.roots-lesson .lesson-check__turn.is-correct .lesson-check__entry input:focus {
    border-color: #15985b; outline: 2px solid #b9dfc8;
}
.roots-lesson .lesson-check__help { margin-top: 8px; }
.roots-lesson .lesson-check__feedback { max-width: 700px; font-weight: 400; }
.roots-lesson .lesson-check__turn.is-correct .lesson-check__check {
    display: none;
}
.roots-lesson .lesson-check__turn.is-correct .lesson-check__response::after {
    content: none;
}
.roots-lesson .lesson-check__feedback,
.roots-lesson .lesson-check__help,
.roots-lesson .lesson-check__support,
.roots-lesson .lesson-check__complete { display: none; }


/* Figures share the reading surface; colour identifies lengths and areas. */
.square-explorer {
    display: grid; grid-template-columns: 260px 1fr; gap: 16px 28px;
    align-items: center; margin: 28px 0; padding: 28px 32px;
    background: #f3faf8; border-radius: 8px;
}
.square-drawing { position: relative; width: 240px; height: 260px; display: grid; place-items: center; padding-bottom: 40px; box-sizing: border-box; }
.square-tiles {
    display: grid; grid-template-columns: repeat(var(--side), 14px);
    grid-auto-rows: 14px; background: #009b8c;
    width: calc(var(--side) * 14px); height: calc(var(--side) * 14px);
}
.square-tiles i { border: 1px solid #fff; box-sizing: border-box; }
.square-side { position: absolute; top: calc(110px + var(--side) * 7px + 8px); color: #006f65; font-size: 18px; font-weight: 700; }
.square-facts p { margin: 12px 0; line-height: 1.6; }
.square-product { font-size: 22px; color: #006f65; font-weight: 700; }
.square-area { font-size: 17px; color: #243445; }
.square-control { margin-top: 28px; }
.square-control label { display: block; font-size: 14px; margin-bottom: 10px; }
.square-control input { width: 100%; font: inherit; accent-color: #007b70; cursor: pointer; }
.square-control input:focus-visible { outline: 2px solid #7048c8; outline-offset: 4px; }
.square-control[hidden] { display: none; }
.square-explorer figcaption { grid-column: 1 / -1; font-size: 15px; color: #465966; line-height: 1.6; text-align: center; }
.square-fact-list {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 24px;
    margin: 28px 0; padding: 24px 28px; background: #f7f8fc; border-radius: 8px;
}
.square-fact-list > span { font-size: 17px; line-height: 1.6; white-space: nowrap; }
.square-fact-list strong { color: #5531a9; }
.square-decimals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 28px 0; }
.square-decimals p { margin: 0; text-align: center; font-size: 18px; line-height: 1.7; }
.square-decimals span, .square-decimals strong { display: block; }
.square-decimals strong { color: #006f65; border-top: 2px solid #d4e9e5; padding-top: 8px; margin-top: 8px; }
.square-quarter { margin: 28px 0; padding: 28px 32px; background: #f7f8fc; border-radius: 8px; }
.square-unit { position: relative; width: 200px; height: 200px; margin: 0 auto 42px; border: 2px solid #a2aabd; }
.square-unit::before, .square-unit::after { content: ""; position: absolute; background: #a2aabd; }
.square-unit::before { top: 50%; left: 0; width: 100%; height: 1px; }
.square-unit::after { left: 50%; top: 0; height: 100%; width: 1px; }
.square-unit__quarter { position: absolute; left: 0; top: 0; width: 50%; height: 50%; display: grid; place-items: center; background: #7048c8; color: #fff; font-size: 18px; }
.square-unit__half { position: absolute; right: calc(100% + 14px); top: 18%; color: #5531a9; font-size: 17px; }
.square-unit__whole { position: absolute; top: calc(100% + 8px); left: 0; width: 100%; text-align: center; font-size: 17px; }
.square-quarter figcaption { font-size: 15px; line-height: 1.6; text-align: center; color: #465966; }
@media (prefers-reduced-motion: reduce) {
    .roots-lesson .roots-revealed,
    .roots-lesson .lesson-check__entry input.roots-answer-retry { animation: none; }
}
