@media (max-width: 650px), (max-width: 950px) and (max-height: 500px) {
  .site-header .series {
    display: none;
  }

  .academy-nav-toggle,
  .academy-nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid #8bd7c42c;
    border-radius: 10px;
    color: #c9e5da;
    background: #8bd7c409;
    touch-action: manipulation;
  }

  .academy-nav-toggle {
    gap: 9px;
    margin-left: 12px;
    padding: 0 12px;
    font-size: 12px;
    letter-spacing: 0.1em;
  }

  .academy-nav-icon {
    position: relative;
    width: 15px;
    height: 1px;
    background: currentColor;
  }

  .academy-nav-icon::before,
  .academy-nav-icon::after {
    position: absolute;
    left: 0;
    width: 15px;
    height: 1px;
    background: currentColor;
    content: "";
  }

  .academy-nav-icon::before {
    top: -5px;
  }
  .academy-nav-icon::after {
    top: 5px;
  }

  .academy-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: #03090dc9;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    touch-action: none;
  }

  .lesson-sidebar {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1101;
    flex-direction: column;
    width: min(360px, calc(100vw - 36px));
    height: 100vh;
    height: 100dvh;
    padding: 0 14px max(24px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid #8bd7c428;
    background: #0d161b;
    box-shadow: 18px 0 70px #0006;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #35524f transparent;
    visibility: hidden;
    transform: translateX(-102%);
    transition:
      transform 240ms ease,
      visibility 240ms;
  }

  .academy-nav-open .lesson-sidebar {
    visibility: visible;
    transform: translateX(0);
  }

  .academy-nav-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 3;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    margin: 0 -14px;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px 24px;
    border-bottom: 1px solid #263c42;
    background: #0d161b;
  }

  .academy-nav-title {
    color: #d2e5dd;
    font-size: 13px;
    letter-spacing: 0.12em;
  }

  .academy-nav-close {
    font-size: 28px;
    line-height: 1;
    font-weight: 300;
  }

  .lesson-sidebar .academy-home {
    display: flex;
    position: static;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    margin: 8px 0 0;
    padding: 12px 10px 4px;
    color: #d2e5dd;
    background: transparent;
    box-shadow: none;
    font-size: 15px;
    letter-spacing: 1px;
  }

  .academy-home > span {
    color: #819c9b;
    font-size: 9px;
    letter-spacing: 2px;
  }

  .sidebar-label {
    margin: 8px 10px 18px;
    color: #859d9f;
    font-size: 11px;
    line-height: 1.7;
  }

  .course-group {
    margin: 24px 10px 10px;
    color: #9ab4aa;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.14em;
  }

  .course-group:first-child {
    margin-top: 8px;
  }

  .course-menu > a {
    display: flex;
    gap: 12px;
    min-height: 66px;
    padding: 12px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    touch-action: manipulation;
  }

  .course-menu .course-current {
    border-color: #8bd7c42c;
    background: #8bd7c40b;
  }

  .course-number {
    flex: 0 0 18px;
    padding-top: 2px;
    color: #819e9f;
    font:
      11px ui-monospace,
      monospace;
  }

  .course-current .course-number {
    color: #8bd7c4;
  }

  .course-menu small {
    display: block;
    margin-bottom: 5px;
    color: #8ba5a9;
    font-size: 10px;
    line-height: 1.5;
    letter-spacing: 0.04em;
  }

  .course-menu strong {
    display: block;
    color: #bccdcf;
    font-size: 13px;
    line-height: 1.7;
    font-weight: 500;
    overflow-wrap: anywhere;
  }

  .course-current strong {
    color: #ddede6;
  }

  .chapter-menu {
    margin: 10px 4px 18px 25px;
    padding: 0 0 0 13px;
    border-left: 1px solid #2d4549;
  }

  .chapter-menu button {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 44px;
    padding: 8px 2px;
    border: 0;
    color: #9ab0b5;
    background: transparent;
    font-size: 12px;
    line-height: 1.7;
    text-align: left;
    touch-action: manipulation;
  }

  .chapter-menu i {
    flex: 0 0 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #405d61;
  }

  .chapter-menu .visited i {
    background: #688c81;
  }
  .chapter-menu button[aria-current] {
    color: #8bd7c4;
  }
  .chapter-menu button[aria-current] i {
    background: #8bd7c4;
  }

  .lesson-prerequisite {
    display: block;
    margin: 16px 10px 0;
    padding-top: 18px;
    border-top: 1px solid #263c42;
    color: #879ea4;
    font-size: 11px;
    line-height: 1.8;
  }

  .lesson-prerequisite a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .lesson-prerequisite strong {
    display: block;
    margin: 0;
    color: #b8d5c7;
    font-size: 12px;
    font-weight: 400;
  }

  .sidebar-note {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 10px 0;
    padding-top: 16px;
    color: #80999c;
    font-size: 11px;
    line-height: 1.8;
  }

  .note-orbit {
    color: #8bd7c4;
  }

  @media (prefers-reduced-motion: reduce) {
    .lesson-sidebar {
      transition: none;
    }
  }
}
