:root {
  --glsp-mobile-font-base: 0.9375rem;
  --glsp-mobile-font-small: 0.8125rem;
  --glsp-mobile-font-tiny: 0.75rem;
}

.topbar,
.topbar .topbar-main-row,
.topbar .topbar-right,
.topbar .topbar-context-row,
.topbar .dropdown,
.topbar .dropdown-menu,
.topbar .dropdown-menu-end {
  overflow: visible;
}

.topbar .dropdown-menu {
  z-index: 1360;
}

.content .table-responsive,
.content .glsp-list-table-wrap,
.glsp-list-shell .table-responsive {
  overflow-x: auto;
  overflow-y: visible;
}

.glsp-list-shell .table td,
.glsp-list-shell .table th,
.glsp-list-value,
.app-list-card,
.app-tile-text {
  overflow-wrap: anywhere;
}

.glsp-list-shell .table td.text-nowrap,
.glsp-list-shell .table th.text-nowrap {
  white-space: nowrap;
}

.glsp-list-shell .table-actions,
.glsp-list-shell .actions,
.glsp-list-cards .actions {
  gap: 0.375rem;
  flex-wrap: wrap;
}

.glsp-list-shell .table-actions .btn-icon-action,
.glsp-list-shell .actions .btn-icon-action,
.glsp-list-cards .actions .btn-icon-action,
.glsp-list-shell .table-actions .btn-icon,
.glsp-list-shell .actions .btn-icon,
.glsp-list-cards .actions .btn-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.glsp-list-shell .table-actions .btn,
.glsp-list-shell .actions .btn,
.glsp-list-cards .actions .btn {
  min-height: 32px;
}

.glsp-list-footer {
  gap: 0.75rem;
}

.glsp-pagination {
  flex-wrap: wrap;
  row-gap: 0.25rem;
}

.glsp-pager-nav {
  width: 100%;
}

.app-mobile-header,
.app-mobile-actions,
.app-mobile-actions .dropdown {
  overflow: visible;
}

.app-mobile-header .dropdown-menu {
  z-index: 1400;
}

.app-mobile-nav {
  --app-nav-item-height: 60px;
}

.app-nav-link {
  min-height: var(--app-nav-item-height);
}

.app-nav-link span {
  width: 100%;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 991.98px) {
  .topbar .topbar-right {
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .topbar .topbar-right .glsp-scope-selector {
    min-width: 0;
    margin-left: auto;
  }

  .topbar .topbar-right .glsp-scope-badge {
    max-width: min(46vw, 220px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 767.98px) {
  .content,
  .app-mobile-content {
    font-size: var(--glsp-mobile-font-base);
  }

  .content .page-title {
    font-size: 1rem;
    line-height: 1.2;
  }

  .content h2.h5,
  .content h2.h6,
  .content .card-title,
  .glsp-list-shell h2.h6,
  .glsp-list-shell .table td,
  .glsp-list-shell .table th {
    font-size: 0.875rem;
  }

  .content .form-label,
  .content .btn,
  .content .badge,
  .content .small,
  .glsp-list-label,
  .glsp-page-size {
    font-size: var(--glsp-mobile-font-small);
  }

  .glsp-list-value {
    font-size: 0.875rem;
    line-height: 1.3;
  }

  .glsp-list-row {
    grid-template-columns: minmax(84px, 38%) 1fr;
  }

  .glsp-list-shell .table thead th {
    font-size: 0.72rem;
  }

  .glsp-list-shell .table-actions,
  .glsp-list-shell .actions,
  .glsp-list-cards .actions {
    justify-content: flex-start;
  }

  .glsp-list-footer {
    justify-content: center;
  }

  .glsp-page-size {
    width: 100%;
    justify-content: center;
  }

  .glsp-pagination .glsp-page-link {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border-radius: 9px;
    font-size: 0.78rem;
  }

  body.logia-mobile-host .content {
    padding-bottom: max(
      calc(var(--logia-bottom-nav-height, 86px) + env(safe-area-inset-bottom) + 1rem),
      6rem
    );
  }

  .app-mobile-content {
    padding-bottom: max(
      calc(var(--app-bottom-nav-height, 82px) + env(safe-area-inset-bottom) + 0.85rem),
      5.5rem
    );
  }

  .app-mobile-nav {
    min-height: calc(var(--app-nav-item-height) + env(safe-area-inset-bottom));
  }

  .app-nav-link {
    font-size: 0.7rem;
  }

  .app-mobile-scope,
  .app-kpi-label,
  .app-tile-text,
  .app-list-card {
    font-size: var(--glsp-mobile-font-small);
  }
}

@media (max-width: 359.98px) {
  :root {
    --glsp-mobile-font-base: 0.875rem;
    --glsp-mobile-font-small: 0.765rem;
    --glsp-mobile-font-tiny: 0.7rem;
  }

  .content .page-title,
  .content h2.h5,
  .content h2.h6,
  .content .card-title {
    font-size: 0.9rem;
  }

  .glsp-list-label {
    font-size: var(--glsp-mobile-font-tiny);
  }

  .glsp-list-value {
    font-size: var(--glsp-mobile-font-small);
  }

  .topbar .topbar-right .glsp-scope-badge {
    max-width: min(50vw, 180px);
  }

  .topbar .topbar-right .glsp-scope-select {
    min-width: 132px;
    max-width: min(54vw, 180px);
    font-size: 0.78rem;
  }

  .app-nav-link {
    font-size: 0.66rem;
  }

  .app-nav-link i {
    font-size: 1rem;
  }
}
