/* Your path: the card on the Train tab, the path page and the node screen.
   Everything that moves animates transform or opacity only. States are opacity layers (fill, ring, glow, check), so a state
   change never repaints layout. Reduced motion is handled by the global rule in styles.css plus the checks in js/features/path.js. */
:root{--pe:cubic-bezier(.2,.8,.2,1);--chrome:linear-gradient(145deg,#FBFCFD 0%,#C4CBD6 38%,#EEF0F4 55%,#A9B2C0 100%)}

/* the card on the Train tab */
.pathc{position:relative;display:flex;align-items:center;gap:12px;width:100%;min-height:64px;margin-top:10px;padding:10px 14px;border-radius:20px;text-align:left;background:rgba(255,255,255,.7);box-shadow:inset 0 0 0 1px #fff,0 14px 28px -22px rgba(21,23,28,.6);transition:transform .18s var(--pe)}
.pathc:active{transform:scale(.985)}
.pathc .pcimg{width:44px;height:44px;border-radius:50%;flex:0 0 auto;display:grid;place-items:center;background:var(--chrome);box-shadow:0 8px 14px -8px rgba(21,23,28,.5),inset 0 0 0 1.5px rgba(255,255,255,.9)}
.pathc .pcimg img{width:40px;height:40px;display:block}
.pathc .dtx{flex:1;min-width:0}
.pathc b{display:block;font-family:"Sora",system-ui,sans-serif;font-size:15px;font-weight:600;line-height:1.25}
.pathc small{display:block;font-size:12px;color:var(--mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pathc>svg{width:14px;height:14px;flex:0 0 auto;color:var(--mute)}

/* the path page: a five column board, with the nodes as raised square tiles on it */
.pthbody{padding:16px 0 96px;container-type:inline-size}
#pathWrap{--c:calc(100cqw/5)}
.pthbody .phead{padding:0 20px}
.pth{position:relative}
.pu{position:relative;margin-top:22px;overflow-x:clip;background:conic-gradient(transparent 0 25%,rgba(21,23,28,.05) 0 50%,transparent 0 75%,rgba(21,23,28,.05) 0);background-size:calc(var(--c)*2) calc(var(--c)*2);background-position:0 0}
/* the unit card stays pinned while you scroll inside its unit */
.puh{position:sticky;top:8px;z-index:5;overflow:hidden;margin:0 16px;padding:14px 16px 16px;border-radius:20px;color:#fff;background:radial-gradient(90% 120% at 85% 0%,#3B404A,#15171C);box-shadow:0 16px 28px -18px rgba(21,23,28,.8),inset 0 0 0 1px rgba(255,255,255,.06)}
.puh small{display:block;font-size:11px;font-weight:600;letter-spacing:.08em;color:#AEB5C0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.puh h3{font-family:"Sora",system-ui,sans-serif;font-size:20px;font-weight:600;letter-spacing:-.02em;line-height:1.2;margin-top:4px}
.pubar{height:3px;border-radius:2px;margin-top:12px;background:rgba(255,255,255,.16);overflow:hidden}
.pubar i{display:block;height:100%;width:100%;background:linear-gradient(90deg,#DDE2EA,#fff);transform-origin:0 50%;transition:transform .45s var(--pe)}
.pu.todo .puh{opacity:.62}
.pushim{position:absolute;inset:0;pointer-events:none;opacity:0;transform:translateX(-120%);background:linear-gradient(105deg,transparent 28%,rgba(255,255,255,.55) 44%,rgba(221,226,234,.5) 52%,transparent 70%)}
.pun{position:relative;height:calc(var(--c)*13)}
.pn{position:absolute;left:calc(var(--c)*(var(--col) - .5));top:calc(var(--c)*(var(--row) + .5));width:0;height:0;z-index:1}
.pnb{position:absolute;left:-36px;top:-36px;width:72px;height:72px;display:block;transition:transform .22s var(--pe);-webkit-tap-highlight-color:transparent}
.pn.k .pnb{left:-48px;top:-48px;width:96px;height:96px}
.pn.cur:not(.k) .pnb{transform:scale(1.1667)}
.pnb:focus-visible{outline:2px solid var(--ink);outline-offset:6px;border-radius:12px}
/* the raised tile: a darker edge sits 6px below the face, and pressing moves the face down 4px */
.pne,.pnface{position:absolute;left:0;right:0;border-radius:10px;display:block}
.pne{top:6px;bottom:-6px;background:#CFD5DE}
.pnface{top:0;bottom:0;display:grid;place-items:center;background:#F3F5F8;box-shadow:inset 0 0 0 2px #CDD3DD;transition:transform .15s var(--pe)}
.pnb:active .pnface{transform:translateY(4px)}
.pne i,.pnface i{position:absolute;inset:0;border-radius:10px;opacity:0;transition:opacity .22s var(--pe)}
.pne i{background:#AEB6C3}.pne i.d{background:#050608}
.pnface i{background:linear-gradient(145deg,#FFFFFF,#E4E8EE 55%,#D2D8E1);box-shadow:inset 0 0 0 1.5px #fff,0 0 0 1px rgba(174,182,195,.6)}
.pnface i.d{background:linear-gradient(145deg,#2B2F37,#15171C);box-shadow:none}
.pne i:first-child{opacity:0}
.pn.cur .pne i.c,.pn.cur .pnface i.c,.pn.done .pne i.d,.pn.done .pnface i.d{opacity:1}
.pni,.pnc{position:relative;z-index:2;width:28px;height:28px;margin-top:8px;color:var(--ink);transition:opacity .22s var(--pe)}
.pn.k .pni,.pn.k .pnc{width:34px;height:34px;margin-top:6px}
.pn.todo .pni{opacity:.32}
.pn.done .pni{opacity:0}
.pnc{position:absolute;color:#E4E8EE;opacity:0}
.pn.done .pnc{opacity:1}
.pn.busy .pnb{opacity:.7}
/* the current tile: a soft ring that breathes, opacity only */
.pn.cur .pnb::after{content:"";position:absolute;inset:-7px -7px -13px;border-radius:15px;box-shadow:0 0 0 2px rgba(174,182,195,.9);pointer-events:none;animation:pthRing 2s ease-in-out infinite}
@keyframes pthRing{0%,100%{opacity:0}50%{opacity:.85}}
/* the mascot stands on the current square, at the back edge so the icon stays visible. One element moved with transform.
   The wrapper takes no taps; .ppm is his own small tap target over his body, above the tile, so a tap never opens a tile */
.ppc{position:absolute;left:0;top:0;width:120px;height:120px;opacity:0;pointer-events:none;z-index:3;will-change:transform;filter:drop-shadow(0 5px 5px rgba(21,23,28,.18))}
.ppc .rk-mascot-wrap{display:block}
.ppm{position:absolute;left:30px;top:30px;width:64px;height:84px;padding:0;border:0;background:none;pointer-events:auto;-webkit-tap-highlight-color:transparent}
.ppm:focus-visible{outline:2px solid var(--ink);outline-offset:2px;border-radius:12px}
/* the bubble above a square */
.pbub{position:absolute;left:0;top:0;z-index:6;padding:14px 14px 12px;border-radius:18px;background:#fff;box-shadow:0 18px 32px -16px rgba(21,23,28,.5),inset 0 0 0 1px rgba(21,23,28,.06);opacity:0;visibility:hidden;pointer-events:none;
  transform:translate(var(--bx,0),var(--by,0)) scale(.96);transform-origin:var(--tx,50%) 100%;transition:opacity .18s var(--pe),transform .22s var(--pe)}
.pbub.on{opacity:1;visibility:visible;pointer-events:auto;transform:translate(var(--bx,0),var(--by,0)) scale(1);transition:opacity .18s var(--pe),transform .22s var(--pe)}
.pbub b{display:block;font-family:"Sora",system-ui,sans-serif;font-size:16px;font-weight:600;letter-spacing:-.01em}
.pbub span{display:block;font-size:13px;color:#4A515D;margin-top:2px;line-height:1.35}
.pbub .btn{width:100%;min-height:44px;margin-top:10px;padding:10px}
.pbub .btn:disabled{opacity:.45}
.pbtail{position:absolute;left:var(--tx,50%);bottom:-6px;width:12px;height:12px;margin-left:-6px;background:#fff;transform:rotate(45deg);border-radius:2px}
/* first open: the path draws in from top to bottom, 40ms apart. Later opens only fade in */
@keyframes pthIn{from{opacity:0;transform:translateY(14px)}}
.pth.draw .pfx{animation:pthIn .4s var(--pe) backwards;animation-delay:calc(var(--d)*40ms)}
.pth.lite .pfx{animation:pthIn .25s var(--pe) backwards}
.pth.draw .ppc{animation:pthIn .4s var(--pe) .5s backwards}
.pu.compact{margin-top:18px;background:none}
.pdots{display:flex;justify-content:center;gap:10px;padding:12px 0 2px}
.pdots i{width:30px;height:30px;border-radius:7px;display:grid;place-items:center;background:linear-gradient(145deg,#2B2F37,#15171C);color:#E4E8EE;box-shadow:0 4px 0 #050608}
.pdots svg{width:16px;height:16px}
.pthempty{display:grid;justify-items:center;text-align:center;padding:72px 32px 0}
.pthempty>img{width:96px;height:96px;opacity:.9}
.pthempty h2{font-family:"Sora",system-ui,sans-serif;font-size:20px;font-weight:600;margin-top:12px}
.pthempty p{font-size:14px;color:var(--mute);margin-top:6px}

/* the node screen */
.psbody{display:flex;flex-direction:column;min-height:100%;padding:16px 20px calc(24px + env(safe-area-inset-bottom))}
.pstop{display:flex;align-items:center;gap:14px}
.pstop .segs{flex:1}
.pscard{flex:1;display:flex;flex-direction:column;padding-top:20px}
.pscard.in{animation:psIn .28s var(--pe)}
@keyframes psIn{from{opacity:0;transform:translateY(10px)}}
.pshead{text-align:center}
.pshead small{display:block;font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--mute)}
.pshead h2{font-family:"Sora",system-ui,sans-serif;font-size:20px;font-weight:600;letter-spacing:-.02em;line-height:1.2;margin-top:6px;text-wrap:balance;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pshead p{font-size:15px;color:#4A515D;margin-top:6px;min-height:22px}
.psbig{flex:1;display:grid;place-content:center;justify-items:center;text-align:center;padding:12px 0}
.psbig b{font-family:"Sora",system-ui,sans-serif;font-weight:300;font-size:92px;line-height:1;letter-spacing:-.04em}
.psbig small{font-size:15px;color:var(--mute);margin-top:8px}
.psdots{display:flex;gap:8px;justify-content:center;margin-top:18px}
.psdots i{width:14px;height:14px;border-radius:50%;background:var(--ink)}
.psdots i.bad{background:var(--coral)}
.pschk{width:112px;height:112px;border-radius:50%;display:grid;place-items:center;background:var(--chrome);color:var(--ink);box-shadow:0 18px 30px -16px rgba(21,23,28,.55),inset 0 0 0 2px rgba(255,255,255,.9);animation:pthPop .45s var(--pe)}
.pschk svg{width:48px;height:48px}
@keyframes pthPop{from{opacity:0;transform:scale(.8)}}
.pswrap{position:relative;margin-top:20px}
.psarrow{position:absolute;inset:0;pointer-events:none;animation:psIn .3s var(--pe)}
.psarrow svg{width:100%;height:100%;display:block}
.psbody .status{min-height:40px;text-align:center}
.rk-psband{margin:auto -20px calc(-24px - env(safe-area-inset-bottom));padding:12px 20px calc(16px + env(safe-area-inset-bottom))}
.psbody .rk-band-row{padding-top:0}
.psbody .btn{min-height:48px}.psbody .rk-band-sq{min-height:0}
.pstop .segs i.ok{background:var(--ink)}
.psbody .xpf{color:var(--ink)}
.psbody .btn:disabled{opacity:.45}
@media (max-width:340px){.psbig b{font-size:76px}.pshead h2{font-size:20px}}
@media (prefers-reduced-motion:reduce){.pn.cur .pnb::after{animation:none;opacity:.85}.pth .pfx,.ppc,.pscard.in,.psarrow,.pschk{animation:none}}

/* the cue that there is more path below */
.pthmorew{position:sticky;bottom:0;z-index:7;height:110px;margin-top:-110px;pointer-events:none;background:linear-gradient(180deg,rgba(233,236,240,0),rgba(233,236,240,.92) 70%)}
.pthmore{position:absolute;left:50%;bottom:16px;margin-left:-62px;width:124px;min-height:44px;display:flex;align-items:center;justify-content:center;gap:6px;border-radius:999px;background:var(--ink);color:#fff;font-size:13px;font-weight:600;box-shadow:0 12px 22px -12px rgba(21,23,28,.7);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .22s var(--pe)}
.pthmore.on{opacity:1;visibility:visible;pointer-events:auto}
.pthmore svg{width:16px;height:16px;animation:pthBob 1.6s ease-in-out infinite}
@keyframes pthBob{50%{transform:translateY(3px)}}
@media (prefers-reduced-motion:reduce){.pthmore svg{animation:none}}
.psbig.withboard{flex:none;padding:10px 0 0}.psbig.withboard b{font-size:64px}
