/* dashboard.html: moved out of the page unchanged (4 Nov 2026) */
/* ============ CLASSIC: the dashboard ============
   Same data, same painted objects, same subject cloth-tabs as the cosy
   desk — laid out as a clean planner page. This is the professional
   front door (and the mobile answer); the desk is the cosy mode. */
:root{--paper:#f6f1e7;--card:#fffdf8;--ink:#26231e;--sec:#57534a;--mut:#84806f;
  --line:#e4dfd2;--linel:#efeadf;--anchor:#5b4632;--rust:#c06325;
  --head:'Schibsted Grotesk',system-ui,sans-serif;--read:'Literata',Georgia,serif;--hand:'Caveat',cursive;
  --ease:cubic-bezier(.22,1,.36,1)}
*{box-sizing:border-box}
html{background:var(--paper);overflow-x:clip}
body{margin:0;font-family:var(--head);color:var(--ink);background:var(--paper);
  opacity:0;transition:opacity .3s ease}
body.ready{opacity:1}

.top{max-width:1000px;margin:0 auto;padding:18px clamp(16px,4vw,32px) 6px;display:flex;align-items:center;gap:14px}   /* the page header's look is css/header.css (job S3-01); this rule also sets out a book's panel (.sdetail .top) */
.brandlogo{height:30px;display:block}
.datestamp{font-family:var(--hand);font-size:1.35rem;color:var(--mut);margin-left:6px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.top .sp{flex:1}
.avatar{width:32px;height:32px;flex:none;border-radius:50%;background:#221E19;color:#faf8f5;
  display:grid;place-items:center;font-weight:700;font-size:.8rem}

.wrap{max-width:1000px;margin:0 auto;padding:10px clamp(16px,4vw,32px) 56px;
  display:grid;grid-template-columns:minmax(0,1fr);gap:34px}
@media (max-width:560px){ .datestamp{display:none} .scard h3,.scard .meta{padding-right:86px} }

.h1row{display:flex;align-items:baseline;gap:18px;flex-wrap:wrap;margin:.2rem 0 2rem}
h1{font-size:clamp(1.5rem,2.6vw,1.9rem);font-weight:800;letter-spacing:-.02em;margin:0;position:relative;padding-bottom:7px}
h1::after,.starttile b::after{content:'';position:absolute;left:2px;right:2px;bottom:-4px;height:11px;
  background:url('/assets/lw/shelf/underline_sketch.webp') center/100% 100% no-repeat;opacity:.85;pointer-events:none}
.momentum{font-family:var(--read);font-size:.92rem;color:var(--sec);margin:0}
/* LAW 1: the home surface fits the viewport on desktop */
@media (min-width:981px) and (min-height:760px){   /* shorter windows scroll like a normal page */
  html,body{height:100%;overflow:hidden}
  /* the page fits the window, but what does not fit must still be reachable: on a window between about 760 and 1040 px
     high, an opened book's units were below the edge with no way to scroll to them (Tom, 19 Nov 2026) */
  .wrap{height:calc(100% - 64px);overflow-x:hidden;overflow-y:auto;align-content:start}
}
.hl{background:linear-gradient(101deg,transparent 1.5%,rgba(255,222,84,.5) 7%,rgba(255,226,96,.4) 93%,transparent 98.5%);
  border-radius:6px;padding:1px 7px;margin:0 -3px;-webkit-box-decoration-break:clone;box-decoration-break:clone}

.card{background:var(--card);border:1px solid #d5c9b3;border-radius:4px;box-shadow:0 1px 0 rgba(60,40,20,.05)}

/* ---- today's plan ---- */
.plan{padding:.7rem 1.2rem .8rem}
.plan ol{list-style:none;margin:0;padding:0}
.plan li{display:grid;grid-template-columns:28px minmax(0,1fr) 58px;gap:0 12px;align-items:center;
  padding:.36rem .4rem;border-radius:3px;cursor:pointer;transition:background .14s}
.plan li.inert{cursor:default}
.plan li:hover:not(.inert){background:rgba(112,90,50,.06)}
.plan li+li{border-top:1px solid var(--linel)}
.plan .n{font-family:var(--read);font-weight:700;font-size:1.05rem;color:var(--mut);padding-top:.05rem}
.plan b{font-family:var(--read);font-weight:600;font-size:.98rem;line-height:1.25;display:block}
.plan small{font-size:.8rem;color:var(--mut);display:block;margin-top:.1rem}
.plan .mins{font-size:.83rem;font-weight:600;color:var(--mut);text-align:right;padding-top:.2rem;font-variant-numeric:tabular-nums}
.startrow{display:flex;align-items:stretch;margin:.6rem -1.2rem -.8rem}
.start{display:inline-flex;align-items:center;justify-content:center;gap:10px;padding:.8rem 1.35rem;border:none;border-radius:0 0 4px 4px;width:100%;
  background:var(--rust);color:#fff;font-family:var(--head);font-weight:700;font-size:.95rem;cursor:pointer;
  box-shadow:inset 0 -2px 0 rgba(0,0,0,.22);transition:filter .15s}
.start:focus-visible{outline:3px solid color-mix(in srgb,var(--rust) 40%,#fff);outline-offset:2px}
.start:hover{filter:brightness(1.06)}
.start:active{box-shadow:inset 0 1px 2px rgba(0,0,0,.3)}
.start svg{width:14px;height:14px;fill:#fff}
/* ---- the plan beside its Start tile: three rows on the left, the one thing to do on the right,
   a pen-drawn arrow between them (assets/lw/shelf/arrow_sketch.webp, the welcome page's) ---- */
.startrow{display:none}
.plan{padding-bottom:.8rem}
.plancol{display:grid;grid-template-columns:minmax(0,1fr) 210px;gap:44px;align-items:stretch;position:relative}
.plancol .arrow{position:absolute;right:151px;top:64px;width:132px;height:auto;pointer-events:none;transform:scaleX(-1) rotate(25deg);opacity:.92;z-index:3}
.starttile{border:1px solid var(--line);border-radius:4px;background:var(--card);cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.45rem;font-family:var(--head);color:var(--ink);padding:1rem;transition:border-color .15s}
.starttile .disc{width:66px;height:66px;border-radius:50%;display:grid;place-items:center;transform:rotate(-6deg);
  background:radial-gradient(circle at 34% 28%,#d9843f 0%,#c56a2a 45%,#a8521c 100%);
  box-shadow:0 0 0 1.5px #3a2615,inset 0 0 0 2px rgba(255,255,255,.18),inset -3px -4px 0 rgba(90,40,10,.18)}
.starttile .disc svg{width:24px;height:24px;fill:#fff8ee;margin-left:3px}
.starttile b{font-size:1.05rem;font-weight:800;position:relative;padding-bottom:5px}
.starttile b::after{left:-4px;right:-4px;bottom:-5px;height:9px}
.starttile small{font-size:.85rem;color:var(--mut)}
.starttile:hover{border-color:#c9ba9e}
.starttile:hover .disc{filter:brightness(1.06)}
.starttile:focus-visible{outline:3px solid color-mix(in srgb,var(--rust) 40%,#fff);outline-offset:2px}
@media (max-width:700px){ .plancol{grid-template-columns:1fr;gap:10px} .plancol .arrow{display:none} .starttile{flex-direction:row;padding:.7rem 1rem} }
.startnote{font-family:var(--hand);font-size:1.15rem;color:var(--mut)}

/* ---- subjects ---- */
.sechead{display:flex;align-items:baseline;gap:12px;margin:.6rem 0 .35rem}
.sechead h2{font-size:1.15rem;font-weight:700;letter-spacing:-.01em;margin:0}
.sechead span{font-size:.85rem;color:var(--mut)}
/* THE SHELF: nine spines, progress as ink filling each book from the
   bottom. Whole GCSE at a glance, no words doing the work. Width is
   honest (proportional to lesson count). Stale books grow an amber
   bookmark. Selected spine pulls forward; the fixed-height panel below
   shows that subject with every unit selectable. */
/* THE PAINTED SHELF: each spine is line-and-wash art. Two stacked copies
   of the same painting — the lower layer knocked back to a pencil-sketch
   state, the colour layer clipped to progress — so every book literally
   colours in from the bottom as its subject gets studied. */
/* THE SHELF: static per-subject books (one image each, reused for every
   student — zero per-student cost) on a shared walnut ledge. Pale = not
   studied; the colour fills up AND deepens from the shelf as it is learned. */
.shelfstage{position:relative;margin-top:52px;   /* clearance so a lifted/selected spine never covers the heading + metrics above */
  --bkshadow:drop-shadow(0 3px 3px rgba(28,18,8,.15))}                 /* lamp off: soft neutral shadow */
.shelfstage.lit{--bkshadow:drop-shadow(-6px 2px 3px rgba(28,18,8,.30))}  /* lamp on: shadow cast left */
.shelf{display:flex;align-items:flex-end;justify-content:flex-start;gap:3px;height:212px;padding:0 6px 0 10px;position:relative;z-index:2;pointer-events:none}
.shelf>*{pointer-events:auto}
/* the picture on the wall: this week's, in a chunky painted frame, hung a little askew from a nail */
/* the painted frame (assets/lw/shelf/frame_wall.webp, nail and twine included) hangs a little askew from its nail;
   the week's picture sits in the opening measured from the frame's own alpha (frame_wall.json) */
/* the fishbowl on the ledge: tap, and the fish does a few lengths */
.fishbowl{position:absolute;left:79%;bottom:40px;width:9%;aspect-ratio:700/688;z-index:3;border:0;background:none;padding:0;cursor:pointer}
.fishbowl .bowl{position:absolute;inset:0;width:100%;height:100%;display:block;z-index:1}
.fishbowl .fish{position:absolute;left:30%;top:44%;width:34%;height:auto;transform-origin:50% 50%;transition:none;z-index:0}
.fishbowl.swim .fish{animation:swim 5.4s ease-in-out 1}
@keyframes swim{
  0%{left:30%;top:44%;transform:scaleX(1) rotate(0)} 22%{left:52%;top:38%;transform:scaleX(1) rotate(-8deg)}
  30%{left:52%;top:40%;transform:scaleX(-1) rotate(4deg)} 55%{left:22%;top:52%;transform:scaleX(-1) rotate(8deg)}
  62%{left:22%;top:50%;transform:scaleX(1) rotate(-4deg)} 85%{left:50%;top:42%;transform:scaleX(1) rotate(-6deg)}
  100%{left:30%;top:44%;transform:scaleX(1) rotate(0)} }
.fishbowl:focus-visible{outline:3px solid var(--rust);outline-offset:3px;border-radius:50%}
@media (max-width:700px){ .fishbowl{display:none} }
@media (prefers-reduced-motion:reduce){ .fishbowl.swim .fish{animation:none} }
.wallhang{position:absolute;left:58.5%;bottom:107px;width:14.5%;aspect-ratio:755/781;z-index:1;transform:rotate(2.4deg);transform-origin:52% 2%}
.wallhang[hidden]{display:none}
.wallhang .frame{position:absolute;inset:0;width:100%;height:100%;display:block;filter:drop-shadow(0 4px 5px rgba(40,25,10,.3))}
.wallhang .pic{position:absolute;left:14.2%;top:34.1%;width:71.5%;height:51.7%;object-fit:cover;display:block}
.wallhang .walltip{position:absolute;left:50%;bottom:-14px;transform:translate(-50%,100%) rotate(-2.4deg);white-space:normal;width:max-content;max-width:230px;text-align:center;line-height:1.3;
  background:var(--card);border:1px solid var(--line);border-radius:10px;padding:.4rem .62rem;font:700 .82rem var(--head);color:var(--ink);
  box-shadow:0 10px 26px rgba(40,28,12,.16);opacity:0;pointer-events:none;transition:opacity .16s;z-index:30}
.wallhang:hover .walltip{opacity:1}
/* the frame's layer sits under the shelf (books z2, fishbowl z3): lift it on hover so its caption reads
   clear of both; the caption stays level (counter-rotated) and wraps (Tom, 9 Oct 2026) */
.wallhang:hover{z-index:6}
@media (max-width:700px){ .wallhang{display:none} }
.bookend{height:calc(var(--beh,210px) * var(--bes,1));width:auto;align-self:flex-end;margin-right:-6px;pointer-events:none;
  filter:drop-shadow(-7px 5px 4px rgba(40,28,12,.30))}
/* lamp on the right, arm reaching left; its shade is the light source for the scene */
.lamp{position:absolute;right:14px;bottom:20px;height:250px;width:auto;z-index:5;pointer-events:none;
  filter:drop-shadow(-10px 8px 8px rgba(40,28,12,.22));transition:filter .2s ease}
.lamp.hot{filter:drop-shadow(-10px 8px 8px rgba(40,28,12,.22)) brightness(1.06)}
/* invisible click-target over the lamp, kept in the gap (right of the books) so it
   never steals a spine's click */
.lampbtn{position:absolute;right:12px;bottom:18px;width:132px;height:240px;z-index:7;
  border:none;background:transparent;cursor:pointer;padding:0}
.lampbtn:focus-visible{outline:3px solid var(--anchor);outline-offset:2px;border-radius:8px}
/* pull-cord — the visible 'you can click me' affordance hanging from the shade */
.pullcord{position:absolute;left:82.5%;top:21.3%;width:2px;height:68px;z-index:6;pointer-events:none;
  background:linear-gradient(#7c6848,#57492f);border-radius:1px;transform-origin:top center}
.pullcord::after{content:"";position:absolute;left:50%;bottom:-12px;transform:translateX(-50%);
  width:10px;height:14px;border-radius:46% 46% 50% 50%/36% 36% 64% 64%;
  background:radial-gradient(46% 38% at 38% 28%, #e6d29c 0%, #d9b978 30%, #a2814f 62%, #6f5733 100%);
  box-shadow:0 1px 2px rgba(40,28,12,.45)}
@keyframes cord-tug{0%{transform:translateY(0)}26%{transform:translateY(9px)}62%{transform:translateY(-2px)}100%{transform:translateY(0)}}
.pullcord.tug{animation:cord-tug .42s cubic-bezier(.3,1.25,.5,1)}
.lampbtn:hover ~ .pullcord{filter:brightness(1.08)}
/* ---- ?place : drag-to-position workbench for the cord + light origin ---- */
.ph{position:absolute;z-index:60;width:26px;height:26px;margin:-13px 0 0 -13px;border-radius:50%;
  background:transparent;border:3px solid currentColor;color:#fff;cursor:grab;touch-action:none;
  box-shadow:0 0 0 1.5px rgba(255,255,255,.9),0 1px 4px rgba(0,0,0,.45)}
.ph::before{content:"";position:absolute;left:50%;top:50%;width:3px;height:3px;margin:-1.5px 0 0 -1.5px;
  border-radius:50%;background:currentColor;box-shadow:0 0 0 1px rgba(255,255,255,.9)}
.ph.grab{cursor:grabbing;transform:scale(1.12)}
.ph-top{color:#2563eb}.ph-knob{color:#f59e0b}.ph-glow{color:#ef4444}.ph-aim{color:#a855f7}
.ph b{position:absolute;left:22px;top:-3px;white-space:nowrap;font:600 11px/1.4 system-ui,sans-serif;
  color:#fff;background:rgba(20,15,8,.7);padding:1px 6px;border-radius:5px}
.placepanel{position:fixed;top:14px;right:14px;z-index:9999;background:#211d17;color:#f3ead4;border-radius:13px;
  padding:15px 17px;font:12.5px/1.55 ui-monospace,Consolas,monospace;box-shadow:0 14px 44px rgba(0,0,0,.45);width:308px}
.placepanel h4{margin:0 0 3px;font:700 14px/1.2 Georgia,serif;color:#fff}
.placepanel .sub{font:400 11px/1.4 system-ui,sans-serif;color:#a89b82;margin:0 0 11px}
.placepanel .row{margin:4px 0}.placepanel .k{color:#c9b891}
.placepanel .dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:6px;vertical-align:1px}
.placepanel button{margin-top:12px;font:600 12px/1 system-ui,sans-serif;background:#8a6d3b;color:#fff;
  border:0;border-radius:8px;padding:7px 13px;cursor:pointer}
.placepanel .ok{color:#8fce9b;font-family:system-ui,sans-serif;font-size:11px;margin-left:8px;opacity:0;transition:opacity .2s}
.placepanel .ok.on{opacity:1}
.placepanel input[type=range]{width:120px;vertical-align:middle;accent-color:#e0a86a;margin-left:6px}
.placepanel .cbtn{margin:0 5px 0 0;background:#4a4235;color:#e8ddc8}
.placepanel .cbtn[aria-pressed=true]{background:#c98a3a;color:#fff}
/* ?lean bench */
body.leaning .bk{cursor:grab}
.bk.tilting{transition:none;cursor:grabbing;z-index:30}
.leanlbl{position:absolute;top:-22px;left:50%;transform:translateX(-50%) rotate(calc(-1*var(--lean,0deg)));
  font:600 11px/1 system-ui,sans-serif;color:#fff;background:rgba(20,15,8,.72);padding:1px 5px;border-radius:4px;
  white-space:nowrap;pointer-events:none;z-index:40}
/* soft shadow falling to the LEFT, away from the lamp (over spines AND shelf) */
.lightwash{position:absolute;left:0;right:0;top:-6px;bottom:2px;z-index:3;pointer-events:none;
  background:linear-gradient(to right, rgba(24,16,7,.38), rgba(24,16,7,.13) 34%, transparent 58%);
  mix-blend-mode:multiply;opacity:0;transition:opacity .55s ease}
/* the light itself: a conical beam fanning down-left from the shade onto the books */
.lampglow{position:absolute;inset:0;z-index:4;pointer-events:none;
  clip-path:polygon(calc(100% - 176px) 45px, calc(100% - 113px) 81px, calc(100% - 152px) 347px, calc(100% - 384px) 215px);
  background:linear-gradient(to bottom,
    rgba(255,170,86,.60) 22%, rgba(255,158,74,.48) 40%, rgba(252,146,64,.24) 66%, rgba(252,146,64,.08) 86%, transparent 97%);
  mix-blend-mode:screen;filter:blur(2.5px);opacity:0;transition:opacity .55s ease}
/* a warm bulb behind the shade, glowing only when lit */
.bulb{position:absolute;left:80.0%;top:25.3%;width:66px;height:66px;transform:translate(-50%,-50%);z-index:6;
  pointer-events:none;border-radius:50%;opacity:0;transition:opacity .55s ease;
  background:radial-gradient(circle, rgba(255,198,124,.92), rgba(255,168,84,.48) 42%, transparent 72%);
  mix-blend-mode:screen}
.shelfstage.lit .lightwash,.shelfstage.lit .lampglow,.shelfstage.lit .bulb{opacity:1}
.bk{position:relative;height:var(--bkh,204px);border:none;background:none;padding:0;cursor:grab;touch-action:none;
  transform:translateX(calc((var(--shift,0px) + var(--gapx,0px))*var(--fit,1))) rotate(calc(var(--lean,0deg) + var(--nudge,0deg)));filter:var(--bkshadow);
  transition:transform .38s cubic-bezier(.34,1.4,.5,1),filter .55s ease;transform-origin:bottom center}
.bk img{display:block}
.bk img.cold{height:var(--bkh,204px);width:auto;filter:var(--coldf, saturate(1.20) brightness(0.92) contrast(1.30) sepia(0.10) hue-rotate(-8deg))}
.bk img.warm{position:absolute;inset:0;height:100%;width:100%;filter:var(--warmf, saturate(1.64) brightness(1.15) contrast(0.93))}
.bk::before{content:"";position:absolute;left:4%;right:4%;bottom:1px;height:15px;z-index:-1;
  background:radial-gradient(52% 120% at 50% 0%,rgba(34,22,8,.55),rgba(34,22,8,.18) 55%,transparent 78%);filter:blur(2.5px)}
.bk:hover{transform:translateX(calc((var(--shift,0px) + var(--gapx,0px))*var(--fit,1))) rotate(calc(var(--lean,0deg) + var(--nudge,0deg))) translateY(-5px)}
/* taken off the shelf, in stages: slide DOWN out of the slot → turn 90° while sliding to the frame
   centre → draw closer (enlarge). --pull-dx (set per-book in JS) is the x-shift to the frame centre,
   so every book ends in the same central spot regardless of which slot it came from. */
.bk[aria-selected="true"]{transform:translateX(var(--pull-dx,0px)) translateY(20px) rotate(-90deg) scale(1.5);
  transform-origin:center center;z-index:20;animation:book-pull 1s cubic-bezier(.4,0,.2,1) forwards}
.bk[aria-selected="true"]::before{opacity:0}
@keyframes book-pull{
  0%   {transform:translateX(calc(var(--shift,0px)*var(--fit,1))) translateY(0)    rotate(var(--lean,0deg)) scale(1)}
  34%  {transform:translateX(calc(var(--shift,0px)*var(--fit,1))) translateY(30px) rotate(0deg)             scale(1.02)}  /* pulled straight down out of its slot */
  66%  {transform:translateX(var(--pull-dx,0px))                  translateY(30px) rotate(-90deg)          scale(1.04)}  /* turned, slid to centre */
  100% {transform:translateX(var(--pull-dx,0px))                  translateY(20px) rotate(-90deg)          scale(1.5)}   /* centred + drawn closer */
}
/* click again -> slot back in. Needs its OWN @keyframes (not book-pull with reverse): reusing
   book-pull's name leaves the resolved animation-name unchanged, so the browser never restarts
   it and the book just snaps. book-return is book-pull with the keyframes mirrored. */
.bk.returning{transform-origin:center center;z-index:20;animation:book-return 1s cubic-bezier(.4,0,.2,1) both}
@keyframes book-return{
  0%   {transform:translateX(var(--pull-dx,0px))                  translateY(20px) rotate(-90deg)          scale(1.5)}   /* centred, in the hand */
  34%  {transform:translateX(var(--pull-dx,0px))                  translateY(30px) rotate(-90deg)          scale(1.04)}  /* drawn back, still turned */
  66%  {transform:translateX(calc(var(--shift,0px)*var(--fit,1))) translateY(30px) rotate(0deg)             scale(1.02)}  /* turned upright, slid back to its slot */
  100% {transform:translateX(calc(var(--shift,0px)*var(--fit,1))) translateY(0)    rotate(var(--lean,0deg)) scale(1)}     /* slotted back into the shelf */
}
@media (prefers-reduced-motion:reduce){ .bk[aria-selected="true"],.bk.returning{animation:none} }
/* DOCK (desktop): instead of hovering over its neighbours, the chosen book slides down off the
   shelf and lies in the panel's header as the subject's name; the neighbours close the gap with
   a small lean. --dock is measured per pick in JS (js: _dockTransform). */
body.dock .bk[aria-selected="true"]{animation:none;transform:var(--dock,translateY(60px));transform-origin:center center;z-index:20;
  transition:transform .75s cubic-bezier(.4,0,.2,1)}
body.dock .bk[aria-selected="true"]:hover{transform:var(--dock,translateY(60px))}
body.dock .bk.returning{animation:none;transform-origin:center center;z-index:20;transition:transform .75s cubic-bezier(.4,0,.2,1)}
body.dock .bk.taken::before{opacity:0}
.sdetail .top .bookslot{flex:none;width:188px;height:46px}
.sdetail .top.withbook{align-items:center}
.sdetail .top.withbook>h3{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.sdetail .top.withbook>.back+h3,.sdetail .top.withbook>.back~h3{position:static;width:auto;height:auto;overflow:visible;clip:auto}
@media (prefers-reduced-motion:reduce){ body.dock .bk[aria-selected="true"],body.dock .bk.returning{transition:none} }
.bk:focus-visible{outline:3px solid var(--anchor);outline-offset:3px;border-radius:6px}
/* drag to reorder; drop with a little physics */
.bk.dragging{z-index:50;transition:none;cursor:grabbing;
  filter:drop-shadow(0 16px 14px rgba(40,28,12,.38))}
body.dragging-book{cursor:grabbing;user-select:none}
@keyframes drop-settle{
  0%{transform:translateX(calc(var(--shift,0px)*var(--fit,1))) translateY(-15px) rotate(var(--lean,0deg))}
  45%{transform:translateX(calc(var(--shift,0px)*var(--fit,1))) translateY(0) rotate(calc(var(--lean,0deg) - 4deg))}
  72%{transform:translateX(calc(var(--shift,0px)*var(--fit,1))) translateY(-3px) rotate(calc(var(--lean,0deg) + 2.2deg))}
  100%{transform:translateX(calc(var(--shift,0px)*var(--fit,1))) translateY(0) rotate(var(--lean,0deg))}}
.bk.settling{animation:drop-settle .55s cubic-bezier(.3,1.2,.5,1)}
@media (prefers-reduced-motion:reduce){ .bk.settling{animation:none} }
.ledge{display:block;width:100%;height:46px;object-fit:cover;object-position:center 18%;margin-top:-8px;position:relative;z-index:1}
/* hover card — the book's own name + progress, in-style (replaces the OS tooltip) */
.booktip{position:absolute;z-index:20;pointer-events:none;opacity:0;transform:translate(-50%,-94%);
  background:var(--card);border:1px solid var(--line);border-radius:10px;padding:.4rem .62rem;
  box-shadow:0 10px 26px rgba(40,28,12,.16);white-space:nowrap;font-family:var(--head);
  transition:opacity .16s ease,transform .16s cubic-bezier(.16,1,.3,1)}
.booktip.on{opacity:1;transform:translate(-50%,-100%)}
.booktip b{font-weight:700;font-size:.86rem;color:var(--ink)}
.booktip .c{display:block;font-size:.73rem;color:var(--mut);margin-top:1px}
.booktip::after{content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);
  border:6px solid transparent;border-top-color:var(--card)}
/* prompt shown under the shelf when nothing is selected */
.selprompt{text-align:center;padding:16px 0 6px;color:var(--mut);font-family:var(--hand);font-size:1.2rem;line-height:1.1}
.selprompt .uparrow{display:block;font-size:1.5rem;color:var(--rust);margin-bottom:2px;animation:sp-bob 1.7s ease-in-out infinite}
@keyframes sp-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}
@media (prefers-reduced-motion:reduce){ .selprompt .uparrow{animation:none} }
/* the open book: a ledger page; sizes to its content so nothing is ever clipped */
.sdetail{min-height:100px;padding:.6rem 1rem .7rem;position:relative;overflow:visible;display:flex;flex-direction:column;gap:.4rem;
  background:var(--card);border:1px solid var(--line);border-radius:4px;box-shadow:none}
.sdetail[hidden]{display:none}
.sdetail{transition:opacity .55s ease}
.sdetail.fading{opacity:.35}
.sdetail.swap{animation:panelswap .45s ease}
@keyframes panelswap{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){ .sdetail.swap{animation:none} }
.sdetail .top{display:flex;align-items:baseline;gap:10px;flex:none;flex-wrap:nowrap}
.sdetail h3{font-family:var(--read);font-size:1.1rem;font-weight:600;margin:0;white-space:nowrap;color:var(--ink)}
.sdetail .sub{font-size:.76rem;color:var(--mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card.week .weeksaid{margin:.6rem 0 0;font-family:var(--read);font-size:.9rem;color:var(--ink)}
.sdetail .sub{font-size:.82rem}.sdetail .sub .pg-track{color:var(--rust);font-weight:600}.sdetail .sub .pg-pct{opacity:.7}
.sdetail .sp{flex:1}
/* the book's button: the site's main one, a pressable slab, not a pill (css/buttons.css, job S3-02) */
.sdetail .cont,.sdetail .go{white-space:nowrap}
/* choose-your-options prompt (History/Lit/RS/Drama before the student sculpts) */
.optprompt{display:flex;flex-direction:column;gap:.75rem;align-items:flex-start;padding:.15rem 0 .2rem}
.optprompt p{margin:0;font-family:var(--read);font-size:.9rem;line-height:1.45;color:var(--sec);max-width:54ch}
.optprompt .cont{position:static}
/* topics — hairline-divided ledger cells, not floating cards */
.units{display:flex;gap:0;flex:none}
.ublock{flex:1 1 0;min-width:0;border:none;border-left:1px solid var(--line);background:none;cursor:pointer;
  text-align:left;font-family:var(--head);color:inherit;padding:.45rem .75rem .2rem;transition:background .15s}
.ublock:first-child{border-left:none}
.ublock{text-align:center}
.ublock .un{text-align:center}
.ublock:hover{background:color-mix(in srgb,var(--tc) 9%,transparent)}
.ublock .un{font-family:var(--read);font-size:.84rem;font-weight:600;line-height:1.2;color:var(--ink);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.1em}
.ublock .utrack{display:block;height:3px;background:var(--linel);margin:.5rem 0 .3rem;overflow:hidden}
.ublock .utrack i{display:block;height:100%;background:var(--tc)}
/* the band, as a tint on the tile: emerging / developing / secure. Untouched units stay plain. */
.ublock{margin:0 3px;border-radius:0}
.ublock.band-g{box-shadow:inset 0 0 0 1px #4e7a4a}
.ublock.band-a{box-shadow:inset 0 0 0 1px #c9922a}
.ublock.band-r{box-shadow:inset 0 0 0 1px #b5442f}
/* the student's OWN rating, before there is evidence: the same colour, dashed (Tom, 6 Oct 2026). Evidence turns it solid. */
.ublock.rated-g{outline:1px dashed #4e7a4a;outline-offset:-1px}
.ublock.rated-a{outline:1px dashed #c9922a;outline-offset:-1px}
.ublock.rated-r{outline:1px dashed #b5442f;outline-offset:-1px}
.ublock .utrack{margin-bottom:.45rem}
/* drill into a topic -> pick any lesson (select, then confirm) */
.sdetail .back{flex:none;width:24px;height:24px;border:1px solid var(--line);background:var(--card);border-radius:3px;
  cursor:pointer;font-size:1.05rem;line-height:1;color:var(--sec)}
.sdetail .back:hover{border-color:var(--tc);color:var(--ink)}
.lessons{display:flex;flex-wrap:nowrap;gap:5px;align-content:flex-start;flex:none}
.ltile{flex:1 1 0;min-width:0;height:30px;border:1px solid var(--line);border-radius:3px;background:var(--card);cursor:pointer;
  font:600 .78rem/1 var(--head);color:var(--sec);display:grid;place-items:center;transition:border-color .12s,background .12s,color .12s}
.ltile:hover{border-color:var(--tc);color:var(--ink)}
.ltile.done{background:color-mix(in srgb,var(--tc) 16%,var(--card));color:var(--tc);border-color:transparent}
.ltile.next:not(.sel){box-shadow:inset 0 0 0 1.5px var(--tc);color:var(--tc)}
.ltile.sel{background:var(--tc);color:#fff;border-color:var(--tc)}
.lpick{display:flex;align-items:baseline;gap:8px;border-top:1px solid var(--line);padding-top:.32rem;flex:none}
.lpn{flex:none;font-size:.7rem;color:var(--mut);text-transform:uppercase;letter-spacing:.05em;font-weight:600}
.lpt{flex:1;min-width:0;font-family:var(--read);font-size:.92rem;font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lpick .go{align-self:center}
/* ---- the strip under the plan: countdown · this week · cards · shorts · podcast ----
   one line; "This week" opens to a full-width row beneath it; everything else is one tap */
.rail{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0 22px}
.rail>.card{flex:1 1 0;min-width:0;display:flex;align-items:center;justify-content:center;gap:.6rem;padding:.5rem 1.6rem .5rem .85rem;min-height:54px;box-sizing:border-box;position:relative;text-align:center}
.exam{align-items:baseline;gap:.5rem}
.exam::after,.week h3::after{content:'›';position:absolute;right:.8rem;top:50%;transform:translateY(-50%);font-size:1.25rem;line-height:1;color:var(--mut)}
/* the open week's close: a 44px quiet square in the buttons' own look (css/buttons.css tokens, job S3-02); the heading is its tap */
.week.open h3::after{content:'×';top:.35rem;right:.35rem;transform:none;width:44px;height:44px;display:grid;place-items:center;
  border-radius:var(--sv-radius,8px);background:var(--sv-tint,rgba(91,70,50,.07));color:var(--sv-quiet-ink,#5b4632);font-size:1.4rem}
.exam:hover::after,.week:not(.open):hover h3::after{color:var(--rust)}
.week.open h3:hover::after{background:var(--sv-tint-hover,rgba(91,70,50,.13))}
.exam .big{font-size:1.4rem;font-weight:800;letter-spacing:-.02em;line-height:1}
.exam .lbl{font-size:.78rem;color:var(--mut);line-height:1.15;white-space:nowrap}
.cal{display:none;grid-column:1 / -1;margin-top:.45rem;border-top:1px solid var(--linel);padding-top:.7rem}
.cal .mon{font-size:.72rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--mut);margin-bottom:.4rem}
.cal .grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;font-size:.72rem;color:var(--sec)}
.cal .d{position:relative;text-align:center;padding:.18rem 0;font-variant-numeric:tabular-nums}
.cal .d.gone{color:var(--mut)}
.cal .d.gone::after{content:"✕";position:absolute;inset:0;display:grid;place-items:center;
  color:rgba(184,68,47,.38);font-size:.82rem;transform:rotate(-4deg)}
.cal .d.today{color:#fff;isolation:isolate}
.cal .d.today::before{content:"";position:absolute;inset:-1px 18%;background:var(--rust);border-radius:3px;z-index:-1}

.rail>.card.week{flex-direction:column;align-items:stretch;justify-content:center;cursor:pointer}
.week h3{font-size:.78rem;font-weight:700;letter-spacing:.11em;text-transform:uppercase;color:var(--mut);margin:0;display:flex;align-items:baseline;justify-content:center;gap:.7rem}
.week h3 .sum{font-family:var(--read);font-size:.92rem;font-weight:600;letter-spacing:0;text-transform:none;color:var(--ink)}
.week.open h3{justify-content:flex-start}
.week:not(.open)>:not(h3){display:none}
.week.open{flex-basis:100%;order:9;cursor:default}
.week.open h3{margin-bottom:.5rem;cursor:pointer}
.week .ln{display:flex;justify-content:space-between;gap:12px;font-family:var(--read);font-size:.85rem;
  color:var(--sec);padding:.26rem 0;border-top:1px solid var(--linel)}
.week .ln:first-of-type{border-top:none}
.week .ln b{color:var(--ink);font-weight:600;text-align:right}

.door{cursor:pointer;text-align:left;font-family:var(--head);color:inherit;transition:border-color .2s,background .2s}
.rail>.door{padding-right:.85rem}
.door:hover{border-color:#c9ba9e;background:color-mix(in srgb,var(--anchor) 4%,transparent)}
.door img{width:36px;height:28px;object-fit:contain;display:block;flex:none}
.door>span{min-width:0;display:flex;align-items:center;gap:.5rem;flex:0 1 auto}
.door h3{font-size:.92rem;font-weight:700;margin:0;white-space:nowrap}
.door p{font-size:.8rem;color:var(--mut);margin:0;display:none}
.door.more p{display:block}
#fcdoor.more>span{flex-direction:column;align-items:flex-start;gap:.1rem}#fcdoor.more p{white-space:nowrap;line-height:1.1}   /* "Want more?" under the word, not squeezed beside it */
.door .go{display:none}
/* a door the pupil cannot use yet (Tom, 14 Nov 2026): shown greyed, still in the Tab order; a press says why in the
   one line at the foot of the screen (js/pages/dashboard.js svDoorLock, svDoorToast) */
.door[aria-disabled="true"],.door[aria-disabled="true"]:hover{cursor:default;color:var(--mut);background:transparent;border-color:var(--line);box-shadow:none}
.door[aria-disabled="true"] img,.door[aria-disabled="true"] .pm-doorsq{filter:grayscale(1);opacity:.45}
.doortoast{position:fixed;left:50%;bottom:calc(22px + env(safe-area-inset-bottom,0px));z-index:80;transform:translate(-50%,8px);
  box-sizing:border-box;max-width:min(440px,calc(100vw - 32px));width:max-content;padding:.8rem 1.1rem;border-radius:12px;
  background:#26231e;color:#fffdf8;font:600 1rem/1.35 var(--head);text-align:center;box-shadow:0 8px 24px rgba(38,30,18,.28);
  opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s,transform .2s cubic-bezier(.16,1,.3,1),visibility 0s .2s}
.doortoast.on{opacity:1;visibility:visible;transform:translate(-50%,0);transition:opacity .2s,transform .2s cubic-bezier(.16,1,.3,1)}
body.dark-mode .doortoast{background:#ece9e4;color:#181614}
/* a phone: at the top, so the line does not cover the door that was pressed */
@media (max-width:700px){ .doortoast{bottom:auto;top:calc(64px + env(safe-area-inset-top,0px))} }
@media (prefers-reduced-motion:reduce){ .doortoast,.doortoast.on{transition:none;transform:translate(-50%,0)} }
/* the podcast is a player in the top bar: play, skip, and the title of what is playing */
.podbar{display:flex;align-items:center;gap:8px;min-width:0;max-width:340px;flex:none}
.podradio{height:30px;width:auto;flex:none}
/* the title window: a marquee once it is longer than the window, like a radio display */
.podtitle{display:inline-block}
.podtitle.scroll{overflow:hidden;white-space:nowrap;text-overflow:clip}
.podtitle.scroll span{display:inline-block;padding-right:2.5rem;animation:podscroll var(--dur,14s) linear infinite}
@keyframes podscroll{from{transform:translateX(0)}to{transform:translateX(-50%)}}
@media (prefers-reduced-motion:reduce){ .podtitle.scroll span{animation:none} }
.podrow{display:flex;align-items:center;gap:8px;min-width:0}
.podrow button{width:30px;height:30px;border-radius:50%;border:1px solid var(--line);background:var(--card);
  cursor:pointer;display:grid;place-items:center;color:var(--rust)}
.podrow button:hover{border-color:var(--rust)}
.podrow svg{width:12px;height:12px;fill:currentColor}
.podtitle{font-size:.8rem;color:var(--sec);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;max-width:220px}
.podtitle:empty{display:none}
@media (max-width:700px){ .podtitle{display:none} }
@media (max-width:480px){ #podnext{display:none} .top{gap:8px} }   /* room for the reading button; skip lives on the lock screen too */

.signoff{font-family:var(--hand);font-size:1.15rem;color:var(--mut);text-align:right;padding:0 .3rem}
@media (max-height:780px){ .signoff{display:none} }

/* ---- the flashcards: the one flashcard screen (css/flashcards.css, js/flashcard-screen.js; job S5-08) ---- */
body.fc-open .top,body.fc-open .wrap,body.fc-open .savebar{filter:blur(14px)}   /* a wide screen: the page behind is frosted */

/* ---- shorts modal ---- */
.phonemodal{position:fixed;inset:0;background:rgba(38,30,18,.6);display:none;place-items:center;z-index:60}
.phonemodal.open{display:grid}
.phonemodal .dev{position:relative;height:min(92vh,860px);aspect-ratio:9/18.2;background:#26231e;border-radius:30px;padding:10px;
  box-shadow:0 30px 80px -20px rgba(0,0,0,.6)}
.phonemodal iframe{width:100%;height:100%;border:0;border-radius:20px;background:#f2efe9}
.phonemodal .x{position:absolute;top:-14px;right:-14px;width:34px;height:34px;border-radius:50%;border:none;cursor:pointer;
  background:#fffdf8;color:#26231e;font-size:18px;font-weight:700;box-shadow:0 4px 12px rgba(0,0,0,.4)}

@media (prefers-reduced-motion: reduce){
  *{transition:none !important;animation:none !important}
}
/* ---- the planner: click the exam card, the plan opens on a real calendar ---- */
.card.exam{cursor:pointer;transition:border-color .15s}
@media (max-width:640px){ .rail>.card{flex:1 1 calc(50% - 5px)} .week.open{flex-basis:100%} }
.card.exam:hover{border-color:#c9bda4}
.cal .d.hasplan{cursor:pointer}
.cal .d.hasplan::after{content:"";position:absolute;left:50%;bottom:-1px;width:4px;height:4px;
  margin-left:-2px;border-radius:50%;background:var(--dot,#8a5a44)}
.cal .d.hol2{color:#a3873a}
/* planner modal + day-tooltip styles live in planner.js (shared with the desk) */
/* a finished plan step: the number becomes a quiet green tick and the text
   steps back — no strikethrough, no fade, no boxes */
.card.plan li.done .n{color:#4e6e5d;font-weight:800}
.card.plan li.done>div>b{color:var(--sec);font-weight:600}
.card.plan li.done>div>small{color:var(--mut)}
.card.plan li.done .mins{color:var(--mut)}

/* wizard hand-off: quiet save-it bar (account creation is opt-in, never a gate) */
.savebar{max-width:1116px;width:calc(100% - 32px);margin:12px auto 0;display:flex;align-items:center;
  gap:14px;justify-content:space-between;background:var(--card);border:1px solid var(--line);
  border-radius:6px;padding:.7rem 1rem .7rem 1.2rem}
.savebar>span{font-family:var(--read);font-size:.93rem;color:var(--sec)}
.savecta{flex:none;background:var(--rust);color:#faf6ec;font-weight:600;font-size:.9rem;
  padding:.55rem 1.2rem;border-radius:4px;text-decoration:none}
.savecta:hover{filter:brightness(1.08)}
.ratebar{max-width:calc(1000px - 2*clamp(16px,4vw,32px));width:calc(100% - 2*clamp(16px,4vw,32px))}   /* the same edges as the plan below it */
.ratebar-acts{display:flex;align-items:center;gap:10px;flex:none}
@media (max-width:560px){.ratebar{flex-wrap:wrap}.ratebar-acts{width:100%;justify-content:flex-end}}
.weekempty{font-family:var(--read);font-size:.92rem;color:var(--sec);line-height:1.55;margin:.4rem 0 0}
/* short laptop screens (760-900px tall): the stack must still fit once a subject's panel
   opens under the shelf. The sign-up strip goes (the top bar carries the same button), the
   shelf scene shrinks as one piece, the plan tightens; the column scrolls as a last resort. */
@media (min-width:981px) and (min-height:760px) and (max-height:900px){
  .savebar{display:none}
  .savebar.ratebar{display:flex;padding:.35rem .8rem .35rem 1rem;margin-top:8px}   /* no copy of it elsewhere, unlike the sign-up strip */
  .shelfstage{zoom:.86;margin-top:16px}
  .wallhang{width:11.5%}   /* the tighter gap above the shelf: a full-size picture hung its wire into the search bar (Tom, 7 Nov 2026) */
  .plan{padding-top:.5rem}
  .startrow{margin-bottom:-.8rem}
  .plan li{padding:.22rem .4rem}
  .h1row{margin-bottom:1.6rem}
  .wrap{padding-bottom:12px}
  .wrap>:first-child{min-height:0;overflow-y:auto;overflow-x:hidden;padding-bottom:6px}
}
/* phones: the books are what you tap, so they get the width. The lamp is small and
   tucked right, the bookend half size; fitShelf() re-anchors the cord and the bulb
   to the lamp's box (their desktop positions are percentages of the 722px stage). */
@media (max-width:700px){
  .top{gap:10px;padding-top:14px}
  .top .savecta{font-size:.82rem;padding:.5rem .8rem;white-space:nowrap}
  .shelfstage{margin-top:22px}
}
@media (max-width:480px){
  .top{gap:6px}
  .top .savecta{padding:.5rem .65rem}
}
@media (max-width:380px){                    /* small Androids (360px): still 17px too wide */
  .top{gap:4px}
  .top .savecta{padding:.45rem .55rem}
}
@media (max-width:700px){
  .shelf{padding-left:4px;height:auto;min-height:150px;--bes:.5}
  .bookend{margin-right:-3px}
  .lamp{height:150px;right:-4px;bottom:16px}
  .lampglow{display:none}                     /* the cone is drawn for the desktop stage */
  .lampbtn{width:90px;height:150px;right:-4px;bottom:14px}
  .bulb{width:40px;height:40px}
  /* the subject panel: the button drops to its own line instead of running off the edge */
  .sdetail .top,.sdetail .top.withbook{flex-direction:column;align-items:center;text-align:center;gap:.35rem}
  .sdetail .top .bookslot,.sdetail .top .sp{display:none}
  .sdetail .top.withbook>h3{position:static;width:auto;height:auto;overflow:visible;clip:auto}
  .sdetail h3{white-space:normal}
  .sdetail .top .sub{white-space:normal;overflow:visible}
  .sdetail .top .cont,.sdetail .top .go{margin:.2rem 0 0;width:100%;text-align:center}
  /* nine units in one row are two letters each on a phone: a list instead,
     full name, count on the right, the progress bar underneath */
  .units{flex-direction:column}
  .lessons{flex-wrap:wrap;max-height:110px;overflow-y:auto}
  .ltile{flex:none;width:30px}
  .ublock{display:grid;grid-template-columns:1fr auto;align-items:center;gap:.15rem .8rem;
    border-left:none;border-top:1px solid var(--line);padding:.55rem .2rem .6rem}
  .ublock:first-child{border-top:none;padding-left:.2rem}
  .ublock .un{min-height:0;-webkit-line-clamp:2}
  .ublock .utrack{grid-row:2;grid-column:1/-1;margin:.25rem 0 0}
  .ublock{margin:0;padding-left:.6rem;padding-right:.6rem}
}
/* ---- dark mode: evening on the same shelf (js/dash-a11y.js; shared with the lessons' toggle).
   The paper goes to a deep warm brown, cards a shade lighter, the painted props stay, the pencil
   marks flip to chalk, and the lamp is the light in the room. ---- */
body.dark-mode{--paper:#181614;--card:#211f1c;--ink:#ece9e4;--sec:#b3aea6;--mut:#8a857c;--line:#36332e;--linel:#2b2925;--anchor:#c9b48f}
html.dark-mode{background:#181614}
body.dark-mode .card{border-color:var(--line);box-shadow:none}
body.dark-mode .hl{background:linear-gradient(101deg,transparent 1.5%,rgba(255,200,60,.26) 7%,rgba(255,206,80,.2) 93%,transparent 98.5%)}
body.dark-mode h1::after,body.dark-mode .starttile b::after,body.dark-mode .plancol .arrow{filter:invert(.88) brightness(1.1)}
body.dark-mode .avatar{background:#ece9e4;color:#181614}
body.dark-mode .starttile:hover,body.dark-mode .door:hover,body.dark-mode .card.exam:hover{border-color:#5a5448}
body.dark-mode .plan li:hover:not(.inert){background:rgba(255,235,200,.06)}
body.dark-mode .ublock.band-g{box-shadow:inset 0 0 0 1px #7fb27a}
body.dark-mode .ublock.band-a{box-shadow:inset 0 0 0 1px #e0ac4a}
body.dark-mode .ublock.band-r{box-shadow:inset 0 0 0 1px #e0705a}
body.dark-mode .ublock.rated-g{outline-color:#7fb27a}
body.dark-mode .ublock.rated-a{outline-color:#e0ac4a}
body.dark-mode .ublock.rated-r{outline-color:#e0705a}
body.dark-mode .card.plan li.done .n{color:#8fc9a6}
body.dark-mode .ltile.sel{color:#181614}
body.dark-mode .lightwash{background:linear-gradient(to right, rgba(0,0,0,.55), rgba(0,0,0,.25) 34%, transparent 58%);opacity:1}
body.dark-mode .shelfstage .lampglow,body.dark-mode .shelfstage .bulb{opacity:1}   /* evening: the lamp is on */
body.dark-mode .lampglow{background:linear-gradient(to bottom, rgba(255,190,110,.55) 22%, rgba(255,170,90,.42) 40%, rgba(252,150,70,.22) 66%, rgba(252,146,64,.08) 86%, transparent 97%)}
/* evening: the beam softened, and the inside of the shade lit (placed from the lamp by script) */
/* the cone leaves the whole width of the shade's opening (drawn from a virtual apex up inside the
   shade, --ax/--ay) and runs down the shade's axis onto the shelf, fading as it goes; where it
   lands, a warm pool on the wood (--px/--py). Both placed from the lamp by script. */
body.dark-mode .shelfstage .lampglow{display:block;clip-path:none!important;filter:none;opacity:1;   /* (placeLampBits sets a clip-path inline) */
  background:
    radial-gradient(calc(var(--lh,250px)*.55) calc(var(--lh,250px)*.62) at calc((var(--lx,600px) + var(--px,500px))/2) calc((var(--ly,60px) + var(--py,200px))/2 + var(--lh,250px)*.08),rgba(255,196,124,.26),rgba(255,186,110,.1) 55%,transparent 100%),
    conic-gradient(from 160deg at var(--ax,640px) var(--ay,20px),transparent 0deg,rgba(255,200,128,.22) 26deg,rgba(255,196,120,.22) 64deg,transparent 92deg,transparent 360deg);
  -webkit-mask:radial-gradient(calc(var(--lh,250px)*1.15) calc(var(--lh,250px)*1.0) at var(--lx,600px) var(--ly,60px),#000 0%,rgba(0,0,0,.75) 35%,rgba(0,0,0,.25) 72%,transparent 100%);
  mask:radial-gradient(calc(var(--lh,250px)*1.15) calc(var(--lh,250px)*1.0) at var(--lx,600px) var(--ly,60px),#000 0%,rgba(0,0,0,.75) 35%,rgba(0,0,0,.25) 72%,transparent 100%)}
.lamppool{position:absolute;z-index:4;pointer-events:none;opacity:0;transition:opacity .5s ease;border-radius:50%;mix-blend-mode:screen;
  left:calc(var(--px,500px) - var(--lh,250px)*.62);top:calc(var(--py,200px) - var(--lh,250px)*.07);
  width:calc(var(--lh,250px)*1.24);height:calc(var(--lh,250px)*.16);
  background:radial-gradient(closest-side,rgba(255,214,150,.85),rgba(255,184,104,.4) 55%,transparent)}
body.dark-mode .shelfstage.lit .lamppool{opacity:1}
body.dark-mode .shelfstage .bulb{display:none}
.lampmouth{position:absolute;z-index:6;pointer-events:none;opacity:0;transition:opacity .5s ease;border-radius:50%;transform:rotate(28deg);
  left:calc(var(--lx,600px) - var(--lh,250px)*.175);top:calc(var(--ly,60px) - var(--lh,250px)*.064);
  width:calc(var(--lh,250px)*.35);height:calc(var(--lh,250px)*.128);
  background:radial-gradient(closest-side,#fffbe8 0%,#ffe6a8 40%,rgba(255,196,110,.9) 70%,rgba(255,176,86,0));filter:blur(1.5px);
  box-shadow:0 0 calc(var(--lh,250px)*.14) calc(var(--lh,250px)*.04) rgba(255,200,120,.35)}
.shelfstage.lit .lampmouth{opacity:1}
/* the cord's dusk/dawn fade (see the lamp script) */
::view-transition-old(root),::view-transition-new(root){animation-duration:1.1s;animation-timing-function:cubic-bezier(.4,0,.2,1)}
html.sv-fading *,html.sv-fading *::before,html.sv-fading *::after{transition:background-color 1s ease,color 1s ease,border-color 1s ease,box-shadow 1s ease,fill 1s ease,filter 1s ease!important}
body.dark-mode .selprompt{color:var(--mut)}
body.dark-mode .phonemodal .x{background:#ece9e4;color:#181614}
body.dark-mode .podrow button{background:var(--card)}
body.dark-mode .cal .d.gone::after{color:rgba(240,140,120,.4)}
body.dark-mode .savebar{background:var(--card)}
body.dark-mode .svtimer{color:var(--sec)}
body.dark-mode .svtimer-pop{background:var(--card);border-color:var(--line)}body.dark-mode .svtimer-pop button{background:var(--paper);color:var(--ink);border-color:var(--line)}

/* Finder: revise one specific thing. Sits between the plan and the shelf; results open in flow. */
.finder{margin:1.15rem 0 .2rem}
.finder .fbar{display:flex;align-items:center;gap:.6rem;background:var(--card);border:1px solid #d5c9b3;border-radius:4px;padding:.55rem .8rem;box-shadow:0 1px 0 rgba(60,40,20,.05);transition:border-color .15s}
.finder .fbar:focus-within{border-color:#b9a98c}
.finder .fbar svg{width:18px;height:18px;flex:none;fill:none;stroke:var(--mut);stroke-width:1.8;stroke-linecap:round}
.finder input{flex:1;min-width:0;border:0;outline:0;background:transparent;font-family:var(--read);font-size:1rem;color:var(--ink)}
.finder input::placeholder{color:var(--mut)}
.finder .fclear{border:0;background:transparent;color:var(--mut);font:600 .8rem var(--head);cursor:pointer;padding:.2rem .3rem}
.finder .fclear:hover{color:var(--ink)}
.finder .fres{margin-top:.6rem;background:var(--card);border:1px solid #d5c9b3;border-radius:4px;overflow:hidden}
.finder .fgroup{padding:.55rem .85rem .2rem;font:700 .72rem var(--head);letter-spacing:.06em;text-transform:uppercase;color:var(--mut);display:flex;align-items:center;gap:.5rem}
.finder .fgroup i{width:9px;height:9px;border-radius:50%;background:var(--tc,#b9a98c);display:inline-block}
.finder .frow{display:flex;align-items:center;gap:.8rem;padding:.55rem .85rem;border-top:1px solid #eee5d4;cursor:pointer}
.finder .frow:hover,.finder .frow.hot{background:#fbf7ee}
.finder .frow .ft{flex:1;min-width:0}
.finder .frow b{display:block;font-family:var(--read);font-weight:600;font-size:.97rem;line-height:1.25;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.finder .frow small{display:block;font-family:var(--head);font-size:.78rem;color:var(--mut);margin-top:.1rem}
.finder .frow mark{background:#f3e7c4;color:inherit;border-radius:2px;padding:0 .05em}
.finder .fstr{flex:none;font:600 .74rem var(--head);color:var(--sec);border:1px solid #e4dac6;border-radius:3px;padding:.15rem .4rem;white-space:nowrap}
.finder .fstr.s0{color:var(--mut)}.finder .fstr.s1{color:#8a5a2b;border-color:#e9d3b8}.finder .fstr.s2{color:#7a6a2a;border-color:#e6dcb0}.finder .fstr.s3{color:#3f6b3f;border-color:#cfe0c8}
.finder .facts{flex:none;display:flex;gap:.3rem}
.finder .facts button{border:1px solid #d5c9b3;background:var(--card);border-radius:3px;font:600 .76rem var(--head);color:var(--sec);padding:.28rem .55rem;cursor:pointer}
.finder .facts button:hover{border-color:var(--rust);color:var(--ink)}
.finder .facts button.pri{background:var(--rust);border-color:var(--rust);color:#fff}
.finder .fnone{padding:.9rem .85rem;font-family:var(--read);font-size:.92rem;color:var(--sec)}
/* phone: the title gets the full width (it was squeezed to "Scale, Ecli…" beside the label), then the label and the buttons on one line */
@media(max-width:640px){.finder .frow{flex-wrap:wrap;row-gap:.45rem}.finder .frow .ft{flex:1 1 100%}.finder .frow b{white-space:normal}.finder .fstr{order:0}.finder .facts{margin-left:auto}}
/* Finder in dark mode: the light-only colours above (cream hover row, pale highlight) made results unreadable (Tom, 6 Oct 2026) */
body.dark-mode .finder .fbar,body.dark-mode .finder .fres{border-color:var(--line);box-shadow:none}
body.dark-mode .finder .fbar:focus-within{border-color:#5a5448}
body.dark-mode .finder .frow{border-top-color:var(--linel)}
body.dark-mode .finder .frow:hover,body.dark-mode .finder .frow.hot{background:rgba(255,235,200,.07)}
body.dark-mode .finder .frow mark{background:rgba(255,196,64,.32);color:#fff4dc}
body.dark-mode .finder .fstr{border-color:var(--line)}
body.dark-mode .finder .fstr.s1{color:#e8a878;border-color:#5c4532}body.dark-mode .finder .fstr.s2{color:#dcc677;border-color:#57502f}body.dark-mode .finder .fstr.s3{color:#8fc9a6;border-color:#2f4a3a}
body.dark-mode .finder .facts button{border-color:var(--line);background:transparent;color:var(--sec)}
body.dark-mode .finder .facts button:hover{border-color:var(--rust);color:var(--ink)}
body.dark-mode .finder .facts button.pri{background:var(--rust);border-color:var(--rust);color:#fff}

/* phones and the app: the plan, not explanations (Tom, 7 Nov 2026: "the captions and subtext and footer text is all
   too much"). Gone at phone size: the highlighted line under the heading, the slider's 15/30/45/60, the description
   under Shorts and under a "Next time" note, the "Select a subject" prompt; "Make my own plan" shares the heading's
   row; the topic-rating nudge is one row of two buttons (Not now, Rate my topics · 2 min). Subject, topic and counts stay. ":root" outruns the styles the
   dashboard's scripts add */
.ratebar .rb-short{display:none}
@media (max-width:700px){
  :root .h1row .momentum,:root .fx-scale,:root .fx-shorts small,:root .fx-note small,:root .selprompt{display:none}
  :root .h1row{flex-wrap:nowrap;align-items:center;gap:10px}
  :root .h1row h1{min-width:0}
  :root .h1row .mp-edit{flex:none;padding-inline:10px}
  :root .ratebar{flex-wrap:nowrap;padding-block:.45rem}
  :root .ratebar .rb-long{display:none}
  :root .ratebar .rb-short{display:inline;white-space:nowrap}
  :root .ratebar-acts{width:100%;justify-content:flex-end;gap:10px}
  :root .tierbar{padding-inline:.8rem}
  :root .tierbar .savecta{flex:1;text-align:center}   /* the tier reminder has no "Not now": its button fills the bar, centred */
  :root .plan ol>li{min-height:48px;box-sizing:border-box}   /* a row without its second line is still a thumb's height */
}
/* phones: the heading and its button stay on one row (the button's text is 15px now) */
@media (max-width:440px){ :root .h1row h1{font-size:1.32rem} }
@media (max-width:380px){ :root .h1row h1{font-size:1.25rem} :root .h1row .mp-edit{padding-inline:8px} }

/* phones (Tom, 7 Nov 2026): the chosen book stands up and comes forward instead of lying across the others; the topic's
   lessons are thumb-sized with one highlighted square; the lesson's name has its own line over two full buttons */
.sdetail .back span{display:none}
@media (max-width:700px){
  :root .bk[aria-selected="true"]{animation:book-lift .45s cubic-bezier(.16,1,.3,1) forwards;transform-origin:bottom center;z-index:20}
  :root .bk[aria-selected="true"]::before{opacity:1}
  :root .bk.returning{animation:book-drop .4s cubic-bezier(.16,1,.3,1) both;transform-origin:bottom center}
  :root .sdetail .back{width:auto;height:auto;min-height:44px;padding:0 .9rem 0 .5rem;align-self:flex-start;font:600 1rem var(--head);display:inline-flex;align-items:center;gap:.25rem}
  :root .sdetail .back span{display:inline}
  :root .lessons{flex-wrap:wrap;max-height:none;overflow:visible;gap:6px}
  :root .ltile{width:44px;height:44px;font-size:1rem}
  :root .ltile.next:not(.sel){box-shadow:none;color:var(--sec)}
  :root .lpick{display:grid;grid-template-columns:1fr 1fr;gap:.35rem .6rem;padding-top:.7rem}
  :root .lpick .lpn{grid-column:1/-1;font-size:.84rem}
  :root .lpick .lpt{grid-column:1/-1;white-space:normal;overflow:visible;font-size:1.06rem;line-height:1.3}
  :root .lpick .go{margin:.3rem 0 0}
  :root .lpick .mp-add{min-height:48px;font-size:1rem;margin:.3rem 0 0}
  :root .lpick .mp-add.today{font-size:1rem !important}   /* js/my-plan.js sets its font with !important */
  :root .lpick .go:only-of-type{grid-column:1/-1}
}
@keyframes book-lift{
  from{transform:translateX(calc(var(--shift,0px)*var(--fit,1))) translateY(0) rotate(var(--lean,0deg)) scale(1)}
  to{transform:translateX(calc(var(--shift,0px)*var(--fit,1))) translateY(-14px) rotate(0deg) scale(1.06)}
}
@keyframes book-drop{
  from{transform:translateX(calc(var(--shift,0px)*var(--fit,1))) translateY(-14px) rotate(0deg) scale(1.06)}
  to{transform:translateX(calc(var(--shift,0px)*var(--fit,1))) translateY(0) rotate(var(--lean,0deg)) scale(1)}
}
/* phones: no text under 15px (Tom, 7 Nov 2026: "the text on many screens is still a little small"); labels in capitals
   13.5px, which reads as large as 15px lower case. ":root" outruns the styles the dashboard's scripts add */
@media (max-width:700px){
  :root .fx-subj{font-size:.84rem}
  :root .tierbar .savecta,:root .top .savecta{font-size:.94rem}
  :root .fx-q,:root .week h3{font-size:.86rem}
  :root .week h3 .sum,:root .door h3,:root .avatar,:root .booktip b{font-size:1rem}
  :root .exam .lbl,:root .card.plan ol li small,:root .door p,:root .card.plan .mins,:root .booktip .c,
  :root .sdetail .sub,:root .ublock .un{font-size:.94rem}
  /* the bigger lines wrap rather than run off their tiles */
  :root #pmdoor>span{flex-wrap:wrap;row-gap:0}
  :root #pmdoor p{white-space:normal;line-height:1.3}
  :root .exam .lbl{white-space:normal;text-align:center}
}
/* phones: one alignment (Tom, 7 Nov 2026: "mostly not centred ... clutter, not a premium app experience"). The subject
   area is a centred composition, so its heading, back link, lesson grid and lesson name all centre; the grid fills the
   panel's width edge to edge; the shelf's floating name tip goes (the panel names the subject) */
@media (max-width:700px){
  :root .sechead{justify-content:center;margin:1.6rem 0 .6rem}
  :root .sechead h2{font-size:1.32rem}
  :root .booktip{display:none}
  :root .sdetail .back{align-self:center}
  :root .lessons{display:grid;grid-template-columns:repeat(auto-fill,minmax(44px,1fr));gap:8px;width:100%}
  :root .ltile{width:auto;height:auto;aspect-ratio:1}
  :root .lpick{text-align:center}
  /* the two count tiles say it the same way: the number large, what it counts underneath */
  :root .week h3{flex-direction:column-reverse;align-items:center;gap:.15rem;font-size:.94rem;font-weight:400;letter-spacing:0;text-transform:none;line-height:1.15}
  :root .week h3 .sum{font-family:var(--head);font-size:1.4rem;font-weight:800;letter-spacing:-.02em;line-height:1}
  :root .exam .lbl{line-height:1.15}
}
/* phones: fewer boxes, one rhythm (Tom, 7 Nov 2026: "clutter, not a premium app experience"). His limits: no separate
   phone version, nothing taken away, the website unchanged, so this is styling at phone width only, on the same page and
   the same code. The time picker and the plan are one "Today" card; the five small tiles are one grouped card with
   hairlines between them; 16px inside a card, 24px between sections. A finished day lists what was done; "Start another
   session" brings the rest of the plan back */
@media (max-width:700px){
  :root .h1row{margin-bottom:1.25rem}
  :root .plancol{gap:0}
  :root #fxtile{border-radius:8px 8px 0 0;border-bottom:0;box-shadow:none}
  :root .plancol>.card.plan{border-radius:0 0 8px 8px;border-top:1px solid var(--linel);box-shadow:none;padding:.75rem 1rem .85rem}
  :root .rail{margin:1.5rem 0 0;gap:1px;background:var(--line);border:1px solid var(--line);border-radius:8px;overflow:hidden}
  :root .rail>.card{border:0;border-radius:0;box-shadow:none;margin:0;padding:.75rem 1rem}
  :root .finder{margin:1.5rem 0 0}
  :root .sechead{margin:2rem 0 .75rem}
  :root body.fx-day-closed .card.plan ol li:not(.done){display:none}
  :root body.fx-day-closed .plancol:not(:has(li.done))>.card.plan{display:none}
  :root body.fx-day-closed .plancol:not(:has(li.done))>#fxtile{border-radius:8px;border-bottom:1px solid var(--line)}
}

/* ============ The phone app's start (Tom, 16 Nov 2026) ============
   Only when the app opens from closed (html.app-start, js/app-mode.js). The cream screen and closed lock are the same
   as the app draws itself as it starts (app/android: MainActivity, splash_lock.xml), so the pupil sees one lock;
   --svcy (js/app-mode.js) puts the page's lock on Android's, at the middle of the whole screen.
   When the dashboard is ready (js/app-start.js adds .go): the key turns, the lock hops, the ring jumps up and swings
   round on its left leg, and the dashboard opens out from the keyhole. A long wait: the key tries the lock each second. */
@property --svr { syntax: '<length>'; inherits: false; initial-value: 0px; }
.svstart{display:none}
html.app-start body{opacity:1;transition:none}
html.app-start,html.app-start body{scrollbar-width:none}   /* no scroll bar flashes over the lock while the page is built */
html.app-start::-webkit-scrollbar,html.app-start body::-webkit-scrollbar{display:none}
/* the size of the SCREEN (vw, vh), not inset:0: while the dashboard is built, a part of it is wider than the phone for a
   moment, and a box tied to the page's own width moved down and right with it (seen on the emulator) */
html.app-start .svstart{display:block;position:fixed;left:0;top:0;width:100vw;height:100vh;z-index:99999;background:#f6f1e7}
.svlock{position:absolute;left:50%;top:var(--svcy,50%);width:104px;margin:-86px 0 0 -52px;transform-origin:50% 100%}
.svlock svg{display:block;width:100%;overflow:visible}
.svstart .shackle{transform-box:view-box;transform-origin:678.5px 880px}
.svstart .key{transform-box:view-box;transform-origin:1025px 1200px;animation:svs-try 1s ease-in-out 1.5s infinite}
.svmark{position:absolute;left:0;right:0;top:var(--svcy,50%);margin-top:66px;text-align:center;font:400 2.1rem/1 'Young Serif',serif;color:#1d1c1a;opacity:0;transition:opacity .25s ease-out}
/* the word shows when its own font is here (js/app-start.js), so it never draws in another font and then changes; on a
   page that loaded itself again it is there from the first frame, with no second fade (js/app-mode.js) */
html.svmark-on .svmark{opacity:1}
html.svmark-now .svmark{transition:none}
.svstart.go{animation:svs-iris .46s cubic-bezier(.6,0,.85,.5) .78s forwards;
  -webkit-mask-image:radial-gradient(circle at 50% calc(var(--svcy,50%) - 3px), transparent var(--svr), #000 calc(var(--svr) + 1px));
          mask-image:radial-gradient(circle at 50% calc(var(--svcy,50%) - 3px), transparent var(--svr), #000 calc(var(--svr) + 1px))}
.svstart.go .key{animation:svs-turn .2s cubic-bezier(.3,0,.2,1.4) forwards}
.svstart.go .shackle{animation:svs-up .26s cubic-bezier(.3,1.9,.5,1) .16s forwards, svs-round .34s cubic-bezier(.35,1.6,.5,1) .36s forwards}
.svstart.go .svlock{animation:svs-hop .46s cubic-bezier(.3,0,.3,1) .12s}
.svstart.go .svmark{animation:svs-away .16s ease-in .74s forwards}
/* the dashboard is a little large behind the keyhole and settles to its size as the hole grows */
html.app-go .top{transform-origin:50% 50vh;animation:svs-settle .6s cubic-bezier(.16,1,.3,1) .78s backwards}
html.app-go .wrap{transform-origin:50% calc(50vh - 64px);animation:svs-settle .6s cubic-bezier(.16,1,.3,1) .78s backwards}
@keyframes svs-try{0%,62%,100%{transform:none}72%{transform:rotate(16deg)}82%{transform:rotate(-6deg)}91%{transform:rotate(7deg)}}
@keyframes svs-turn{to{transform:rotate(90deg)}}
@keyframes svs-up{from{transform:none}to{transform:translateY(-125px)}}
@keyframes svs-round{from{transform:translateY(-125px) scaleX(1)}to{transform:translateY(-125px) scaleX(-1)}}
@keyframes svs-hop{0%{transform:none}22%{transform:scale(1.07,.9)}48%{transform:translateY(-9px) scale(.96,1.05)}74%{transform:scale(1.03,.97)}100%{transform:none}}
@keyframes svs-away{to{opacity:0;visibility:hidden}}
@keyframes svs-iris{0%{--svr:12px}100%{--svr:150vmax;visibility:hidden}}
@keyframes svs-settle{from{transform:scale(1.03)}}
/* reduced motion: the lock does not move; the screen fades */
@media (prefers-reduced-motion:reduce){
  .svstart .key,.svstart.go .key,.svstart.go .shackle,.svstart.go .svlock,.svstart.go .svmark{animation:none}
  .svmark{transition:none}
  .svstart.go{-webkit-mask-image:none;mask-image:none;animation:svs-away .25s ease-out forwards}
  html.app-go .top,html.app-go .wrap{animation:none}
}

/* ==== The night look (job S6-01, 20 Nov 2026) ====
   The night's colours are written once in css/buttons.css (--sv-night-*): a dark walnut from the painted shelf. */
body.dark-mode{--paper:var(--sv-night-page,#181614);--card:var(--sv-night-card,#211f1c);--ink:var(--sv-night-ink,#ece9e4);
  --sec:var(--sv-night-sec,#b3aea6);--mut:var(--sv-night-mut,#8a857c);--line:var(--sv-night-line,#36332e);--linel:var(--sv-night-linel,#2b2925)}
html.dark-mode{background:var(--sv-night-page,#181614)}
/* the slider's empty track is dim, not the brightest thing on a dark screen (point 055.2): the browser draws a light
   track under a dark accent colour and a dim one under a light one, so at night the rust is a shade lighter */
body.dark-mode input[type=range]{color-scheme:dark;accent-color:#d9783a}
/* the shelf's shade at night fades out at its top and its left edge, so the painting never shows as a box on the
   page (point 048.2) */
body.dark-mode .lightwash{
  -webkit-mask-image:linear-gradient(to bottom,transparent,#000 42%),linear-gradient(to right,transparent,#000 18%);-webkit-mask-composite:source-in;
  mask-image:linear-gradient(to bottom,transparent,#000 42%),linear-gradient(to right,transparent,#000 18%);mask-composite:intersect}
/* the revision plan's sheet (js/dash-a11y.js writes the old charcoal into it, later in the page: hence "html") */
html body.dark-mode .plsheet,html body.dark-mode .replan{background:var(--paper)}
html body.dark-mode :is(.plctl,.plday,.pldaysheet){background:var(--card);border-color:var(--line)}
html body.dark-mode .plsess li{border-color:var(--line)}
@media (max-width:700px){ html body.dark-mode :is(.plctl,.pldaysheet){background:none} }
