/* HTE Grade 6 Math — additions on top of the Geometry course styles (style.css + course.css) */
/* neutral cover, made in HTML/CSS (no Geometry cover picture) */
.g6-cover { float: right; width: 150px; height: 200px; margin: 0 0 10px 18px; border-radius: 8px; box-shadow: 0 6px 18px #0002;
  background: linear-gradient(160deg, #1f3a6b 0%, #13294b 60%, #0f6e64 100%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; }
.g6-cover::before { content: ""; position: absolute; inset: 10px; border: 2px solid #f2b33d88; border-radius: 6px; pointer-events: none; }
.g6-cover .g6c-brand { font-size: 16px; font-weight: 700; letter-spacing: .06em; color: #f2b33d; }
.g6-cover .g6c-num { font-size: 84px; font-weight: 900; line-height: 1; margin: 2px 0; }
.g6-cover .g6c-t { font-size: 18px; font-weight: 800; }
.g6-cover .g6c-r { font-size: 16px; margin-top: 6px; background: #ffffff22; padding: 2px 10px; border-radius: 999px; }
.g6-cover.small-cover { float: none; width: 110px; height: 130px; margin: 0 auto 10px; }
.g6-cover.small-cover .g6c-num { font-size: 72px; }
@media (max-width: 600px) { .g6-cover { width: 108px; height: 150px; margin-left: 12px; } .g6-cover .g6c-num { font-size: 60px; } .g6-cover .g6c-t { font-size: 16px; } .g6-cover .g6c-brand { font-size: 16px; } }
/* GPT phone QA 11-20: on phones 'HTE Learning' and 'Grade 6 Math' wrapped to 2 lines and the top/bottom lines were cut off → a slightly
   bigger cover, one line each, tighter line height; every line sits inside the gold frame (text stays ≥16px) */
@media (max-width: 600px) { .g6-cover { width: 146px; height: 194px; padding: 12px 6px; box-sizing: border-box; }
  .g6-cover > span { white-space: nowrap; line-height: 1.15; } .g6-cover .g6c-brand { letter-spacing: 0; }
  .g6-cover .g6c-num { font-size: 56px; line-height: 1; } .g6-cover .g6c-r { margin-top: 5px; padding: 2px 10px; } }
.route-line { font-size: 19px; margin: 6px 0; }
.route-line .btn { margin: 0 0 0 6px; padding: 6px 12px; font-size: 17px; }
/* route choice (first open + ⚙ Settings) */
.route-pick { text-align: center; max-width: 620px; margin: 24px auto; }
.route-list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.route-card { display: flex; flex-direction: column; gap: 4px; text-align: left; width: 100%; border: 3px solid #d5dbea; border-radius: 14px; background: #fff; padding: 16px 18px; cursor: pointer; font: inherit; color: inherit; }
.route-card:hover { border-color: #2f5bea; }
.route-card.on { border-color: #17803f; background: #f1faf3; }
.route-card .rc-name { font-size: 24px; font-weight: 800; color: #13294b; } .route-card .rc-name em { font-size: 17px; font-weight: 600; color: #17803f; font-style: normal; }
.route-card .rc-sub { font-size: 18px; color: #4a5468; }
.g6-modal { position: fixed; inset: 0; background: #0008; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.g6-dialog { background: #fff; border-radius: 16px; padding: 20px; width: min(560px, 100%); max-height: 92vh; overflow: auto; font-size: 19px; }
.g6-dialog h2 { margin: 0 0 8px; }
#side .sb-route { display: block; width: 100%; text-align: left; margin: 4px 0 8px; padding: 9px 12px; border-radius: 10px; border: 1px solid #ffffff55; background: #ffffff14; color: #fff; font: 700 17px -apple-system, "Segoe UI", sans-serif; cursor: pointer; }
/* pending makeup / retest box (was inline in Geometry) */
.pend-box { background: #fff3e0; border: 3px solid #e8820c; border-radius: 14px; padding: 14px 16px; margin: 0 0 16px; text-align: left; }
.pend-box h2 { font-size: 24px; margin: 0 0 10px; color: #b45309; }
body .pend-box .btn.pend-btn { display: block; width: 100%; text-align: left; font-size: 20px; line-height: 1.35; padding: 12px 14px; margin: 8px 0; background: #e8820c !important; color: #fff !important; border: 0; border-radius: 10px; white-space: normal; }
.pend-box .pend-more { font-size: 19px; margin: 6px 0 0; color: #7c3a06; }
/* owner: below 80% the retest button is ORANGE */
body .btn.retest-btn { background: #e8820c !important; color: #fff !important; }
body .big-score.low { color: #c2690e !important; }
/* sections without a teaching page yet (testers see this) */
.tp-soon { display: inline-block; font-size: 16px; font-weight: 700; color: #8a5a00; background: #fff2d6; border-radius: 999px; padding: 1px 10px; margin-top: 4px; }
.soon-card { background: #fff8e6; border-color: #f0c96a; font-size: 19px; }
.fold-sum { cursor: pointer; font-weight: 800; font-size: 19px; padding: 12px 4px; color: #1f3a6b; }
/* big readable text everywhere (owner: nothing under 16px) */
#side .sb-badge { font-size: 16px; }
.small, .muted.small { font-size: 16px; }
/* no horizontal scroll on small screens */
html, body { max-width: 100%; overflow-x: hidden; }
.q, .opt, .tp-q, .steps li, .chk-q { overflow-wrap: anywhere; }
.q-fig img { max-width: 100%; height: auto; background: #fff; }

/* owner 11-19: questions with a picture — picture LEFT (sticky, always in sight), question + choices / proof steps RIGHT.
   Phones: the picture stays pinned at the top of the card (max 35vh); tap it to see it big. Cards without a picture are untouched. */
:root { --qs-top: 0px; }
@media (max-width: 900px) { :root { --qs-top: 64px; } }   /* the phone/tablet top bar (☰ Grade 6) is sticky there */
.qsplit .qs-fig .q-fig { margin: 0; cursor: zoom-in; }
.qsplit .qs-fig .q-fig img { width: auto; height: auto; max-width: 100%; margin: 0 auto; object-fit: contain; }
.qsplit .qs-main { min-width: 0; }
.qsplit .qs-main > .q:first-child, .qsplit .qs-main > .pt-count:first-child { margin-top: 0; }
@media (min-width: 820px) {
  .card.qsplit { display: grid; grid-template-columns: minmax(0, 43fr) minmax(0, 57fr); gap: 0 26px; align-items: start; }
  .qsplit .qs-fig { position: sticky; top: calc(var(--qs-top) + 14px); z-index: 2; }
  .qsplit .qs-fig .q-fig img { max-height: calc(100vh - var(--qs-top) - 48px); }
}
@media (max-width: 819.98px) {
  .qsplit .qs-fig { position: sticky; top: var(--qs-top); z-index: 3; background: inherit; margin: -6px -10px 12px; padding: 6px 10px 8px;
    border-radius: 0 0 12px 12px; box-shadow: 0 6px 10px -6px #1d243340; }
  .qsplit .qs-fig .q-fig img { max-height: 35vh; }
}
/* GPT phone QA 11-20: on phones (≤700px wide) or short screens the pinned picture covered the choices — a tap on C opened the
   enlarge view instead of choosing C. There the picture now scrolls with the question (tap to enlarge still works). Wide screens keep the sticky column. */
@media (max-width: 700px), (max-width: 819.98px) and (max-height: 760px) {
  .qsplit .qs-fig { position: static; z-index: auto; box-shadow: none; }
}
.fig-zoom { position: fixed; inset: 0; z-index: 2000; background: #0d1626e6; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.fig-zoom img { max-width: 100%; max-height: calc(100vh - 90px); width: auto; height: auto; background: #fff; border-radius: 10px; }
.fig-zoom .fz-x { margin-top: 12px; color: #fff; font: 700 18px -apple-system, sans-serif; border: 2px solid #fff8; border-radius: 10px; padding: 8px 18px; }
/* owner 11-19: 'overflow-x: hidden' on html/body (line 43) turns the body into its own scroller, so nothing could stay sticky
   (not the top bar, not the picture). 'clip' still cuts off sideways overflow but lets sticky work. */
@supports (overflow: clip) { html, body { overflow-x: clip; } }

/* ---- ported from Grade 7 (Muse 11-20) + G6 QA 11-20 ---- */
/* the chapter arrow had no room (#side .sb-ch padding overrode course.css) → fixed-width arrow column on the right */
#side .sb-chap > summary.sb-ch { padding-right: 36px; }
/* Muse 11-21: the ▸/▾ text glyph showed half or as a tofu box on some computers → a CSS chevron (two borders), no font needed,
   drawn inside the 36px right padding. Closed = points right, open = points down. */
#side .sb-chap > summary.sb-ch::after { content: ""; right: 14px; width: 10px; height: 10px; box-sizing: border-box; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: translateY(-50%) rotate(-45deg); opacity: .85; font-size: 0; line-height: 0; }
#side .sb-chap[open] > summary.sb-ch::after { content: ""; transform: translateY(-70%) rotate(45deg); }
/* check page shows the whole question, wrapped; nothing is cut */
.chk-row { white-space: normal; height: auto; line-height: 1.4; overflow: visible; }
.chk-q, .chk-a { white-space: normal; overflow: visible; overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 560px) { .chk-row { grid-template-columns: 30px 1fr; } .chk-a { grid-column: 2; } .chk-c { grid-column: 2; text-align: left; } }
/* the Save/Check button wraps if needed */
#submit { white-space: normal; height: auto; }
/* Key idea / Pitfall formulas — one formula per line, centered, never split inside a term (book.js fpiece) */
.tp-km { white-space: normal; line-height: 1.5; text-align: center; overflow-wrap: normal; word-break: normal; }
.tp-km .fm { display: block; margin: .45em 0; }
.tp-km .fm + .fm { padding-top: .1em; }
/* "Before you begin": each prerequisite on its own line */
.tp-pre .pre-i { display: block; margin-top: 4px; padding-left: 1em; text-indent: -1em; }
.tp-pre .pre-i::before { content: "• "; color: var(--teal, #0f8b8d); }
.tp-pit .tp-km { margin: 10px 20px; font-size: 19px; }   /* same size/indent as the old <p class="tp-km"> inside the Pitfall card */
.tp-km { min-width: 0; max-width: 100%; } .tp-km .fc { display: inline-block; max-width: 100%; white-space: nowrap; vertical-align: baseline; } .tp-km .fc.wide { white-space: normal; }   /* one formula part never splits; only a part wider than the box may (fitFm) */
.tp > .tp-l, .tp > .tp-r { min-width: 0; }   /* grid columns must not grow past the screen (a long nowrap formula part widened the card) */
/* the floating ☁️ Save button is hidden while a question or the check page is on screen (book.js body.in-q) */
body.in-q #hteSync { display: none !important; }

/* owner 11-20: teaching-page pictures — tap to enlarge, and on phones the picture uses the card's full width (labels ≥16px at 360) */
.tp-ex .q-fig { cursor: zoom-in; }
.tp-ex .q-fig::after { content: "Tap the picture to enlarge"; display: block; margin-top: 4px; font-size: 16px; color: #5b6475; text-align: center; }
@media (max-width: 480px) { .tp-ex .q-fig { margin-left: -14px; margin-right: -14px; } .tp-ex .q-fig img { padding: 2px; width: 100%; max-width: 100%; } }
/* Muse 11-21 #5: result / review pages (makeup result, test result, practice review) show each picture WHOLE —
   not pinned, no screen-height cap that can squeeze it, nothing clipped at the edges. The question pages keep the sticky picture. */
.card.sheet-q.qsplit .qs-fig { position: static; margin: 0 0 12px; padding: 0; box-shadow: none; }
.card.sheet-q .q-fig { overflow: visible; }
.card.sheet-q .q-fig img, .card.sheet-q.qsplit .qs-fig .q-fig img, .card.sheet-q.qsplit .qs-fig .q-fig img.tall { display: block; width: auto; height: auto; max-width: 100%; max-height: none; object-fit: contain; overflow: visible; margin: 0 auto; }
/* Muse 11-21 #1: a picture that could not load shows a clear message + button instead of a broken-image icon (book.js picFail) */
.fig-fail { border: 2px dashed #c0392b; background: #fdf2f1; color: #5a1d17; border-radius: 12px; padding: 14px 16px; font-size: 18px; line-height: 1.45; text-align: center; }
.fig-fail .btn { display: block; margin: 10px auto 0; }

/* pre-launch QA 11-21 (G6/G7/G8): the check page shows the question's figure (tap = enlarge); ✓ + tab label never split;
   the score page shows this attempt first and the other to-dos folded below it */
.chk-fig { display: block; margin: 8px 0 2px; cursor: zoom-in; }
.chk-fig img { display: block; max-width: 100%; max-height: 240px; height: auto; background: #fff; border: 1px solid #d5d8e0; border-radius: 8px; }
.chk-zh { display: block; font-size: 16px; color: #5b6472; font-weight: 400; margin-top: 4px; }
.tab-l { white-space: nowrap; }
.pend-box.pend-fold { margin: 16px 0; }
.pend-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pend-fold > summary::-webkit-details-marker { display: none; }
.pend-fold > summary h2 { margin: 0; }
.pend-fold .pend-tap { font: 700 17px -apple-system, "Segoe UI", sans-serif; color: #7c3a06; white-space: nowrap; text-decoration: underline; }
.pend-fold[open] .pend-tap { display: none; }
/* phones: “✓ Teaching / ✓ Practice / Test” did not fit next to “☰ Contents” → Contents sits on its own line above the tabs */
@media (max-width: 520px) {
  body.tb .trail.tabs { flex-wrap: wrap; }
  body.tb .trail.tabs .tab-toc { order: -1; flex: 1 0 100%; text-align: right; padding: 2px 6px 8px; }
}
.fx-note { margin-top: 14px; }
@media (max-width: 400px) { body.tb .trail.tabs button { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; padding-left: 2px; padding-right: 2px; } }   /* bold “✓ Teaching” fits a 360 phone at 16px */
.trail.tabs span.tab-l, body.tb .trail.tabs span.tab-l { padding: 0; background: none; border-radius: 0; color: inherit; font: inherit; }   /* not the old .trail span pill */

/* Muse 11-21: every try has its own full result page — the tries list (one button per row, all the same width) */
.tries { max-width: 560px; margin: 14px auto 14px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.tries .tries-h { margin: 0 0 2px; font-size: 17px; color: #4b5563; }
.tries .try-btn { width: 100%; text-align: left; white-space: normal; }
.tries .try-btn.on { outline: 3px solid #2563eb; outline-offset: 1px; }
#lastTry { white-space: normal; }
/* owner 11-22 (layout): one complete expression never breaks (.mx no-break, its terms .mt; .mxw = wider than the whole box → may wrap
   before an operator). Heading colons / wording arrows break (<br class="hb">) and bold labels sit on their own line only when the
   box itself is narrower than ~520px (container queries on the boxes). */
.card, .tp-card, .tp-pre, .qs-main, .opt, .hint, .why, .chk-row { container-type: inline-size; }
.mx, .mx .mt, .nb { white-space: nowrap; }
.mx.mxw { white-space: normal; }
.mx.mxw .mt.mj::before { content: "\200B"; }   /* pieces written without a space ('x²+(y−1)²'): a break chance only when too wide */
br.hb { display: none; }
.tp-ex .tp-tab .ext { display: inline; }
@container (max-width: 519px) {
  br.hb { display: inline; }
  .tp-ex .tp-tab .ext { display: block; } .tp-ex .tp-tab .exd { display: none; }
  .tp-meth .tp-steps li > .mlab { display: block; }
  .tp-steps .slab.slab-b { display: block; }
  .tp-types dt, .tp-types dd { display: block; }
  .tp-pre > b { display: block; }
}

/* 2026-11-22 picture solutions (圖解): hint picture under Hint 1, solution picture under the steps; tap = enlarge (book.js vizImg).
   Pictures are 400 wide with 22-unit text: at 100% card width on a phone the text stays ≥ 16px. Same block goes into every course css. */
.viz-key { margin: 6px 0 4px; font-size: 19px; color: #1f3a6b; }
.viz-fig { margin: 8px 0 12px; cursor: zoom-in; max-width: 440px; }
.viz-fig img { display: block; width: 100%; height: auto; background: #fff; border: 1px solid #dde3e1; border-radius: 8px; }
.viz-fig figcaption { margin-top: 4px; font-size: 16px; color: #5b6475; text-align: center; }
.viz-fig:focus-visible { outline: 3px solid #f0b429; outline-offset: 2px; }
@media (max-width: 560px) { .viz-fig { max-width: none; width: 100%; } }
@media (max-width: 420px) { .viz-fig { margin-left: -12px; margin-right: -12px; width: calc(100% + 24px); } .viz-fig img { border-radius: 0; border-left: 0; border-right: 0; } }   /* 360 phone: text stays ≥ 16px */

/* 2026-11-24 phone check (390 / 360):
   - a long formula with no spaces ('(x−h)³+k=x³−3hx²+…') ran off the right edge: the break chance before each term (.mxw .mt.mj::before)
     sat inside a no-wrap term, so it never broke → the zero-width space itself may wrap
   - the floating cloud button covered the last words of lines and the ✓ marks: on a phone it is a small 44px round ☁️ button,
     and the page ends with room under the last line
   - tabs and "☰ Contents" are at least 44px tall (easy to tap); the course name in the top bar stays on 2 lines at 360px */
.mx.mxw .mt.mj::before { white-space: normal; }
@media (max-width: 600px) {
  #hteSync { font-size: 0 !important; width: 44px; height: 44px; padding: 0 !important; display: flex; align-items: center; justify-content: center; }
  #hteSync::before { content: "☁️"; font-size: 20px; line-height: 1; }
  body.tb main { padding-bottom: 76px; }
  body.tb .trail.tabs > button { min-height: 44px; }
}
@media (max-width: 380px) { body.tb .top.mob { gap: 8px; padding-left: 10px; padding-right: 10px; } body.tb .top.mob .title { font-size: 19px; line-height: 1.2; } }
