/* Учебка CRM — student mobile Mono-style layout; 2026-11-05.
   Fixes translucent "Ещё" sheet and prevents it overlapping lesson cards.
   Pure CSS: no role/API changes, no hidden student information. */
@media (max-width: 1023.98px) {
  [data-role-shell="student"] {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow: hidden;
  }
  [data-role-shell="student"] > main {
    min-width: 0;
    padding-bottom: calc(75px + env(safe-area-inset-bottom)) !important;
  }
  [data-role-shell="student"] > main > div:last-child {
    min-width: 0;
    min-height: 0;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }
  [data-role-shell="student"] > main > div:last-child > div.min-h-screen {
    min-width: 0;
    min-height: 0;
    background: var(--ui-canvas, var(--ui-bg));
  }
  [data-role-shell="student"] > main > div:last-child > div > header {
    min-width: 0;
    padding: 14px 16px 12px !important;
    position: static !important;
  }
  [data-role-shell="student"] > main > div:last-child > div > header > div {
    min-width: 0;
    flex: 1;
  }
  [data-role-shell="student"] > main > div:last-child > div > header h1 {
    font-size: clamp(17px, 4.8vw, 21px) !important;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  [data-role-shell="student"] > main > div:last-child > div > div.space-y-6 {
    padding: 14px 16px 30px !important;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
  }
  [data-role-shell="student"] section {
    min-width: 0;
    max-width: 100%;
    scroll-margin-bottom: 92px;
  }
  [data-role-shell="student"] section.ui-surface-soft {
    border-radius: 18px;
    padding: 17px !important;
    gap: 12px;
    box-shadow: 0 4px 17px rgba(15, 23, 42, .04);
  }
  [data-role-shell="student"] section.ui-surface-soft > div.flex-col {
    min-width: 0;
    flex: 1 1 150px;
  }
  [data-role-shell="student"] section.ui-surface-soft > a {
    flex: 0 0 auto;
    min-height: 46px;
    white-space: nowrap;
  }
  [data-role-shell="student"] section:has(svg[viewBox="0 0 100 100"]) {
    padding-block: 6px;
  }
  [data-role-shell="student"] section:has(svg[viewBox="0 0 100 100"]) > div.relative {
    width: 172px !important;
    height: 172px !important;
  }
  [data-role-shell="student"] section:has(svg[viewBox="0 0 100 100"]) .text-4xl {
    font-size: 30px !important;
  }
  [data-role-shell="student"] section:has(svg[viewBox="0 0 100 100"]) .text-sm {
    font-size: 12px !important;
  }
  [data-role-shell="student"] section.ui-surface {
    border-radius: 16px;
  }
  nav.ui-mobile-nav[aria-label="Навигация курсанта"] {
    z-index: 60 !important;
    position: fixed !important;
    bottom: 0 !important;
    width: 100%;
    max-width: 100vw;
    padding-bottom: env(safe-area-inset-bottom) !important;
    background: var(--ui-surface) !important;
    border-color: var(--ui-border) !important;
    box-shadow: 0 -9px 24px rgba(10, 23, 18, .09);
  }
  nav.ui-mobile-nav[aria-label="Навигация курсанта"] ul {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    height: 64px;
    min-width: 0;
    margin: 0;
    padding: 0 3px;
  }
  nav.ui-mobile-nav[aria-label="Навигация курсанта"] li,
  nav.ui-mobile-nav[aria-label="Навигация курсанта"] li > a,
  nav.ui-mobile-nav[aria-label="Навигация курсанта"] li > button {
    min-width: 0;
    min-height: 44px;
  }
  nav.ui-mobile-nav[aria-label="Навигация курсанта"] span.material-symbols-outlined {
    font-size: 23px;
    line-height: 25px;
    flex-shrink: 0;
  }
  nav.ui-mobile-nav[aria-label="Навигация курсанта"] li > a,
  nav.ui-mobile-nav[aria-label="Навигация курсанта"] li > button {
    font-size: 10px;
    line-height: 14px;
    overflow: hidden;
    border-radius: 10px;
  }
  nav.ui-mobile-nav[aria-label="Навигация курсанта"] li > a[aria-current="page"] {
    color: var(--ui-link, #3da731) !important;
    background: var(--ui-selected, rgba(99,200,51,.08));
  }
  /* This matches only the student More overlay; other dialogs are untouched. */
  body:has(nav[aria-label="Навигация курсанта"])
  div.fixed.inset-0.z-50.flex.flex-col.justify-end:has(> .ui-panel) {
    z-index: 55 !important;
    top: 0;
    bottom: calc(64px + env(safe-area-inset-bottom)) !important;
    background: rgba(10, 19, 16, .56) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
  body:has(nav[aria-label="Навигация курсанта"])
  div.fixed.inset-0.z-50.flex.flex-col.justify-end > .ui-panel {
    display: block !important;
    position: relative;
    flex: 0 1 auto;
    width: 100%;
    min-width: 0;
    max-height: min(72dvh, 650px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--ui-surface) !important;
    color: var(--ui-text) !important;
    opacity: 1 !important;
    border: 1px solid var(--ui-border) !important;
    border-bottom: 0 !important;
    box-shadow: 0 -14px 40px rgba(0, 0, 0, .22);
  }
  body:has(nav[aria-label="Навигация курсанта"])
  div.fixed.inset-0.z-50.flex.flex-col.justify-end > .ui-panel .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }
  body:has(nav[aria-label="Навигация курсанта"])
  div.fixed.inset-0.z-50.flex.flex-col.justify-end > .ui-panel a {
    border-radius: 12px;
    min-width: 0;
    min-height: 78px;
    padding: 12px 4px;
    overflow-wrap: anywhere;
    background: var(--ui-surface-soft, rgba(127,127,127,.07));
  }
}
@media (max-width: 360px) {
  [data-role-shell="student"] section.ui-surface-soft {
    flex-wrap: wrap;
  }
  [data-role-shell="student"] section.ui-surface-soft > a {
    margin-left: auto;
  }
  nav.ui-mobile-nav[aria-label="Навигация курсанта"] li > a,
  nav.ui-mobile-nav[aria-label="Навигация курсанта"] li > button {
    font-size: 9px;
  }
}
/* Fallback for deployments whose CSS theme does not declare --ui-surface. */
@media (max-width: 1023.98px) {
  body:has(nav[aria-label="Навигация курсанта"])
  div.fixed.inset-0.z-50.flex.flex-col.justify-end > .ui-panel {
    background-color: #ffffff !important;
    color: #18232b !important;
  }
  html[data-theme="dark"] body:has(nav[aria-label="Навигация курсанта"])
  div.fixed.inset-0.z-50.flex.flex-col.justify-end > .ui-panel {
    background-color: #121720 !important;
    color: #f2f5f8 !important;
  }
}
