/* Shared label sizing, authored in the canonical CRECE Site. */
.page,
.topbar > div,
.section-head > *,
.module-toolbar > *,
.content-actions,
.row-actions,
.campus-hero > div,
.admin-hero > div,
.campus-grid > *,
.training-semester-summary > * {
  min-width: 0;
}

:is(h1, h2, h3, h4, label, legend, button, summary, .eyebrow, .badges span) {
  overflow-wrap: anywhere;
}
button, .primary-command, .text-command, .employee-payroll-download {
  max-width: 100%;
  white-space: normal;
  line-height: 1.4;
}
.section-head, .topbar, .content-actions, .row-actions, .module-tabs {
  flex-wrap: wrap;
}
.section-head > :is(button, a) { flex-shrink: 0; }
.module-tabs { overflow-x: visible; }
.module-tabs button { min-width: 0; flex-shrink: 1; }
.content-actions { flex-shrink: 1; }
.content-search input { min-width: 0; width: 100%; }
.content-search > button { flex-shrink: 0; }

/* A text action is not a 50px icon control. Keep all search actions together. */
.catalog-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.catalog-filters .catalog-search,
.catalog-filter-actions { grid-column: 1 / -1; }
.catalog-filter-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.catalog-filters .catalog-filter-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 0;
  padding: 12px 16px;
}
.catalog-row .catalog-side { flex-shrink: 1; }
.campus-history-search label { min-width: 0; }
.campus-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, .8fr); }
.course-item { grid-template-columns: 38px minmax(0, 1fr) auto; }
.podium-panel li { gap: 12px; flex-wrap: wrap; overflow-wrap: anywhere; }

/* The text stays inside the circle, including at the smallest phone width. */
.score-cluster, .admin-count { flex-shrink: 0; padding: 12px; }
.score-cluster .score-total-label {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  letter-spacing: .035em;
  font-size: 10px;
  line-height: 1.4;
  overflow-wrap: normal;
}
.score-cluster > strong, .admin-count > strong { overflow-wrap: anywhere; }
.admin-count > span { max-width: 100%; letter-spacing: .04em; }
.metrics :is(strong, span), .overview-metrics dd { overflow-wrap: anywhere; }

/* Dialogs use shrinkable tracks; native inputs cannot widen the whole form. */
dialog form { min-width: 0; grid-template-columns: minmax(0, 1fr); }
dialog :is(form > *, label, fieldset, legend) { min-width: 0; max-width: 100%; }
dialog :is(input, select, textarea) { min-width: 0; max-width: 100%; }
dialog input:not([type=checkbox]):not([type=radio]),
dialog select, dialog textarea { width: 100%; }
dialog :is(.check-row, .role-options label) input { flex-shrink: 0; }
.table-wrap { max-width: 100%; min-width: 0; }

#week-view :is(.wu-metric > span, .wu-metric > strong, .wu-metric > small,
  .wu-week > summary > span, .wu-night-types > *, .wu-calendar) {
  min-width: 0;
  overflow-wrap: anywhere;
}
#week-view .wu-week > summary { flex-wrap: wrap; }
#week-view .wu-week > summary::after { flex-shrink: 0; }

@media (max-width: 1100px) {
  .catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .campus-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 780px) {
  .course-item { grid-template-columns: 38px minmax(0, 1fr); }
  .course-item time { grid-column: 2; }
  .admin-hero { flex-direction: column; gap: 18px; min-height: 0; }
  .admin-hero > div:first-child { width: 100%; }
  .admin-hero .admin-count {
    position: static;
    width: 140px;
    min-width: 140px;
    align-self: flex-end;
  }
  .campus-hero .score-cluster { width: 140px; min-width: 140px; }
  .catalog-filter-actions button { flex: 1 1 10rem; }
  body .app-shell > aside nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    max-height: 32dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body .app-shell nav button {
    min-width: 0;
    min-height: 62px;
    padding: 6px 3px;
    justify-content: flex-start;
    text-align: center;
  }
  body .app-shell nav button span {
    min-width: 0;
    max-width: 100%;
    font-size: 11px;
    line-height: 1.3;
    white-space: normal;
    hyphens: auto;
  }
}
@media (max-width: 360px) {
  body .app-shell > aside nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body .admin-hero h2 { font-size: 28px; line-height: 1.15; }
}
@media (max-width: 420px) {
  .catalog-filters { grid-template-columns: minmax(0, 1fr); }
  body .portal-band .section-head { align-items: flex-start; }
  .catalog-filter-actions button { flex-basis: 100%; }
  .metrics { grid-template-columns: minmax(0, 1fr); }
  #week-view .wu-payroll .wu-metrics { grid-template-columns: minmax(0, 1fr); }
  #content-scope-options, #catalog-scope-options,
  #benefit-scope-options, #bulletin-scope-options { grid-template-columns: minmax(0, 1fr); }
}
