/* Slightly soften the type scale without changing controls or the calendar's time grid. */
html { font-size: 93.75%; }
body { font-size: 1.0625rem; }
button, input, select, textarea { font-family: inherit; }
.btn, .btn-compact, .page-heading > .btn, .search-field input,
.modal-form input, .modal-form select, .modal-form textarea,
.account-membership, .mat-search-filters select,
.cl-answer-input, .cl-ai-prompt, .cl-context-fields input, .cl-context-fields select {
  font-size: 1rem;
}
.btn, .btn-compact { min-height: 44px; white-space: normal; }
.btn-icon { min-width: 40px; min-height: 40px; flex-shrink: 0; }
.page-heading { flex-wrap: wrap; }
.page-heading > .btn { gap: 8px; }
.page-heading > div { min-width: 0; }
.page-subtitle { font-size: 1rem; }
.text-btn { font-size: .9375rem; }
.search-field { max-width: 380px; min-height: 48px; }
.student-card { display: flex; flex-direction: column; align-items: stretch; }
.student-card h3 { font-size: 1.375rem; line-height: 1.4; overflow-wrap: anywhere; }
.student-card > p { flex: 1; font-size: 1rem; line-height: 1.7; color: #71816c; }
.student-progress-label, .student-card-foot { font-size: .875rem; color: #71816c; }
.student-card-foot { flex-wrap: wrap; gap: 12px; }
.student-card-foot > span:last-child { flex-shrink: 0; }
.student-card .level-badge { font-size: .875rem; }
.student-card .avatar-lg { font-size: 1.375rem; width: 58px; height: 58px; }
.filter-row { flex-wrap: wrap; gap: 16px; }
.sidebar { width: 248px; overflow-y: auto; }
.app-main { margin-left: 248px; }
.nav-item { font-size: 1rem; }
.topbar { height: auto; min-height: 82px; padding-top: 12px; padding-bottom: 12px; gap: 16px; }
.topbar-left, .topbar-right { min-width: 0; }
.topbar-right { flex-wrap: wrap; justify-content: flex-end; gap: 14px; }
.account-sync { max-width: none; white-space: nowrap; flex-shrink: 0; }
.account-membership { max-width: 230px; min-height: 44px; }
.lesson-row { flex-wrap: wrap; padding: 16px 0; gap: 12px; }
.lesson-time { width: 58px; }
.lesson-info { min-width: 120px; }
.lesson-info strong, .lesson-info > span { white-space: normal; overflow-wrap: anywhere; }
.lesson-row .btn { font-size: .9375rem; min-height: 40px; }
.mat-row-prepare { white-space: normal; }
.student-mini strong, .student-mini span { white-space: normal; overflow-wrap: anywhere; }
.section-title { flex-wrap: wrap; gap: 12px; }
.calendar-toolbar, .calendar-month, .calendar-footer { flex-wrap: wrap; gap: 12px; }
.calendar { min-width: 1060px; }
.calendar-head, .calendar-body { grid-template-columns: 68px repeat(7, minmax(0, 1fr)); }
.calendar-event { padding: 3px 6px; line-height: 1.2; container: lesson / size; }
.calendar-event > span, .calendar-event strong, .calendar-event small, .calendar-event em { font-size: .875rem; flex-shrink: 0; }
/* Short appointments retain a readable name; clicking opens the complete details. */
@container lesson (max-height: 42px) {
  .calendar-event > span, .calendar-event em { display: none; }
}
.bill-bell-count { min-width: 21px; height: 21px; font-size: .75rem; }
.bill-table-heading, .bill-filters { flex-wrap: wrap; gap: 10px; }
.bill-filters button { min-height: 40px; }
.bill-table { min-width: 880px; }
.bill-table-scroll { position: relative; }
.bill-person .avatar { font-size: .875rem; width: 38px; height: 38px; }
.bill-currency-label { max-width: 140px; }
.cl-heading, .cl-heading-actions, .cl-homework-footer, .cl-sheet-kicker { flex-wrap: wrap; }
.cl-heading-actions { gap: 12px; }
.cl-end, .cl-homework-button, .cl-add-board { font-size: 1rem !important; white-space: normal; }
.cl-homework-footer p { max-width: none; }
.cl-homework-button { margin-left: 0; }
.cl-layout { grid-template-columns: minmax(0, 1fr) 350px; }
.cl-board-toolbar { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.cl-tabs { min-width: 0; max-width: 100%; overflow-x: auto; }
.cl-tab { min-height: 44px; }
.cl-context-fields { grid-template-columns: 84px minmax(0, 1fr); }
.cl-ai-prompt { height: 110px; }
.cl-exercise { padding: 12px 0; }
.cl-live-worksheet .cl-exercise { flex-wrap: wrap; }
.cl-ai-mode { overflow-wrap: anywhere; }
.lesson-call-body, .lesson-call-footer { flex-wrap: wrap; }
.lesson-call-controls .btn { font-size: .9375rem; min-height: 44px; }
.mat-search-filters { flex-wrap: wrap; }
.mat-search-filters select { max-width: 180px; min-height: 44px; }
.mat-card-foot { flex-wrap: wrap; gap: 10px; }
.mat-resource-row { min-width: 0; overflow-wrap: anywhere; }
.mat-row-controls .btn-icon { min-width: 40px; min-height: 40px; }
.mat-library-select { flex-wrap: wrap; }
.modal h2 { overflow-wrap: anywhere; }
.form-row > label { min-width: 0; }

@media (max-width: 1180px) {
  .sidebar { width: 230px; }
  .app-main { margin-left: 230px; }
  .overview-top, .dashboard-lower { grid-template-columns: minmax(0, 1fr); }
  .cl-layout { grid-template-columns: minmax(0, 1fr); }
  .student-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .topbar { padding-left: 20px; padding-right: 20px; }
  .account-membership { max-width: 180px; }
  .account-sync { font-size: .875rem; }
  .student-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .sidebar { width: 260px; }
  .app-main { margin-left: 0; }
  .topbar { min-height: 72px; padding: 12px 17px; }
  .topbar-right { gap: 8px; }
  .account-membership { max-width: 150px; }
  .page-heading > .btn { font-size: 1rem; min-height: 44px; }
  .student-card { padding: 22px; }
  .bill-stat-top, .bill-stat > p { padding-right: 0; }
  .bill-stat > strong { position: static; text-align: left; margin: 12px 0; }
  .bill-overview .text-btn, .bill-student-balance .text-btn { margin-left: 0; }
  .bill-table { min-width: 880px; }
  .mat-grid { grid-template-columns: minmax(0, 1fr); }
  .cl-heading h1 { max-width: none; }
  .cl-homework-footer p { max-width: none; }
  .cl-homework-button { width: 100%; justify-content: center; }
  /* Keep text-entry controls at 16px to avoid focus zoom on mobile. */
  input, select, textarea { font-size: 16px !important; }
  .lesson-call-controls .btn { font-size: .875rem; }
}

@media (max-width: 460px) {
  .form-row { flex-direction: column; }
  .account-role label { flex-basis: 100%; }
  .student-mini-grid { grid-template-columns: minmax(0, 1fr); }
  .next-copy { max-width: 100%; }
  .hero-art { display: none; }
  .bill-filters button { flex: 1 1 100px; }
  .cl-heading-left { align-items: flex-start; }
}

/* Keep the interface compact after removing decorative copy. */
.sidebar > nav { margin-top: 36px; }
.next-lesson { min-height: 0; }
.next-copy { max-width: 100%; width: 100%; }
.next-copy h2 { max-width: none; overflow-wrap: anywhere; }
.progress-card .progress-stats { margin-top: 24px; }
