/* Safe Hands course. Phone first: one column, large touch targets. Two columns from 880px. */
:root{
  --cream:#F5EFE6; --card:#FFFBF5; --coffee:#2B211C; --coffee-2:#3B2E27; --copper:#9A4A22; --copper-dark:#7A3816;
  --peach:#F0B892; --tint:#F3DFD0; --sand:#EBDDCB; --line:#DCCFC0; --muted:#6B5B50; --body:#4A3D35;
  --green:#2F6B45; --green-tint:#DFEEDF; --green-ink:#1E4A2E; --red-tint:#F7D9CC; --red-ink:#7A2216;
  --radius:24px; --radius-s:16px;
  --font:'Nunito Sans',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--cream);color:var(--coffee);font-family:var(--font);font-size:17px;line-height:1.5;
  min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;overflow-x:hidden}
img{max-width:100%;display:block}
h1,h2,h3,p{margin:0}
h1{font-size:clamp(28px,6vw,42px);line-height:1.1;font-weight:900}
h2{font-size:clamp(22px,4.5vw,28px);line-height:1.2;font-weight:900}
h3{font-size:18px;font-weight:800}
button{font-family:inherit;color:inherit;cursor:pointer;touch-action:manipulation}
:focus-visible{outline:3px solid var(--copper);outline-offset:3px}
.dark :focus-visible{outline-color:var(--peach)}
.skip{position:absolute;left:-999px}.skip:focus{left:12px;top:12px;z-index:50;background:var(--card);padding:10px 14px;border-radius:12px}
.live{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}

.top{display:flex;align-items:center;gap:12px;justify-content:space-between;
  padding:max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 8px max(16px,env(safe-area-inset-left))}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.logo{width:42px;height:42px;border-radius:14px;background:var(--copper);display:flex;align-items:center;justify-content:center;flex:none}
.brand-text{display:flex;flex-direction:column;min-width:0;line-height:1.2}
.brand-text strong{font-size:18px;font-weight:900}
.brand-text span{font-size:13px;font-weight:700;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.progress{display:flex;flex-direction:column;gap:5px;align-items:flex-end;flex:none}
.progress-label{font-size:13px;font-weight:800}
.progress-track{width:96px;height:8px;border-radius:4px;background:var(--line);overflow:hidden}
.progress-fill{display:block;height:100%;background:var(--copper);border-radius:4px;transition:width .3s}

main{flex:1;width:100%;max-width:1180px;margin:0 auto;padding:8px 16px 16px;display:grid;gap:16px;align-content:start;outline:none}
.card{background:var(--card);border-radius:var(--radius);padding:20px;display:flex;flex-direction:column;gap:14px;min-width:0}
.card.dark{background:var(--coffee);color:var(--card)}
.card.dark p{color:var(--line)}
.lede{font-size:18px;color:var(--body)}
.tag{align-self:flex-start;background:var(--tint);color:var(--copper-dark);border-radius:999px;padding:5px 13px;font-size:13px;font-weight:800}
.dark .tag,.kicker{background:none;padding:0;color:var(--peach);font-size:13px;font-weight:800}
.photo{border-radius:var(--radius-s);overflow:hidden;background:var(--sand);position:relative}
.photo img{width:100%;height:auto}
.muted{color:var(--muted);font-size:15px}

.foot{position:sticky;bottom:0;display:flex;align-items:center;gap:10px;justify-content:space-between;background:linear-gradient(transparent,var(--cream) 30%);
  padding:18px max(16px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
.credit{font-size:12px;color:var(--muted);text-align:center;flex:1;min-width:0}
.btn{min-height:52px;padding:0 24px;border-radius:var(--radius-s);font-size:16px;font-weight:800;border:2px solid transparent}
.btn.primary{background:var(--copper);color:var(--card)}
.btn.primary:hover{background:var(--copper-dark)}
.btn.ghost{background:var(--card);border-color:var(--line)}
.btn.peach{background:var(--peach);color:var(--coffee)}
.btn[disabled]{opacity:.45;cursor:not-allowed}
.btn[hidden]{display:none}
.row{display:flex;gap:10px;flex-wrap:wrap}

/* Media: video with a graceful placeholder, narration with transcript */
.video{position:relative;border-radius:var(--radius-s);overflow:hidden;background:var(--sand);aspect-ratio:16/9}
.video video,.video img{width:100%;height:100%;object-fit:cover}
.video .soon{position:absolute;inset:auto 12px 12px 12px;background:var(--card);border-radius:12px;padding:10px 14px;font-size:14px;font-weight:700}
audio{width:100%}
.transcript{background:var(--cream);border-radius:var(--radius-s);padding:14px 16px;font-size:16px;color:var(--body)}
.dark .transcript{background:var(--coffee-2);color:var(--line)}
.transcript strong{display:block;font-size:13px;color:var(--muted);margin-bottom:4px}
.dark .transcript strong{color:var(--peach)}

/* Lists */
.learn{display:grid;gap:10px;list-style:none;margin:0;padding:0}
.learn li{display:flex;align-items:center;gap:12px;background:var(--coffee-2);border-radius:var(--radius-s);padding:12px 14px;font-weight:800}
.learn b{width:34px;height:34px;border-radius:11px;background:var(--peach);color:var(--coffee);display:flex;align-items:center;justify-content:center;flex:none;font-weight:900}
.chips{display:flex;flex-wrap:wrap;gap:8px;list-style:none;margin:0;padding:0}
.chips li{background:var(--tint);color:var(--copper-dark);border-radius:999px;padding:8px 14px;font-size:15px;font-weight:700}

/* Handwashing steps */
.steps-nav{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:center}
.steps-nav .dots{grid-column:1/-1;justify-content:center;order:-1}
.steps-nav .btn{padding:0 12px}
.dots{display:flex;gap:6px}
.dots span{width:26px;height:8px;border-radius:4px;background:var(--line)}
.dots span.on{background:var(--copper)}
.step-caption{font-size:18px}
.step-caption b{font-weight:900}
.tip{background:var(--tint);border-radius:var(--radius-s);padding:12px 16px;font-weight:700;color:var(--copper-dark)}

/* Pins on the danger zone photo */
.pin{position:absolute;transform:translate(-50%,-50%);width:48px;height:48px;border-radius:24px;border:3px solid var(--card);background:var(--copper);color:var(--card);font-weight:900;font-size:18px;box-shadow:0 2px 8px rgb(0 0 0 / .35)}
.pin.on{background:var(--coffee)}
.temps{display:grid;gap:10px}
.temp{border:0;text-align:left;border-radius:var(--radius-s);padding:14px 16px;display:flex;flex-direction:column;gap:2px;min-height:64px}
.temp small{font-size:14px;font-weight:800}
.temp b{font-size:22px;font-weight:900;line-height:1.15}
.temp.cold{background:#DDE9F3;color:#1D4466}.temp.danger{background:var(--red-tint);color:var(--red-ink)}.temp.hot{background:#FBE7C2;color:#6E4200}
.temp.on{outline:3px solid var(--coffee)}
.explain{min-height:3em;color:var(--body)}

/* Fridge or counter game */
.game{display:grid;gap:10px}
.game-item{background:var(--coffee-2);border-radius:var(--radius-s);padding:12px;display:grid;grid-template-columns:64px 1fr;gap:10px 12px;align-items:center}
.game-item img{width:64px;height:64px;object-fit:contain}
.game-item .name{font-weight:800;font-size:17px}
.game-item .choices{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.choice{min-height:48px;border-radius:12px;border:2px solid #5A4A40;background:transparent;color:var(--card);font-weight:800;font-size:15px}
.choice.right{background:var(--green-tint);border-color:var(--green-tint);color:var(--green-ink)}
.choice.wrong{border-color:var(--peach);color:var(--peach)}
.game-item .fb{grid-column:1/-1;font-size:15px;color:var(--line)}
.game-item .fb:empty{display:none}

/* Drag-and-drop fridge */
.fridge-wrap{display:grid;gap:12px}
.fridge-side{display:contents}
.fridge-wrap .tray{order:-1}
.fridge img{width:100%;height:auto}
.fridge-inner{position:relative;margin:-18% 0 -17%}
.fridge{position:relative;max-width:320px;width:100%;margin:0 auto;border-radius:var(--radius-s);overflow:hidden;background:var(--sand);touch-action:none;user-select:none;-webkit-user-select:none}
.zone{position:absolute;left:29%;width:36.5%;display:flex;align-items:flex-end;justify-content:center;gap:2%;border:2px dashed transparent;border-radius:8px;background:transparent;padding:0}
.zone.hot,.fridge.picking .zone{border-color:rgb(154 74 34 / .7);background:rgb(240 184 146 / .22)}
.zone.over{background:rgb(240 184 146 / .5)}
.zone img{height:92%;width:auto;max-width:48%;min-width:0;flex:0 1 auto;object-fit:contain;object-position:bottom;pointer-events:none}
.tray{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;min-height:92px}
.tray:empty{display:none}
.item{width:92px;height:92px;border-radius:var(--radius-s);border:2px solid var(--line);background:var(--card);padding:6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:12px;font-weight:800;touch-action:none;user-select:none;-webkit-user-select:none}
.item img{width:100%;height:52px;object-fit:contain;pointer-events:none}
.item.sel{border-color:var(--copper);background:var(--tint)}
.item.dragging{opacity:.35}
.ghost-item{position:fixed;z-index:40;width:96px;pointer-events:none;transform:translate(-50%,-60%);filter:drop-shadow(0 6px 10px rgb(0 0 0 / .35))}
.feedback{border-radius:var(--radius-s);padding:12px 16px;font-weight:700;background:var(--cream);color:var(--body);min-height:52px}
.feedback.good{background:var(--green-tint);color:var(--green-ink)}
.feedback.bad{background:var(--red-tint);color:var(--red-ink)}

/* Chopping boards */
.boards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.board{min-height:76px;border-radius:14px;border:2px solid rgb(0 0 0 / .15);font-weight:800;font-size:14px;padding:6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;line-height:1.2;text-align:center}
.board span{font-size:13px;font-weight:700;min-height:1.2em}
.board.red{background:#C8362B;color:#fff}.board.blue{background:#1F5FB5;color:#fff}.board.yellow{background:#F2CB3C;color:#2B211C}
.board.green{background:#2E8B4A;color:#fff}.board.brown{background:#6B4A2E;color:#fff}.board.white{background:#fff;color:#2B211C}

/* Spot what's wrong */
.scene{position:relative;border-radius:var(--radius-s);overflow:hidden;background:var(--sand)}
.scene img{width:100%;height:auto}
.spot{position:absolute;border:0;background:transparent;padding:0;border-radius:14px}
.spot.found{cursor:default}
.spot.found::after{content:"";position:absolute;left:50%;top:50%;width:40px;height:40px;margin:-20px;border-radius:20px;border:3px solid var(--card);
  background:var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFBF5' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/22px no-repeat;box-shadow:0 2px 8px rgb(0 0 0 / .4)}
.spot.hint{box-shadow:0 0 0 4px var(--peach),0 0 0 9999px rgb(43 33 28 / .35)}
.scene.debug .spot{outline:2px solid red;background:rgb(255 0 0 / .2)}
.counter{position:absolute;left:10px;bottom:10px;background:var(--card);border-radius:999px;padding:7px 14px;font-size:14px;font-weight:800}
.finds{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.finds li{display:flex;gap:10px;align-items:center;font-weight:700;font-size:16px}
.finds i{width:26px;height:26px;border-radius:13px;flex:none;border:2px dashed #A8978A}
.finds li.got i{border:0;background:var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFBF5' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/15px no-repeat}
.finds li:not(.got){color:var(--line)}

/* Quiz */
.options{display:grid;gap:10px}
.option{min-height:58px;border-radius:var(--radius-s);border:2px solid var(--line);background:var(--card);font-weight:800;font-size:16px;text-align:left;padding:10px 16px}
.option.right{border-color:var(--green);background:var(--green-tint);color:var(--green-ink)}
.option.wrong{border-color:#B4442F;background:var(--red-tint);color:var(--red-ink)}
.option[disabled]{cursor:default;opacity:1}
.score{background:var(--coffee-2);border-radius:var(--radius-s);padding:14px 16px}
.score small{display:block;font-size:13px;font-weight:800;color:var(--peach)}
.score b{font-size:28px;font-weight:900}
.qdots{display:flex;gap:6px}
.qdots span{width:26px;height:8px;border-radius:4px;background:var(--line)}
.qdots span.done{background:var(--green)}.qdots span.miss{background:#B4442F}.qdots span.now{background:var(--copper)}

@media (min-width:880px){
  main{grid-template-columns:7fr 5fr;gap:20px;padding:12px 32px 20px}
  main.single{grid-template-columns:minmax(0,820px);justify-content:center}
  .card{padding:28px}
  .span2{grid-column:1/-1}
  .progress-track{width:160px}
  .temps{grid-template-columns:repeat(3,minmax(0,1fr))}
  .fridge-wrap{grid-template-columns:minmax(0,380px) minmax(0,1fr);align-items:start;gap:20px}
  .fridge{margin:0;max-width:380px}
  .fridge-side{display:grid;gap:12px}
  .fridge-wrap .tray{order:0}
  .tray{justify-content:flex-start}
  .boards{grid-template-columns:repeat(6,minmax(0,1fr))}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
@media print{.foot,.top{display:none}}

/* ===== Version 2: one screen per page, animations, outlines, quiz mode ===== */
.spacer{flex:1}
.card.off{display:none}
h1[tabindex="-1"]:focus{outline:none}
.btn.small{min-height:44px;font-size:14px;padding:0 16px}
.btn.big{min-height:60px;font-size:18px;padding:0 32px}
.msg{color:var(--peach);min-height:1.4em;font-size:15px;font-weight:700}
.panel{border-radius:var(--radius-s);padding:16px;display:flex;flex-direction:column;gap:12px;min-width:0}
.panel.dark{background:var(--coffee);color:var(--card)}
.panel.dark p{color:var(--line)}
.panel.dark .kicker{color:var(--peach)}
.duo{gap:14px}
.duo-a{display:flex;flex-direction:column;gap:14px;min-width:0}
.photo.fit,.scene.fit{width:100%;max-width:calc(var(--ph,60vh)*1.5);align-self:center}
.finds-wrap{display:none}

/* Motion */
@keyframes enter{from{opacity:0;transform:translateX(36px)}to{opacity:1;transform:none}}
@keyframes enterBack{from{opacity:0;transform:translateX(-36px)}to{opacity:1;transform:none}}
@keyframes rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes pop{0%{transform:scale(.96)}60%{transform:scale(1.03)}100%{transform:none}}
@keyframes popIn{0%{transform:scale(0)}70%{transform:scale(1.15)}100%{transform:scale(1)}}
@keyframes drop{0%{transform:translateY(-26px);opacity:0}70%{transform:translateY(3px);opacity:1}100%{transform:none}}
@keyframes shake{20%{transform:translateX(-6px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(4px)}}
@keyframes glow{0%,100%{box-shadow:0 0 0 2px rgb(0 0 0 / .35),0 0 0 0 var(--oc)}50%{box-shadow:0 0 0 2px rgb(0 0 0 / .35),0 0 0 7px transparent}}
@keyframes fill{from{width:0}to{width:100%}}
.card.enter{animation:enter .5s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(var(--i,0)*110ms)}
.card.enter-back{animation:enterBack .5s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(var(--i,0)*110ms)}
.card.enter .learn li,.card.enter .chips li,.card.enter-back .learn li,.card.enter-back .chips li{animation:rise .45s both;animation-delay:calc(.25s + var(--d,0)*80ms)}
.rise{animation:rise .35s both}
.pop{animation:pop .35s}
.zone.shake{animation:shake .45s}
.zone img.drop{animation:drop .45s cubic-bezier(.3,1.3,.5,1)}
.spot.found::after{animation:popIn .4s cubic-bezier(.3,1.4,.5,1)}
.progress-fill{transition:width .5s cubic-bezier(.2,.8,.2,1)}

/* Handwashing: crossfading photos, step tabs, 20-second bar */
.stack{aspect-ratio:3/2}
.layer{position:absolute;inset:0;opacity:0;transform:scale(1.06);transition:opacity .6s ease,transform 1.2s ease}
.layer.on{opacity:1;transform:none}
.layer img{width:100%;height:100%;object-fit:cover}
.timer{position:absolute;left:12px;right:12px;bottom:12px;height:30px;border-radius:15px;background:rgb(43 33 28 / .78);overflow:hidden;display:none;align-items:center;justify-content:center}
.timer.run{display:flex}
.timer i{position:absolute;left:0;top:0;bottom:0;background:var(--copper);width:0}
.timer.run i{animation:fill 20s linear forwards}
.timer em{position:relative;font-style:normal;font-size:13px;font-weight:800;color:var(--card)}
.stepper{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.stepdot{border:0;background:transparent;padding:4px 0;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:12px;font-weight:800;color:var(--muted);min-height:48px}
.stepdot b{width:30px;height:30px;border-radius:15px;background:var(--line);color:var(--coffee);display:flex;align-items:center;justify-content:center;transition:background .3s,transform .3s}
.stepdot.done b{background:var(--green);color:var(--card)}
.stepdot.on{color:var(--coffee)}
.stepdot.on b{background:var(--copper);color:var(--card);transform:scale(1.15)}
.step-caption{min-height:3em}
.steps-nav{grid-template-columns:1fr 1fr 1fr}
.steps-nav .btn{padding:0 8px;font-size:14px;min-height:48px}

/* Danger zone: dashed outlines around the things in the photo */
.outline{position:absolute;border:3px dashed var(--oc);border-radius:14px;background:transparent;padding:0;animation:glow 2s ease-in-out infinite;animation-delay:calc(var(--d,0)*.4s)}
.outline.cold{--oc:#8FD0FF}.outline.danger{--oc:#FF9B85}.outline.hot{--oc:#FFD166}
.outline.on{border-style:solid;background:color-mix(in srgb,var(--oc) 30%,transparent);animation:none;box-shadow:0 0 0 2px rgb(0 0 0 / .35)}
.outline:hover{background:color-mix(in srgb,var(--oc) 20%,transparent)}
.temps{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.temp{padding:10px;min-height:60px}
.temp small{font-size:12px}.temp b{font-size:16px}
.explain{min-height:4.5em}

/* Quiz mode: the page turns dark so it is clearly "question time" */
body{transition:background .4s}
.quiz-mode{background:var(--coffee)}
.quiz-mode .brand-text strong{color:var(--card)}
.quiz-mode .brand-text span,.quiz-mode .progress-label{color:var(--line)}
.quiz-mode .progress-track{background:#5A4A40}.quiz-mode .progress-fill{background:var(--peach)}
.quiz-mode .foot{background:linear-gradient(transparent,var(--coffee) 30%)}
.quiz-mode :focus-visible{outline-color:var(--peach)}
.btn.quiet{background:transparent;color:var(--line);border-color:#5A4A40}
.btn.quiet:hover{background:var(--coffee-2)}
.quiz-card.intro{background:var(--coffee-2);color:var(--card);align-items:center;text-align:center;justify-content:center;padding:36px 22px;min-height:min(62vh,520px);gap:16px}
.quiz-card.intro .lede{color:var(--line);max-width:34em}
.quiz-card.intro .kicker{font-size:15px}
.qmark{width:96px;height:96px;border-radius:48px;background:var(--peach);color:var(--coffee);font-size:40px;font-weight:900;display:flex;align-items:center;justify-content:center;animation:popIn .5s cubic-bezier(.3,1.4,.5,1)}
.qhead{display:flex;align-items:center;justify-content:space-between;gap:10px}
.question{font-size:clamp(22px,5vw,32px)}
.option{display:flex;align-items:center;gap:12px}
.option b{width:32px;height:32px;border-radius:16px;background:var(--tint);color:var(--copper-dark);display:flex;align-items:center;justify-content:center;flex:none;font-weight:900}
.option.right b{background:var(--green);color:var(--card)}.option.wrong b{background:#B4442F;color:var(--card)}
.quiz-card:has(.waiting) .option{animation:rise .35s both;animation-delay:calc(var(--d,0)*70ms)}
.quiz-card .score{padding:10px 14px}.quiz-card .score b{font-size:22px}

/* Phones: tighter so each page fits one screen where it can */
@media (max-width:879px){
  main{padding:4px 12px 8px;gap:12px}
  .card{padding:16px;gap:12px}
  h1{font-size:26px}
  .lede{font-size:16px}
  .tag{font-size:12px}
  .foot{padding-top:12px}
  .game-item{padding:10px;gap:8px 10px;grid-template-columns:48px 1fr}
  .game-item img{width:48px;height:48px}
  .choice{min-height:44px}
  .quiz-card .score{display:none}
  .panel.dark.waiting{display:none}
  .fridge{max-width:min(300px,32vh)}
  .item{width:84px;height:72px;font-size:11px;padding:4px}
  .item img{height:40px}
  .tray{min-height:0;gap:8px}
  .feedback{min-height:0;padding:10px 14px;font-size:15px}
  .fridge-wrap{gap:10px}
}
@media (max-width:879px) and (max-height:760px){.tip{display:none}}

/* Wide screens: fit the viewport */
@media (min-width:880px){
  main{align-content:center}
  .duo{display:grid;grid-template-columns:7fr 5fr;gap:20px;align-items:start}
  .finds-wrap{display:block}
  .photo.fit,.scene.fit{--ph:34vh}
  [data-section="spot"] .scene.fit{--ph:52vh}
  [data-section="danger"] .photo.fit{--ph:30vh}
  [data-section="separate"] main{grid-template-columns:5fr 7fr}
  .fridge-wrap{grid-template-columns:minmax(0,min(260px,36vh)) minmax(0,1fr)}
  .fridge{max-width:min(260px,36vh)}
  .steps-nav .btn{font-size:15px}
  .temp b{font-size:20px}.temp small{font-size:13px}
  .quiz-card.intro{min-height:56vh}
  .game{grid-template-columns:1fr 1fr}
  [data-section="danger"] h1{font-size:30px}
  [data-section="danger"] .photo.fit{--ph:28vh}
  .explain{min-height:3em}
  [data-section="hands"] .photo.fit{--ph:28vh}
  .game-item{grid-template-columns:48px 1fr;padding:10px}
  .game-item img{width:48px;height:48px}
  .game-item .fb{font-size:14px}
}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

@media (min-width:880px) and (max-height:860px){#stepBox .tip{display:none}}
@media (min-width:880px) and (max-height:900px){[data-section="hands"] .card.dark .lede{font-size:15px}[data-section="hands"] .chips li{font-size:13px;padding:5px 11px}[data-section="hands"] .chips{gap:6px}[data-section="hands"] .transcript{font-size:14px;padding:12px 14px}[data-section="hands"] .card.dark{padding:22px;gap:11px}}

/* ===== Version 3: bigger photos, text over the handwashing photo, course menu ===== */
main{max-width:1360px}
.only-wide{display:none}
.head{display:flex;flex-direction:column;gap:10px}

/* Menu */
.menu-btn{min-height:44px;padding:0 14px;border-radius:14px;border:2px solid var(--line);background:var(--card);font-weight:800;font-size:14px;display:inline-flex;align-items:center;gap:8px;flex:none}
.quiz-mode .menu-btn{background:transparent;color:var(--card);border-color:#5A4A40}
.top{gap:10px}
.brand{flex:1}
dialog#menu{border:0;border-radius:var(--radius);padding:20px;background:var(--card);color:var(--coffee);width:min(92vw,440px);max-height:88dvh}
dialog#menu::backdrop{background:rgb(43 33 28 / .55)}
dialog#menu[open]{animation:rise .25s both}
.menu-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.menu-list{list-style:none;margin:0 0 10px;padding:0;display:grid;gap:8px}
.menu-list button{width:100%;min-height:52px;border-radius:var(--radius-s);border:2px solid var(--line);background:var(--card);display:flex;align-items:center;gap:12px;padding:8px 14px;font-weight:800;font-size:16px;text-align:left}
.menu-list button b{width:32px;height:32px;border-radius:11px;background:var(--tint);color:var(--copper-dark);display:flex;align-items:center;justify-content:center;flex:none}
.menu-list button.here{border-color:var(--copper);background:var(--tint)}
.menu-list button.here b{background:var(--copper);color:var(--card)}
.menu-list button[disabled]{opacity:.5;cursor:not-allowed}
.menu-list button:not([disabled]):hover{background:var(--cream)}

/* Remember list as links */
.learn.links li{padding:0;background:none}
.learn.links button,.learn.links a{width:100%;min-height:56px;display:flex;align-items:center;gap:12px;background:var(--coffee-2);border:2px solid transparent;border-radius:var(--radius-s);padding:10px 14px;color:var(--card);font:inherit;font-weight:800;text-decoration:none;text-align:left}
.learn.links span{flex:1}
.learn.links i{font-style:normal;font-size:24px;color:var(--peach);line-height:1}
.learn.links button:hover,.learn.links a:hover{border-color:var(--peach)}

/* Handwashing hero: photo fills the card, title and caption sit on top of it */
.hero-card{padding:0;gap:0;overflow:hidden}
.hero{position:relative;height:min(54dvh,480px);background:var(--sand);overflow:hidden}
.hero .layer img{width:100%;height:100%;object-fit:cover;object-position:42% 60%}
.hero-top,.hero-bottom{position:absolute;left:0;right:0;padding:16px;display:flex;flex-direction:column;gap:8px;pointer-events:none}
.hero-top{top:0;background:linear-gradient(rgb(43 33 28 / .78),transparent);padding-bottom:44px;align-items:flex-start}
.hero-top h1{color:var(--card)}
.hero-bottom{bottom:0;background:linear-gradient(transparent,rgb(43 33 28 / .9) 45%);padding-top:56px}
.hero .step-caption{color:var(--card);font-size:19px;font-weight:700;min-height:0;line-height:1.35}
.hero .step-caption b{color:var(--peach)}
.hero .timer{position:relative;left:auto;right:auto;bottom:auto;width:100%;background:rgb(255 251 245 / .25)}
.hero-controls{padding:12px 14px 14px;display:flex;flex-direction:column;gap:10px}

/* Game: compact rows so the photo can take the space */
.game{gap:8px}
.game-item{grid-template-columns:40px minmax(0,1fr) auto;padding:8px 10px;gap:6px 10px}
.game-item img{width:40px;height:40px}
.game-item .name{font-size:15px}
.game-item .choices{grid-column:auto;display:flex;gap:6px}
.choice{min-height:44px;padding:0 12px;font-size:14px}
.game-item .fb{font-size:14px}
.game-item.solved{outline:2px solid rgb(223 238 223 / .35)}

.spot-card{display:flex;flex-direction:column}
.spot-head{display:flex;flex-direction:column;gap:8px}

@media (max-width:879px){
  main{padding:4px 8px 8px}
  .card{padding:14px}
  .hero-card{padding:0}
  .fridge{max-width:min(320px,34dvh)}
  .menu-btn span{display:none}
  .menu-btn{padding:0 12px}
  .brand-text span{display:none}
}
@media (min-width:880px){
  .only-wide{display:flex}.only-narrow{display:none}
  main{grid-template-columns:8fr 4fr}
  /* Each photo gets the full height left after the header, footer and its own controls */
  .hero{height:calc(100dvh - 332px);min-height:300px}
  .hero-top{padding:24px 28px 60px}.hero-bottom{padding:70px 28px 22px}
  .hero-top h1{font-size:44px}
  .hero .step-caption{font-size:24px;max-width:26em}
  .hero-controls{padding:14px 22px 18px;display:grid;grid-template-columns:1fr auto;align-items:center;gap:20px}
  .steps-nav{grid-template-columns:auto auto auto}
  .steps-nav .btn{padding:0 18px}
  [data-section="danger"] .photo.fit{--ph:calc(100dvh - 412px)}
  [data-section="danger"] .card.dark h1{font-size:30px;color:var(--card)}
  [data-section="danger"] .card.dark .tag{background:none;padding:0;color:var(--peach)}
  [data-section="danger"] .card.dark h2{font-size:22px}
  .game{grid-template-columns:1fr}
  [data-section="separate"] main{grid-template-columns:5fr 7fr}
  [data-section="separate"] .lede{font-size:16px}
  [data-section="separate"] .transcript{font-size:15px}
  .fridge-wrap{grid-template-columns:minmax(0,min(410px,calc((100dvh - 316px)/1.15))) minmax(170px,1fr)}
  .fridge{max-width:min(410px,calc((100dvh - 316px)/1.15))}
  .spot-card{display:grid;grid-template-columns:minmax(0,3fr) minmax(250px,1fr);grid-template-rows:auto 1fr;gap:14px 22px;align-items:start}
  .spot-card .scene{grid-column:1;grid-row:1 / span 2}
  [data-section="spot"] .scene.fit{--ph:calc(100dvh - 232px);align-self:start;justify-self:center}
  .spot-head h1{font-size:30px}
  .spot-head .lede{font-size:16px}
  .finds-wrap{display:none}
  [data-section="welcome"] .video,[data-section="wrap"] .video{aspect-ratio:auto;height:calc(100dvh - 440px);min-height:240px}
}
@media (min-width:880px) and (min-height:940px){.finds-wrap{display:block}}
@media (min-width:880px){[data-section="danger"] .card.dark .lede{font-size:15px}[data-section="danger"] .card.dark{gap:10px}[data-section="danger"] .card.dark h1{font-size:28px}}

/* ===== Version 4: Listen player, fridge guide, spot ticks, menu on the far right ===== */
.top .progress{order:1}.top .menu-btn{order:2}

/* Listen player */
.listen{background:var(--cream);border-radius:var(--radius-s);padding:12px;display:flex;flex-direction:column;gap:10px;color:var(--coffee)}
.dark .listen{background:var(--coffee-2);color:var(--card)}
.listen-row{display:flex;align-items:center;gap:12px}
.listen-play{width:52px;height:52px;border-radius:26px;border:0;background:var(--copper);color:var(--card);display:flex;align-items:center;justify-content:center;flex:none}
.dark .listen-play{background:var(--peach);color:var(--coffee)}
.listen-play .i-pause,.listen.playing .i-play{display:none}
.listen.playing .i-pause{display:block}
.listen-main{flex:1;min-width:0;display:grid;grid-template-columns:1fr auto;gap:4px 10px;align-items:center}
.listen-title{grid-column:1/-1;font-size:15px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.listen-title b{font-weight:900;color:var(--copper-dark);margin-right:4px}
.dark .listen-title b{color:var(--peach)}
.listen-time{font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--muted)}
.dark .listen-time{color:var(--line)}
.listen-bar{-webkit-appearance:none;appearance:none;width:100%;height:24px;background:transparent;margin:0;cursor:pointer;--p:0%}
.listen-bar::-webkit-slider-runnable-track{height:8px;border-radius:4px;background:linear-gradient(to right,var(--copper) var(--p),var(--line) var(--p))}
.listen-bar::-moz-range-track{height:8px;border-radius:4px;background:linear-gradient(to right,var(--copper) var(--p),var(--line) var(--p))}
.dark .listen-bar::-webkit-slider-runnable-track{background:linear-gradient(to right,var(--peach) var(--p),#5A4A40 var(--p))}
.dark .listen-bar::-moz-range-track{background:linear-gradient(to right,var(--peach) var(--p),#5A4A40 var(--p))}
.listen-bar::-webkit-slider-thumb{-webkit-appearance:none;width:18px;height:18px;border-radius:9px;background:var(--copper);margin-top:-5px;border:2px solid var(--card)}
.listen-bar::-moz-range-thumb{width:18px;height:18px;border-radius:9px;background:var(--copper);border:2px solid var(--card)}
.dark .listen-bar::-webkit-slider-thumb{background:var(--peach);border-color:var(--coffee)}
.dark .listen-bar::-moz-range-thumb{background:var(--peach);border-color:var(--coffee)}
.listen-toggle{align-self:flex-start;min-height:44px;padding:0 14px;border-radius:12px;border:2px solid var(--line);background:transparent;font-weight:800;font-size:14px}
.dark .listen-toggle{border-color:#5A4A40;color:var(--card)}
.listen .transcript{background:transparent;padding:0;font-size:15px;max-height:9.5em;overflow:auto;animation:rise .3s both}
.listen .transcript[hidden]{display:none}
.listen.no-audio .listen-row,.listen.no-audio .listen-toggle{display:none}
.listen.no-audio .transcript{max-height:none}

/* Where things go in the fridge */
.guide{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.guide li{border-radius:var(--radius-s);padding:10px 14px;display:flex;flex-direction:column;gap:1px;font-size:15px;line-height:1.35}
.guide b{font-weight:900;font-size:16px}
.guide .g-ready{background:#DDE9F3;color:#1D4466}
.guide .g-veg{background:var(--green-tint);color:var(--green-ink)}
.guide .g-raw{background:var(--red-tint);color:var(--red-ink)}
.card.enter .guide li,.card.enter-back .guide li{animation:rise .45s both;animation-delay:calc(.25s + var(--d,0)*90ms)}

/* Spot what's wrong: six ticks that fill in */
.ticks{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}
.tick{width:100%;aspect-ratio:1;max-width:44px;border-radius:50%;border:2px dashed #7A6A5F;background:transparent;color:#B8A99C;font-weight:800;font-size:14px;display:flex;align-items:center;justify-content:center;padding:0;margin:0 auto}
.tick.got{border:0;background:var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFBF5' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/55% no-repeat;animation:popIn .4s cubic-bezier(.3,1.4,.5,1)}
.tick.got.on{box-shadow:0 0 0 3px var(--peach)}
.panel.dark .finds li{font-size:14px}

@media (max-width:879px){
  .guide li{padding:8px 12px;font-size:14px}
  .guide b{font-size:15px}
  .listen{padding:10px}
  .listen .transcript{max-height:7.5em}
  .tick{max-width:36px}
  .spot-head .lede{font-size:15px}
}
@media (min-width:880px){
  [data-section="separate"] h2{font-size:20px}
  [data-section="separate"] h1{font-size:32px}
  [data-section="separate"] .lede{font-size:15px}
  [data-section="separate"] .card{gap:11px}
  .guide{gap:6px}
  .guide li{padding:7px 12px;font-size:14px}
  .guide b{font-size:15px}
  .listen .transcript{max-height:6em}
}

/* ===== Version 5: WCAG 2.2 AA fixes ===== */
:root{--edge:#8E7B6C;--edge-dark:#9C8878}
html{scroll-padding-bottom:110px;scroll-padding-top:70px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* 1.4.11 Non-text contrast: control borders are at least 3:1 against their background */
.btn.ghost,.option,.item,.menu-btn,.menu-list button,.listen-toggle{border-color:var(--edge)}
.option.right{border-color:var(--green)}.option.wrong{border-color:#B4442F}
.item.sel,.menu-list button.here{border-color:var(--copper)}
.choice,.btn.quiet,.dark .listen-toggle,.quiz-mode .menu-btn{border-color:var(--edge-dark)}
.choice.right{border-color:var(--green-tint)}.choice.wrong{border-color:var(--peach)}
.tick{border-color:var(--edge-dark);color:var(--line)}
.dots span,.qdots span{background:var(--edge)}
.dots span.on{background:var(--copper)}
.qdots span.done{background:var(--green)}.qdots span.miss{background:#B4442F}.qdots span.now{background:var(--copper)}
.quiz-mode .qdots span{background:var(--edge)}
.stepdot b{background:var(--card);border:2px solid var(--edge)}
.stepdot.done b{border-color:var(--green)}.stepdot.on b{border-color:var(--copper)}
.progress-track{box-shadow:inset 0 0 0 1px var(--edge)}

/* 2.4.7 / 2.4.13 Focus is visible on photos too: light ring with a dark halo */
.spot:focus-visible,.outline:focus-visible,.zone:focus-visible{outline:3px solid #FFFFFF;outline-offset:2px;box-shadow:0 0 0 7px var(--coffee)}

/* 2.2.2 Pause, stop, hide: nothing moves on its own for more than five seconds */
.outline{animation-iteration-count:2}

/* 1.4.12 Text spacing: titles may wrap rather than being cut off */
.listen-title{white-space:normal;overflow:visible}
.brand-text span{white-space:normal}

/* Text over the handwashing photo keeps its contrast whatever is behind it */
.hero-top h1,.hero .step-caption{text-shadow:0 1px 3px rgb(0 0 0 / .6)}
.hero-top{background:linear-gradient(rgb(43 33 28 / .88),rgb(43 33 28 / .55) 60%,transparent)}
.hero-bottom{background:linear-gradient(transparent,rgb(43 33 28 / .88) 38%)}

/* The 20-second timer is a button the learner starts */
.hero .timer{display:flex;border:2px solid var(--card);min-height:44px;height:auto;padding:6px 14px;pointer-events:auto;background:rgb(43 33 28 / .8);cursor:pointer;font-family:inherit}
.hero .timer[hidden]{display:none}
.hero .timer em{font-size:14px;color:var(--card)}
.hero .timer i{animation:none;width:0}
.hero .timer.run i{animation:fill 20s linear forwards}
@media (prefers-reduced-motion:reduce){.hero .timer.run i{animation:fill 20s linear forwards!important}}

/* 2.1.1 Keyboard: transcripts open at full length, so there is no scrolling box to get stuck outside of */
.listen .transcript{max-height:none!important;overflow:visible}

/* ===== Version 6: language switch ===== */
.top .lang-btn{order:2}.top .menu-btn#menuBtn{order:3}
.lang-btn{padding:0 12px;letter-spacing:.02em}

/* ===== Version 7: fit one screen =====
   course.js measures each page. If it is taller than the window it first shrinks the photo or video,
   then adds .d1, .d2 and .d3 to <body> (tighter spacing, slightly smaller type). Below that the page scrolls. */
.outline,.spot,.zone{min-width:24px;min-height:24px}
.stepper{min-width:0}.stepdot{min-width:24px}
.d1 .top{padding-top:6px;padding-bottom:4px}
.d1 .logo{width:36px;height:36px;border-radius:12px}
.d1 .foot{padding-top:8px;padding-bottom:max(8px,env(safe-area-inset-bottom))}
.d1 .foot .btn{min-height:46px}
.d1 main{gap:10px!important;padding-top:4px!important;padding-bottom:4px!important}
.d1 .card{gap:10px!important}
.d1 .hero-card{gap:0!important}
.d1 .lede{font-size:15px!important}
.d1 .explain,.d1 .step-caption{min-height:0!important}
.d1 .tip{display:none!important}
.d1 .learn{gap:8px}.d1 .learn li{padding:8px 12px}
.d1 .learn.links li{padding:0}.d1 .learn.links button,.d1 .learn.links a{min-height:48px;padding:6px 12px}
.d1 .options{gap:8px}.d1 .option{min-height:50px;padding:8px 14px}
.d1 .quiz-card.intro{min-height:0!important;padding:22px 18px!important;gap:12px!important}
.d1 .qmark{width:72px;height:72px;font-size:30px}
.d1 .guide{gap:5px}.d1 .guide li{padding:6px 12px}
.d1 .game{gap:6px}.d1 .game-item{padding:6px 10px}
.d1 .listen{padding:8px;gap:6px}.d1 .listen-play{width:46px;height:46px}
.d1 .hero-controls{padding:8px 12px 10px!important;gap:6px}
.d1 .temp{min-height:52px;padding:8px 10px}
.d1 .feedback{padding:8px 12px!important;min-height:0!important}
.d1 .chips{gap:6px}.d1 .chips li{padding:5px 11px;font-size:14px}
.d1 .panel{padding:12px;gap:8px}
.d1 .duo,.d1 .duo-a{gap:10px}
.d1 .msg:empty{display:none}
.d2{font-size:15px;line-height:1.4}
.d2 .top{padding-top:4px;padding-bottom:2px}
.d2 .logo{width:32px;height:32px}.d2 .brand-text strong{font-size:16px}
.d2 .foot{padding-top:6px;padding-bottom:max(6px,env(safe-area-inset-bottom))}
.d2 .foot .btn{min-height:44px;font-size:15px}
.d2 main{gap:8px!important;padding-top:2px!important;padding-bottom:2px!important}
.d2 .card{gap:8px!important}
.d2 .hero-card{gap:0!important}
.d2 h1{font-size:22px!important}.d2 h2{font-size:18px!important}
.d2 .lede{font-size:14px!important}
.d2 .learn{gap:6px}.d2 .learn li{padding:6px 10px;font-size:14px}.d2 .learn b{width:28px;height:28px;border-radius:9px}
.d2 .learn.links li{padding:0}.d2 .learn.links button,.d2 .learn.links a{min-height:44px;padding:4px 10px;font-size:14px}
.d2 .options{gap:6px}.d2 .option{min-height:44px;font-size:15px;padding:6px 12px}.d2 .option b{width:28px;height:28px}
.d2 .question{font-size:20px!important}
.d2 .quiz-card.intro{padding:16px!important;gap:8px!important}
.d2 .qmark{width:56px;height:56px;font-size:24px}
.d2 .guide li{padding:5px 10px;font-size:13px}.d2 .guide b{font-size:14px}
.d2 .game-item{padding:5px 8px}.d2 .game-item img{width:34px;height:34px}.d2 .game-item .name{font-size:14px}
.d2 .listen-play{width:44px;height:44px}.d2 .listen-title{font-size:14px}
.d2 .stepdot{min-height:44px;font-size:11px}.d2 .stepdot b{width:26px;height:26px}
.d2 .steps-nav .btn{min-height:44px}
.d2 .hero .step-caption{font-size:16px!important}
.d2 .hero-top{padding:10px 14px 30px!important}.d2 .hero-bottom{padding:36px 14px 12px!important}
.d2 .temp{min-height:46px;padding:6px 8px}.d2 .temp b{font-size:15px!important}
.d2 .transcript{font-size:14px!important}
.d2 .chips li{font-size:13px;padding:4px 10px}
.d2 .item{width:76px;height:64px}.d2 .item img{height:34px}
.d2 .btn.big{min-height:48px;font-size:16px}
.d2 .btn.small{min-height:44px}
.d2 .panel{padding:10px}
.d2 .score{padding:8px 12px}
.d2 .tick{max-width:30px}
@media (max-width:879px){
  .d1 .card{padding:12px!important}.d1 .hero-card{padding:0!important}
  .d1 h1{font-size:24px}
  .d2 .card{padding:10px!important}.d2 .hero-card{padding:0!important}
}
@media (min-width:880px){
  .d1 .card{padding:20px!important}.d1 .hero-card{padding:0!important}
  .d1 main{gap:14px!important;padding-left:20px;padding-right:20px}
  .d1 h1{font-size:28px!important}
  .d1 .hero-top h1{font-size:34px!important}.d1 .hero .step-caption{font-size:20px}
  .d1 .hero-top{padding:16px 20px 40px}.d1 .hero-bottom{padding:44px 20px 14px}
  .d2 .card{padding:14px!important}.d2 .hero-card{padding:0!important}
  .d2 main{gap:10px!important;padding-left:12px;padding-right:12px}
  .d2 h1{font-size:24px!important}.d2 .hero-top h1{font-size:28px!important}
  .d2 .hero .step-caption{font-size:17px!important}
}
/* Smallest windows: one more step, and the section label goes (the header already says which part this is) */
.d3{font-size:14px}
.d3 .card>.tag,.d3 .head>.tag,.d3 .spot-head>.tag{display:none}
.d3 h1{font-size:20px!important}.d3 h2{font-size:17px!important}
.d3 .lede{font-size:13.5px!important}
.d3 .logo{width:30px;height:30px}
.d3 .guide li{padding:3px 10px}
.d3 .option{padding:4px 10px}
.d3 .question{font-size:18px!important}
.d3 .hero .step-caption{font-size:15px!important}
.d3 .temp b{font-size:14px!important}
.d3 .game-item .fb{font-size:13px}
.d3 .learn li{padding:4px 10px}.d3 .learn.links li{padding:0}
.d3 .chips li{padding:3px 9px}
.d3 .listen{padding:6px}
.d3 .panel{padding:8px;gap:6px}
@media (max-width:879px){.d3 .card{padding:8px!important}.d3 .hero-card{padding:0!important}}
@media (min-width:880px){.d3 .card{padding:12px!important}.d3 .hero-card{padding:0!important}.d3 h1{font-size:22px!important}.d3 .hero-top h1{font-size:24px!important}}

/* The page itself takes focus when you move on (for screen readers); it does not need a ring */
main:focus-visible{outline:none}
/* Phone header: the course name stays on one line */
.brand-text strong{white-space:nowrap}
@media (max-width:879px){
  .progress-track{width:72px}
  .top{gap:8px}
  /* All five foods sit in one row above the fridge */
  .tray{flex-wrap:nowrap;gap:6px}
  .item{flex:1 1 0;min-width:0;width:auto;max-width:84px;height:72px;line-height:1.1}
  .item img{height:36px}
}
@media (max-width:879px){.fridge-wrap{grid-template-columns:minmax(0,1fr)}.item{overflow-wrap:anywhere}}
/* Food buttons grow rather than cut off a long name */
.item{height:auto;min-height:92px}
.d2 .item{height:auto;min-height:64px}
@media (max-width:879px){.item{height:auto;min-height:72px}}
@media (min-width:880px){
  /* Handwashing controls: the step dots and the buttons share a row when there is room and stack when there is not */
  .hero-controls{display:flex!important;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 20px!important}
  .stepper{flex:1 1 300px;min-width:300px;max-width:440px}
}
/* Narrower desktop windows (and the portfolio embed): give the text column more room so it wraps less */
@media (min-width:880px) and (max-width:1199px){
  main{grid-template-columns:3fr 2fr}
  [data-section="danger"] main,[data-section="separate"] main{grid-template-columns:1fr 1fr}
}
/* The "found" count never blocks a tap on the photo; on phones the six ticks under the photo do its job */
.counter{pointer-events:none}
@media (max-width:879px){.counter{display:none}}
/* Phones: once the first mistake is found the instruction line steps aside, so the photo keeps its size */
@media (max-width:879px){.spot-card:has(.spot.found) .spot-head .lede{display:none}}
/* Narrow phones: the header items shrink a little so the course name never runs into the progress label */
@media (max-width:400px){
  .top{gap:6px;padding-left:10px;padding-right:10px}
  .logo{width:34px;height:34px;border-radius:11px}
  .brand{gap:8px}.brand-text strong{font-size:16px}
  .progress-label{font-size:12px}
  .menu-btn{padding:0 10px}
}
@media (max-width:340px){.logo{display:none}}
/* Subtitles in the course's own style, drawn over the video (see wireSubtitles in course.js) */
.video{container-type:inline-size}
.video .cc{position:absolute;left:0;right:0;bottom:4%;z-index:1;padding:0 5%;text-align:center;pointer-events:none;transition:bottom .2s}
.video.ui .cc{bottom:calc(4% + 54px)}
.video .cc span{display:inline;padding:.12em .45em;border-radius:4px;background:rgba(20,15,12,.78);color:#fff;font:600 clamp(12px,3.3cqw,20px)/1.5 var(--font);-webkit-box-decoration-break:clone;box-decoration-break:clone}
.video .cc-btn{position:absolute;top:10px;right:10px;z-index:2;min-width:44px;min-height:32px;padding:5px 11px;border:0;border-radius:999px;background:rgba(43,33,28,.72);color:#FFFBF5;font:900 12px/1 var(--font);letter-spacing:.04em;cursor:pointer}
.video .cc-btn[aria-pressed="true"]{background:var(--copper)}
.video .cc-btn:focus-visible{outline:3px solid var(--peach);outline-offset:2px}
@media (max-width:879px){.video .cc-btn{top:8px;right:8px}}
/* Full screen: the browser draws the subtitles, so match them as far as ::cue allows */
::cue{background:rgba(20,15,12,.78);color:#fff;font-family:'Nunito Sans',system-ui,sans-serif;font-weight:600;line-height:1.5}
/* One thing at a time: step labels, and the dashed box that stands in for a step that is not open yet (see flow() in course.js) */
.task{display:flex;align-items:center;gap:10px;margin:0;padding:6px 14px 6px 6px;border-radius:16px;background:var(--tint);color:var(--copper-dark);font-weight:700;font-size:15px;line-height:1.3;align-self:flex-start}
.task b{flex:none;background:var(--copper);color:#fff;border-radius:999px;padding:4px 11px;font-size:13px;font-weight:800;white-space:nowrap}
.card.dark .task{background:var(--coffee-2);color:var(--peach)}
.card.dark .task b{background:var(--peach);color:var(--coffee)}
.task.done{background:var(--green-tint);color:var(--green-ink)}
.task.done b{background:var(--green);color:#fff}
.task.done b::before{content:"✓ "}
.hero-controls .task{grid-column:1/-1;flex-basis:100%}
.read-next[hidden]{display:none}
@media (max-width:879px){.wide-only{display:none!important}.task{font-size:14px}}
.d2 .task,.d3 .task{font-size:13px;padding:4px 10px 4px 4px}
/* ===== Wide screens: step 1 is one full-width card (picture left, words and controls right, like "Spot what's wrong").
   When step 2 opens, main gets .split and the two cards sit side by side in their compact layouts. ===== */
.side{display:flex;flex-direction:column;gap:14px;min-width:0}
.split-head{display:none}
.learn-panel{border-radius:var(--radius-s);padding:18px;display:flex;flex-direction:column;gap:10px}
.learn-panel[hidden]{display:none!important}
.card.off{display:none!important}
/* The 20-second timer sits with the controls, never over the photo */
.hero-controls .timer{position:relative;left:auto;right:auto;bottom:auto;display:flex;width:100%;flex-basis:100%;grid-column:1/-1;min-height:46px;height:auto;padding:6px 14px;border:0;border-radius:23px;background:var(--coffee);cursor:pointer;font-family:inherit}
.hero-controls .timer[hidden]{display:none}
.hero-controls .timer em{font-size:15px;color:var(--card)}
.hero-controls .timer i{animation:none;width:0}
.hero-controls .timer.run i{animation:fill 20s linear forwards}
@media (prefers-reduced-motion:reduce){.hero-controls .timer.run i{animation:fill 20s linear forwards!important}}
@media (max-width:879px){
  .side{display:contents}
  .learn-panel{display:none!important}
  .photo-card .head{order:-2}.photo-card .task{order:-1}
}
@media (min-width:880px){
  body:not([data-section="wrap"]) main:not(.split){grid-template-columns:minmax(0,1fr)}
  main:not(.split) .wide2{display:grid;grid-template-columns:minmax(0,3fr) minmax(300px,1.2fr);gap:20px 28px;align-items:center}
  main:not(.split) .wide2.cols{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:20px 36px}
  main:not(.split) .welcome-card{grid-template-columns:minmax(0,1.5fr) minmax(300px,1fr);align-items:start}
  .welcome-card .video{aspect-ratio:16/9!important;height:auto;min-height:0!important}
  .learn-panel .learn li{font-size:15px}
  /* Clean hands on its own: photo left, steps and buttons in a column on the right */
  main:not(.split) #stepBox{display:grid;grid-template-columns:minmax(0,3fr) minmax(310px,1.15fr);align-items:stretch}
  main:not(.split) #stepBox .hero{height:calc(100dvh - 210px);min-height:320px;max-height:660px}
  main:not(.split) #stepBox .hero-controls{flex-direction:column!important;flex-wrap:nowrap!important;align-items:stretch!important;justify-content:center!important;padding:24px!important;gap:16px!important}
  main:not(.split) #stepBox .stepper{flex:none;min-width:0;max-width:none}
  main:not(.split) #stepBox .steps-nav{grid-template-columns:1fr 1fr}
  main:not(.split) #stepBox #stepPlay{grid-column:1/-1;order:3}
  main:not(.split) #stepBox .task{flex:none;align-self:flex-start}
  main:not(.split) #stepBox .hero-controls .timer{flex:none}
  /* Danger zone on its own: photo left; title, temperatures and what each one means on the right */
  [data-section="danger"] main:not(.split) .photo.fit{--ph:calc(100dvh - 250px)}
  main:not(.split) .photo-card .temps{grid-template-columns:1fr}
  main:not(.split) .photo-card .explain{min-height:4.5em}
  /* Split: both steps side by side, each card a simple column again */
  main.split .side{display:contents}
  main.split .photo-card .head{display:none}
  main.split .photo-card .task{order:-1}
  main.split .split-head{display:flex;flex-direction:column;gap:8px}
}
/* Welcome: the start button lives under the video; until the video has played, a quiet line holds its place */
.start-row{display:flex;align-items:center;min-height:60px}
.start-hint{color:var(--muted);font-size:15px;font-weight:700}
.start-hint[hidden]{display:none}
@media (max-width:879px){.welcome-card .start-row{order:5}.welcome-card .start-hint{display:none}.welcome-card .start-row:has(#startBtn[hidden]){display:none}}
@media (min-width:880px){
  main:not(.split) .welcome-card{grid-template-columns:minmax(0,1.45fr) minmax(300px,1fr);align-items:center;gap:20px 32px}
  .welcome-card .side{gap:16px}
}
@media (min-width:880px){.welcome-card>.side:last-child{padding-left:14px}}
/* Phones: pictures run edge to edge of their card, and the cards sit closer to the screen edge, so photos are as big as the screen allows */
@media (max-width:879px){
  main{padding-left:6px;padding-right:6px}
  .card{--pad:16px}
  .d1 .card{--pad:12px}.d2 .card{--pad:10px}.d3 .card{--pad:8px}
  .card>.photo.fit,.card>.scene.fit{max-width:none!important;width:calc(100% + 2*var(--pad))!important;margin-inline:calc(-1*var(--pad))!important;border-radius:0;align-self:auto}
  .fridge{max-width:min(100%,42dvh)!important;touch-action:pan-y}
}
