/* 🎓 shared Learn chrome — the exercise bar, the go-menu and the generic
   kiosk rules, linked by every tool page that hosts exercises (the sphere
   and the planisphere). Tool-specific kiosk extras — ids only one page
   owns, rail-button placement — stay in that page's own sheet, loaded
   after this one so its offsets win. */

/* kiosk mode: while an exercise runs (body.learning) every control leaves
   the screen except the few the exercise whitelists — the endless toggles
   are the engine's, the lesson keeps only its required knobs. Opt-ins:
   .lpanel (some panel sections stay), .lzoom (#viewCtl), .lmag (#magBar) */
body.learning #iconBar, body.learning #iconTip, body.learning #mini,
body.learning #snapQuick, body.learning #snapBtn, body.learning #recBtn,
body.learning #tourLib, body.learning #tourBar,
body.learning #orreryBtn, body.learning #orrery,
body.learning #homeBtn, body.learning #fps,
body.learning #learnBtn, body.learning #learnGo { display: none; }
body.learning:not(.lzoom) #viewCtl { display: none; }
body.learning:not(.lmag) #magBar { display: none; }
body.learning:not(.lpanel) #panel { display: none; }
body.learning #panelBody > .grp:not(.learnKeep) { display: none; }
body.learning #panel footer, body.learning #collapseBtn { display: none; }

/* the exercise bar: parks where the control panel sits; when whitelisted
   panel sections stay on screen it steps left beside them */
#learnBar {
  position: fixed; top: 14px; right: 14px; z-index: 40;
  width: 404px; max-height: calc(100vh - 28px);
  overflow-y: auto; scrollbar-width: thin;
  background: var(--panel-bg); border: 1px solid var(--panel-border);
  border-radius: 16px; padding: 12px 14px 10px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0,0,0,.55);
}
#learnBar[hidden] { display: none; }
body.lpanel #learnBar { right: 316px; }
#learnHead { display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim); }
#learnHead b { color: var(--text); font-weight: 600; }
#learnHead .sp { flex: 1; }
#learnModT { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#learnHead button, #learnCtl button {
  background: none; border: 1px solid var(--panel-border); color: var(--text-dim);
  border-radius: 7px; min-width: 26px; height: 24px; cursor: pointer; font-size: 12px;
  padding: 0 9px;
}
#learnHead button:hover, #learnCtl button:hover { color: var(--text); background: rgba(255,255,255,.06); }
#learnCtl button.accent { color: var(--accent); border-color: rgba(122,162,255,.4); }
#learnCtl { display: flex; gap: 6px; margin-top: 10px; }
#learnCtl .accent { flex: 1; }
#learnStep { font-size: 11.5px; color: var(--text-dim); margin: 7px 2px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the certificate constellation: one star per exercise, lit as it's earned */
#learnCert { margin: 7px 0 2px; border-radius: 10px;
  border: 1px solid rgba(140, 160, 220, 0.12);
  background: radial-gradient(ellipse at 50% 60%, rgba(24, 32, 58, 0.55), rgba(8, 12, 24, 0.65)); }
#learnCert canvas { display: block; width: 100%; height: 92px; cursor: pointer; }
/* the nudge pill: a hint offered, never forced */
#learnNudge { display: block; width: 100%; margin: 8px 0 2px; padding: 6px 10px;
  border-radius: 9px; border: 1px dashed rgba(122,162,255,.5);
  background: rgba(122,162,255,.08); color: var(--accent);
  font-size: 11.5px; text-align: left; cursor: pointer;
  animation: tryPulse 1.6s ease-in-out infinite; }
#learnNudge:hover { background: rgba(122,162,255,.16); }
#learnNudge[hidden] { display: none; }
#learnBrief { font-size: 13px; line-height: 1.55; color: var(--text); margin: 9px 2px 4px; }
#learnLive {
  margin: 6px 2px 2px; font-size: 11.5px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
#learnLive[hidden] { display: none; }
/* the estimate row: one number is the whole answer */
#learnEst { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; }
#learnEst[hidden] { display: none; }
#learnEstIn {
  flex: 1; min-width: 0; padding: 7px 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px; color: var(--text); font-size: 13px; outline: none;
  font-variant-numeric: tabular-nums;
}
#learnEstIn:focus { border-color: rgba(122, 162, 255, 0.5); }
#learnEstUnit { color: var(--text-dim); font-size: 12.5px; }
/* the hint pulses gently, tour-try style; its numbers tick live */
#learnHint {
  margin: 8px 0 2px; padding: 6px 10px; border-radius: 9px;
  border: 1px dashed rgba(122,162,255,.5); background: rgba(122,162,255,.08);
  color: var(--accent); font-size: 11.5px; line-height: 1.4;
  animation: tryPulse 1.6s ease-in-out infinite;
}
#learnHint[hidden] { display: none; }
#learnFb { margin: 8px 0 2px; padding: 7px 10px; border-radius: 9px;
  border: 1px solid rgba(230, 150, 130, 0.35); background: rgba(230, 150, 130, 0.07);
  font-size: 11.5px; line-height: 1.5; }
#learnFb[hidden] { display: none; }
#learnFb .lfb-head { color: var(--text); margin-bottom: 3px; }
/* 🧭 a trap fired: the author recognized this wrong turn — warm, specific */
#learnFb .lfb-trap { color: #ffd68c; margin-bottom: 3px; line-height: 1.5; }
#learnFb .lfb-no { color: #e8a898; }
#learnFb .lfb-ok { color: #86e2d0; }
#learnWin { margin: 8px 0 2px; padding: 7px 10px; border-radius: 9px;
  border: 1px solid rgba(78,200,180,.5); background: rgba(78,200,180,.1);
  color: #86e2d0; font-size: 12.5px; line-height: 1.5; }
#learnWin[hidden] { display: none; }
#learnWin .lw-q { color: #d6e4ff; }
#learnWin .lw-b { color: #ffd68c; margin-top: 3px; }
#learnWin .lw-p { color: var(--text-dim); font-size: 11.5px; margin-top: 3px; }
#learnWin .lw-r { color: #86e2d0; margin-top: 3px; }
#learnWin .lw-x { margin-top: 6px; }
#learnChoices { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 2px; }
#learnChoices[hidden] { display: none; }
#learnChoices button {
  text-align: left; padding: 7px 11px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--panel-border); background: rgba(255,255,255,.04);
  color: var(--text); font-size: 12.5px; line-height: 1.4;
}
#learnChoices button:hover { border-color: rgba(122, 162, 255, 0.5); }
#learnChoices button.wrong { border-color: rgba(230, 130, 120, 0.6);
  background: rgba(230, 130, 120, 0.08); color: #e8a898; }
#learnChoices button.right { border-color: rgba(78, 200, 180, 0.6);
  background: rgba(78, 200, 180, 0.1); color: #86e2d0; }
#learnChoices button:disabled { cursor: default; opacity: .8; }
/* the order list: events to rank, earliest on top — ▲▼ while the call is
   open, each event's real time stamped on once the film has shown it */
#learnOrder { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 2px; }
#learnOrder[hidden] { display: none; }
#learnOrder .lo-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 9px; border-radius: 9px;
  border: 1px solid var(--panel-border); background: rgba(255,255,255,.04);
  color: var(--text); font-size: 12.5px; line-height: 1.35;
  transition: border-color .5s, background .5s;
}
#learnOrder .lo-n { flex: none; width: 13px; color: var(--text-dim); font-size: 11px;
  font-variant-numeric: tabular-nums; text-align: right; }
#learnOrder .lo-t { flex: 1; min-width: 0; }
#learnOrder .lo-s { flex: none; color: #ffd68c; font-size: 11.5px; font-variant-numeric: tabular-nums;
  white-space: nowrap; animation: loStamp .7s ease-out; }
#learnOrder .lo-row.stamped { border-color: rgba(255, 214, 140, 0.32); background: rgba(255, 214, 140, 0.05); }
#learnOrder button {
  flex: none; width: 24px; height: 22px; padding: 0; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--panel-border); background: rgba(255,255,255,.05);
  color: var(--text-dim); font-size: 9.5px; line-height: 1;
}
#learnOrder button:hover:not(:disabled) { border-color: rgba(122, 162, 255, 0.5); color: var(--accent); }
#learnOrder button:disabled { opacity: .28; cursor: default; }
@keyframes loStamp { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }
/* the reveal is running: the controls are away, the sky has the floor */
#learnFilm { margin: 8px 0 2px; padding: 6px 10px; border-radius: 9px;
  border: 1px solid rgba(255, 214, 140, 0.3); background: rgba(255, 214, 140, 0.06);
  color: #ffd68c; font-size: 11.5px; line-height: 1.45; }
#learnFilm[hidden] { display: none; }
/* …and it takes no clicks or drags meanwhile — a forecast's marker
   stays where it was called */
body.lfilm #sky { pointer-events: none; }

/* (the tryPulse keyframes the nudge and hint ride live in style.css,
   which every tool page loads before this sheet) */

/* 🎓 the go-menu: the library moved to the /learn portal — this little
   drop offers just "continue" and the way there. Pages override `right`
   to sit under their own rail button (the planisphere's is at 532). */
#learnGo {
  position: fixed; top: 58px; right: 532px; z-index: 45;
  width: 264px; padding: 6px;
  background: var(--panel-bg); border: 1px solid var(--panel-border);
  border-radius: 12px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0,0,0,.55);
}
#learnGo[hidden] { display: none; }
#learnGo a, #learnGo button {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 8px 10px; border-radius: 9px; border: 0; background: none;
  color: var(--text); text-decoration: none; font-size: 12.5px; line-height: 1.35;
}
#learnGo a:hover, #learnGo button:hover { background: rgba(122, 162, 255, 0.12); }
#learnGo b { display: block; font-weight: 600; }
#learnGo span { display: block; color: var(--text-dim); font-size: 11px; margin-top: 2px; }

/* ⏯ the resume pill: a reload interrupted an exercise — the sky is already
   restored; this quiet drop offers the way back in (top center, clear of
   both tools' right-hand panels) */
#learnResume {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 39; display: flex; align-items: stretch; overflow: hidden;
  background: var(--panel-bg); border: 1px solid rgba(122, 162, 255, 0.4);
  border-radius: 12px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
#learnResume button {
  background: none; border: 0; color: var(--text); cursor: pointer;
  text-align: left; padding: 9px 14px; font-size: 12.5px; line-height: 1.35;
}
#learnResume button:hover { background: rgba(122, 162, 255, 0.1); }
#learnResume b { display: block; font-weight: 600; }
#learnResume span { display: block; color: var(--text-dim); font-size: 11px; margin-top: 2px; }
#learnResume .lrX { border-left: 1px solid var(--panel-border); color: var(--text-dim); padding: 0 11px; }
