/* Shared typography. Load after page styles so equivalent controls use one scale.
   Important declarations intentionally override legacy page-specific font sizes.
   Icon glyphs, hidden chevrons and OTP digits retain their own sizing. */
:root {
  --font-size-caption: 12px;
  --font-size-label: 13px;
  --font-size-body: 14px;
  --font-size-subheading: 16px;
  --font-size-section: 18px;
  --font-size-dialog: 22px;
  --font-size-page: 28px;
  --font-size-display-type: 15px;
}

body { font-size: var(--font-size-body); }

:is(.page, .modal, dialog, .auth-form, .auth-card) p,
:is(.page, .modal, dialog) li,
.page__subtitle, .auth-description, .showcase-description,
.activity-item .a-title, .work-result a, .work-result strong {
  font-size: var(--font-size-body) !important;
  line-height: 1.8;
}

.page h1, .page__title, .auth-title {
  font-size: var(--font-size-page) !important;
  line-height: 1.5;
}
.page h2, .section-head h3, .panel__head h4 {
  font-size: var(--font-size-section) !important;
  line-height: 1.6;
}
.page h3, .page h4,
:is(.modal, dialog) h3, :is(.modal, dialog) h4 {
  font-size: var(--font-size-subheading) !important;
  line-height: 1.6;
}
:is(.modal, dialog) h2 {
  font-size: var(--font-size-dialog) !important;
  line-height: 1.6;
}

/* Body copy in all tables, including page-specific name and location cells. */
.page :is(th, td) { font-size: var(--font-size-body) !important; }
.page th { font-size: var(--font-size-label) !important; }
.page td :is(strong, a), .phone-link, .video-duration,
.course-file-name strong, .details-list strong, .details-list .detail-phone,
.global-result-copy strong,
#work-detail-fields dd {
  font-size: var(--font-size-body) !important;
}

/* Search fields, native controls and the text of custom dropdowns. */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not(.otp-input),
textarea, select,
[class$="combo-trigger"], .subject-trigger, .multi-picker-trigger,
[class$="combo-list"] button, .unit-course-option, .subject-option {
  font-size: var(--font-size-body) !important;
}
[class$="combo-trigger"] > span, .subject-trigger > span,
.multi-picker-trigger > span, [class$="combo-list"] button > span,
.unit-course-option > span, .subject-option > span {
  font-size: inherit !important;
}
input::placeholder, textarea::placeholder { font-size: inherit; }

/* Text buttons only; close buttons and decorative marks keep their geometry. */
button:where(:not([class*="close"]):not([class*="toggle"]):not([class*="icon"]):not([data-pin])),
.primary-btn, .secondary-btn, .danger-btn, .work-button, .text-link {
  font-size: var(--font-size-label) !important;
}
button > span:not([class]):not(:has(svg)) { font-size: inherit !important; }
button[class$="combo-trigger"], [class$="combo-list"] button,
.unit-course-option, .subject-option, .marketing-select-menu > label input {
  font-size: var(--font-size-body) !important;
}

.field, .field-label, .upload-field,
label:not([class*="switch"]):not([class*="dropzone"]),
[class$="-label"], .breadcrumb, .nav-link, .sub-link,
.work-pins strong, .work-directory-grid strong,
.quick-card__title, .mini-link .m-txt {
  font-size: var(--font-size-label) !important;
}
.sidebar__user .user-info .name, .topbar__profile .p-info .p-name {
  font-size: var(--font-size-label) !important;
}

/* Secondary information has the same readable minimum on every page. */
small, .field-error, .field-hint, .file-hint, .char-count,
[class$="-hint"], [class$="-caption"], [class$="-kicker"],
.card-footer, .card-footer > span, .table-state small,
.teacher-form-head > div > span,
.video-name-cell small, .video-location-cell small,
.picture-status, .status, .track-boolean, [class$="-badge"],
.teacher-visibility b, .video-status-wrap > span,
.work-eyebrow, .work-head time, .work-examples,
.work-section-head a, .work-coverage, #work-health,
.auth-footer, .security-note, .otp-recipient__label,
.global-result-copy small, .global-search-loading-more, .search-shortcut,
.sidebar__brand-text .subtitle, .nav-section-label,
.sidebar__user .user-info .role, .topbar__profile .p-info .p-role {
  font-size: var(--font-size-caption) !important;
  line-height: 1.65;
}
.page td small, .page td small a,
.card-toolbar p, .work-section-head p, .teacher-form-head p {
  font-size: var(--font-size-caption) !important;
}
.ip-address, .device-details code { font-size: var(--font-size-label) !important; }

/* Keep the requested compact, colored display-type letters. */
.video-type { font-size: var(--font-size-display-type) !important; }

@media (max-width: 600px) {
  :root { --font-size-page: 24px; --font-size-dialog: 20px; }
  /* Let labels grow instead of clipping when a narrow control wraps. */
  .card-toolbar, .work-section-head { row-gap: 12px; }
}
