@media (max-width: 1260px) {
  main.app-main {
    grid-template-columns: 228px minmax(0, 1fr);
  }

  .stats-grid,
  .teacher-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-split,
  .chat-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .shell-header {
    width: min(calc(100% - 20px), var(--content-max));
    padding: 14px 16px;
    top: 8px;
  }

  .mobile-nav-toggle.icon-button {
    display: inline-flex;
  }

  main.app-main {
    width: min(calc(100% - 20px), var(--content-max));
    grid-template-columns: 1fr;
    position: relative;
  }

  .sidebar {
    position: fixed;
    top: var(--sticky-shell-offset);
    left: 10px;
    width: min(340px, calc(100vw - 20px));
    max-height: calc(100vh - 108px);
    overflow: auto;
    z-index: 82;
    transform: translateX(-112%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-medium), opacity var(--transition-medium);
    order: initial;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 78;
  }

  body.sidebar-open .mobile-sidebar-scrim {
    display: block !important;
  }

  .page-section {
    min-height: auto;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    padding: 28px 24px 8px;
  }

  .auth-hero h2 {
    max-width: 13ch;
  }

  .auth-form-panel {
    margin-top: 0;
    margin-left: 16px;
    margin-right: 16px;
    margin-bottom: 16px;
  }

  .dashboard-grid,
  .student-kpi-grid,
  .teacher-quick-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 {
    grid-column: span 12;
  }

  .two-col,
  .three-col,
  .dual-list,
  .wizard-tabs,
  .wizard-tabs.two,
  .profile-kpis {
    grid-template-columns: 1fr;
  }

  .wizard-action-bar.sticky {
    top: var(--sticky-shell-offset);
  }

  .classlist-modal-panel {
    width: min(100vw - 20px, 1080px);
    padding: 20px;
  }
}

@media (max-width: 720px) {
  .shell-context {
    display: none;
  }

  .shell-brand-title {
    font-size: 1.6rem;
  }

  .shell-header {
    border-radius: 22px;
  }

  .card,
  .modal-panel {
    padding: 18px;
    border-radius: 22px;
  }

  .student-widget,
  .student-hero,
  .hero-banner {
    padding: 18px;
  }

  .dashboard-grid,
  .student-kpi-grid,
  .teacher-quick-grid,
  .stats-grid,
  .profile-kpis,
  .teacher-dashboard-metrics,
  .stats-card-grid,
  .assignment-pipeline-grid,
  .dashboard-panel-stats {
    grid-template-columns: 1fr;
  }


  .matrix-shell {
    border-radius: 18px;
  }

  .matrix-table {
    min-width: 780px;
  }

  .editor-toolbar {
    position: sticky;
    top: 0;
    z-index: 1;
  }

  .chat-thread-form {
    grid-template-columns: 1fr;
  }

  .classlist-modal-heading h3 {
    font-size: 1.45rem;
  }

  .student-item {
    align-items: flex-start;
  }

  .student-item-actions {
    width: 100%;
    justify-content: space-between;
  }

  .drag-pill {
    display: none;
  }
}

@media (max-width: 1180px) {
  .dashboard-hero-grid,
  .stats-layout {
    grid-template-columns: 1fr;
  }

  .teacher-dashboard-metrics,
  .stats-card-grid,
  .assignment-pipeline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


@media (max-width: 980px) {
  .auth-hero-headline {
    gap: 6px;
  }

  .auth-hero h2 {
    max-width: 18ch;
    font-size: clamp(1.9rem, 8vw, 2.8rem);
  }
}

@media (max-width: 720px) {
  .auth-toggle-row button {
    min-height: 50px;
  }

  .auth-hero-copy,
  .auth-footnote {
    max-width: none;
  }
}


@media (max-width: 980px) {
  .assignment-existing-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .editor-toolbar-secondary {
    gap: 6px;
  }

  .toolbar-group-label {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 980px) {
  .assignment-existing-toolbar-grid {
    grid-template-columns: 1fr;
  }

  .editor-ribbon-header {
    align-items: flex-start;
  }

  .editor-ribbon-tabs {
    width: 100%;
  }

  .toolbar-button-tall {
    min-width: 68px;
  }

  .editor-tools-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .table-insert-layout,
  .editor-workspace:has(.editor-outline-panel:not(.hidden)) {
    grid-template-columns: 1fr;
  }

  .editor-outline-panel {
    border-left: 0;
    border-top: 1px solid var(--color-border);
  }
}

@media (max-width: 720px) {
  .ribbon-select-shell {
    min-width: 180px;
  }

  .toolbar-svg-icon {
    width: 24px;
    height: 24px;
  }

  .spanish-characters-shell {
    flex-direction: column;
    align-items: stretch;
  }

  .spanish-divider {
    width: auto;
    height: 1px;
  }
}


@media (max-width: 900px) {
  .modern-color-group {
    grid-template-columns: 1fr;
  }

  .assignment-preload-overlay {
    inset: 14px;
  }
}

@media (max-width: 960px) {
  .profile-summary-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-list-item-actionable {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-list-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* V89 mobile landing page layout */
@media (max-width: 720px) {
  [data-page-content="auth"] {
    min-height: 100svh;
    overflow-x: hidden;
    background-attachment: scroll;
  }

  [data-page-content="auth"]::before {
    inset: 0 auto auto 50%;
    width: 130vw;
    height: 52vh;
    transform: translateX(-50%);
    background-position: center top;
    background-size: cover;
    opacity: .34;
  }

  .auth-shell {
    min-height: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 88px 18px 32px;
  }

  .auth-hero {
    min-height: 58vh;
    justify-content: center;
    padding: 18px 0 24px;
  }

  .auth-hero h2 {
    font-size: clamp(2.4rem, 15vw, 4.6rem);
    line-height: .88;
    letter-spacing: -.08em;
  }

  .auth-form-panel {
    width: 100%;
    max-width: none;
    margin: 0 auto 12px;
    border-radius: 28px;
  }

  .auth-perspective-toggle {
    position: sticky;
    top: 10px;
    z-index: 30;
    width: calc(100vw - 36px);
    margin: 0 auto;
  }
}

/* V90 mobile landing composition */
@media (max-width: 720px) {
  [data-page-content="auth"] {
    min-height: 100svh;
    overflow-x: hidden;
    background: linear-gradient(180deg, #fff 0%, #fff7f5 48%, #ffffff 100%);
  }
  [data-page-content="auth"]::before {
    inset: 0 auto auto 50% !important;
    width: min(112vw, 620px) !important;
    height: 46svh !important;
    transform: translateX(-50%) !important;
    background-position: center top !important;
    background-size: cover !important;
    filter: none !important;
    opacity: .24 !important;
  }
  [data-page-content="auth"]::after {
    display: none !important;
  }
  .auth-shell {
    min-height: auto !important;
    padding: 86px 18px 36px !important;
    gap: 28px !important;
  }
  .auth-hero {
    min-height: 54svh !important;
    justify-content: end !important;
    text-align: center;
    padding: 28px 0 18px !important;
  }
  .auth-hero-copy,
  .auth-footnote {
    margin-inline: auto;
    max-width: 32rem;
  }
  .auth-form-panel {
    margin-top: 0 !important;
    scroll-margin-top: 84px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .16) !important;
  }
  .app-topbar,
  .mobile-nav-toggle,
  [data-mobile-nav-toggle] {
    z-index: 60;
  }
}


/* V91 mobile landing rhythm */
@media (max-width: 720px) {
  [data-page-content="auth"] {
    background: linear-gradient(180deg, #ffffff 0%, #fff8f6 55%, #ffffff 100%) !important;
  }
  .auth-shell {
    gap: clamp(36px, 9svh, 72px) !important;
    padding: 90px 18px 42px !important;
  }
  .auth-hero {
    min-height: auto !important;
    padding: clamp(42px, 12svh, 86px) 0 clamp(32px, 8svh, 64px) !important;
    display: flex !important;
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .auth-kicker,
  .auth-perspective-toggle {
    margin-inline: auto !important;
  }
  .auth-hero h2,
  .auth-hero-headline,
  .auth-hero-copy,
  .auth-footnote {
    margin-inline: auto !important;
    text-align: center !important;
  }
  .auth-hero-copy {
    max-width: 30rem !important;
  }
  .auth-form-panel {
    margin-top: clamp(10px, 4svh, 34px) !important;
  }
}

/* Mobile landing alignment and spacing */
@media (max-width: 720px) {
  .auth-shell {
    align-items: stretch !important;
    gap: clamp(52px, 12svh, 96px) !important;
    padding: 92px 18px 48px !important;
  }

  .auth-hero {
    width: 100%;
    min-height: auto !important;
    padding: clamp(48px, 12svh, 92px) 0 clamp(42px, 10svh, 84px) !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .auth-kicker,
  .auth-perspective-toggle,
  .auth-hero h2,
  .auth-hero-headline,
  .auth-hero-copy,
  .auth-feature-list,
  .auth-footnote {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }

  .auth-feature-list {
    width: min(100%, 34rem);
  }

  .auth-hero-copy {
    max-width: 31rem !important;
    line-height: 1.65 !important;
  }

  .auth-footnote {
    max-width: 30rem !important;
    margin-top: 4px !important;
  }

  .auth-form-panel {
    margin-top: 0 !important;
    position: relative;
  }

  .auth-form-panel::before {
    opacity: .9;
  }
}

/* V93 mobile landing rhythm */
@media (max-width: 720px) {
  .auth-shell {
    gap: clamp(34px, 8svh, 68px) !important;
    padding: 92px 18px 52px !important;
  }

  .auth-hero,
  .auth-hero > .stack-md,
  .auth-hero .stack-sm {
    align-items: center !important;
    justify-items: center !important;
    text-align: center !important;
  }

  .auth-hero {
    padding-bottom: clamp(28px, 7svh, 56px) !important;
  }

  .auth-kicker,
  .auth-perspective-toggle,
  .auth-hero-headline,
  .auth-hero-copy,
  .auth-footnote {
    margin-inline: auto !important;
  }

  .auth-footnote {
    display: block !important;
    max-width: 29rem !important;
    margin-top: clamp(10px, 2svh, 18px) !important;
    color: #64748b !important;
    line-height: 1.7 !important;
  }

  .auth-form-panel {
    margin-top: clamp(8px, 2svh, 20px) !important;
  }
}

@media (max-width: 980px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar.card {
    overflow: auto;
  }

  .sidebar {
    max-height: calc(100dvh - var(--sticky-shell-offset) - 16px);
    overscroll-behavior: contain;
  }

  .student-practice-flyout {
    max-width: 100%;
    box-shadow: none;
  }
}
