/* Classeto v7.2 — responsive off-canvas navigation for authenticated dashboards only.
   Public teacher sites are not affected. */
.classeto-mobile-nav-trigger,
.classeto-mobile-drawer-close,
.classeto-mobile-drawer-overlay { display: none; }

@media (max-width: 800px) {
  .app-shell {
    display: block !important;
    padding-bottom: 0 !important;
    min-height: 100dvh;
  }
  .app-shell .main { min-height: 100dvh; }
  .app-shell .topbar {
    height: 68px;
    min-height: 68px;
    padding-inline: 16px !important;
    background: var(--bg, #080808);
    border-bottom: 1px solid var(--line, #2a2a2a);
    z-index: 25;
  }
  .app-shell .top-left { display: flex; align-items: center; }
  .app-shell .top-left .crumb { display: none !important; }
  .classeto-mobile-nav-trigger {
    display: inline-flex !important;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    border: 1px solid var(--line, #2c2c2c);
    background: var(--panel, #161616);
    color: var(--ink, #f5f5f5);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }
  .classeto-mobile-nav-trigger svg,
  .classeto-mobile-drawer-close svg { width: 23px; height: 23px; }
  .classeto-mobile-nav-trigger:focus-visible,
  .classeto-mobile-drawer-close:focus-visible,
  .app-shell .sidebar .nav a:focus-visible {
    outline: 3px solid var(--teal, #26d5ba) !important;
    outline-offset: 3px;
  }

  .app-shell > .sidebar {
    /* Open FROM THE RIGHT, matching the RTL dashboard. */
    position: fixed !important;
    inset: 0 0 0 auto !important;
    left: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    top: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    width: min(345px, 87vw) !important;
    max-width: 100vw;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 22px 17px 18px !important;
    margin: 0 !important;
    border: 0 !important;
    border-left: 1px solid var(--line, #303030) !important;
    border-radius: 22px 0 0 22px !important;
    background: var(--v6-nav, #080808) !important;
    box-shadow: -12px 0 50px rgba(0,0,0,.5);
    z-index: 1002 !important;
    transform: translate3d(105%, 0, 0);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    pointer-events: none;
    direction: rtl;
  }
  html.classeto-mobile-drawer-open .app-shell > .sidebar {
    transform: translate3d(0,0,0);
    visibility: visible;
    pointer-events: auto;
  }
  html.classeto-mobile-drawer-open,
  html.classeto-mobile-drawer-open body { overflow: hidden !important; }
  .app-shell .sidebar .brand {
    display: flex !important;
    align-items: center;
    min-height: 68px;
    padding: 7px 5px 16px 45px !important;
    margin-bottom: 8px;
  }
  .app-shell .sidebar .brand .brand-wordmark {
    display: block;
    max-width: 182px;
    max-height: 45px;
    width: auto;
    height: auto;
    object-fit: contain;
  }
  .app-shell .sidebar .nav-label {
    display: block !important;
    padding: 10px 13px 13px !important;
    font-size: .77rem !important;
    color: var(--muted, #9e9e9e);
  }
  .app-shell .sidebar .nav {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    gap: 5px !important;
    height: auto !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    flex: 0 0 auto;
  }
  .app-shell .sidebar .nav a,
  .app-shell .sidebar .nav a:nth-child(n+6) {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    text-align: right !important;
    gap: 13px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    padding: 10px 13px !important;
    margin: 0 !important;
    border: 1px solid transparent;
    border-radius: 12px !important;
    font-size: .86rem !important;
    font-weight: 600;
    line-height: 1.5;
    white-space: normal;
    color: var(--muted, #b5b5b5);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .app-shell .sidebar .nav a svg {
    width: 19px !important;
    height: 19px !important;
    flex-shrink: 0;
  }
  .app-shell .sidebar .nav a.active {
    color: var(--teal, #26d5ba) !important;
    background: color-mix(in srgb, var(--teal, #26d5ba) 12%, var(--panel, #161616)) !important;
    border: 1px solid color-mix(in srgb, var(--teal, #26d5ba) 22%, var(--line, #303030)) !important;
  }
  .app-shell .sidebar .mobile-more-toggle,
  .app-shell .sidebar .mobile-more-sheet { display: none !important; }
  .app-shell .sidebar .side-foot {
    display: block !important;
    margin-top: auto !important;
    margin-bottom: 4px;
    padding: 13px;
  }
  .classeto-mobile-drawer-close {
    display: inline-flex !important;
    position: absolute;
    top: 23px;
    left: 17px;
    width: 39px;
    height: 39px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border: 1px solid var(--line, #333);
    background: var(--panel, #171717);
    color: var(--ink, #fff);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }
  .classeto-mobile-drawer-overlay:not([hidden]) {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 1001 !important;
    background: rgba(0,0,0,.67);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
  html[data-theme="light"] .app-shell .topbar { background: #fff; }
  html[data-theme="light"] .app-shell > .sidebar { background: #fff !important; box-shadow: -12px 0 50px rgba(4,20,30,.18); }
  html[data-theme="light"] .classeto-mobile-drawer-close,
  html[data-theme="light"] .classeto-mobile-nav-trigger { background: #f7fafb; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell > .sidebar { transition: none !important; }
}

/* Classeto v7.3: compact, scrollbar-free right drawer (authenticated app only).
   Keep vertical touch-scrolling as an accessibility fallback on short devices. */
@media (max-width: 800px) {
  .app-shell > .sidebar {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;         /* Firefox */
    -ms-overflow-style: none !important;      /* Legacy Edge */
    overscroll-behavior: contain !important;
  }
  .app-shell > .sidebar::-webkit-scrollbar,
  .app-shell > .sidebar .nav::-webkit-scrollbar,
  .app-shell > .sidebar .side-foot::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  .app-shell > .sidebar .nav,
  .app-shell > .sidebar .side-foot {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .app-shell > .sidebar .brand {
    min-height: 55px !important;
    padding-block: 2px 8px !important;
    margin-bottom: 3px !important;
  }
  .app-shell > .sidebar .nav-label {
    padding: 5px 13px 7px !important;
  }
  .app-shell > .sidebar .nav {
    gap: 3px !important;
  }
  .app-shell > .sidebar .nav a {
    min-height: 42px !important;
    padding: 7px 11px !important;
    line-height: 1.35 !important;
  }
  .app-shell > .sidebar .side-foot {
    padding: 10px !important;
  }
  html.classeto-mobile-drawer-open,
  html.classeto-mobile-drawer-open body {
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }
  html.classeto-mobile-drawer-open .classeto-mobile-drawer-overlay {
    touch-action: none;
  }
}
@media (max-width: 800px) and (max-height: 680px) {
  .app-shell > .sidebar {
    padding-top: 12px !important;
    padding-bottom: 10px !important;
  }
  .app-shell > .sidebar .nav a {
    min-height: 39px !important;
    padding: 6px 11px !important;
  }
  .app-shell > .sidebar .side-foot {
    margin-top: 9px !important;
  }
}

/* Classeto v7.4 — transparent mobile header controls and accessible user shortcut.
   Includes v7.2 right drawer + v7.3 scrollbar-free compact layout above.
   Scoped to authenticated app shell; public teacher websites stay unchanged. */
.app-shell .topbar .theme-toggle {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 10px;
  min-height: 44px;
  min-width: 44px;
  width: 44px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink, #fff);
  -webkit-tap-highlight-color: transparent;
}
.app-shell .topbar .theme-toggle:hover,
.app-shell .topbar .theme-toggle:active {
  background: transparent !important;
  border: 0 !important;
  color: var(--teal, #26d5ba);
}
.app-shell .topbar .theme-toggle .theme-toggle-label { display: none !important; }
.app-shell .topbar .theme-toggle svg { width: 23px; height: 23px; }
.app-shell .topbar .classeto-header-user {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border: 0 !important;
  border-radius: 10px;
  color: var(--ink, #fff);
  background: transparent !important;
  text-decoration: none;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}
.app-shell .topbar .classeto-header-user svg { width: 23px; height: 23px; }
.app-shell .topbar .classeto-header-user:hover { color: var(--teal, #26d5ba); }
.app-shell .topbar .theme-toggle:focus-visible,
.app-shell .topbar .classeto-header-user:focus-visible,
.app-shell .topbar .classeto-mobile-nav-trigger:focus-visible {
  outline: 2px solid var(--teal, #26d5ba) !important;
  outline-offset: 2px;
}
@media (max-width: 800px) {
  .app-shell .topbar .classeto-mobile-nav-trigger,
  html[data-theme="light"] .app-shell .topbar .classeto-mobile-nav-trigger {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0 !important;
    color: var(--ink, #fff);
    -webkit-tap-highlight-color: transparent;
  }
  .app-shell .topbar .classeto-mobile-nav-trigger:hover { color: var(--teal, #26d5ba) !important; }
  /* Retain v7.3 scrolling behavior without visible scrollbars. */
  .app-shell > .sidebar { scrollbar-width: none !important; }
  .app-shell > .sidebar::-webkit-scrollbar { display: none !important; }
  /* Keep the main content free of the obsolete fixed bottom-tabbar padding. */
  .app-shell { padding-bottom: 0 !important; }
}
