/* Scene-first layout: the screens around the lessons (the Risk planner is tectonics only). Loaded after world.css; everything here is scoped to
   .w-stage.sf, so the classic layout is unchanged.
   1. Risk planner: outcome chips over the scene, "Watch it happen" in the guide footer
   2. Place pages: lesson start cards, the tour call to action, the guided tour bar
   3. Lesson steps on dark glass and in the docked reading column
   4. Full screen */

/* ---------- shared: the guide's heading row ---------- */
/* the kind and title take the row, so they sit at the left with KS3/GCSE at the right (not pushed right) */
.w-stage.sf .w-ptop>div:first-child{flex:1;min-width:0}
.w-stage.sf.sf-dock .w-ptop h2{font-size:24px;line-height:1.15}
/* the time banner, HUD and outcome chips keep clear of the view-tool column (its pills are wider than the round buttons) */
.w-stage.sf:not(.sf-dock) .w-stack{right:112px}
/* the chart dock (wide charts and tables), tablets and wider: above the map at the right, left of the view tools, so it is
   never under the guide card at the left (phones: world-sf-mobile.css) */
@media(min-width:721px){
 .w-stage.sf .w-chart{left:auto;right:calc(24px + var(--sf-railw));bottom:calc(var(--sf-dockh) + 28px + var(--sf-maph, 0px));width:min(320px,28%)}
 .w-stage.sf:has(.w-locator:not(.collapsed)) .w-chart{--sf-maph:118px}
 .w-stage.sf:has(.w-locator.collapsed) .w-chart{--sf-maph:52px}
 .w-stage.sf .w-chart.min{width:auto}
}
/* the scene caption keeps clear of the guide card and the locator map; with no dock (places, tools) it and the map drop to the bottom */
@media(min-width:721px){
 .w-stage.sf .w-caption{display:flex;justify-content:center;left:14px;right:calc(min(250px,40%) + 28px);width:auto;max-width:none;transform:none}
 .w-stage.sf.w-guide-open:not(.sf-dock):has(>.w-panel.w-float-left:not(.w-minimised)) .w-caption{left:calc(var(--sf-cardw) + 28px)}
 /* with the map folded to its button (tablets), the caption can run up to the button */
 .w-stage.sf:has(.w-locator.collapsed) .w-caption{right:124px}
 .w-stage.sf:has(#w-player[hidden]) .w-caption,.w-stage.sf:has(#w-player[hidden]) .w-locator{bottom:16px}
 .w-stage.sf:not(.sf-dock):has(#w-player[hidden]) .w-panel{max-height:calc(100% - 66px - 16px)}
}

/* ---------- 1. Risk planner ---------- */
.rk-chips{display:none}
.w-stage.sf .rk-chips{display:block;pointer-events:none}
.w-stage.sf .w-stack:has(.rk-chips){width:min(640px,calc(100% - min(410px,36%) - 150px));max-width:none}
.w-stage.sf.sf-dock .w-stack:has(.rk-chips){width:min(640px,calc(100% - 136px))}
.rk-chipk{display:inline-block;margin:0 0 6px;padding:4px 10px;border-radius:999px;background:var(--sf-glass);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border:1px solid var(--sf-line);font-size:11px;font-weight:750;letter-spacing:.1em;text-transform:uppercase;color:var(--sf-amber2)}
.rk-chipk small{font-weight:600;letter-spacing:0;text-transform:none;color:var(--sf-ink);opacity:.85}
.rk-chips ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr 1.25fr .9fr;gap:8px}
.rk-c{position:relative;overflow:hidden;display:grid;gap:2px;min-width:0;padding:10px 14px 11px;border:1px solid var(--sf-line);border-radius:14px;background:var(--sf-glass);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);color:var(--sf-ink)}
.rk-c b{font-size:24px;line-height:1.1;font-weight:750;font-variant-numeric:tabular-nums;white-space:nowrap}
.rk-c b small{font-size:13px;font-weight:600;color:var(--sf-muted)}
.rk-c span{font-size:12px;line-height:1.35;color:var(--sf-muted)}
.rk-c.good{box-shadow:inset 0 3px 0 var(--sf-good)}.rk-c.good b{color:var(--sf-good)}
.rk-c.mid{box-shadow:inset 0 3px 0 var(--sf-amber)}.rk-c.mid b{color:var(--sf-amber2)}
.rk-c.bad{box-shadow:inset 0 3px 0 #f2785c}.rk-c.bad b{color:#ffb4a1}
.rk-c:nth-child(3) b{font-size:18px;line-height:1.2;white-space:normal;padding-top:3px}
.rk-c i{position:absolute;left:0;bottom:0;height:3px;background:var(--sf-amber);transition:width .25s}
/* the run button: the footer of the guide, amber like the play button */
.w-stage.sf .w-float-actions>.rk-run,.w-stage.sf.sf-dock .w-float-actions>.rk-run{background:var(--sf-amber);color:#1d1407;min-height:52px;font-size:16px;font-weight:800;letter-spacing:.01em;box-shadow:0 6px 18px rgba(242,178,62,.28)}
.w-stage.sf .w-float-actions>.rk-run:hover,.w-stage.sf.sf-dock .w-float-actions>.rk-run:hover{background:var(--sf-amber2)}
.w-stage.sf.sf-dock .w-float-actions{background:var(--sf-paper)}
/* in the docked column the four outcome numbers float over the scene instead; tighten what remains */
.w-stage.sf.sf-dock .rk-m label{border-radius:9px;padding:9px 11px}
.w-stage.sf.sf-dock .pl-presets button[aria-pressed=true]{background:var(--ink);border-color:var(--ink)}
/* if the planner guide is floated over the scene: its cards and tables on dark glass */
.w-stage.sf:not(.sf-dock) .pl-honest{background:rgba(242,178,62,.1);border-color:rgba(242,178,62,.3);color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-about{color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-presets button{background:rgba(255,255,255,.06);border-color:var(--sf-line);color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-presets button[aria-pressed=true]{background:var(--sf-ink);border-color:var(--sf-ink);color:#13202a}
.w-stage.sf:not(.sf-dock) .rk-budget{background:rgba(255,255,255,.12)}.w-stage.sf:not(.sf-dock) .rk-budget span{background:var(--sf-amber)}
.w-stage.sf:not(.sf-dock) .rk-m label{background:rgba(255,255,255,.05);border-color:var(--sf-line);border-radius:10px}
.w-stage.sf:not(.sf-dock) .rk-m.on label{background:rgba(99,210,159,.12);border-color:var(--sf-good);box-shadow:inset 3px 0 0 var(--sf-good)}
.w-stage.sf:not(.sf-dock) .rk-m.no label{background:rgba(255,255,255,.03)}
.w-stage.sf:not(.sf-dock) .rk-m input{accent-color:var(--sf-good)}
.w-stage.sf:not(.sf-dock) .rk-m small{color:var(--sf-muted)}.w-stage.sf:not(.sf-dock) .rk-m i{color:var(--sf-amber2)}
.w-stage.sf:not(.sf-dock) .rk-note{background:rgba(242,178,62,.14);border-color:rgba(242,178,62,.4);color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .rk-notes .good{background:rgba(99,210,159,.1);border-color:var(--sf-good)}
.w-stage.sf:not(.sf-dock) .rk-notes .mid{background:rgba(242,178,62,.1);border-color:var(--sf-amber)}
.w-stage.sf:not(.sf-dock) .rk-notes .bad{background:rgba(242,120,92,.12);border-color:#f2785c}
.w-stage.sf:not(.sf-dock) .rk-notes li,.w-stage.sf:not(.sf-dock) .rk-q{color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-ledger th,.w-stage.sf:not(.sf-dock) .pl-ledger td{border-color:var(--sf-line);color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .pl-ledger thead th{background:rgba(255,255,255,.07)}
.w-stage.sf:not(.sf-dock) .pl-ledger td.ok{color:var(--sf-good)}.w-stage.sf:not(.sf-dock) .pl-ledger td.mid{color:var(--sf-amber2)}.w-stage.sf:not(.sf-dock) .pl-ledger td.bad{color:#ffb4a1}

/* ---------- 2. Place pages ---------- */
/* "Start the tour": the call to action */
.w-stage.sf .w-cta{flex-direction:row;align-items:center;gap:14px;margin:12px 0 4px;padding:14px 14px 14px 16px;border-radius:14px}
.w-stage.sf .w-cta>div{flex:1;min-width:0}
.w-stage.sf .w-cta b{font-size:18px;margin-bottom:2px}
.w-stage.sf .w-cta .w-primary{align-self:center;flex:none;min-height:46px;padding:10px 18px;border-radius:999px;font-size:15px;font-weight:800}
.w-stage.sf .w-cta .w-primary::before{content:"▶";font-size:11px;margin-right:8px;vertical-align:1px}
.w-stage.sf:not(.sf-dock) .w-cta{background:linear-gradient(135deg,rgba(242,178,62,.22),rgba(242,178,62,.08));border:1px solid rgba(242,178,62,.45)}
.w-stage.sf:not(.sf-dock) .w-cta b{color:var(--sf-ink)}.w-stage.sf:not(.sf-dock) .w-cta span{color:#d9d2c0}
.w-stage.sf:not(.sf-dock) .w-cta .w-primary{background:var(--sf-amber);color:#1d1407;box-shadow:0 6px 18px rgba(242,178,62,.3)}
.w-stage.sf:not(.sf-dock) .w-cta .w-primary:hover{background:var(--sf-amber2)}
.w-stage.sf.sf-dock .w-cta{background:#f8ecd0;border:1px solid #ecd39b}
.w-stage.sf.sf-dock .w-cta .w-primary{background:#b76c1e;border-color:#b76c1e;color:#fff}
/* lessons here: start cards */
.w-stage.sf .w-lessons{gap:10px}
.w-stage.sf .w-lesson{position:relative;gap:4px;padding:13px 14px 12px;border-radius:14px;transition:transform .15s,background .15s,border-color .15s}
.w-stage.sf:not(.sf-dock) .w-lesson{background:rgba(255,255,255,.06);border:1px solid var(--sf-line);border-left:1px solid var(--sf-line)}
.w-stage.sf:not(.sf-dock) .w-lesson:hover,.w-stage.sf:not(.sf-dock) .w-lesson:focus-visible{background:rgba(255,255,255,.11);border-color:rgba(242,178,62,.6);transform:translateY(-1px)}
.w-stage.sf .w-lesson b{font-size:19px;line-height:1.2}
.w-stage.sf .w-ltag{letter-spacing:.12em;text-transform:uppercase}
.w-stage.sf:not(.sf-dock) .w-ltag{color:var(--sf-amber2)}
.w-stage.sf .w-lout{font-size:13.5px}
.w-stage.sf:not(.sf-dock) .w-lout{color:#cfd7d6}
.w-stage.sf .w-lmeta{font-weight:600}
.w-stage.sf:not(.sf-dock) .w-lmeta{color:var(--sf-muted)}
.w-stage.sf .w-lgo{justify-self:start;margin-top:8px;padding:7px 14px;border-radius:999px;font-size:13.5px;font-weight:800}
.w-stage.sf:not(.sf-dock) .w-lgo{background:var(--sf-ink);color:#13202a}
.w-stage.sf:not(.sf-dock) .w-lesson:hover .w-lgo{background:var(--sf-amber);color:#1d1407}
.w-stage.sf:not(.sf-dock) .w-lesson[data-progress=started] .w-lgo{background:var(--sf-amber);color:#1d1407}
.w-stage.sf:not(.sf-dock) .w-lesson[data-progress=done]{border-color:rgba(99,210,159,.4)}
.w-stage.sf:not(.sf-dock) .w-lesson[data-progress=done] .w-lgo{background:rgba(99,210,159,.16);color:var(--sf-good)}
.w-stage.sf.sf-dock .w-lgo{background:var(--green);color:#fff}
.w-stage.sf.sf-dock .w-lesson[data-progress=done] .w-lgo{background:#e5efdf;color:var(--green)}
/* places to visit */
.w-stage.sf .w-place{border-radius:11px;padding:9px 11px}
.w-stage.sf:not(.sf-dock) .w-place:hover{border-color:rgba(255,255,255,.3)}
.w-stage.sf:not(.sf-dock) .w-place span{color:var(--sf-muted)}
.w-stage.sf:not(.sf-dock) .w-later summary{cursor:pointer}
.w-stage.sf:not(.sf-dock) .w-later .w-link{color:var(--sf-ink)}
/* the guided tour bar */
.w-stage.sf .w-tourbar{border-radius:14px;padding:12px 14px;gap:8px}
.w-stage.sf:not(.sf-dock) .w-tourbar{background:rgba(242,178,62,.1);border:1px solid rgba(242,178,62,.35)}
.w-stage.sf:not(.sf-dock) .w-tourtop{color:var(--sf-amber2)}
.w-stage.sf:not(.sf-dock) .w-tourtop .w-link{color:var(--sf-muted)}.w-stage.sf:not(.sf-dock) .w-tourtop .w-link:hover{color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .w-tourdots i{background:rgba(255,255,255,.16)}
.w-stage.sf:not(.sf-dock) .w-tourdots i.done{background:var(--sf-good)}
.w-stage.sf:not(.sf-dock) .w-tourdots i.on{background:var(--sf-amber)}
.w-stage.sf:not(.sf-dock) .w-tourbar p{color:var(--sf-ink)}
.w-stage.sf .w-tourbtns .w-secondary{border-radius:999px;min-height:38px;padding:7px 14px}
.w-stage.sf:not(.sf-dock) .w-tourbtns #wt-next{background:var(--sf-ink);color:#13202a;border-color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .w-tourbtns #wt-next:hover{background:#fff}
.w-stage.sf:not(.sf-dock) .w-tourbtns .w-link{color:var(--sf-muted)}
.w-stage.sf.sf-dock .w-tourbtns #wt-next{background:var(--ink);color:#fff;border-color:var(--ink)}

/* ---------- 3. Lesson steps ---------- */
/* Predict: the recorded choice */
.w-stage.sf .w-choices button{text-align:left}
.w-stage.sf:not(.sf-dock) .w-choices button[aria-checked=true]{box-shadow:inset 3px 0 0 var(--sf-amber)}
.w-stage.sf:not(.sf-dock) .w-choices button[aria-checked=true]::after{content:"Your prediction";float:right;font-size:11px;font-weight:750;color:var(--sf-amber2);margin-left:8px}
/* Explain: "your prediction" sits apart from the step heading */
.w-stage.sf #w-body>.w-key:first-child{margin:0 0 16px;border-radius:0 11px 11px 0}
.w-stage.sf.sf-dock #w-body>.w-key:first-child{background:#f8ecd0;border-left-color:#b76c1e}
.w-stage.sf.sf-dock #w-body>.w-key:first-child span{color:#8a4f12}
.w-stage.sf:not(.sf-dock) #w-body>.w-key:first-child{background:rgba(242,178,62,.1);padding:10px 12px}
.w-stage.sf:not(.sf-dock) #w-body>.w-key:first-child p+p{color:#d9d2c0;font-size:14px}
.w-stage.sf .w-frames{padding-left:22px}
.w-stage.sf .w-open textarea{border-radius:10px;padding:10px 12px;font-size:14.5px;line-height:1.5}
.w-stage.sf:not(.sf-dock) .w-open textarea::placeholder{color:var(--sf-muted)}
.w-stage.sf:not(.sf-dock) .w-open textarea:focus{outline:2px solid var(--sf-amber);outline-offset:1px}
.w-stage.sf:not(.sf-dock) .w-model{color:var(--sf-ink)}.w-stage.sf:not(.sf-dock) .w-model p,.w-stage.sf:not(.sf-dock) .w-assume{color:#d9d2c0}
/* Check: evidence, feedback and order questions */
.w-stage.sf:not(.sf-dock) .w-evidence p{color:#d6f2e4}
.w-stage.sf:not(.sf-dock) .w-evidence .w-small{color:#a9c9b9}
.w-stage.sf .w-feedback{border-radius:0 10px 10px 0;font-size:14px}
.w-stage.sf.sf-dock .w-feedback{color:var(--ink)}
.w-stage.sf .w-order{list-style:none;padding:0;counter-reset:ord;display:grid;gap:6px;font-size:14px}
.w-stage.sf .w-order li{counter-increment:ord;border:1px solid var(--line);border-radius:10px;padding:6px 6px 6px 10px;gap:8px}
.w-stage.sf .w-order li::before{content:counter(ord);flex:none;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;font-size:12px;font-weight:800}
.w-stage.sf .w-order li button{border-radius:8px;width:34px;height:34px}
.w-stage.sf:not(.sf-dock) .w-order li{background:rgba(255,255,255,.05);border-color:var(--sf-line);color:var(--sf-ink)}
.w-stage.sf:not(.sf-dock) .w-order li::before{background:rgba(242,178,62,.18);color:var(--sf-amber2)}
.w-stage.sf:not(.sf-dock) .w-order li button:hover{background:rgba(255,255,255,.16)}
.w-stage.sf.sf-dock .w-order li{background:#fffefa}
.w-stage.sf.sf-dock .w-order li::before{background:#efe9db;color:var(--ink)}
/* open answers: one box (the textarea), not a box inside a box */
.w-stage.sf.sf-dock .w-q{border:0;padding:0}
.w-stage.sf .w-q label.w-open,.w-stage.sf:not(.sf-dock) .w-q label.w-open{display:block;background:none;border:0;padding:0;margin:4px 0 0}
/* the question's own button (Check answer / order, model answer) in the guide footer */
.w-stage.sf.sf-dock .w-float-actions>button[data-check],.w-stage.sf.sf-dock .w-float-actions>button[data-model]{background:var(--ink)}
/* Done: the recap */
.w-stage.sf .w-recap{padding-left:0;list-style:none;display:grid;gap:8px;margin:4px 0 8px}
.w-stage.sf .w-recap li{position:relative;padding-left:26px;line-height:1.5;font-size:14.5px}
.w-stage.sf .w-recap li::before{content:"✓";position:absolute;left:0;top:1px;width:18px;height:18px;border-radius:50%;display:grid;place-items:center;font-size:11px;font-weight:800}
.w-stage.sf:not(.sf-dock) .w-recap li{color:#e9e5da}
.w-stage.sf:not(.sf-dock) .w-recap li::before{background:var(--sf-good);color:#0d1a14}
.w-stage.sf.sf-dock .w-recap li::before{background:var(--green);color:#fff}
.w-stage.sf #w-body .w-actions:not(:first-child){border-top-color:var(--line)}

/* ---------- 4. Full screen ---------- */
/* the whole window is the scene: square corners and no page shadow; the dock sits clear of the screen edge */
.w-stage.sf.sf-full{box-shadow:none}
.w-stage.sf.sf-full .w-trail{top:14px}
.w-stage.sf.sf-full .w-player{bottom:16px}

/* docked column on laptop widths: the scene side is narrow, so the trail keeps only the back button beside the steps
   (the guide's header names the lesson) and the dock drops the clock and the stage names, keeping the timeline usable */
@media(min-width:721px) and (max-width:1400px){
 .w-stage.sf.sf-dock .w-trail:has(.w-steps:not([hidden])) #w-crumbs{display:none}
 .w-stage.sf.sf-dock .w-trail:has(.w-steps:not([hidden])) .w-crumbnav{padding-right:3px}
 .w-stage.sf.sf-dock .w-time{display:none}
 .w-stage.sf.sf-dock #w-segs button span{display:none}
 .w-stage.sf.sf-dock .w-player{gap:10px}
}

/* phones: smaller chips, two by two */
@media(max-width:720px){
 .w-stage.sf .w-stack:has(.rk-chips),.w-stage.sf.sf-dock .w-stack:has(.rk-chips){left:8px;right:8px;top:152px;width:auto;max-width:none}
 .w-stage.sf.w-guide-open .w-stack:has(.rk-chips){display:flex}
 .w-stage.sf.w-guide-open .w-stack:has(.rk-chips)>:not(.rk-chips){display:none}
 .w-stage.sf:has(#w-player[hidden]) .w-panel,.w-stage.sf.sf-dock:has(#w-player[hidden]) .w-panel{bottom:0}
 .rk-chipk{display:none}
 .rk-chips ul{display:grid;grid-template-columns:1fr 1fr;gap:6px}
 .rk-c{min-width:0;padding:7px 10px 8px;border-radius:11px}
 .rk-c b{font-size:17px}.rk-c:nth-child(3) b{font-size:14px}
 .rk-c span{font-size:11px}
 .w-stage.sf .w-cta{flex-direction:column;align-items:stretch}
 .w-stage.sf .w-cta .w-primary{align-self:flex-start}
}
@media(prefers-reduced-motion:reduce){.w-stage.sf .w-lesson{transition:none}.w-stage.sf:not(.sf-dock) .w-lesson:hover{transform:none}}
