/* Shared proportions, with the established blue branding in the light theme. */
html .reference-feed-tabs {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}
html .reference-feed-tabs.platform-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
html .reference-feed-tabs > a {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 52px !important;
  padding: 12px 10px !important;
  justify-content: center !important;
  gap: 8px !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  text-align: center !important;
}
html .reference-feed-tabs > a::after { left: 16px !important; right: 16px !important; width: auto !important; }
html .reference-feed-tabs > a:first-child { min-width: 0 !important; }
html .reference-feed-tabs > a > .svg-icon { flex: 0 0 20px !important; width: 20px !important; height: 20px !important; }
html .welcome-panel {
  display: flex !important;
  align-items: center !important;
  min-height: 108px !important;
  padding: 24px !important;
  margin-bottom: 16px !important;
}
html .welcome-panel .welcome-copy { width: 100% !important; max-width: none !important; }
html .welcome-panel .welcome-copy h1 {
  font-size: clamp(22px, 1.7vw, 28px) !important;
  line-height: 1.25 !important;
  letter-spacing: -.5px !important;
  margin: 0 !important;
  max-width: none !important;
}
html .welcome-panel .welcome-copy p { margin: 8px 0 0 !important; }

/* An uploaded image supplies its own background. Initials retain their tile. */
html img.avatar,
html .profile-main > img.avatar,
html .profile-main-flat > img.avatar,
html img.school-logo,
html img.school-mark-image {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  padding: 0 !important;
}
html img.school-logo,
html img.school-mark-image,
html img.avatar-school { object-fit: contain !important; border-radius: 0 !important; }

/* Light surfaces keep the original blue, cyan and navy brand colors. */
html[data-theme="light"] {
  --ui-card: #ffffff;
  --ui-line: #dce7f3;
  --ui-ink: #123459;
  --ui-muted: #526b85;
  --ui-soft: #f2f7fd;
  --ui-shadow: 0 3px 14px rgba(21, 60, 102, .045);
}
html[data-theme="light"] :is(.post-card, .composer, .rail-card, .settings-panel-card, .admin-poll-card, .reference-feed-tabs) {
  border: 1px solid var(--ui-line) !important;
  border-radius: 16px !important;
  box-shadow: var(--ui-shadow) !important;
  background: var(--ui-card) !important;
}
html[data-theme="light"] :is(.composer, .post-card, .rail-card, .admin-poll-card) { padding: 18px !important; }
html[data-theme="light"] :is(.post-card, .composer, .reference-feed-tabs, .rail-card, .quote-card) { margin-bottom: 16px !important; }
html[data-theme="light"] :is(.post-author strong, .user-menu strong, .school-mini-link strong, .school-list-row strong, .profile-dropdown strong) { font-size: 14px !important; color: var(--ui-ink) !important; }
html[data-theme="light"] :is(.post-author small, .user-menu small, .school-mini-link small, .school-list-row small, .post-meta, .composer-launcher-hint, .profile-dropdown small) { font-size: 12px !important; color: var(--ui-muted) !important; line-height: 1.45 !important; }
html[data-theme="light"] :is(.post-interactions button, .composer-launcher-actions button) { font-size: 14px !important; }
html[data-theme="light"] .post-interactions button { min-height: 42px !important; }
html[data-theme="light"] .post-body { font-size: 15px !important; line-height: 1.6 !important; color: var(--ui-ink) !important; }
html[data-theme="light"] .comment-bubble { background: var(--ui-soft) !important; }
html[data-theme="light"] .comment-bubble strong { font-size: 13px !important; }
html[data-theme="light"] .comment-bubble p { font-size: 14px !important; line-height: 1.5 !important; }
html[data-theme="light"] .comment-actions :is(button, small) { font-size: 11px !important; color: var(--ui-muted) !important; }
html[data-theme="light"] .rail-heading { font-size: 17px !important; line-height: 1.35 !important; color: var(--ui-ink) !important; gap: 12px !important; }
html[data-theme="light"] .rail-heading > a { font-size: 11px !important; white-space: nowrap; }
html[data-theme="light"] .composer-launcher-main > button { min-height: 46px !important; font-size: 14px !important; color: var(--ui-muted) !important; background: var(--ui-soft) !important; }
html[data-theme="light"] .composer-launcher-actions .svg-icon { color: #0878f9 !important; }
html[data-theme="light"] :is(.primary-button, .secondary-button, .danger-button) { min-height: 40px; font-size: 13px; border-radius: 10px; }
html[data-theme="light"] :is(.settings-title p, .privacy-row-copy small, .privacy-clean-section-title p, .admin-section-title p, .admin-poll-card header p, .poll-builder-head p) { font-size: 12px !important; line-height: 1.5 !important; color: var(--ui-muted) !important; }
html[data-theme="light"] :is(.privacy-row-copy strong, .settings-toggle-row strong, .poll-card-overview strong) { font-size: 14px !important; }
html[data-theme="light"] :is(.admin-poll-card header small, .poll-card-overview small, .admin-poll-tags span) { font-size: 11px !important; }
html[data-theme="light"] .reference-feed-tabs > a { color: var(--ui-muted) !important; }
html[data-theme="light"] .reference-feed-tabs > a.active { color: #0664d0 !important; background: #f2f7ff !important; }
html[data-theme="light"] .reference-feed-tabs > a:first-child { border-radius: 15px 0 0 15px; }
html[data-theme="light"] .reference-feed-tabs > a:last-child { border-radius: 0 15px 15px 0; }
html[data-theme="light"] .reference-feed-tabs > a:hover { background: #edf5ff !important; }
html .poll-card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
html .poll-card-actions > :is(a, button) { min-height: 38px; font-size: 12px; }
html .poll-card-actions .delete-poll { margin-left: auto; color: var(--theme-danger, #b42338) !important; border-color: var(--theme-border, #e5cbd0) !important; }
html .poll-card-actions .delete-poll:hover { background: var(--theme-danger-soft, #fff0f2) !important; }
html .admin-poll-card { opacity: 1; }

@media (min-width: 1181px) {
  html .content-grid.with-right { grid-template-columns: minmax(0, 1fr) 330px !important; gap: 20px !important; }
  html .content-grid.with-right > .main-column { margin-top: 0 !important; }
}
@media (min-width: 901px) { html .topbar .mobile-menu { display: none !important; } }
@media (max-width: 760px) {
  html .reference-feed-tabs > a { min-height: 54px !important; padding: 10px 5px !important; font-size: 11px !important; gap: 4px !important; }
  html .reference-feed-tabs > a > .svg-icon { width: 17px !important; height: 17px !important; flex-basis: 17px !important; }
  html .reference-feed-tabs > a::after { left: 8px !important; right: 8px !important; }
  html .welcome-panel { min-height: 84px !important; padding: 18px 16px !important; }
  html .welcome-panel .welcome-copy h1 { font-size: 21px !important; }
  html .poll-card-actions .delete-poll { margin-left: 0; }
}
@media (max-width: 640px) {
  html[data-theme="light"] :is(.composer, .post-card, .rail-card) { padding: 14px !important; }
  html[data-theme="light"] :is(.composer, .post-card, .reference-feed-tabs) { border-radius: 0 !important; border-inline: 0 !important; margin-bottom: 10px !important; }
  html .poll-card-actions > :is(a, button) { flex: 1 1 calc(50% - 8px); justify-content: center; }
  html .composer-launcher-hint { display: none !important; }
}

/* Legible secondary labels retain the same navy/blue palette. */
html[data-theme="light"] :is(.nav-title, .sidebar-brand-foot small, .sidebar-brand-foot a, .post-comment-count, .post-reaction-summary, .comment-reaction-summary, .rail-empty small) { color: #526b85 !important; }
html[data-theme="light"] :is(.rail-action-link, .rail-heading > a) { color: #0664d0 !important; }
html[data-theme="light"] .notification-badge { background: #d92134 !important; }
html[data-theme="light"] .sidebar-promo a { background: #0668dc !important; }
html[data-theme="light"] .right-rail > :is(.rail-card, .quote-card) { margin-bottom: 0 !important; }
html[data-theme="light"] :is(.admin-section, .poll-builder-card, .auth-card) :is(label > span:first-child, .field > span, .poll-question-label, .poll-question-kind) { font-size: 12px !important; }
html[data-theme="light"] :is(.admin-user-card-person strong, .admin-user-card-facts strong, .role-hierarchy p, .role-hierarchy small) { font-size: 13px !important; line-height: 1.45 !important; }
html[data-theme="light"] :is(.admin-user-card-person small, .admin-user-card-facts small, .poll-builder-toolbar small, .poll-builder-destinations small, .poll-builder-question small) { font-size: 11px !important; line-height: 1.45 !important; }
html[data-theme="light"] :is(.auth-form input, .auth-form select, .auth-card button, .profile-settings-rework input, .profile-settings-rework textarea) { font-size: 14px !important; }
html .admin-user-card-facts { gap: 14px !important; }
html .admin-user-card-facts > :is(div, span) { min-width: 0; overflow-wrap: anywhere; }
html .admin-user-card-facts strong { white-space: normal; }
@media (min-width: 1181px) {
  html .admin-user-card { grid-template-columns: minmax(160px,1fr) minmax(430px,1.5fr) auto auto !important; }
  html .admin-user-card-facts { grid-template-columns: minmax(0,.8fr) minmax(0,1fr) minmax(135px,1.5fr) minmax(0,1fr) !important; }
}
