/* Prayogshala lab shell: one calm layout for every lab.
   The 3D view takes the whole screen; panels open as drawers (desktop) or bottom sheets (phone) only when asked. */
:root.lsh{
  --bg:#090e0c; --bg2:#0d1411; --panel:#111916; --panel2:#16201c; --raise:#1c2823; --line:#22302a; --line2:#2d3f37;
  --text:#ecf3ef; --muted:#93a59b; --faint:#64766c;
  --brass:#facc15; --brass2:#fde68a; --leaf:#34d399; --leaf2:#6ee7b7; --teal:#34d399; --copper:#34d399;
  --f-ui:"Geist","Noto Sans Devanagari",system-ui,sans-serif; --f-num:"Geist Mono",ui-monospace,monospace; --f-head:"Bricolage Grotesque","Geist",system-ui,sans-serif;
  --lsh-glass:rgba(13,20,17,.86); --lsh-line:rgba(255,255,255,.08); --lsh-acc:#34d399; --lsh-acc2:#facc15; --lsh-hud:58px; --lsh-tab:0px;
  color-scheme:dark;
}
html.lsh [hidden]{display:none!important}
html.lsh,html.lsh body{height:100%;overflow:hidden!important;background:var(--bg)}
html.lsh body{font-family:var(--f-ui)!important;-webkit-tap-highlight-color:transparent}
html.lsh #app{display:block!important;height:100%!important;min-height:0!important;padding:0!important}

/* the 3D stage fills the screen below the HUD */
html.lsh :is(#stage,#centre){position:fixed!important;left:0!important;right:0!important;top:var(--lsh-hud)!important;bottom:var(--lsh-tab)!important;width:auto!important;height:auto!important;min-height:0!important;z-index:1;border:0!important}

/* HUD */
#lsh-hud{position:fixed;left:0;right:0;top:0;height:var(--lsh-hud);z-index:40;display:flex;align-items:center;gap:10px;padding:0 max(12px,env(safe-area-inset-right,0px)) 0 max(12px,env(safe-area-inset-left,0px));background:linear-gradient(180deg,rgba(9,14,12,.96),rgba(9,14,12,.82));backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-bottom:1px solid var(--lsh-line);font:500 14px/1 var(--f-ui);color:var(--text)}
#lsh-hud a.lsh-back{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:12px;color:var(--text);text-decoration:none;border:1px solid var(--lsh-line);background:rgba(255,255,255,.03);flex:none}
#lsh-hud .lsh-title{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}
#lsh-hud .lsh-title b{font:650 15px/1.1 var(--f-head);letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#lsh-hud .lsh-title span{font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lsh-actions{display:flex;gap:6px;align-items:center}
.lsh-btn{display:inline-flex;align-items:center;gap:7px;height:38px;padding:0 13px;border-radius:12px;border:1px solid var(--lsh-line);background:rgba(255,255,255,.035);color:var(--text);font:500 13px/1 var(--f-ui);cursor:pointer;white-space:nowrap;transition:background .15s,border-color .15s}
.lsh-btn:hover{background:rgba(255,255,255,.07)}
.lsh-btn[aria-pressed="true"]{background:rgba(52,211,153,.14);border-color:rgba(52,211,153,.55);color:#d1fae5}
.lsh-btn svg{width:17px;height:17px;flex:none}
.lsh-btn.icon{width:38px;padding:0;justify-content:center}
.lsh-btn.play{background:var(--lsh-acc);color:#04130c;border-color:var(--lsh-acc);font-weight:650}
:is(.lsh-btn,#lsh-hud a):focus-visible{outline:2px solid var(--lsh-acc2);outline-offset:2px}

/* drawers: the lab's own panels, restyled */
html.lsh .lsh-dr{position:fixed!important;z-index:30!important;display:flex!important;flex-direction:column!important;background:var(--lsh-glass)!important;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);border:1px solid var(--lsh-line)!important;box-shadow:0 18px 50px rgba(0,0,0,.45);overflow:hidden!important;transition:transform .28s cubic-bezier(.2,.8,.2,1),opacity .2s;margin:0!important;width:auto;height:auto;min-height:0!important;max-height:none!important;grid-area:auto!important}
html.lsh .lsh-dr>.lsh-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column}
html.lsh .lsh-dr>.lsh-body>*{flex-shrink:0}
html.lsh .lsh-dr>.lsh-body>:is(.pane,#nav,#pane,#panel,.sec:last-child){flex-shrink:1}
html.lsh .lsh-dr:not(.open){opacity:0;pointer-events:none}
.lsh-dh{display:flex;align-items:center;gap:8px;padding:10px 10px 10px 16px;border-bottom:1px solid var(--lsh-line);flex:none;font:600 13px/1 var(--f-ui);color:var(--text);letter-spacing:.01em}
.lsh-dh span{flex:1}
.lsh-dh .grip{display:none}
.lsh-dh button{width:34px;height:34px;border-radius:10px;border:1px solid var(--lsh-line);background:rgba(255,255,255,.04);color:var(--text);cursor:pointer;font-size:15px}

/* desktop placement */
@media (min-width:900px){
  html.lsh .lsh-dr[data-side="left"]{left:12px!important;top:calc(var(--lsh-hud) + 12px)!important;bottom:12px!important;width:min(340px,30vw)!important;border-radius:18px!important}
  html.lsh .lsh-dr[data-side="right"]{right:12px!important;top:calc(var(--lsh-hud) + 12px)!important;bottom:12px!important;width:min(360px,32vw)!important;border-radius:18px!important}
  html.lsh .lsh-dr[data-side="bottom"]{left:50%!important;bottom:12px!important;width:min(1100px,calc(100vw - 24px))!important;height:min(46vh,460px)!important;border-radius:18px!important;transform:translateX(-50%)}
  html.lsh .lsh-dr[data-side="top"]{left:50%!important;top:calc(var(--lsh-hud) + 10px)!important;width:min(980px,calc(100vw - 24px))!important;max-height:60vh!important;border-radius:18px!important;transform:translateX(-50%)}
  html.lsh .lsh-dr[data-side="left"]:not(.open){transform:translateX(-24px)}
  html.lsh .lsh-dr[data-side="right"]:not(.open){transform:translateX(24px)}
  html.lsh .lsh-dr[data-side="bottom"]:not(.open){transform:translate(-50%,24px)}
  html.lsh .lsh-dr[data-side="top"]:not(.open){transform:translate(-50%,-14px)}
  #lsh-scrim{display:none}
  #lsh-tabs{display:none}
}
/* phone and small tablet: bottom tab bar + bottom sheets */
@media (max-width:899px){
  :root.lsh{--lsh-hud:52px;--lsh-tab:calc(62px + env(safe-area-inset-bottom,0px))}
  #lsh-hud .lsh-actions.main{display:none}
  #lsh-tabs{position:fixed;left:0;right:0;bottom:0;z-index:45;height:var(--lsh-tab);display:flex;justify-content:space-around;gap:2px;padding:6px max(8px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(8px,env(safe-area-inset-left,0px));background:rgba(9,14,12,.97);border-top:1px solid var(--lsh-line)}
  #lsh-tabs .lsh-btn{flex-direction:column;gap:4px;height:50px;padding:0 4px;min-width:0;flex:1;border:0;background:none;font-size:10.5px;color:var(--muted);border-radius:12px}
  #lsh-tabs .lsh-btn[aria-pressed="true"]{color:#a7f3d0;background:rgba(52,211,153,.1)}
  #lsh-tabs .lsh-btn svg{width:21px;height:21px}
  /* camera view chips: one scrolling row instead of a block of buttons */
  html.lsh :is(#views,#viewtags,#viewchips){flex-wrap:nowrap!important;overflow-x:auto!important;max-width:calc(100% - 16px)!important;left:8px!important;top:8px!important;scrollbar-width:none}
  html.lsh :is(#views,#viewtags,#viewchips) :is(button,.tb){flex:none!important;font-size:12px!important;padding:6px 10px!important}
  #lsh-hud .lsh-title span{display:none}
  #lsh-hud .lsh-btn.wide-only{display:none}
  html.lsh .lsh-dr{left:0!important;right:0!important;bottom:var(--lsh-tab)!important;top:auto!important;width:auto!important;height:min(72vh,640px)!important;border-radius:22px 22px 0 0!important;border-bottom:0!important;transform:none}
  html.lsh .lsh-dr:not(.open){transform:translateY(40px)}
  .lsh-dh .grip{display:block;position:absolute;left:50%;top:5px;width:38px;height:4px;border-radius:4px;background:rgba(255,255,255,.18);transform:translateX(-50%)}
  .lsh-dh{position:relative;padding-top:16px}
  #lsh-scrim{position:fixed;inset:0;z-index:25;background:rgba(0,0,0,.35);opacity:0;pointer-events:none;transition:opacity .2s}
  #lsh-scrim.on{opacity:1;pointer-events:auto}
}

/* calmer overlays: notices become small pills; prediction cards become a compact sheet */
html.lsh #toast{position:fixed!important;top:calc(var(--lsh-hud) + 10px)!important;bottom:auto!important;left:50%!important;right:auto!important;transform:translate(-50%,-6px)!important;max-width:min(92vw,480px)!important;width:auto!important;padding:8px 14px!important;border-radius:999px!important;font:500 12.5px/1.35 var(--f-ui)!important;background:rgba(17,25,22,.94)!important;color:var(--text)!important;border:1px solid var(--lsh-line)!important;box-shadow:0 8px 24px rgba(0,0,0,.35)!important;z-index:60!important;text-align:center}
html.lsh #toast.show{transform:translate(-50%,0)!important;opacity:1!important}
html.lsh #toast:not(.show){opacity:0!important;pointer-events:none!important}
html.lsh #poe{position:fixed!important;left:50%!important;right:auto!important;top:auto!important;bottom:calc(var(--lsh-tab) + 12px)!important;transform:translateX(-50%)!important;width:min(560px,calc(100vw - 20px))!important;max-height:48vh!important;overflow:auto!important;border-radius:18px!important;z-index:35!important;background:var(--lsh-glass)!important;backdrop-filter:blur(16px);border:1px solid var(--lsh-line)!important}
html.lsh .modal{z-index:70!important}
@media (max-width:899px){html.lsh .modal{align-items:flex-end!important;padding:0!important}html.lsh .modal .box{border-radius:20px 20px 0 0!important;max-height:86vh!important;width:100%!important}}
/* hide decorative / duplicate overlays unless the student asks for them */
html.lsh-quiet :is(#legend,#physnote,#dragnote,#scalecard,#trackcard,#chip,#topov,#modelchips,#hint.ov,#viewtags){display:none!important}
html.lsh :is(#dockToggle,#dockT){display:none!important}
html.lsh #top :is(h1,.brand){display:none!important}
html.lsh #top{border:0!important;padding:12px 14px!important;gap:10px!important;flex-wrap:wrap!important}
html.lsh #top .spacer{display:none!important}
html.lsh .lsh-dr[data-side="bottom"] :is(#pane,.pane){min-height:0}
@media (prefers-reduced-motion:reduce){html.lsh .lsh-dr{transition:none}}

/* ---------- Guide: coach card, highlight ring, moving pointer, doubt sheet ---------- */
#lsh-hud .lsh-btn.guide{background:var(--lsh-acc);border-color:transparent;color:#04130c;font-weight:600}
#lsh-hud .lsh-btn.guide:hover{background:#6ee7b7}
html.lsh-guiding #lsh-hud .lsh-btn.guide{background:rgba(52,211,153,.16);color:#d1fae5;border-color:rgba(52,211,153,.55)}
#lsh-ring{position:fixed;z-index:55;pointer-events:none;border-radius:14px;border:2px solid var(--lsh-acc2);box-shadow:0 0 0 4000px rgba(0,0,0,.0),0 0 0 6px rgba(250,204,21,.18),0 0 26px rgba(250,204,21,.35);opacity:0;transition:left .35s cubic-bezier(.2,.8,.2,1),top .35s cubic-bezier(.2,.8,.2,1),width .35s,height .35s,opacity .2s}
#lsh-ring.on{opacity:1;animation:lshPulse 1.8s ease-in-out infinite}
@keyframes lshPulse{50%{box-shadow:0 0 0 10px rgba(250,204,21,.08),0 0 34px rgba(250,204,21,.45)}}
#lsh-finger{position:fixed;left:0;top:0;z-index:56;width:28px;height:28px;border-radius:50%;pointer-events:none;background:radial-gradient(circle at 40% 35%,#fff 0 22%,#fde68a 23% 46%,rgba(250,204,21,.25) 47%);box-shadow:0 4px 14px rgba(0,0,0,.5);opacity:0;transition:transform .6s cubic-bezier(.3,.7,.2,1),opacity .25s}
#lsh-finger.on{opacity:1}
#lsh-finger.tap::after{content:"";position:absolute;inset:-10px;border-radius:50%;border:2px solid #fde68a;animation:lshTap .5s ease-out forwards}
@keyframes lshTap{from{transform:scale(.4);opacity:1}to{transform:scale(1.5);opacity:0}}
#lsh-guide{position:fixed;z-index:50;left:50%;bottom:16px;transform:translateX(-50%);width:min(470px,calc(100vw - 24px));max-height:min(62vh,560px);display:flex;flex-direction:column;background:rgba(14,21,18,.94);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(52,211,153,.28);border-radius:22px;box-shadow:0 24px 60px rgba(0,0,0,.55);color:var(--text);font:400 14.5px/1.5 var(--f-ui);animation:lshIn .3s cubic-bezier(.2,.8,.2,1)}
@keyframes lshIn{from{opacity:0;transform:translate(-50%,14px)}to{opacity:1;transform:translate(-50%,0)}}
#lsh-guide .gh{display:flex;align-items:center;gap:8px;padding:12px 12px 8px 16px}
#lsh-guide .gk{font:600 12px/1 var(--f-num);letter-spacing:.04em;text-transform:uppercase;color:var(--lsh-acc)}
#lsh-guide .gn{font:500 12px/1 var(--f-num);color:var(--faint);margin-right:auto}
#lsh-guide .gl{display:flex;border:1px solid var(--lsh-line);border-radius:10px;overflow:hidden}
#lsh-guide .gl button{height:28px;padding:0 9px;border:0;background:none;color:var(--muted);font:600 12px var(--f-ui);cursor:pointer}
#lsh-guide .gl button[aria-pressed="true"]{background:rgba(52,211,153,.18);color:#d1fae5}
#lsh-guide .gx{width:30px;height:30px;border-radius:10px;border:1px solid var(--lsh-line);background:none;color:var(--muted);cursor:pointer}
#lsh-guide .gp{height:3px;margin:0 16px;border-radius:3px;background:rgba(255,255,255,.07);overflow:hidden}
#lsh-guide .gp i{display:block;height:100%;background:linear-gradient(90deg,var(--lsh-acc),var(--lsh-acc2));transition:width .4s}
#lsh-guide .gbody{padding:12px 16px 4px;overflow:auto;min-height:0;flex:1}
#lsh-guide .gt{margin:0;font:600 16.5px/1.4 var(--f-head);letter-spacing:-.01em}
#lsh-guide .gs{margin:8px 0 0;color:var(--muted);font-size:13.5px}
#lsh-guide .gs.small{font-size:12.5px}
#lsh-guide .gs.wait{color:var(--brass2)}
#lsh-guide .gplan{margin:10px 0 0;padding-left:20px;color:var(--muted);font-size:13.5px}
#lsh-guide .gplan li{margin:3px 0}
#lsh-guide .gin{display:flex;flex-direction:column;gap:6px;margin-top:12px;font-size:13px;color:var(--muted)}
#lsh-guide .gi{display:flex;align-items:center;gap:8px}
#lsh-guide .gi input{flex:1;min-width:0;height:44px;padding:0 12px;border-radius:12px;border:1px solid var(--line2);background:var(--bg2);color:var(--text);font:500 17px var(--f-num)}
#lsh-guide .gi input:focus{outline:2px solid var(--lsh-acc);outline-offset:1px}
#lsh-guide .gi b{font:500 14px var(--f-num);color:var(--muted)}
#lsh-guide .gfb{margin:8px 0 0;padding:8px 10px;border-radius:10px;font-size:13.5px;background:rgba(255,255,255,.04)}
#lsh-guide .gfb.good{background:rgba(52,211,153,.12);color:#a7f3d0}
#lsh-guide .gfb.warn{background:rgba(250,204,21,.12);color:#fde68a}
#lsh-guide .gfb.bad{background:rgba(248,113,113,.12);color:#fecaca}
#lsh-guide .gtt{margin:12px 0 6px;font:600 11.5px/1 var(--f-num);letter-spacing:.05em;text-transform:uppercase;color:var(--faint)}
#lsh-guide .gtw{overflow-x:auto;border:1px solid var(--lsh-line);border-radius:12px}
#lsh-guide table{width:100%;border-collapse:collapse;font:500 12.5px/1.3 var(--f-num)}
#lsh-guide th,#lsh-guide td{padding:6px 8px;text-align:left;white-space:nowrap;border-bottom:1px solid var(--lsh-line)}
#lsh-guide th{font:600 11.5px var(--f-ui);color:var(--muted);background:rgba(255,255,255,.03)}
#lsh-guide th small{color:var(--faint);font-weight:500}
#lsh-guide tr:last-child td{border-bottom:0}
#lsh-guide tr.you td{background:rgba(250,204,21,.08);color:#fde68a}
#lsh-guide .gb{display:flex;align-items:center;gap:6px;padding:10px 12px 12px;border-top:1px solid var(--lsh-line);margin-top:8px}
#lsh-guide .g1,#lsh-ask .g1,#lsh-nudge .g1{height:40px;padding:0 18px;border-radius:12px;border:0;background:var(--lsh-acc);color:#04130c;font:600 14px var(--f-ui);cursor:pointer;margin-left:auto}
#lsh-guide .g1:disabled{opacity:.6;cursor:wait}
#lsh-guide .g2{height:40px;padding:0 11px;border-radius:12px;border:1px solid var(--lsh-line);background:rgba(255,255,255,.03);color:var(--text);font:500 13px var(--f-ui);cursor:pointer;white-space:nowrap}
#lsh-guide .g2[data-g="back"]{width:40px;padding:0;font-size:20px}
#lsh-guide .g2:disabled{opacity:.35}
#lsh-guide .g2.on{border-color:rgba(52,211,153,.55);color:#a7f3d0}
#lsh-nudge{position:fixed;z-index:48;left:50%;bottom:calc(var(--lsh-tab) + 16px);transform:translate(-50%,20px);opacity:0;display:flex;align-items:center;gap:10px;padding:8px 8px 8px 16px;border-radius:16px;background:rgba(14,21,18,.95);border:1px solid rgba(52,211,153,.3);box-shadow:0 16px 40px rgba(0,0,0,.5);color:var(--text);font:500 13.5px var(--f-ui);transition:opacity .35s,transform .35s;width:max-content;max-width:calc(100vw - 24px)}
#lsh-nudge.on{opacity:1;transform:translate(-50%,0)}
#lsh-nudge .g1{height:34px;margin:0;padding:0 14px;flex:none}
#lsh-nudge .gx{width:30px;height:30px;border:0;background:none;color:var(--muted);cursor:pointer;flex:none}
#lsh-ask{position:fixed;inset:0;z-index:70;background:rgba(0,0,0,.45);display:flex;align-items:flex-start;justify-content:center;padding:calc(var(--lsh-hud) + 12px) 12px 12px}
#lsh-ask .ak{width:min(560px,100%);max-height:calc(100vh - var(--lsh-hud) - 24px);display:flex;flex-direction:column;background:#0f1714;border:1px solid var(--lsh-line);border-radius:22px;box-shadow:0 30px 70px rgba(0,0,0,.6);color:var(--text);font:400 14.5px/1.55 var(--f-ui);overflow:hidden}
#lsh-ask .akh{display:flex;align-items:center;justify-content:space-between;padding:14px 14px 6px 18px;font:600 17px var(--f-head)}
#lsh-ask .akh button{width:32px;height:32px;border-radius:10px;border:1px solid var(--lsh-line);background:none;color:var(--muted);cursor:pointer}
#lsh-ask .akq{display:flex;align-items:center;gap:8px;margin:6px 14px 8px;height:46px;padding:0 14px;border-radius:14px;border:1px solid var(--line2);background:var(--bg2)}
#lsh-ask .akq svg{width:18px;height:18px;color:var(--muted);flex:none}
#lsh-ask .akq input{flex:1;min-width:0;border:0;background:none;color:var(--text);font:400 15px var(--f-ui);outline:none}
#lsh-ai{display:flex;flex-direction:column;gap:8px;padding:0 14px 8px}
#lsh-ai .g1{margin:0;align-self:flex-start}
#lsh-aans{white-space:pre-wrap;font-size:14px;color:#d1fae5}
#lsh-aans:empty{display:none}
#lsh-alist{overflow:auto;padding:0 14px 14px}
#lsh-alist details{border-bottom:1px solid var(--lsh-line)}
#lsh-alist summary{padding:11px 4px;cursor:pointer;font-weight:500;list-style:none}
#lsh-alist summary::-webkit-details-marker{display:none}
#lsh-alist summary::before{content:"+";display:inline-block;width:18px;color:var(--lsh-acc);font-weight:600}
#lsh-alist details[open] summary::before{content:"−"}
#lsh-alist p{margin:0 0 12px 18px;color:var(--muted);font-size:14px}
@media (max-width:899px){
  #lsh-hud .lsh-btn.guide{height:36px;padding:0 11px}
  #lsh-hud .lsh-title{min-width:0}
  #lsh-guide{top:calc(var(--lsh-hud) + 8px);bottom:auto;max-height:36vh;border-radius:18px;font-size:14px}
  #lsh-guide .gt{font-size:15px}
  #lsh-guide .gbody{padding-top:8px}
  #lsh-guide .gb{padding:8px 10px 10px;margin-top:4px}
  #lsh-guide .g2{padding:0 9px;font-size:12.5px}
  html.lsh-guiding .lsh-dr{max-height:calc(100vh - 36vh - var(--lsh-hud) - var(--lsh-tab) - 28px)!important}
  #lsh-ask{align-items:flex-end;padding:0}
  #lsh-ask .ak{border-radius:22px 22px 0 0;max-height:88vh;padding-bottom:env(safe-area-inset-bottom,0px)}
}
@media (max-width:420px){#lsh-guide .g2[data-g="auto"]{font-size:0;width:40px;padding:0}#lsh-guide .g2[data-g="auto"]::first-letter{font-size:15px}}
@media (prefers-reduced-motion:reduce){#lsh-ring.on{animation:none}#lsh-finger{transition:none}}
#lsh-guide h3,#lsh-guide p,#lsh-guide table,#lsh-ask p{text-transform:none!important;letter-spacing:normal}
#lsh-guide h3.gt{letter-spacing:-.01em;color:var(--text)}
