/* ALLTRACE BY / Учебка — iPhone student shell safe-area and More tiles.
   Scoped to the student role only; no changes to CRM staff shells. */
@media (max-width: 1023.98px) {
  [data-role-shell="student"] > main > header {
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    min-height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    padding: env(safe-area-inset-top, 0px)
      max(16px, env(safe-area-inset-right, 0px)) 0
      max(16px, env(safe-area-inset-left, 0px)) !important;
    align-items: center !important;
    gap: 10px !important;
  }
  [data-role-shell="student"] > main > header > button[aria-label="Открыть меню"] {
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 10px !important;
  }
  [data-role-shell="student"] > main > header > div:last-child {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 54px) !important;
    gap: 4px !important;
    overflow: visible !important;
    justify-content: flex-end !important;
  }
  [data-role-shell="student"] > main > header > div:last-child > a,
  [data-role-shell="student"] > main > header > div:last-child > button {
    flex-shrink: 0 !important;
    min-width: 40px !important;
    min-height: 40px !important;
    display: inline-flex;
    justify-content: center;
    align-items: center;
  }
  [data-role-shell="student"] > main > header > div:last-child > div:last-child {
    padding: 4px !important;
    min-width: 34px;
    flex: 0 0 auto;
  }
  /* Equal-height tiles; prevent unsupported icon labels from leaking as text. */
  body:has(nav[aria-label="Навигация курсанта"])
  div.fixed.inset-0.z-50.flex.flex-col.justify-end > .ui-panel .grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 9px !important;
    align-items: stretch !important;
  }
  body:has(nav[aria-label="Навигация курсанта"])
  div.fixed.inset-0.z-50.flex.flex-col.justify-end > .ui-panel .grid > a {
    box-sizing: border-box;
    min-width: 0 !important;
    min-height: 100px !important;
    padding: 12px 6px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    border-radius: 14px !important;
    text-align: center !important;
  }
  body:has(nav[aria-label="Навигация курсанта"])
  div.fixed.inset-0.z-50.flex.flex-col.justify-end > .ui-panel .grid > a > span.material-symbols-outlined {
    display: block !important;
    font-family: "Material Symbols Outlined", sans-serif !important;
    font-feature-settings: "liga";
    font-variant-ligatures: normal;
    font-size: 27px !important;
    white-space: nowrap;
    overflow: hidden;
    max-width: 32px;
    height: 30px;
    line-height: 30px;
    flex: 0 0 30px;
    text-align: center;
  }
  body:has(nav[aria-label="Навигация курсанта"])
  div.fixed.inset-0.z-50.flex.flex-col.justify-end > .ui-panel .grid > a > span:last-child {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: 12px !important;
    font-weight: 550 !important;
    line-height: 1.25 !important;
    overflow-wrap: break-word;
    overflow: hidden;
    min-height: 29px;
    max-width: 100%;
  }
}
/* iOS installed web-app fallback when safe-area env() resolves to zero. */
@supports (-webkit-touch-callout: none) {
  @media (display-mode: standalone) and (max-width: 1023.98px) {
    [data-role-shell="student"] > main > header {
      padding-top: max(env(safe-area-inset-top, 0px), 54px) !important;
      height: calc(56px + max(env(safe-area-inset-top, 0px), 54px)) !important;
      min-height: calc(56px + max(env(safe-area-inset-top, 0px), 54px)) !important;
    }
  }
}
@media (max-width: 359.98px) {
  body:has(nav[aria-label="Навигация курсанта"])
  div.fixed.inset-0.z-50.flex.flex-col.justify-end > .ui-panel .grid {
    gap: 6px !important;
  }
}
