/* First steps guide (assets/js/first-steps.js): a small card in the
   floating tray that stays on screen on every step's page. On the main
   layout it sits in features.js's tray, left of back to top, the quiz score
   and the Teacher Mode pill; the VR pages give it a tray of its own in the
   same corner. Overlays (search results, dialogs) sit above it and dim it,
   so it steps back while something else is open (principle 9b). */

.fs-tray {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 100;
  max-width: calc(100vw - 2.5rem);
}

.float-tray .fs-guide { order: 4; }

.fs-guide {
  box-sizing: border-box;
  width: min(21rem, calc(100vw - 2.5rem));
  padding: 0.65rem 0.75rem 0.75rem;
  border: 1px solid #CBD5E0;
  border-radius: 14px;
  background: #FFFFFF;
  color: #2D3748;
  box-shadow: 0 6px 24px rgba(15, 20, 25, 0.14);
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: left;
  animation: fs-in 0.2s ease-out;
}
@keyframes fs-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .fs-guide { animation: none; } }

.fs-guide__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.6rem;
}
.fs-guide__home {
  font: 700 0.72rem/1.2 "Inter", system-ui, sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2B6F9B !important;
  text-decoration: none !important;
  white-space: nowrap;
}
.fs-guide__home:hover { text-decoration: underline !important; text-underline-offset: 2px; }
.fs-guide__count { color: #526072; font-size: 0.82rem; white-space: nowrap; }

.fs-guide__dots {
  display: flex;
  gap: 4px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}
.fs-guide__dots > li { margin: 0; padding: 0; }
.fs-guide__dots > li::before { content: none !important; display: none !important; }
.fs-guide__dot {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border: 1px solid #CBD5E0;
  border-radius: 50%;
  background: #FFFFFF;
  color: #526072 !important;
  font: 600 0.7rem/1 "Inter", system-ui, sans-serif;
  text-decoration: none !important;
}
.fs-guide__dot:hover { border-color: #61B0DD; }
.fs-guide__dot--seen { background: #EAF4FA; border-color: #9CC9E3; color: #2B6F9B !important; }
.fs-guide__dot[aria-current] { background: #2B6F9B; border-color: #2B6F9B; color: #FFFFFF !important; }

.fs-guide__end {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  margin-right: -0.2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #526072;
  cursor: pointer;
}
.fs-guide__end:hover { background: #EDF2F7; color: #2D3748; }

.fs-guide__title {
  margin: 0.4rem 0 0.6rem;
  font: 700 0.98rem/1.3 "Inter", system-ui, sans-serif;
  color: #2D3748;
}
.fs-guide__title a { color: #2B6F9B !important; text-decoration: underline !important; text-underline-offset: 2px; }

.fs-guide__nav { display: flex; gap: 0.5rem; }
.fs-guide__btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #CBD5E0;
  border-radius: 8px;
  background: #FFFFFF;
  color: #2B6F9B !important;
  font: 600 0.82rem/1.2 "Inter", system-ui, sans-serif;
  text-decoration: none !important;
  cursor: pointer;
}
.fs-guide__btn:hover { border-color: #61B0DD; background: #EAF4FA; }
.fs-guide__btn--primary { background: #2B6F9B; border-color: #2B6F9B; color: #FFFFFF !important; }
.fs-guide__btn--primary:hover { background: #1F5A80; border-color: #1F5A80; }

.fs-guide a:focus-visible,
.fs-guide button:focus-visible { outline: 2px solid #5093BB; outline-offset: 2px; }

/* Room to scroll the end of a page out from under the guide. */
body.fs-guide-on { padding-bottom: 8.5rem; }

.fs-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 767px) {
  .fs-tray { right: 1rem; bottom: 1rem; max-width: calc(100vw - 2rem); }
  .fs-guide { width: min(21rem, calc(100vw - 2rem)); }
}

[data-theme="dark"] .fs-guide {
  background: #242D3A;
  border-color: #313D4F;
  color: #E2E8F0;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .fs-guide__home { color: #94C5E5 !important; }
[data-theme="dark"] .fs-guide__count { color: #B8C2CE; }
[data-theme="dark"] .fs-guide__title { color: #E2E8F0; }
[data-theme="dark"] .fs-guide__title a { color: #94C5E5 !important; }
[data-theme="dark"] .fs-guide__dot { background: #1A2029; border-color: #3C536B; color: #B8C2CE !important; }
[data-theme="dark"] .fs-guide__dot--seen { background: rgba(148, 197, 229, 0.14); border-color: #4A6A85; color: #94C5E5 !important; }
[data-theme="dark"] .fs-guide__dot[aria-current] { background: #94C5E5; border-color: #94C5E5; color: #0B1522 !important; }
[data-theme="dark"] .fs-guide__end { color: #B8C2CE; }
[data-theme="dark"] .fs-guide__end:hover { background: #313D4F; color: #E2E8F0; }
[data-theme="dark"] .fs-guide__btn { background: #1A2029; border-color: #3C536B; color: #94C5E5 !important; }
[data-theme="dark"] .fs-guide__btn:hover { background: #242D3A; border-color: #61B0DD; }
[data-theme="dark"] .fs-guide__btn--primary { background: #94C5E5; border-color: #94C5E5; color: #0B1522 !important; }
[data-theme="dark"] .fs-guide__btn--primary:hover { background: #B3D7EE; border-color: #B3D7EE; }
