@media (max-width: 1050px) {
  .desktop-nav {
    gap: 18px;
    font-size: 12px;
  }
  .education-card {
    min-height: 132px;
  }
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .course-detail,
  .lesson-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
  .category-card h3 {
    font-size: 21px;
  }
  .home-hero h1 {
    font-size: 36px;
  }
}
@media (max-width: 760px) {
  body {
    padding-bottom: 76px;
  }
  .brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 82px;
    padding: 12px 15px 8px;
    text-align: center;
  }
  .brand-header::after {
    display: none;
  }
  .brand-header > a {
    gap: 0;
  }
  .brand-header img {
    width: 208px;
    height: 64px;
  }
  .brand-header span {
    font-size: 9px;
  }
  .brand-header > a > span {
    display: none;
  }
  .mobile-menu-icon {
    position: absolute;
    left: 18px;
    display: grid;
    place-items: center;
    color: #fff4ca;
  }
  .mobile-header-actions {
    position: absolute;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 9px;
  }
  .notification-icon {
    position: relative;
    display: grid;
    place-items: center;
    color: #fff4ca;
  }
  .notification-icon b {
    position: absolute;
    top: -7px;
    right: -9px;
    display: grid;
    width: 15px;
    height: 15px;
    place-items: center;
    border-radius: 50%;
    background: #d60a08;
    color: white;
    font-size: 9px;
  }
  .mobile-header-actions > img,
  .header-avatar {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 2px solid #f5d681;
    border-radius: 50%;
    background: #fff1c4;
    color: var(--maroon);
    font:
      700 13px Georgia,
      serif;
    object-fit: cover;
  }
  .identity-strip {
    display: none;
  }
  .identity strong {
    font-size: 18px;
  }
  .identity div span {
    font-size: 12px;
  }
  .identity img,
  .avatar {
    width: 56px;
    height: 56px;
  }
  .auth-actions .button {
    min-height: 45px;
    padding: 8px 25px;
  }
  .desktop-nav {
    display: none;
  }
  .page {
    margin: 10px 8px;
    padding: 20px 16px 35px;
    border-radius: 14px;
    box-shadow:
      inset 0 0 0 2px #f1cf78,
      inset 0 0 0 4px #7b2600,
      0 6px 17px rgba(83, 31, 0, 0.12);
    border: 10px solid transparent;
    border-image-source: url("/images/royal-temple-frame-reference.png");
    border-image-slice: 125;
    border-image-width: 8px;
    border-image-repeat: stretch;
  }
  .page > section {
    margin-top: 28px;
  }
  .home-page {
    padding: 16px 12px 32px;
  }
  .dashboard-home {
    display: block;
  }
  .teacher-page {
    display: block;
  }
  .teacher-side {
    display: none;
  }
  .teacher-top {
    min-height: 180px;
    padding: 16px;
    display: block;
  }
  .teacher-top h1 {
    font-size: 28px;
  }
  .teacher-top p {
    font-size: 13px;
  }
  .teacher-search {
    min-width: 0;
    margin-top: 12px;
  }
  .teacher-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .teacher-stats > div:last-child {
    grid-column: span 2;
  }
  .teacher-grid {
    grid-template-columns: 1fr;
  }
  .teacher-courses article {
    grid-template-columns: 72px 1fr auto;
  }
  .teacher-courses img {
    width: 72px;
    height: 52px;
  }
  .teacher-courses article > button {
    display: none;
  }
  .teacher-bottom {
    grid-template-columns: 1fr;
  }
  .dashboard-sidebar {
    display: none;
  }
  .home-page > section {
    margin-top: 24px;
  }
  h1 {
    font-size: 32px;
  }
  h2 {
    font-size: 26px;
  }
  h3 {
    font-size: 21px;
  }
  .home-page > .home-hero {
    display: block;
    position: relative;
    min-height: 285px;
    background: var(--maroon);
    border: 10px solid transparent;
    border-image-source: url("/images/royal-temple-frame-reference.png");
    border-image-slice: 125;
    border-image-width: 8px;
    border-image-repeat: stretch;
  }
  .dashboard-hero {
    min-height: 245px !important;
  }
  .home-page .home-hero > .home-hero-copy {
    position: absolute;
    z-index: 1;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    padding: 13px 14px;
    border-radius: 15px;
    background: rgba(101, 0, 0, 0.92);
  }
  .home-page .home-hero h1 {
    max-width: none;
    margin: 6px 0;
    font-size: 27px;
  }
  .home-page .home-hero p {
    max-width: none;
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
  }
  .home-page .home-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    object-fit: cover;
  }
  .home-page .home-hero small {
    font-size: 8px;
  }
  .home-page .home-hero .button {
    min-height: 37px;
    margin-top: 9px;
    padding: 7px 12px;
    font-size: 12px;
  }
  .dashboard-welcome {
    min-height: 88px;
    margin-top: 12px;
    padding: 11px;
  }
  .dashboard-avatar {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    font-size: 23px;
  }
  .dashboard-welcome h2 {
    font-size: 20px;
  }
  .dashboard-welcome p {
    font-size: 10px;
    line-height: 1.25;
  }
  .dashboard-welcome .search {
    display: none;
  }
  .dashboard-stat-grid {
    display: none;
  }
  .dashboard-stat-grid > div {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    justify-items: center;
    gap: 3px;
    padding: 8px 4px;
    text-align: center;
  }
  .dashboard-stat-grid svg {
    grid-row: auto;
    width: 17px;
    height: 17px;
  }
  .dashboard-stat-grid strong {
    font-size: 16px;
  }
  .dashboard-stat-grid span {
    font-size: 8px;
  }
  .search {
    gap: 9px;
    margin: 22px 0;
    padding-left: 12px;
  }
  .search input {
    font-size: 14px;
  }
  .search button {
    padding: 9px 12px;
    font-size: 13px;
  }
  .home-search .search {
    min-height: 48px;
    margin-top: 14px;
    border-radius: 15px;
  }
  .home-search .search.compact button {
    width: 40px;
    min-height: 40px;
  }
  .section-heading {
    gap: 10px;
    margin: 25px 0 14px;
  }
  .section-heading h2 {
    font-size: 25px;
  }
  .section-heading a {
    font-size: 12px;
  }
  .education-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .education-card {
    grid-template-columns: 1fr;
    align-content: end;
    gap: 5px;
    min-height: 190px;
    padding: 11px 10px;
    border-radius: 15px;
  }
  .education-art {
    inset: 7px 7px auto;
    width: calc(100% - 14px);
    height: 82px;
    opacity: 1;
    border: 1px solid #9c641c;
    border-radius: 10px;
    object-fit: cover;
    filter: saturate(1.06) contrast(1.04);
  }
  .education-card::after {
    inset: 7px 7px auto;
    height: 82px;
    background: linear-gradient(
      90deg,
      rgba(101, 0, 0, 0.12),
      rgba(101, 0, 0, 0.4)
    );
    border-radius: 10px;
  }
  .education-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }
  .education-card-copy {
    gap: 4px;
  }
  .education-card-copy strong {
    font-size: 15px;
    line-height: 1.1;
  }
  .education-card-copy small {
    font-size: 9px;
    line-height: 1.25;
  }
  .education-arrow {
    display: none;
  }
  .home-highlights {
    display: none;
  }
  .home-highlight {
    justify-content: flex-start;
    padding: 9px 8px;
    border-right: 0;
  }
  .home-highlight:nth-child(odd) {
    border-right: 1px solid var(--border);
  }
  .home-highlight > span {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }
  .home-highlight > span svg {
    width: 17px;
  }
  .home-highlight strong {
    font-size: 11px;
  }
  .home-highlight small {
    font-size: 9px;
  }
  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .course-grid.home-course-row {
    display: flex;
    gap: 10px;
    grid-template-columns: none;
    overflow-x: auto;
    padding: 1px 1px 7px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }
  .home-course-row .course-card {
    flex: 0 0 145px;
    scroll-snap-align: start;
  }
  .home-course-row .course-card-media {
    aspect-ratio: 16 / 10;
  }
  .home-course-row .course-card > div {
    padding: 10px;
  }
  .home-course-row .course-card small {
    display: none;
  }
  .home-course-row .course-card h3 {
    display: -webkit-box;
    margin: 0 0 7px;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .home-course-row .course-card span {
    gap: 4px;
    margin-top: 0;
    font-size: 10px;
  }
  .course-card-media {
    aspect-ratio: 4 / 3;
    padding: 6px;
  }
  .course-card > div {
    padding: 13px;
  }
  .course-card h3 {
    font-size: 19px;
  }
  .course-card small {
    font-size: 8px;
  }
  .course-card p {
    font-size: 12px;
    -webkit-line-clamp: 3;
  }
  .course-card strong {
    font-size: 12px;
    padding: 10px;
  }
  .page-banner {
    min-height: 48px;
    margin: 8px 0 18px;
    padding: 9px 12px;
    border-radius: 12px;
  }
  .page-banner h1 {
    font-size: 17px;
  }
  .page-banner small {
    display: none;
  }
  .category-row,
  .category-grid {
    gap: 13px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .board-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .board-row.columns-3 > .category-card:last-child:nth-child(odd) {
    grid-column: auto;
    width: auto;
    max-width: none;
  }
  .board-row .category-art {
    aspect-ratio: 4 / 3;
    padding: 4px;
  }
  .board-row .category-card {
    border-radius: 13px;
  }
  .board-row .category-card > div:last-child {
    padding: 9px 8px;
  }
  .board-row .category-card h3 {
    margin-bottom: 5px;
    font-size: 13px;
    line-height: 1.12;
  }
  .board-row .category-card span {
    font-size: 9px;
  }
  .board-row .category-card span svg {
    width: 12px;
  }
  .columns-3 > .category-card:last-child:nth-child(odd) {
    grid-column: 1/-1;
    max-width: calc(50% - 7px);
    width: 100%;
    justify-self: center;
  }
  .category-card {
    border-radius: 19px;
  }
  .category-art {
    padding: 6px;
  }
  .category-card > div:last-child {
    padding: 14px 12px;
  }
  .category-card h3 {
    font-size: 19px;
  }
  .category-card span {
    font-size: 11px;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .category-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 11px 12px;
  }
  .category-heading .back {
    grid-column: 1 / -1;
    font-size: 12px;
  }
  .category-heading h1 {
    font-size: 22px;
  }
  .selection-count {
    font-size: 10px;
  }
  .selection-panel-heading,
  .course-preview-heading {
    align-items: flex-end;
    gap: 12px;
  }
  .selection-panel-heading h2,
  .course-preview-heading h2 {
    font-size: 22px;
  }
  .filter-field {
    padding: 9px 10px 0;
  }
  .filter-field select {
    min-height: 44px;
    font-size: 14px;
  }
  .filter-panel,
  .panel {
    padding: 22px 18px;
  }
  .filter-panel h2 {
    font-size: 25px;
  }
  .empty {
    padding: 28px 20px;
  }
  .breadcrumbs {
    font-size: 11px;
    gap: 6px;
    overflow-wrap: anywhere;
  }
  .auth-page {
    display: block;
    margin: 22px 16px;
  }
  .auth-page aside {
    display: none;
  }
  .auth-page > section {
    padding: 25px 22px;
  }
  .auth-page section h1 {
    font-size: 33px;
  }
  .auth-page input {
    min-height: 53px;
  }
  .stat-row strong {
    font-size: 26px;
  }
  .stat-row span {
    font-size: 10px;
  }
  .stat-row > div {
    padding: 15px 8px;
  }
  .continue-card {
    gap: 12px;
    padding: 12px;
  }
  .continue-card img {
    width: 60px;
    height: 60px;
  }
  .continue-card h3 {
    font-size: 18px;
  }
  .continue-card > span {
    font-size: 12px;
  }
  .home-continue-card {
    min-height: 92px;
    gap: 10px;
    padding: 10px;
  }
  .home-continue-card > img {
    width: 70px;
    height: 70px;
  }
  .home-continue-card h3 {
    font-size: 15px;
  }
  .home-continue-card p {
    font-size: 11px;
  }
  .home-continue-card .continue-copy > small {
    font-size: 8px;
  }
  .continue-progress {
    gap: 6px;
    margin-top: 3px;
  }
  .continue-progress span {
    font-size: 9px;
  }
  .continue-action {
    width: 34px;
    height: 34px;
    justify-content: center;
    padding: 0;
    font-size: 0 !important;
  }
  .course-detail,
  .lesson-layout {
    grid-template-columns: 1fr;
  }
  .course-banner {
    display: block;
  }
  .course-banner > img {
    width: 100%;
    height: 190px;
  }
  .course-banner > div {
    padding: 23px;
  }
  .course-banner h1 {
    font-size: 30px;
  }
  .course-sidebar {
    padding: 22px;
  }
  .chapter summary {
    font-size: 14px;
  }
  .chapter summary span {
    float: none;
    display: block;
    margin-top: 8px;
  }
  .lesson-layout h1 {
    font-size: 29px;
  }
  .lesson-row {
    font-size: 14px;
  }
  .resource-actions .button {
    font-size: 13px;
    padding: 10px 14px;
  }
  .lesson-text,
  .prewrap {
    font-size: 17px;
  }
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .member-row {
    display: block;
  }
  .pdf-toolbar {
    gap: 8px;
  }
  .pdf-toolbar button {
    padding: 10px;
  }
  .pdf-canvas {
    padding: 4px;
  }
  .site-footer {
    display: none;
  }
  .profile-learning,
  .live-classes-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .profile-learning .button,
  .live-classes-heading .button {
    width: 100%;
  }
  .live-classes-heading {
    gap: 16px;
    margin-bottom: 22px;
  }
  .live-classes-empty {
    align-items: flex-start;
    gap: 14px;
  }
  .live-classes-icon {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 13px;
  }
  .bottom-nav {
    position: fixed;
    z-index: 40;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 7px 7px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--light);
    box-shadow: 0 -4px 18px #65000008;
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    justify-content: center;
    min-height: 49px;
    color: var(--maroon);
    border-radius: 12px;
    font-size: 10px;
  }
  .bottom-nav a.active {
    background: var(--maroon);
    color: var(--cream);
  }
}
@media (max-width: 350px) {
  .course-grid {
    grid-template-columns: 1fr;
  }
  .category-card h3 {
    font-size: 17px;
  }
  .category-card span {
    font-size: 10px;
  }
  .education-card h3 {
    font-size: 20px;
  }
  .search button {
    padding: 8px;
  }
  .page {
    padding-inline: 12px;
  }
  .home-hero h1 {
    font-size: 29px;
  }
}
@media (max-width: 760px) {
  .royal-home {
    padding-top: 10px;
  }
  .royal-home > .royal-hero {
    min-height: 322px;
  }
  .royal-home .education-section {
    margin-top: 14px;
  }
  .royal-home .education-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .royal-home .education-card {
    grid-template-columns: 92px 1fr auto;
    align-items: center;
    min-height: 98px;
    padding: 7px;
    border: 2px solid #b87a20;
    border-radius: 12px;
    background: #fff6d8;
    box-shadow: 0 2px 0 #6c0000;
  }
  .royal-home .education-art {
    position: relative;
    inset: auto;
    width: 92px;
    height: 78px;
    opacity: 1;
    border-radius: 8px;
  }
  .royal-home .education-card::after {
    display: none;
  }
  .royal-home .education-card-copy {
    padding: 2px 0;
  }
  .royal-home .education-card-copy strong {
    font-size: 17px;
  }
  .royal-home .education-card-copy small {
    font-size: 10px;
  }
  .royal-home .education-icon {
    display: none;
  }
  .royal-home .education-arrow {
    display: grid;
    width: 28px;
    height: 28px;
    padding: 6px;
    border-radius: 50%;
    color: #fff3ce;
    background: #720000;
  }
  .royal-home .home-highlights {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 14px !important;
    border: 1px solid #d7ab53;
    background: #fff6dc;
  }
  .royal-home .home-highlight {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 8px 3px;
    text-align: center;
  }
  .royal-home .home-highlight > span {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
  .royal-home .home-highlight strong {
    font-size: 9px;
  }
  .royal-home .home-highlight small {
    display: none;
  }
  .royal-home .section-heading {
    margin: 17px 0 9px;
    padding-bottom: 4px;
    border-bottom: 1px solid #d2a14a;
  }
  .royal-home .section-heading h2 {
    font-size: 22px;
  }
  .royal-home .section-heading a {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
