/* BUILD 20261130-1 */
/* ==========================================================================
   student-guide.css — styling unique to student-guide.html
   Concept: an immersive full-screen "reader". The site header, announcement bar and bottom tab bar are
   hidden on this page only, so the book gets the whole screen. The page never scrolls.
   - Desktop / tablet landscape: two-page spread.  - Phone: one page at a time.
   Controls: a slim bar at the top (back, contents, PDF) and a dock at the bottom (previous / progress / next).
   Every page's text is sized in `em`; student-guide.js sets each page's font size so its content always fits.
   Page content classes start with pg-, reader chrome with sg-.
   ========================================================================== */

/* ================= READER SHELL (locks the page, hides the site chrome) ================= */
/* reset.css gives every body min-height:100vh, which on phones is the height WITH the toolbar hidden, taller than what you can see, so it must be switched off here */
html.js body.sg-reader { position: fixed; inset: 0 0 auto 0; min-height: 0; max-height: var(--app-h, 100dvh); display: flex; flex-direction: column; height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); box-sizing: border-box; overflow: hidden; overflow: clip; padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) { html.js body.sg-reader { padding-bottom: 0; } }
html.js body.sg-reader .announce,
html.js body.sg-reader .app-header,
html.js body.sg-reader .whatsapp-float,
html.js body.sg-reader .site-footer { display: none; }
html.js body.sg-reader main { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; overflow: clip; color: var(--color-text-inverse);
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(58,99,209,.55), transparent 70%),
    radial-gradient(55% 45% at 100% 100%, rgba(43,79,181,.5), transparent 70%),
    radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.6px) 0 0 / 24px 24px,
    var(--color-night); }
.sg-globe { position: absolute; right: -200px; top: -140px; width: 520px; height: 520px; color: rgba(255,255,255,.06); pointer-events: none; }

.sg-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 2px var(--sp-2); }

/* ================= TOP BAR: Home | previous  dial  next | PDF ================= */
.sg-hud { position: relative; z-index: 4; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-2); padding: calc(var(--sp-2) + var(--safe-top)) var(--sp-3) var(--sp-2); }
.sg-hud__left { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.sg-hud__right { display: flex; justify-content: flex-end; }
.sg-hud__title { display: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); font-weight: 700; color: var(--color-text-inverse); }
.sg-nav { display: flex; align-items: center; gap: 10px; }
.sg-arrow { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3); color: var(--color-text-inverse); transition: transform var(--speed) var(--ease), opacity var(--speed) var(--ease); }
.sg-arrow .icon { width: 22px; height: 22px; stroke-width: 2.6; }
.sg-arrow:active { transform: scale(.92); }
.sg-arrow--next { background: var(--color-surface); color: var(--color-primary); border-color: transparent; box-shadow: 0 6px 18px rgba(5,14,44,.4); }
.sg-arrow[disabled] { opacity: .3; pointer-events: none; box-shadow: none; }
.sg-arrow--next.is-hint { animation: sg-pulse 1.8s ease-out infinite; }
@keyframes sg-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); } 80%, 100% { box-shadow: 0 0 0 14px rgba(255,255,255,0); } }
.sg-ring { position: relative; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--color-primary-ink); box-shadow: 0 6px 18px rgba(5,14,44,.5); color: var(--color-text-inverse); transition: transform var(--speed) var(--ease); }
.sg-ring:active { transform: scale(.94); }
.sg-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.sg-ring circle { fill: none; stroke-width: 4; }
.sg-ring__track { stroke: rgba(255,255,255,.18); }
.sg-ring__bar { stroke: #fff; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .6s var(--ease); }
.sg-ring__txt { position: relative; display: grid; justify-items: center; line-height: 1; }
.sg-ring__txt b { font-size: 1rem; font-weight: 800; }
.sg-ring__txt b[data-long] { font-size: .64rem; }
/* the cover: a small, centred "OPEN" (the empty "of" line under it takes no room) */
.sg-ring__txt b[data-word] { font-size: .56rem; letter-spacing: .1em; text-transform: uppercase; line-height: 1; }
.sg-ring__txt i:empty { display: none; }
.sg-ring__txt i { margin-top: 2px; font-style: normal; font-size: .5rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-blue-pale); }

.sg-tool { flex-shrink: 0; min-width: 44px; height: 44px; padding: 0 .85rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); color: var(--color-text-inverse); font-size: var(--fs-xs); font-weight: 700; transition: background var(--speed) var(--ease), opacity var(--speed) var(--ease); }
.sg-tool .icon { width: 18px; height: 18px; stroke-width: 2.4; }
.sg-tool:hover { background: rgba(255,255,255,.22); }
.sg-tool[disabled] { opacity: .35; pointer-events: none; }
.sg-tool--solid { background: var(--color-surface); color: var(--color-primary); border-color: transparent; }
.sg-tool--solid:hover { background: var(--color-wash); }
.sg-tool--text span { display: none; }
.sg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ================= THE BOOK ================= */
/* shown instantly while the script builds the book */
.sg-book:empty { width: min(100%, 440px); height: 100%; border-radius: var(--radius-xl); display: grid; place-items: center; background: linear-gradient(100deg, rgba(255,255,255,.06) 30%, rgba(255,255,255,.17) 50%, rgba(255,255,255,.06) 70%) 0 0 / 220% 100%; animation: sg-shimmer 1.3s linear infinite; }
.sg-book:empty::after { content: "Opening the handbook\2026"; font-size: var(--fs-sm); font-weight: 700; color: var(--color-text-inverse-muted); }
@keyframes sg-shimmer { to { background-position: -220% 0; } }
/* --turn: how long one page turn takes (keep in step with TURN_MS in student-guide.js). The easing starts gently,
   speeds through the middle and settles softly, like a real page. */
.sg-book { --pw: 340px; --ph: 520px; --turn: .9s; --turn-ease: cubic-bezier(.45,.05,.25,1); position: relative; width: var(--pw); height: var(--ph); perspective: 2200px; transition: transform .8s var(--ease); }
.sg-board { display: none; }
/* A page turns on its left edge. Forward and back use the SAME movement, so both directions are equally smooth:
   a turned page is rotated a full half-turn, which hides it naturally (its back is never drawn on phones).
   opacity only switches off AFTER a forward turn has finished, and switches back on at the START of a backward turn. */
.sg-leaf { position: absolute; inset: 0; transform-origin: left center; transform-style: preserve-3d; transition: transform var(--turn) var(--turn-ease), opacity 0s linear 0s; }
.sg-leaf.is-turning { will-change: transform; }
.sg-leaf.is-far:not(.is-turning):not(.is-keep), .sg-leaf.is-skip { visibility: hidden; }
.sg-leaf.is-flipped { transform: rotateY(-180deg); opacity: 0; pointer-events: none; transition: transform var(--turn) var(--turn-ease), opacity 0s linear var(--turn); }
.sg-face.is-ghosted { visibility: hidden; }

/* PHONES / TABLETS (one page at a time): a clean, flat "lift and slide" instead of a full 3D half-turn.
   A half-turn on a single page swings the page's white back out past the left edge of the screen on phones.
   Here the page tilts back on its spine, slides left and fades out; going back it slides in the same way.
   No page ever passes edge-on, so nothing flashes, and both directions are the exact mirror of each other. */
.sg-book:not(.is-spread) .sg-leaf { transform-style: flat; transition: transform var(--turn) var(--turn-ease), opacity calc(var(--turn) * .45) ease-out; }
.sg-book:not(.is-spread) .sg-leaf.is-flipped { transform: translateX(-38%) rotateY(-62deg) scale(.96); opacity: 0;
  transition: transform var(--turn) var(--turn-ease), opacity calc(var(--turn) * .55) ease-in calc(var(--turn) * .3); }
.sg-book:not(.is-spread) .sg-face { backface-visibility: visible; -webkit-backface-visibility: visible; }
/* the page underneath sits a little back and comes forward as it is uncovered (and steps back when covered) */
.sg-book:not(.is-spread) .sg-leaf.is-reveal { animation: sg-rise var(--turn) var(--turn-ease); }
.sg-book:not(.is-spread) .sg-leaf.is-covered { animation: sg-sink var(--turn) var(--turn-ease); }
@keyframes sg-rise { from { transform: scale(.965); } to { transform: none; } }
@keyframes sg-sink { from { transform: none; } to { transform: scale(.965); } }
.sg-face { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, var(--color-surface) 62%, var(--color-wash) 175%); backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 18px 44px rgba(5,14,44,.5); }
.sg-face--right { border-radius: 4px var(--radius-xl) var(--radius-xl) 4px; }
.sg-face--left { border-radius: var(--radius-xl) 4px 4px var(--radius-xl); transform: rotateY(180deg); }
/* paper shading near the spine + a shadow that sweeps across a page while it turns */
.sg-face::before { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; background: linear-gradient(90deg, rgba(11,31,77,.2), transparent 9%); }
.sg-face--left::before { background: linear-gradient(270deg, rgba(11,31,77,.2), transparent 9%); }
.sg-face::after { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; background: var(--color-primary-ink); opacity: 0; }
.sg-leaf.is-turning .sg-face::after { animation: sg-shade var(--turn) ease-in-out; }
@keyframes sg-shade { 0%, 100% { opacity: 0; } 50% { opacity: .3; } }
/* the page being uncovered starts in the turning page's shadow; the page being covered darkens as the page lands on it */
.sg-leaf.is-reveal .sg-face::after { animation: sg-reveal var(--turn) ease-out; }
.sg-leaf.is-covered .sg-face::after { animation: sg-cover var(--turn) ease-in; }
@keyframes sg-reveal { 0% { opacity: .32; } 100% { opacity: 0; } }
@keyframes sg-cover { 0% { opacity: 0; } 100% { opacity: .32; } }
/* the edges of the pages underneath, so the single-page view on phones and tablets reads as a book, not a card */
.sg-book:not(.is-spread)::before, .sg-book:not(.is-spread)::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: 4px var(--radius-xl) var(--radius-xl) 4px; pointer-events: none; }
.sg-book:not(.is-spread)::before { transform: translate(6px, 5px); background: var(--color-wash-deep); opacity: .45; }
.sg-book:not(.is-spread)::after { transform: translate(3px, 2.5px); background: var(--color-wash); opacity: .8; }
.sg-book:empty::before, .sg-book:empty::after { content: none; }

/* running head with the page number and a footer line (both added by JS) */
.sg-foot { position: absolute; left: 1.7em; right: 1.7em; bottom: .85em; z-index: 3; display: flex; align-items: center; gap: .8em; font-size: .56em; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--color-text-muted); }
.sg-foot::before, .sg-foot::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.sg-run { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; gap: var(--sp-2); padding: 1em 1.6em 0; font-size: .58em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--color-text-muted); }
.sg-run span:last-child { color: var(--color-blue-light); text-align: right; }
.sg-page { position: absolute; inset: 0; font-size: var(--fs, 14px); color: var(--color-text); }
.sg-page--dark, .sg-page--cover { color: var(--color-text-inverse); }

/* ================= PAGE CONTENT (all sizes in em) ================= */
.pg { height: 100%; display: flex; flex-direction: column; gap: calc(.85em + var(--gapx, 0px)); padding: 2.6em 1.5em 2.7em; overflow: hidden auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; line-height: 1.5; container-type: inline-size; }
.pg.is-tight .pg-opt { display: none; }
.pg > * { flex-shrink: 0; }
.pg h3 + *, .pg-head + .pg-lede { margin-top: calc(var(--gapx, 0px) * -1); }   /* a heading stays attached to its content */
.pg.is-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.pg p { font-size: 1em; line-height: 1.55; }
.pg strong { color: var(--color-primary); }
.pg-kicker { font-size: .64em; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--color-blue-light); }
.pg h2 { font-size: 1.62em; line-height: 1.12; color: var(--color-primary); letter-spacing: -.015em; }
.pg h3 { display: flex; align-items: center; gap: .5em; margin-top: .15em; font-size: 1.02em; line-height: 1.25; color: var(--color-primary); }
.pg-asof { margin-left: auto; padding: .22em .7em; border-radius: 999px; background: var(--color-wash); color: var(--color-primary); font-size: .6em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.pg-small { font-size: .76em !important; color: var(--color-text-muted); line-height: 1.5 !important; }
.pg-lede { font-size: 1.02em !important; color: var(--color-text-muted); }

/* chapter head: icon badge + kicker + title (the only multi-colour element on a page) */
.pg-head { display: flex; align-items: center; gap: .85em; }
.pg-head > div { min-width: 0; }
.pg-head h2 { margin-top: .12em; }
.pg .icon-badge { width: 3em; height: 3em; box-shadow: 0 6px 14px rgba(30,58,138,.22); }
.pg .icon-badge .icon { width: 1.4em; height: 1.4em; stroke-width: 2.2; }

/* stat tiles */
.pg-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .6em; }
.pg-stats--3 { grid-template-columns: repeat(3, 1fr); }
.pg-stat { padding: .75em .85em; border-radius: var(--radius-md); background: var(--color-wash); }
.pg-stat b { display: block; font-size: 1.45em; line-height: 1.05; color: var(--color-primary); font-weight: 800; letter-spacing: -.01em; }
.pg-stat span { display: block; margin-top: .3em; font-size: .66em; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.35; color: var(--color-text-muted); }

/* ticks and crosses: white mark on a filled circle */
.pg-check li, .pg-cross li { position: relative; padding-left: 1.9em; margin-bottom: .55em; font-size: .95em; line-height: 1.42; }
.pg-check li::before, .pg-cross li::before { content: ""; position: absolute; left: 0; top: .1em; width: 1.3em; height: 1.3em; border-radius: 50%; background: var(--color-primary) center / 62% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.6 4.6L19 7.5'/%3E%3C/svg%3E"); }
.pg-cross li::before { background: var(--color-text-muted) center / 56% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
.pg-check li:last-child, .pg-cross li:last-child { margin-bottom: 0; }
@container (min-width: 440px) { .pg-check--cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.2em; } .pg-check--cols li:nth-last-child(2) { margin-bottom: 0; } }

/* numbered steps (roadmap / journey / questions) */
.pg-steps { counter-reset: pg; display: flex; flex-direction: column; gap: .7em; }
.pg-steps li { counter-increment: pg; position: relative; padding-left: 2.4em; font-size: .94em; line-height: 1.38; }
.pg-steps li::before { content: counter(pg); position: absolute; left: 0; top: .02em; width: 1.75em; height: 1.75em; border-radius: 50%; display: grid; place-items: center; background: var(--color-primary); color: #fff; font-size: .82em; font-weight: 800; z-index: 1; }
.pg-steps li b { display: block; color: var(--color-primary); font-weight: 800; }
.pg-steps li > span { color: var(--color-text-muted); font-size: .9em; }
.pg-steps--path li:not(:last-child)::after { content: ""; position: absolute; left: calc(.72em - 1px); top: 1.5em; bottom: calc(-.7em - 1px); width: 2px; background: var(--color-wash-deep); }
.pg-steps--c { gap: .55em; }
.pg-steps--c li { font-weight: 600; }
@container (min-width: 460px) {
  .pg-steps--cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.4em; }
}
.pg-tag { display: inline-block; margin-left: .35em; padding: .12em .55em; border-radius: 999px; background: var(--color-wash); color: var(--color-primary); font-size: .58em; font-weight: 800; letter-spacing: .08em; vertical-align: .2em; }
.pg-tag--abroad { background: var(--color-primary); color: #fff; }
/* short labelled steps shown as pills (counselling) */
.pg-chips-steps { counter-reset: cs; display: grid; grid-template-columns: 1fr 1fr; gap: .45em; }
.pg-chips-steps li { counter-increment: cs; display: flex; align-items: center; gap: .55em; padding: .5em .7em; border-radius: var(--radius-md); background: var(--color-wash); font-size: .86em; font-weight: 700; line-height: 1.25; color: var(--color-primary); }
.pg-chips-steps li::before { content: counter(cs); flex-shrink: 0; width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; background: var(--color-primary); color: #fff; font-size: .8em; font-weight: 800; }

/* callouts */
.pg-note { display: flex; gap: .7em; padding: .85em .95em; border-radius: var(--radius-md); background: var(--color-wash); font-size: .88em; line-height: 1.5; }
.pg-note .icon { width: 1.3em; height: 1.3em; margin-top: .1em; color: var(--color-primary); }
.pg-note--dark { background: var(--grad-night); color: var(--color-text-inverse-muted); }
.pg-note--dark strong, .pg-note--dark .icon { color: #fff; }
.pg-quote { padding: .2em 0 .2em 1em; border-left: 3px solid var(--color-blue-light); font-size: 1.02em; font-weight: 700; line-height: 1.45; color: var(--color-primary); }
.pg-link { display: inline-flex; align-items: center; gap: .5em; align-self: flex-start; padding: .65em 1.1em; border-radius: 999px; background: var(--color-primary); color: #fff; font-size: .86em; font-weight: 800; }
.pg-link .icon { width: 1.1em; height: 1.1em; stroke-width: 2.8; }

/* tables: light, airy rows */
.pg-table { width: 100%; border-collapse: collapse; font-size: .86em; }
.pg-table th { padding: .45em .5em .55em; border-bottom: 2px solid var(--color-primary); color: var(--color-text-muted); font-size: .72em; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.pg-table td { padding: .6em .5em; vertical-align: top; line-height: 1.4; border-bottom: 1px solid var(--color-border); }
.pg-table td:first-child { font-weight: 700; }
.pg-table td b { color: var(--color-primary); font-weight: 800; }
.pg-table--compact td { padding: .5em .5em; }
.pg-table--compact td:nth-child(2) b, .pg-table--compact td:nth-child(3) { white-space: nowrap; }

/* card grids */
.pg-cards { display: grid; gap: .6em; grid-template-columns: 1fr; }
.pg-card { padding: .8em .95em; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.pg-card h4 { font-size: .98em; color: var(--color-primary); }
.pg-card p { margin-top: .2em; font-size: .86em; line-height: 1.45; color: var(--color-text-muted); }
.pg-cards--wash .pg-card { border: 0; background: var(--color-wash); }
@container (min-width: 440px) { .pg-cards { grid-template-columns: 1fr 1fr; } }

/* myth vs fact */
.pg-myths { display: flex; flex-direction: column; gap: .6em; }
.pg-myth { padding: .75em .95em; border-radius: var(--radius-md); background: var(--color-wash); }
.pg-myth b { display: block; font-size: .62em; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--color-text-muted); }
.pg-myth p:first-of-type { margin: .15em 0 .5em; font-size: .92em; font-weight: 700; line-height: 1.35; color: var(--color-text-muted); text-decoration: line-through; text-decoration-color: rgba(91,102,112,.5); }
.pg-myth b + p + b { color: var(--color-primary); }
.pg-myth p:last-child { font-size: .92em; line-height: 1.45; }

/* contents: two-column tiles */
.pg-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .5em; }
.pg-tiles a { display: flex; align-items: center; gap: .6em; height: 100%; padding: .6em .7em; border-radius: var(--radius-md); background: var(--color-wash); transition: background var(--speed) var(--ease); }
.pg-tiles a:hover { background: var(--color-wash-deep); }
.pg-tiles b { flex-shrink: 0; width: 2.1em; height: 2.1em; border-radius: 50%; display: grid; place-items: center; background: var(--color-primary); color: #fff; font-size: .68em; font-weight: 800; }
.pg-tiles span { flex: 1; min-width: 0; font-size: .86em; font-weight: 700; line-height: 1.2; color: var(--color-primary); }
.pg-tiles em { font-style: normal; font-size: .7em; font-weight: 800; color: var(--color-blue-light); }

/* tick-box checklist (interactive) */
.pg-tick { display: flex; flex-direction: column; gap: .45em; }
.pg-tick label { display: flex; align-items: center; gap: .7em; padding: .6em .85em; border-radius: var(--radius-md); background: var(--color-wash); font-size: .9em; font-weight: 600; line-height: 1.3; cursor: pointer; transition: background var(--speed) var(--ease); }
.pg-tick input { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 1.45em; height: 1.45em; margin: 0; border: 2px solid var(--color-primary); border-radius: 50%; background: var(--color-surface) center / 70% no-repeat; transition: background-color var(--speed) var(--ease); }
.pg-tick input:checked { background-color: var(--color-primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.6 4.6L19 7.5'/%3E%3C/svg%3E"); }
.pg-tick label:has(input:checked) { background: var(--color-wash-deep); }
.pg-tick input:focus-visible { outline: 3px solid var(--color-blue-pale); outline-offset: 2px; }
.pg-progress { font-size: .84em; font-weight: 700; color: var(--color-text-muted); }
.pg-progress b { color: var(--color-primary); font-size: 1.3em; }

/* ================= COVER + BACK COVER ================= */
.sg-face--cover, .sg-face--dark { background:
  radial-gradient(70% 45% at 85% 0%, rgba(96,142,255,.4), transparent 70%),
  radial-gradient(rgba(255,255,255,.08) 1px, transparent 1.6px) 0 0 / 18px 18px, var(--grad-night); color: var(--color-text-inverse); }
.sg-face--cover { cursor: pointer; }
.sg-face--cover::before { z-index: 7; width: 18px; right: auto; background: linear-gradient(90deg, rgba(7,18,52,.55), rgba(255,255,255,.12) 60%, transparent); }
.sg-face--dark::before { display: none; }
.sg-face--dark { box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.pg-cover { height: 100%; position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: .8em; padding: 2.2em 1.7em 1.7em 2.3em; overflow: hidden; }
.pg-cover .globe-art { position: absolute; right: -45%; bottom: -8%; width: 125%; color: rgba(255,255,255,.1); pointer-events: none; }
.pg-cover > * { position: relative; }
.pg-cover__brand { display: flex; align-items: center; gap: .6em; }
.pg-cover__brand svg { width: 2.8em; height: 2.8em; overflow: visible; }
.pg-cover__brand span { font-size: .95em; font-weight: 800; letter-spacing: .02em; }
.pg-cover__brand span i { font-style: normal; margin-left: .3em; color: var(--color-blue-pale); }
.pg-pill { display: inline-flex; align-items: center; gap: .55em; padding: .32em .85em; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); font-size: .62em; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.pg-pill i { width: .7em; height: .7em; border-radius: 50%; background: #fff; }
.pg-cover h1 { margin-top: .55em; color: #fff; font-size: 3em; line-height: 1.02; letter-spacing: -.025em; }
.pg-cover h1 em { display: block; font-style: normal; color: var(--color-blue-pale); }
.pg-cover__line { width: 3em; height: 4px; margin: 1em 0; border-radius: 4px; background: var(--color-blue-pale); }
.pg-cover p { font-size: .95em; line-height: 1.55; color: var(--color-text-inverse-muted); }
.pg-cover__foot { display: flex; justify-content: space-between; align-items: center; gap: .6em; padding-top: .8em; border-top: 1px solid rgba(255,255,255,.2); font-size: .66em; color: var(--color-text-inverse-muted); }
.pg-open { display: inline-flex; align-items: center; gap: .5em; padding: .55em 1.1em; border-radius: 999px; background: #fff; color: var(--color-primary); font-size: 1.1em; font-weight: 800; animation: sg-nudge 2.4s ease-in-out infinite; }
.pg-open .icon { width: 1.1em; height: 1.1em; stroke-width: 2.8; }
@keyframes sg-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

.pg-end { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 1em; padding: 2em 1.7em; color: var(--color-text-inverse); }
.pg-end > * { flex-shrink: 0; }
.pg-end .pg-pill { align-self: flex-start; }
.pg-end h2 { color: #fff; font-size: 2.1em; line-height: 1.08; letter-spacing: -.02em; }
.pg-end h2 em { font-style: normal; color: var(--color-blue-pale); }
.pg-end p { font-size: .95em; color: var(--color-text-inverse-muted); }
.pg-end .btn { font-size: .9em; }
.pg-end .pg-small { color: var(--color-text-inverse-muted); }
.pg-end.is-tight .pg-opt { display: none; }

/* ================= DOWNLOAD GATE ================= */
.sg-modal { position: fixed; inset: 0; z-index: var(--z-menu); display: grid; place-items: center; padding: var(--sp-4); background: rgba(11,31,77,.62); }
.sg-modal[hidden] { display: none; }
.sg-modal__card { position: relative; color: var(--color-text); width: 100%; max-width: 420px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; padding: var(--sp-5); border-radius: var(--radius-xl); background: var(--color-surface); box-shadow: var(--shadow-lg); }
.sg-modal__card h2 { font-size: 1.35rem; }
.sg-modal__lead { margin-top: var(--sp-1); font-size: var(--fs-sm); color: var(--color-text-muted); }
.sg-modal__lead a { color: var(--color-primary); font-weight: 700; text-decoration: underline; }
.sg-modal__close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--color-text-muted); }
.sg-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); margin-top: var(--sp-4); }
.sg-form .field { min-width: 0; }   /* without this a box could grow wider than the card and push the whole form sideways */
.sg-modal__card { overflow-x: hidden; }
.sg-form .btn, .sg-modal .btn--block { margin-top: var(--sp-2); }
.sg-error { font-size: var(--fs-xs); font-weight: 700; color: var(--color-primary); }
.sg-fine { font-size: var(--fs-xs); line-height: 1.5; color: var(--color-text-muted); }
.sg-fine a { text-decoration: underline; }
.sg-done-actions { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); }

/* ================= NO-JS FALLBACK: plain readable pages ================= */
.js .sg-source { display: none; }
.sg-source { max-width: 560px; margin: 0 auto; padding: var(--sp-5) var(--gutter); }
.sg-source .sg-page { position: static; min-height: 0; margin-bottom: var(--sp-5); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.sg-source .pg { height: auto; padding-top: 1.6em; padding-bottom: 1.6em; }
html:not(.js) .sg-stage, html:not(.js) .sg-hud { display: none; }

/* ================= TABLET / DESKTOP ================= */
@media (min-width: 640px) {
  .sg-tool--text span { display: inline; }
  .sg-tool--text { padding: 0 1.1rem; }
  .sg-hud__title { display: block; }
  .sg-arrow { width: 46px; height: 46px; }
  .sg-ring { width: 58px; height: 58px; }
  .sg-ring__txt b { font-size: 1.05rem; }
  .sg-ring__txt b[data-word] { font-size: .6rem; }
}
@media (min-width: 768px) {
  .sg-hud { padding-inline: var(--sp-5); }
  .sg-stage { padding: 0 var(--sp-4) var(--sp-4); }
}
/* two-page spread (JS adds .is-spread when the stage is wide enough) */
.sg-book.is-spread { width: calc(var(--pw) * 2); transform: translateX(calc(var(--pw) / -2)); }
.sg-book.is-spread.is-open { transform: none; }
.sg-book.is-spread.is-end { transform: translateX(calc(var(--pw) / 2)); }
.sg-book.is-spread .sg-board { display: block; position: absolute; top: 0; bottom: 0; width: 50%; z-index: 0; background: transparent; box-shadow: 0 26px 60px rgba(5,14,44,.55); transition: opacity .6s var(--ease); }
.sg-book.is-spread .sg-board--left { left: 0; border-radius: var(--radius-xl) 0 0 var(--radius-xl); opacity: 0; box-shadow: -3px 2px 0 -1px var(--color-wash), -6px 4px 0 -2px var(--color-wash-deep), 0 26px 60px rgba(5,14,44,.55); }
.sg-book.is-spread .sg-board--right { right: 0; border-radius: 0 var(--radius-xl) var(--radius-xl) 0; box-shadow: 3px 2px 0 -1px var(--color-wash), 6px 4px 0 -2px var(--color-wash-deep), 0 26px 60px rgba(5,14,44,.55); }
.sg-book.is-spread.is-open .sg-board--left { opacity: 1; }
.sg-book.is-spread.is-end .sg-board--right { opacity: 0; }
.sg-book.is-spread .sg-leaf { inset: 0 auto 0 50%; width: 50%; }
.sg-book.is-spread .sg-leaf.is-flipped { opacity: 1; pointer-events: auto; }
.sg-book.is-spread .sg-face { box-shadow: none; }
.sg-book.is-spread .sg-face--cover { box-shadow: 0 18px 44px rgba(5,14,44,.55); }
@media (hover: hover) { .sg-book.is-spread .sg-leaf--cover:not(.is-flipped):hover { transform: rotateY(-8deg); } }

/* SHARP LEFT PAGE: browsers draw text inside a 3D-rotated layer as a picture, which looks blurred.
   Once a page has finished turning, student-guide.js adds .is-flat: the turned leaf is laid flat again and its
   left-hand page is simply moved into place on the left, so its text is drawn normally — crisp, like the right page. */
.sg-book.is-spread .sg-leaf.is-flat { transform: none; transition: none; }
.sg-book.is-spread .sg-leaf.is-flat .sg-face--right { visibility: hidden; }
.sg-book.is-spread .sg-leaf.is-flat .sg-face--left { transform: none; left: -100%; right: 100%; }

@media (prefers-reduced-motion: reduce) {
  .sg-book { --turn: .01s; }
  .sg-leaf, .sg-book { transition-duration: .01s; }
  .sg-leaf.is-turning .sg-face::after, .sg-leaf.is-reveal .sg-face::after, .sg-leaf.is-covered .sg-face::after, .pg-open,
  .sg-book:not(.is-spread) .sg-leaf.is-reveal, .sg-book:not(.is-spread) .sg-leaf.is-covered { animation: none; }
}

/* phones: never let the browser enlarge text on its own (Android Chrome / iOS "text size" boosting), and keep form fields at 16px so iOS does not zoom in */
html.js, html.js body.sg-reader, .sg-book { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.sg-modal input { font-size: 16px; }

/* safety net: if a real phone ever renders a page taller than the screen, the page scrolls instead of cutting text off */
.pg::-webkit-scrollbar { display: none; }
.pg.can-scroll { -webkit-mask-image: linear-gradient(#000 calc(100% - 2.4em), transparent); mask-image: linear-gradient(#000 calc(100% - 2.4em), transparent); }
.pg.can-scroll.at-end { -webkit-mask-image: none; mask-image: none; }

/* invisible ruler: its height is the browser's "small viewport" (screen minus toolbars), read by the script in the page head */
.sg-probe { position: fixed; left: 0; top: 0; width: 0; height: 100vh; height: 100svh; visibility: hidden; pointer-events: none; }

.sg-debug { position: fixed; left: 4px; bottom: 4px; z-index: 9999; margin: 0; padding: 6px 8px; font: 11px/1.3 monospace; color: #0f0; background: rgba(0,0,0,.82); border-radius: 6px; pointer-events: none; white-space: pre; }

/* phones AND tablets (any touch screen, or any screen under 1024px): the book sits on top and the control bar
   (home, prev / page / next, PDF) moves to the bottom, so the thumb stays in one place. Computers keep it on top. */
@media (max-width: 1023px), (hover: none) and (pointer: coarse) {
  .sg-stage { order: 1; }
  .sg-hud { order: 2; padding: var(--sp-2) var(--sp-3) calc(var(--sp-2) + var(--safe-top, 0px) * 0); }
}
