.neo-update-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 380;
  width: min(360px, calc(100vw - 36px));
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.neo-update-toast__eyebrow {
  color: #4f78aa;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.neo-update-toast__title {
  color: #173150;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
}

.neo-update-toast__message,
.neo-update-toast__meta {
  color: #5f718f;
  font-size: 12px;
  line-height: 1.45;
}

.neo-update-toast__progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3fb;
}

.neo-update-toast__progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #5ea5ff 0%, #173150 100%);
}

.neo-update-toast__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.neo-update-toast__actions .primary-button,
.neo-update-toast__actions .secondary-button {
  width: auto;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  box-shadow: none;
}

.neo-update-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #dfe9f5;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.neo-update-card__summary,
.neo-update-card__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.neo-update-card__version-group,
.neo-update-card__meta-item {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid #e1e8f3;
  border-radius: 12px;
  background: #ffffff;
}

.neo-update-card__label,
.neo-update-card__meta-item span {
  color: #6281a4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.neo-update-card__value,
.neo-update-card__meta-item strong,
.neo-update-card__badge {
  color: #173150;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.neo-update-card__message,
.neo-update-card__notes {
  color: #5f718f;
  font-size: 12px;
  line-height: 1.5;
}

.neo-update-card__notes {
  padding: 10px;
  border: 1px solid #e1e8f3;
  border-radius: 12px;
  background: #ffffff;
  white-space: pre-wrap;
}

.neo-update-card__progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3fb;
}

.neo-update-card__progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #5ea5ff 0%, #173150 100%);
}

.neo-update-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.neo-update-card__actions .primary-button,
.neo-update-card__actions .secondary-button {
  width: auto;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  box-shadow: none;
}

body.student-profile-page .neo-update-card,
body.teacher-profile-page .neo-update-card,
body.admin-profile-page .neo-update-card {
  padding: 9px;
}

body.student-profile-page .neo-update-card__value,
body.student-profile-page .neo-update-card__badge,
body.teacher-profile-page .neo-update-card__value,
body.teacher-profile-page .neo-update-card__badge,
body.admin-profile-page .neo-update-card__value,
body.admin-profile-page .neo-update-card__badge {
  font-size: 12px;
}

@media (max-width: 900px) {
  .neo-update-card__summary,
  .neo-update-card__meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body.student-profile-page .app-shell,
  body.teacher-profile-page .app-shell {
    width: 100%;
    max-width: 100%;
    padding:
      max(10px, var(--safe-top))
      calc(12px + var(--safe-right))
      calc(18px + var(--safe-bottom))
      calc(12px + var(--safe-left)) !important;
  }

  body.student-profile-page #studentProfileScreen,
  body.teacher-profile-page #teacherProfileScreen {
    gap: 10px !important;
  }

  body.student-profile-page .dashboard-topbar,
  body.teacher-profile-page .dashboard-topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 12px;
    overflow: visible;
    position: relative;
    z-index: 3;
    isolation: isolate;
  }

  body.student-profile-page .user-chip,
  body.teacher-profile-page .teacher-profile-user-chip {
    order: 1;
    width: 100%;
    min-width: 0;
    display: grid;
    gap: 4px;
    justify-items: start;
    align-items: start;
  }

  body.student-profile-page #studentProfilePageUserName {
    display: block;
    width: 100%;
    color: #ffffff;
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  body.student-profile-page .user-chip__meta,
  body.teacher-profile-page .user-chip__meta {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    white-space: normal;
  }

  body.student-profile-page #studentProfilePageUserRole,
  body.teacher-profile-page #teacherProfilePageUserRole {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 12px;
    line-height: 1;
  }

  body.teacher-profile-page .teacher-profile-user-name {
    width: 100%;
    color: #ffffff;
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.student-profile-page #studentProfilePageUserEmail {
    display: inline;
    width: 100%;
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.student-profile-page .student-profile-tabs,
  body.teacher-profile-page .teacher-profile-tabs {
    order: 2;
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    padding: 2px 0 2px 1px;
    position: relative;
    z-index: 2;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  body.student-profile-page .student-profile-tabs::-webkit-scrollbar,
  body.teacher-profile-page .teacher-profile-tabs::-webkit-scrollbar {
    display: none;
  }

  body.student-profile-page .toolbar-actions,
  body.teacher-profile-page .toolbar-actions {
    order: 3;
    width: 100%;
    height: auto;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 2;
  }

  body.student-profile-page .toolbar-actions > *,
  body.teacher-profile-page .toolbar-actions > * {
    flex: 0 0 auto;
    width: auto;
    min-width: 86px;
    max-width: 100%;
    margin: 0;
  }

  body.student-profile-page .toolbar-actions .secondary-button,
  body.teacher-profile-page .toolbar-actions .secondary-button {
    width: auto;
    min-width: 86px;
    min-height: 40px;
    padding: 0 12px;
    font-size: 12px;
  }

  body.student-profile-page .student-topbar-button,
  body.teacher-profile-page .teacher-topbar-button {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    height: 44px;
    min-height: 44px;
    padding: 0 14px;
    gap: 8px;
    position: relative;
    z-index: 2;
  }

  body.student-profile-page .student-topbar-button__icon,
  body.student-profile-page .student-topbar-button__icon svg,
  body.teacher-profile-page .teacher-topbar-button__icon,
  body.teacher-profile-page .teacher-topbar-button__icon svg {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  body.student-profile-page .student-topbar-button__label,
  body.teacher-profile-page .teacher-topbar-button__label {
    display: inline;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
  }

  body.student-profile-page .student-profile-status,
  body.teacher-profile-page .teacher-profile-status {
    width: 100%;
    margin: 0 !important;
  }

  body.student-profile-page .student-profile-root,
  body.teacher-profile-page .teacher-profile-root,
  body.student-profile-page #studentProfileContent,
  body.teacher-profile-page #teacherProfileContent {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 !important;
    position: relative;
    z-index: 1;
  }

  body.student-profile-page .student-profile-root,
  body.teacher-profile-page .teacher-profile-root {
    gap: 10px !important;
  }

  body.student-profile-page #studentProfileContent,
  body.teacher-profile-page #teacherProfileContent {
    gap: 10px;
  }

  body.student-profile-page .student-profile-slot,
  body.teacher-profile-page .teacher-profile-slot,
  body.student-profile-page .student-profile-panel,
  body.teacher-profile-page .teacher-profile-panel,
  body.student-profile-page .neo-update-card,
  body.teacher-profile-page .neo-update-card,
  body.admin-profile-page .admin-profile-subsection,
  body.admin-profile-page .admin-profile-editor,
  body.admin-profile-page .admin-profile-metrics-grid,
  body.admin-profile-page .admin-profile-metrics-grid--compact,
  body.admin-profile-page .admin-profile-split,
  body.admin-profile-page .admin-profile-split--users {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  body.student-profile-page .app-shell,
  body.teacher-profile-page .app-shell {
    padding:
      max(8px, var(--safe-top))
      calc(10px + var(--safe-right))
      calc(16px + var(--safe-bottom))
      calc(10px + var(--safe-left)) !important;
  }

  body.student-profile-page #studentProfileScreen,
  body.teacher-profile-page #teacherProfileScreen {
    gap: 8px !important;
  }

  body.student-profile-page .dashboard-topbar,
  body.teacher-profile-page .dashboard-topbar {
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
  }

  body.student-profile-page .user-chip,
  body.teacher-profile-page .teacher-profile-user-chip {
    justify-items: start;
  }

  body.student-profile-page .student-profile-tabs,
  body.teacher-profile-page .teacher-profile-tabs {
    gap: 6px;
  }

  body.student-profile-page .student-topbar-button,
  body.teacher-profile-page .teacher-topbar-button {
    height: 42px;
    min-height: 42px;
    padding: 0 12px;
    gap: 6px;
  }

  body.student-profile-page .student-topbar-button__icon,
  body.student-profile-page .student-topbar-button__icon svg,
  body.teacher-profile-page .teacher-topbar-button__icon,
  body.teacher-profile-page .teacher-topbar-button__icon svg {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  body.student-profile-page .student-topbar-button__label,
  body.teacher-profile-page .teacher-topbar-button__label {
    font-size: 11px;
  }

  body.student-profile-page .toolbar-actions,
  body.teacher-profile-page .toolbar-actions {
    gap: 6px;
  }

  body.student-profile-page .toolbar-actions > *,
  body.teacher-profile-page .toolbar-actions > * {
    min-width: 80px;
  }

  body.student-profile-page .toolbar-actions .secondary-button,
  body.teacher-profile-page .toolbar-actions .secondary-button {
    min-width: 80px;
    min-height: 38px;
    padding: 0 10px;
    font-size: 11px;
  }

  body.student-profile-page .student-profile-root,
  body.teacher-profile-page .teacher-profile-root,
  body.student-profile-page #studentProfileContent,
  body.teacher-profile-page #teacherProfileContent {
    gap: 8px !important;
  }
}
