/* small extras */
.fadeUp {
  animation: fadeUp 220ms ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .fadeUp { animation: none; }
}

.badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.7);
}

/* ===================== Portal cards (bottom links) ===================== */
.pageWrap {
  width: 100%;
  max-width: 85vw;   /* do not exceed 85% of screen width */
  margin: 0 auto;
}

/* On smaller screens, use more width so it doesn't feel cramped */
@media (max-width: 768px) {
  .pageWrap { max-width: 96vw; }
}

.cardsGrid {
  display: grid;
  /* Default desktop layout: keep 5 cards per row, scale down on smaller desktop widths */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

/* Only on really small screens, reduce columns */
@media (max-width: 1099px) {
  .cardsGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}

@media (max-width: 899px) {
  .cardsGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

@media (max-width: 639px) {
  .cardsGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

@media (max-width: 420px) {
  .cardsGrid { grid-template-columns: 1fr; }
}

/* Keep cards visually aligned even when descriptions differ */
.cardDescClamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cardFixedHeight {
  min-height: 270px;
}

/* Card sizing tweaks for smaller desktop screens (≈ 21" and below in practice) */
.linkCardTop { padding: 20px; gap: 12px; }
.linkCardIcon { width: 64px; height: 64px; }
.linkCardTitle { font-size: 16px; line-height: 1.25; }
.linkCardDesc { font-size: 14px; }
.linkCardBtn { padding: 8px 18px; font-size: 14px; border-radius: 12px; }

@media (min-width: 769px) and (max-width: 1600px) {
  .linksSection { padding: 18px; }
  .cardsGrid { gap: 16px; }

  .linkCardTop { padding: 18px; gap: 10px; }
  .linkCardIcon { width: 56px; height: 56px; }
  .linkCardTitle { font-size: 15px; }
  .linkCardDesc { font-size: 13px; }
  .linkCardBtn { padding: 7px 16px; font-size: 13px; }
  .cardFixedHeight { min-height: 250px; }
}

@media (min-width: 769px) and (max-width: 1400px) {
  .linksSection { padding: 16px; }
  .cardsGrid { gap: 14px; }

  .linkCardTop { padding: 16px; gap: 9px; }
  .linkCardIcon { width: 52px; height: 52px; }
  .linkCardTitle { font-size: 14px; }
  .linkCardDesc { font-size: 12.5px; }
  .linkCardBtn { padding: 6px 14px; font-size: 12.5px; }
  .cardFixedHeight { min-height: 240px; }
  .cardDescClamp { -webkit-line-clamp: 2; }
}

@media (min-width: 769px) and (max-width: 1200px) {
  .linkCardTop { padding: 14px; }
  .linkCardIcon { width: 48px; height: 48px; }
  .cardFixedHeight { min-height: 230px; }
}

/* ===================== Dashboard charts ===================== */
.chartBox {
  position: relative;
  height: 260px; /* stable height to prevent resize loops */
}

canvas.chartCanvas {
  width: 100%;
  height: 100%;
  display: block;
}
