/* Compact section controls scale with the available phone height. */
html {
  scrollbar-width: thin;
  scrollbar-color: #8c806b transparent;
}
html::-webkit-scrollbar { width: 5px; }
html::-webkit-scrollbar-thumb { background: #8c806b; border-radius: 5px; }
html::-webkit-scrollbar-track { background: transparent; }

/* Keep the existing logo container size, with more breathing room inside. */
html body #main-nav img[src*="jaspen-spiral-logo"],
html body .section-menu-topline img[src*="jaspen-spiral-logo"] {
  box-sizing: border-box;
  padding: 4px;
  object-fit: contain !important;
  background: #000;
}

html body #main-site #education-page a[href*="youtube.com/@jaspentrades"] {
  max-width: 100%;
  box-sizing: border-box;
  justify-content: center;
  white-space: normal;
  text-align: center;
  animation: none !important;
}
html body #main-site #education-page h1 { text-wrap: balance; }

@media (max-width: 900px) {
  :root {
    --mobile-rail-step: clamp(24px, 4.2svh, 34px);
    --mobile-rail-height: calc(7 * var(--mobile-rail-step));
    --mobile-rail-top: max(
      calc(var(--site-nav-clearance, 80px) + 46px),
      calc(50svh - var(--mobile-rail-height) / 2)
    );
  }
  #section-rail {
    top: var(--mobile-rail-top);
    right: 2px;
    width: 24px;
    gap: 0;
    transform: none;
  }
  #section-rail::before { right: 11px; }
  #section-rail a {
    width: 24px;
    height: var(--mobile-rail-step);
    min-height: var(--mobile-rail-step);
    padding: 0;
  }
  #section-rail a::after { right: 9px; width: 5px; height: 5px; }
  #section-menu-toggle {
    top: calc(var(--mobile-rail-top) - 44px);
    right: 0;
    min-width: 28px;
    min-height: 36px;
    padding: 2px 0;
    font-size: .45rem;
    gap: 4px;
  }
  .section-menu-toggle-mark { width: 5px; height: 5px; }
}

@media (max-width: 900px) and (max-height: 480px) {
  :root {
    --mobile-rail-step: 24px;
    --mobile-rail-top: max(48px, calc(50svh - var(--mobile-rail-height) / 2));
  }
}
