.lms-to-top {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #ffe29a;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff1a8, #ffce54 46%, #e09a22);
  color: #1c1408;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .7);
  font: 700 13px/1 "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  letter-spacing: .01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lms-to-top[hidden] { display: none !important; }
body.locked .lms-to-top,
body:has(.modal-bg.show) .lms-to-top { display: none !important; }
.lms-to-top svg { width: 16px; height: 16px; flex-shrink: 0; }
.lms-to-top:hover { filter: brightness(1.05); }
.lms-to-top:focus-visible { outline: 3px solid #fff4af; outline-offset: 3px; }
@media (max-width: 900px) {
  body:has(.mobile-bottom-nav:not(.is-scroll-hidden)) .lms-to-top,
  body:has(nav.dock) .lms-to-top {
    bottom: 92px;
  }
}
@media (max-width: 1199.98px) {
  /* Icon-only: the wide "Top" label covered card text on phones and tablets. */
  .lms-to-top {
    right: 12px;
    bottom: 16px;
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    gap: 0;
  }
  .lms-to-top span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lms-to-top { transition: none; }
}
@media print {
  .lms-to-top { display: none !important; }
}
