/*
  Hifz Diary — design tokens + Bootstrap overrides
*/

:root {
  --hd-brand-violet: #667eea;
  --hd-brand-plum: #764ba2;
  --hd-primary-solid: #5b4dc9;
  --hd-primary-solid-rgb: 91, 77, 201;
  --hd-gradient: linear-gradient(135deg, var(--hd-brand-violet) 0%, var(--hd-brand-plum) 100%);
  --hd-gradient-hover: linear-gradient(135deg, #5a6fd6 0%, #684292 100%);

  --hd-page-bg: #f3f2f9;
  --hd-text: #1c2133;
  --hd-muted: #5c6478;

  --bs-primary: var(--hd-primary-solid);
  --bs-primary-rgb: var(--hd-primary-solid-rgb);
  /*
    Bootstrap Reboot uses rgba(var(--bs-link-color-rgb)) for `a` color (not --bs-link-color alone)
    and hardcodes text-decoration: underline on `a`. Override both here.
  */
  --bs-link-color: #1c2133;
  --bs-link-hover-color: var(--hd-primary-solid);
  --bs-link-color-rgb: 28, 33, 51;
  --bs-link-hover-color-rgb: 91, 77, 201;
  --bs-focus-ring-color: rgba(var(--bs-primary-rgb), 0.35);

  --hd-rating-0: #7f1d1d;
  --hd-rating-1: #e53935;
  --hd-rating-2: #ef5a2e;
  --hd-rating-3: #f97316;
  --hd-rating-4: #7fb02a;
  --hd-rating-5: #15803d;
}

.hd-class-nav {
  margin: 1.35rem 0 2rem;
  border-bottom: 1px solid rgba(28, 33, 51, 0.1);
}

.hd-class-nav__links {
  display: flex;
  gap: 0.15rem;
  margin-bottom: -1px;
}

.hd-class-nav__link {
  flex: 0 0 auto;
  padding: 0.7rem 0.95rem;
  color: var(--hd-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}

.hd-class-nav__link:hover,
.hd-class-nav__link:focus-visible {
  color: var(--hd-text);
  outline: 0;
}

.hd-class-nav__link.is-active {
  color: var(--hd-text);
  font-weight: 600;
  border-bottom-color: var(--hd-primary-solid);
}

.hd-nav-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.hd-class-choice-card {
  border-left: 4px solid rgba(var(--bs-primary-rgb), 0.7) !important;
  border-radius: 1.1rem;
  box-shadow: 0 0.65rem 1.8rem rgba(28, 33, 51, 0.07) !important;
}

.hd-teacher-workspace {
  max-width: 74rem;
}

.hd-class-page-header {
  margin-bottom: 0.25rem;
  padding-block: 0.4rem 0.75rem;
}

.hd-class-page-kicker {
  color: var(--hd-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hd-class-page-title {
  color: var(--hd-text);
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.hd-class-page-subtitle {
  color: #7b8292;
  font-size: 0.95rem;
  font-weight: 400;
}

.hd-floating-card,
.hd-progress-card {
  border-radius: 1.15rem;
  background: #fff;
  box-shadow:
    0 1rem 2.6rem rgba(28, 33, 51, 0.075),
    0 0.2rem 0.65rem rgba(28, 33, 51, 0.035);
}

.hd-floating-card .card-body,
.hd-progress-card .card-body,
.hd-settings-card .card-body {
  padding: 1.5rem;
}

.hd-progress-card {
  margin-bottom: 2.25rem;
}

.hd-progress-hero {
  height: 0.8rem;
  border-radius: 999px;
  background: rgba(var(--bs-primary-rgb), 0.11);
  overflow: hidden;
}

.hd-progress-hero .progress-bar {
  border-radius: inherit;
  background: var(--hd-gradient);
  box-shadow: 0 0 1rem rgba(var(--bs-primary-rgb), 0.24);
  transition: width 400ms ease;
}

.hd-progress-completed {
  color: var(--hd-text);
  font-size: 0.95rem;
}

.hd-progress-remaining {
  color: var(--hd-text);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hd-progress-remaining span {
  color: var(--hd-muted);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0;
}

.hd-setup-alert {
  margin-bottom: 2.5rem;
  border-radius: 1rem;
  background: #fff9e8;
  box-shadow: 0 0.45rem 1.25rem rgba(146, 100, 20, 0.07);
}

.hd-student-table-shell {
  overflow: visible;
}

.hd-student-object-table {
  border-collapse: separate;
  border-spacing: 0 0.55rem;
}

.hd-student-object-table thead th {
  padding: 0.25rem 1.15rem 0.4rem;
  border: 0;
  background: transparent;
  color: var(--hd-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

/* Keep row chrome free of filter/transform so dropdown stacking stays predictable */
.hd-student-object-table tbody tr {
  position: relative;
  z-index: 0;
}

.hd-student-object-table tbody tr:has(.dropdown.show),
.hd-student-object-table tbody tr:has(.dropdown-menu.show) {
  z-index: 20;
}

.hd-student-object-table tbody td {
  padding: 0.85rem 1.1rem;
  border-top: 1px solid #ececf3;
  border-bottom: 1px solid #ececf3;
  background: #fff;
  vertical-align: middle;
  height: 76px;
  box-shadow: 0 1px 0 rgba(31, 34, 54, 0.02);
}

.hd-student-object-table tbody td:first-child {
  border-left: 1px solid #ececf3;
  border-radius: 14px 0 0 14px;
}

.hd-student-object-table tbody td:last-child {
  border-right: 1px solid #ececf3;
  border-radius: 0 14px 14px 0;
}

.hd-att-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 5.1rem;
  min-height: 2.625rem;
  padding: 0.35rem 0.7rem !important;
  border-radius: 10px !important;
  border-width: 1.5px !important;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  touch-action: manipulation;
  box-shadow: none;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.hd-att-btn__icon {
  flex-shrink: 0;
}

.hd-att-btn[data-status="present"] {
  min-width: 5.75rem;
}

.hd-att-btn[data-status="late"] {
  min-width: 5.125rem;
}

.hd-att-btn[data-status="absent"] {
  min-width: 5.75rem;
}

.hd-att-btn:hover {
  filter: brightness(0.98);
}

.hd-att-btn:active {
  filter: brightness(0.96);
}

.hd-att-present {
  color: #2e7a51 !important;
  border-color: #55a878 !important;
  background: #fff !important;
}

.hd-att-present-active {
  color: #fff !important;
  border-color: #38835b !important;
  background: #38835b !important;
}

.hd-att-late {
  color: #a95b24 !important;
  border-color: #c7773b !important;
  background: #fff !important;
}

.hd-att-late-active {
  color: #fff !important;
  border-color: #b56529 !important;
  background: #b56529 !important;
}

.hd-att-absent {
  color: #c83e44 !important;
  border-color: #e25e63 !important;
  background: #fff !important;
}

.hd-att-absent-active {
  color: #fff !important;
  border-color: #d64d52 !important;
  background: #d64d52 !important;
}

.hd-status-chip {
  border-radius: 999px;
  padding: 0.4em 0.65em;
  font-weight: 600;
}

.hd-lesson-status {
  border: 0 !important;
  border-radius: 999px;
  padding: 0.45em 0.7em;
  font-weight: 600;
}

.hd-status-chip--warning {
  color: #91600b;
  background: #fff0c7;
  font-size: 0.75rem;
  font-weight: 600;
}

.hd-status-chip--muted {
  color: #4a5168;
  background: #eceef5;
  font-size: 0.75rem;
  font-weight: 600;
}

.hd-diary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  border: 0;
  color: #5947c8;
  background: #f0edff;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.4rem 0.9rem;
}

.hd-diary-action:hover,
.hd-diary-action:focus-visible {
  color: #4e3bbe;
  background: #e8e3ff;
}

.hd-row-menu {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: #6e7385;
  background: #f8f8fb;
  line-height: 1;
  padding: 0;
}

.hd-row-menu:hover,
.hd-row-menu:focus-visible {
  color: #5141b8;
  background: #f0eefa;
}

.hd-students-section {
  margin-top: 0.5rem;
}

.hd-student-search-wrap {
  position: relative;
  max-width: 30rem;
}

.hd-student-search-icon {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  font-size: 0.9rem;
  opacity: 0.62;
  pointer-events: none;
}

.hd-student-search {
  min-height: 3rem;
  padding-left: 1.1rem;
  border: 0;
  border-radius: 0.95rem;
  box-shadow: 0 0.5rem 1.4rem rgba(28, 33, 51, 0.07);
}

.hd-student-search:focus {
  box-shadow:
    0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.13),
    0 0.6rem 1.5rem rgba(28, 33, 51, 0.08);
}

.hd-settings-card {
  cursor: pointer;
  border-radius: 1.1rem;
  color: inherit;
  background: #fff;
  box-shadow: 0 0.8rem 2rem rgba(28, 33, 51, 0.065);
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.hd-settings-card:hover,
.hd-settings-card:focus-visible {
  outline: 0;
  transform: translateY(-4px);
  box-shadow: 0 1.15rem 2.4rem rgba(28, 33, 51, 0.11);
}

.hd-settings-card-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border-radius: 0.8rem;
  background: rgba(var(--bs-primary-rgb), 0.08);
  font-size: 1.15rem;
}

.hd-settings-card-arrow {
  color: var(--hd-primary-solid);
  font-size: 1.4rem;
  transition: transform 170ms ease;
}

.hd-settings-card:hover .hd-settings-card-arrow,
.hd-settings-card:focus-visible .hd-settings-card-arrow {
  transform: translateX(4px);
}

@media (min-width: 768px) {
  .hd-floating-card .card-body,
  .hd-progress-card .card-body,
  .hd-settings-card .card-body {
    padding: 1.85rem 2rem;
  }
}

@media (max-width: 767.98px) {
  .hd-class-nav__link {
    padding-inline: 0.75rem;
  }

  /* class_students and other shells: allow local horizontal scroll */
  .hd-student-table-shell:not(.hd-today-register-shell) {
    overflow-x: auto;
  }

  .hd-student-table-shell:not(.hd-today-register-shell) .hd-student-object-table {
    min-width: 54rem;
  }
}

.hd-rating-num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: help;
}

.hd-rating-num--0 {
  color: var(--hd-rating-0);
}

.hd-rating-num--1 {
  color: var(--hd-rating-1);
}

.hd-rating-num--2 {
  color: var(--hd-rating-2);
}

.hd-rating-num--3 {
  color: var(--hd-rating-3);
}

.hd-rating-num--4 {
  color: var(--hd-rating-4);
}

.hd-rating-num--5 {
  color: var(--hd-rating-5);
}

body.hd-app {
  color: var(--hd-text);
  background-color: var(--hd-page-bg);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(var(--bs-primary-rgb), 0.12);
}

/*
  Reboot’s `a { text-decoration: underline }` is not tied to --bs-link-decoration in BS 5.3.3.
  Strip default underlines in main content; show on hover only (breadcrumbs, inline links).
 */
body.hd-app main a:not(.btn) {
  text-decoration: none;
}

body.hd-app main a:not(.btn):hover {
  text-decoration: underline;
}

/* Softer focus than browser default blue */
body.hd-app main a:focus-visible {
  outline: 2px solid rgba(var(--bs-primary-rgb), 0.4);
  outline-offset: 2px;
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #4a3eb0;
  --bs-btn-hover-border-color: #4539a6;
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #40359a;
  --bs-btn-active-border-color: #3c3291;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #8b82d4;
  --bs-btn-disabled-border-color: #8b82d4;
}

.btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #40359a;
  --bs-btn-active-border-color: #3c3291;
}

.btn-outline-secondary {
  --bs-btn-color: var(--hd-muted);
  --bs-btn-border-color: #c8cdd9;
  --bs-btn-hover-color: var(--hd-text);
  --bs-btn-hover-bg: rgba(var(--bs-primary-rgb), 0.08);
  --bs-btn-hover-border-color: #b4b9c8;
}

.btn-link {
  --bs-btn-color: var(--bs-link-color);
  --bs-btn-hover-color: var(--bs-link-hover-color);
}

.table-hover>tbody>tr:hover>* {
  --bs-table-hover-bg: rgba(var(--bs-primary-rgb), 0.07);
}

.list-group-item-action:hover,
.list-group-item-action:focus-visible {
  background-color: rgba(var(--bs-primary-rgb), 0.07);
  color: var(--hd-text);
}

.hd-gradient-nav {
  background: var(--hd-gradient);
  border-top: 3px solid #1e1b4b;
  box-shadow: 0 0.35rem 1.5rem rgba(91, 77, 201, 0.22);
}

.hd-weekly-shell {
  min-height: 100vh;
  background: linear-gradient(180deg, #f0eff7 0%, #ebe9f3 42%, #e6e8f0 100%);
}

.hd-weekly-hero.card {
  border-left: 4px solid rgb(var(--bs-primary-rgb));
  box-shadow: 0 0.4rem 1.35rem rgba(var(--bs-primary-rgb), 0.12), 0 0.15rem 0.4rem rgba(0, 0, 0, 0.04);
}

.hd-day-card-inner {
  background: rgba(var(--bs-primary-rgb), 0.05);
}

.hd-table-shell {
  box-shadow: 0 0.4rem 1.25rem rgba(var(--bs-primary-rgb), 0.09), 0 0.125rem 0.35rem rgba(0, 0, 0, 0.04);
  border-color: rgba(var(--bs-primary-rgb), 0.14) !important;
}

.hd-sign-in-card {
  max-width: 26rem;
}

.hd-auth-card {
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 0.75rem 2rem rgba(102, 126, 234, 0.18), 0 0.25rem 0.5rem rgba(0, 0, 0, 0.06);
}

.hd-auth-card .card-header {
  background: var(--hd-gradient);
  border: none;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.hd-password-field.input-group-lg > .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.hd-password-field .hd-password-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  padding-inline: 0.85rem;
  color: #6c757d;
  background-color: #fff;
  border-color: var(--bs-border-color);
}

.hd-password-field .hd-password-toggle-btn:hover,
.hd-password-field .hd-password-toggle-btn:focus-visible {
  color: var(--bs-primary);
  background-color: #fff;
  border-color: var(--bs-border-color);
}

.hd-password-field:focus-within .form-control,
.hd-password-field:focus-within .hd-password-toggle-btn {
  border-color: #86b7fe;
}

.hd-password-field:focus-within {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  border-radius: var(--bs-border-radius-lg);
}

.hd-password-field .hd-eye-icon {
  display: block;
}

.hd-password-field .hd-eye-icon--hide {
  display: none;
}

.hd-password-field .hd-password-toggle-btn[aria-pressed="true"] .hd-eye-icon--show {
  display: none;
}

.hd-password-field .hd-password-toggle-btn[aria-pressed="true"] .hd-eye-icon--hide {
  display: block;
}

.btn-hd-cta {
  color: #fff !important;
  border: none;
  background: var(--hd-gradient);
  font-weight: 600;
  box-shadow: 0 0.35rem 1rem rgba(118, 75, 162, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-hd-cta:hover {
  color: #fff !important;
  background: var(--hd-gradient-hover);
  filter: brightness(1.02);
  box-shadow: 0 0.45rem 1.25rem rgba(118, 75, 162, 0.45);
}

.btn-hd-cta:active {
  transform: translateY(1px);
}

.hd-feature-card {
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.04);
}

.diary-week-main {
  max-width: 56rem;
}

.diary-week-main--table {
  max-width: 72rem;
}

.hd-breadcrumb-strip {
  background: #fff;
  border-color: rgba(var(--bs-primary-rgb), 0.12) !important;
}

.hd-breadcrumb {
  --bs-breadcrumb-divider: "›";
  --bs-breadcrumb-item-padding-x: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.hd-breadcrumb .breadcrumb-item a,
.hd-breadcrumb .breadcrumb-item a:visited {
  color: var(--hd-text);
  text-decoration: none;
  font-weight: 600;
}

.hd-breadcrumb .breadcrumb-item a:hover {
  color: var(--hd-primary-solid);
  text-decoration: underline;
}

.hd-breadcrumb .breadcrumb-item.active {
  color: var(--hd-muted);
  font-weight: 600;
}

/* Required / optional field markers (forms) */
.form-label.hd-required::after {
  content: " *";
  color: var(--bs-danger);
  font-weight: 700;
  margin-left: 0.125rem;
}

/* Diary: exempt entries — clearly greyed in card + table views */
.diary-band--exempt {
  border-color: #ced4da !important;
  background-color: #e9ecef;
  color: var(--hd-muted);
}

.diary-band--exempt .card-body {
  background-color: #e2e5ea !important;
  color: var(--hd-muted);
}

.diary-band--exempt .border-top {
  border-color: #ced4da !important;
}

.diary-band-head--exempt {
  background-color: #dee2e6 !important;
  color: var(--hd-muted) !important;
}

.diary-band--exempt .diary-stat-label,
.diary-band--exempt .small,
.diary-band--exempt .text-body {
  color: var(--hd-muted) !important;
}

.diary-tc--exempt {
  padding: 0.35rem 0.45rem;
  border-radius: 0.35rem;
  background-color: rgba(92, 100, 120, 0.1);
  border: 1px solid rgba(92, 100, 120, 0.18);
  color: var(--hd-muted);
}

.hd-diary-comment {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.diary-tc .hd-diary-comment,
.diary-band .hd-diary-comment {
  min-width: 0;
}

.diary-tc--exempt .text-body,
.diary-tc--exempt .fw-semibold {
  color: var(--hd-muted) !important;
  font-weight: 600 !important;
}

.diary-week-table tbody tr>td.diary-week-td--exempt {
  background-color: #e9ecef !important;
  color: var(--hd-muted);
  box-shadow: inset 0 0 0 1px rgba(92, 100, 120, 0.12);
}

.diary-week-table.table-striped>tbody>tr:nth-of-type(odd)>td.diary-week-td--exempt {
  background-color: #e2e5ea !important;
}

.diary-week-table.table-hover tbody tr:hover>td.diary-week-td--exempt {
  background-color: #dde1e6 !important;
  color: var(--hd-muted);
}

/* Missed / absent labels — same red as fail rating (0/5), wins over exempt grey */
.diary-band--exempt .diary-slot-label--alert,
.diary-band-head--exempt .diary-slot-label--alert,
.diary-tc--exempt .diary-slot-label--alert,
.diary-slot-label--alert {
  color: var(--hd-rating-0) !important;
  font-weight: 600 !important;
}

.hd-diary-points-pill {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  max-width: 100%;
}

.diary-week-table td .diary-tc {
  min-width: 0;
  overflow: hidden;
}

.diary-week-table td .diary-tc-metrics {
  overflow-wrap: anywhere;
}
/* =============================================================================
   Hifz Diary — student views design system (Profile + Strategy)
   Status: positive (green) | warning (amber) | critical (red) | neutral (grey)
   ============================================================================= */

.hd-ds-student-page.container {
  max-width: 58rem;
}

.hd-profile-section {
  scroll-margin-top: 1rem;
}

/* L4 — page / panel kickers */
.hd-profile-kicker,
.hd-ds-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hd-muted);
  font-weight: 600;
}

/* Hero panels (Qur’an %, strategy testing order) */
.hd-profile-hero,
.hd-ds-hero-panel {
  border-radius: 1rem;
  background: linear-gradient(145deg, #fff 0%, #f5f3ff 100%);
  border: 1px solid rgba(var(--bs-primary-rgb), 0.15);
}

/* L2 — section labels (muted caps) */
.hd-profile-section-label,
.hd-ds-section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hd-muted);
  font-weight: 600;
}

/* L3 — supporting copy under metrics */
.hd-profile-sub,
.hd-ds-sub {
  font-size: 0.875rem;
  color: var(--hd-muted);
}

/* L1 — large headline numbers */
.hd-profile-metric,.hd-ds-metric-value {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* Analytics: split Class | Home metric box (mirrors diary mistakes/hesitations pair) */
.hd-split-metric-box {
  min-height: 5rem;
}

.hd-split-metric-label {
  font-size: 0.65rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--hd-muted);
  margin-bottom: 0.4rem;
}

.hd-split-metric-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--bs-emphasis-color);
}

.hd-split-metric-sub {
  font-size: 0.75rem;
  color: var(--hd-muted);
  margin-top: 0.35rem;
  line-height: 1.3;
}

/* L1 — primary headline line (strategy testing order) */
.hd-ds-reading-order {
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--hd-text);
  font-variant-numeric: tabular-nums;
}

.hd-ds-hero-panel--reading {
  border-width: 2px;
  box-shadow: 0 6px 22px rgba(var(--bs-primary-rgb), 0.1);
}

.hd-ds-reading-order--lead {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  letter-spacing: -0.03em;
}

.hd-ds-hero-panel--plan {
  border-width: 1px;
  background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
  border-color: rgba(0, 0, 0, 0.08);
}

.hd-ds-plan-list {
  margin: 0;
  padding-left: 1.35rem;
  list-style: decimal outside;
}

.hd-ds-plan-list > li {
  padding-left: 0.35rem;
  margin-bottom: 0.65rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--hd-text);
}

.hd-ds-plan-list > li:last-child {
  margin-bottom: 0;
}

/* Strategy hero — dense focus callout (optional layout) */
.hd-ds-focus-brief {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hd-ds-focus-brief--with-revision {
  border-left: 3px solid rgba(var(--bs-primary-rgb), 0.4);
  padding-left: 0.85rem;
  margin-left: 0.05rem;
}

.hd-ds-focus-brief-primary {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--hd-text);
  letter-spacing: -0.015em;
}

.hd-ds-focus-brief-secondary {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--hd-text);
  letter-spacing: -0.01em;
}

.hd-ds-focus-brief-secondary-lead {
  font-weight: 600;
  color: var(--hd-text);
}

.hd-ds-focus-brief-secondary-sep {
  font-weight: 600;
  margin: 0 0.12em 0 0;
}

.hd-ds-focus-brief-secondary-target {
  font-weight: 600;
}

.hd-ds-focus-brief-escalation {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--hd-muted);
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Shared data tables — Profile revision strength + Strategy revision recency */
.hd-juz-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hd-muted);
  font-weight: 600;
  text-align: center !important;
}

/* Bootstrap .table sets cell alignment; force centre for headers and data */
table.hd-juz-grid > thead > tr > th,
table.hd-juz-grid > tbody > tr > td,
.hd-juz-grid th,
.hd-juz-grid td {
  padding: 0.72rem 0.9rem;
  vertical-align: middle;
  text-align: center !important;
}

.hd-juz-grid th:first-child,
.hd-juz-grid td:first-child {
  padding-left: 1.1rem;
}

.hd-juz-grid th:last-child,
.hd-juz-grid td:last-child {
  padding-right: 1.1rem;
}

/* Revision strength — recency (blue), strongest (green), weakest (red) */
.hd-juz-grid tbody tr.hd-juz-row-latest > td {
  background-color: rgba(var(--bs-primary-rgb), 0.09);
}
.hd-juz-grid tbody tr.hd-juz-row-latest > td:first-child {
  box-shadow: inset 3px 0 0 0 rgba(var(--bs-primary-rgb), 0.55);
}
.table.hd-juz-grid.table-hover tbody tr.hd-juz-row-latest:hover > td {
  background-color: rgba(var(--bs-primary-rgb), 0.14);
}

.hd-juz-grid tbody tr.hd-juz-row-strongest > td {
  background-color: rgba(34, 197, 94, 0.14) !important;
}
.hd-juz-grid tbody tr.hd-juz-row-strongest > td:first-child {
  box-shadow: inset 3px 0 0 0 #22c55e;
}
.table.hd-juz-grid.table-hover tbody tr.hd-juz-row-strongest:hover > td {
  background-color: rgba(34, 197, 94, 0.2) !important;
}

.hd-juz-grid tbody tr.hd-juz-row-weakest > td {
  background-color: rgba(248, 113, 113, 0.16) !important;
}
.hd-juz-grid tbody tr.hd-juz-row-weakest > td:first-child {
  box-shadow: inset 3px 0 0 0 #ef4444;
}
.table.hd-juz-grid.table-hover tbody tr.hd-juz-row-weakest:hover > td {
  background-color: rgba(248, 113, 113, 0.22) !important;
}

/* Revision table — strength labels (plain text, no chip) */
.hd-state-strong {
  color: #15803d;
  font-weight: 700;
}

.hd-state-good {
  color: #16a34a;
  font-weight: 600;
}

.hd-state-medium {
  color: #0f766e;
  font-weight: 600;
}

.hd-state-weak {
  color: #a16207;
  font-weight: 600;
}

.hd-state-atrisk {
  color: #c2410c;
  font-weight: 700;
}

.hd-state-neutral {
  color: var(--hd-muted);
  font-weight: 500;
}

.hd-state-urgent {
  color: #dc2626;
  font-weight: 700;
}

/* Unified status pills — use everywhere (cards, tables, flags) */
.hd-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  border: 1px solid transparent;
  white-space: nowrap;
}

.hd-status-pill--sm {
  font-size: 0.75rem;
  padding: 0.26rem 0.62rem;
}

.hd-status-pill--md {
  font-size: 0.8125rem;
  padding: 0.38rem 0.78rem;
}

.hd-status-pill--lg {
  font-size: 0.95rem;
  padding: 0.55rem 1.1rem;
}

.hd-status-pill--positive {
  background-color: var(--bs-success-bg-subtle);
  color: var(--bs-success-text-emphasis);
  border-color: rgba(25, 135, 84, 0.32);
}

.hd-status-pill--warning {
  background-color: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text-emphasis);
  border-color: rgba(234, 179, 8, 0.45);
}

.hd-status-pill--critical {
  background-color: var(--bs-danger-bg-subtle);
  color: var(--bs-danger-text-emphasis);
  border-color: rgba(220, 53, 69, 0.35);
}

.hd-status-pill--neutral {
  background-color: var(--bs-light);
  color: var(--bs-secondary-color);
  border-color: rgba(0, 0, 0, 0.12);
}

/* Strategy — structured metric tiles */
.hd-ds-tile {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  height: 100%;
  background: rgba(var(--bs-primary-rgb), 0.04);
}

.hd-ds-tile-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hd-muted);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.hd-ds-tile-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hd-text);
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.hd-ds-tile-note {
  font-size: 0.8125rem;
  color: var(--hd-muted);
  margin-top: 0.3rem;
  font-weight: 500;
}

/* Tile on grey footer bands (Strategy revision summary) */
.hd-ds-tile--on-light {
  background: #fff !important;
  border-color: rgba(0, 0, 0, 0.07);
}

/* Strategy — New Lesson summary: narrative groups */
.hd-ds-nl-brief-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hd-muted);
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.hd-ds-tile--lead .hd-ds-tile-value {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.hd-ds-tile--outcomes .hd-ds-tile-label {
  margin-bottom: 0.45rem;
}

.hd-ds-nl-outcomes-line {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--hd-text);
  font-variant-numeric: tabular-nums;
}

.hd-ds-nl-outcomes-sub {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 0.35rem;
  color: #15803d;
}

.hd-ds-tile--outcomes-risk .hd-ds-nl-outcomes-line {
  color: var(--bs-danger-text-emphasis);
}

.hd-ds-tile--outcomes-risk .hd-ds-nl-outcomes-sub {
  color: var(--hd-muted);
  font-weight: 500;
}

.hd-ds-tile--pattern {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.hd-ds-nl-pattern-line {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--hd-text);
}

/* Strategy — key alerts (warning lane) */
.hd-ds-alert-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.hd-ds-alert-list > li {
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--bs-warning);
  background-color: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text-emphasis);
  font-size: 0.875rem;
  font-weight: 600;
}

.hd-ds-alert-list > li:last-child {
  margin-bottom: 0;
}

/* Flags / secondary callouts */
.hd-ds-flags-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Card body rhythm (Profile + Strategy) */
.hd-ds-card-body {
  padding: 1rem 1.25rem;
}

@media (min-width: 768px) {
  .hd-ds-card-body {
    padding: 1.25rem 1.5rem;
  }
}

/* Performance summary rows (Strategy hero) */
.hd-ds-perf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.hd-ds-perf-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.hd-ds-perf-row:first-child {
  padding-top: 0;
}

/* School org / platform — weekday list (wrapper must NOT use .form-check-input; see forms.py) */
.hd-class-weekday-checkboxes .hd-weekday-multiple,
.hd-class-weekday-checkboxes > div[id^="id_class_weekdays"],
.hd-class-weekday-checkboxes #id_class_weekdays {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.hd-class-weekday-checkboxes .hd-weekday-multiple > div > label,
.hd-class-weekday-checkboxes > div[id^="id_class_weekdays"] > div > label,
.hd-class-weekday-checkboxes #id_class_weekdays > div > label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 500;
}

.hd-class-weekday-checkboxes .hd-weekday-multiple input[type="checkbox"],
.hd-class-weekday-checkboxes input[type="checkbox"] {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  margin: 0;
}

.hd-class-weekday-checkboxes ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.hd-class-weekday-checkboxes .form-check {
  margin-bottom: 0;
}

.hd-institution-form-actions {
  /* Keep in normal flow — do not raise z-index or the Save button can paint over fields above */
  width: 100%;
}

/*
 * Bootstrap’s .card is `display: flex; flex-direction: column`. Putting that class on <form>
 * makes the form a flex container and can clip or stack children oddly with long checkbox lists.
 * Use: div.card > div.card-body > form.hd-plain-form
 */
.hd-card-with-form.card {
  overflow: visible;
}

.hd-card-with-form > .card-body {
  overflow: visible;
  /* Avoid flex-grow filling parent viewport (can clip long checkbox lists inside the card) */
  flex: 0 0 auto;
}

.hd-plain-form {
  display: block;
}

/* Class analytics — coloured summary + metric tiles */
.hd-analytics-points-card {
  border-radius: 0.85rem;
  padding: 1rem 1.1rem;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.hd-analytics-points-card--positive {
  background: linear-gradient(145deg, #fff 0%, var(--bs-success-bg-subtle) 100%);
  border-color: rgba(25, 135, 84, 0.28);
}

.hd-analytics-points-card--warning {
  background: linear-gradient(145deg, #fff 0%, var(--bs-warning-bg-subtle) 100%);
  border-color: rgba(234, 179, 8, 0.35);
}

.hd-analytics-points-card--critical {
  background: linear-gradient(145deg, #fff 0%, var(--bs-danger-bg-subtle) 100%);
  border-color: rgba(220, 53, 69, 0.28);
}

.hd-analytics-points-card--neutral {
  background: linear-gradient(145deg, #fff 0%, #f4f5f8 100%);
}

.hd-analytics-points-card__class {
  font-weight: 700;
  font-size: 0.95rem;
}

.hd-analytics-points-card__teacher {
  font-size: 0.8rem;
  color: var(--hd-muted);
}

.hd-analytics-points-card__rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hd-muted);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.hd-analytics-points-card__total {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0.65rem 0 0.35rem;
  font-variant-numeric: tabular-nums;
}

.hd-analytics-points-card__pts-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--hd-muted);
}

.hd-analytics-points-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--hd-muted);
}

.hd-analytics-class-card {
  border-left: 4px solid transparent;
}

.hd-analytics-class-card--positive {
  border-left-color: var(--bs-success);
}

.hd-analytics-class-card--warning {
  border-left-color: var(--bs-warning);
}

.hd-analytics-class-card--critical {
  border-left-color: var(--bs-danger);
}

.hd-analytics-class-card--neutral {
  border-left-color: var(--bs-secondary);
}

.hd-analytics-class-points-badge {
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  min-width: 9.5rem;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.hd-analytics-class-points-badge--positive {
  background: var(--bs-success-bg-subtle);
  border-color: rgba(25, 135, 84, 0.3);
}

.hd-analytics-class-points-badge--warning {
  background: var(--bs-warning-bg-subtle);
  border-color: rgba(234, 179, 8, 0.35);
}

.hd-analytics-class-points-badge--critical {
  background: var(--bs-danger-bg-subtle);
  border-color: rgba(220, 53, 69, 0.3);
}

.hd-analytics-class-points-badge--neutral {
  background: var(--bs-light);
}

.hd-analytics-class-points-badge__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--hd-muted);
}

.hd-analytics-class-points-badge__value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.hd-analytics-class-points-badge__sub {
  font-size: 0.75rem;
  color: var(--hd-muted);
}

.hd-analytics-metric {
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}

.hd-analytics-metric--positive {
  background: rgba(var(--bs-success-rgb), 0.07);
  border-color: rgba(25, 135, 84, 0.22);
}

.hd-analytics-metric--warning {
  background: rgba(var(--bs-warning-rgb), 0.1);
  border-color: rgba(234, 179, 8, 0.28);
}

.hd-analytics-metric--critical {
  background: rgba(var(--bs-danger-rgb), 0.07);
  border-color: rgba(220, 53, 69, 0.22);
}

.hd-analytics-metric--neutral {
  background: rgba(var(--bs-secondary-rgb), 0.05);
}

.hd-analytics-metric__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--hd-muted);
  margin-bottom: 0.45rem;
}

.hd-analytics-metric__value {
  min-height: 2rem;
  margin-bottom: 0.35rem;
}

.hd-analytics-metric__detail {
  font-size: 0.8125rem;
  color: var(--hd-muted);
  line-height: 1.35;
}

/* Diary — school holiday / closure days */
.diary-day-card--closure,
.diary-day-head--closure {
  background: linear-gradient(180deg, #fff9eb 0%, #fff 100%) !important;
}

.diary-day-col--closure {
  background: #fff9eb !important;
}

.diary-closure-badge .badge {
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Points earned/lost flash */
.hd-points-flash {
  position: fixed;
  top: 5.25rem;
  right: 1.25rem;
  z-index: 1080;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  pointer-events: none;
  animation: hd-points-float 2.4s ease-out forwards;
}

.hd-points-flash--gain {
  background: #ecfdf3;
  color: #15803d;
  border: 1px solid rgba(21, 128, 61, 0.25);
}

.hd-points-flash--loss {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.22);
}

@keyframes hd-points-float {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  12% {
    opacity: 1;
    transform: translateY(0) scale(1.04);
  }
  70% {
    opacity: 1;
    transform: translateY(-10px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-28px) scale(0.98);
  }
}

.hd-school-admin-shell {
  min-height: 100%;
}

.hd-school-admin-sidebar {
  position: sticky;
  top: 1rem;
}

.hd-school-admin-nav__list {
  display: grid;
  gap: 0.15rem;
}

.hd-school-admin-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
  color: var(--hd-text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.hd-school-admin-nav__link:hover {
  background: rgba(var(--bs-primary-rgb), 0.08);
  color: var(--hd-primary-solid);
}

.hd-school-admin-nav__link.is-active {
  background: rgba(var(--bs-primary-rgb), 0.12);
  color: var(--hd-primary-solid);
  font-weight: 600;
}

.hd-school-admin-nav__section {
  padding-left: 0.15rem;
}

.hd-setup-checklist {
  display: grid;
  gap: 0.75rem;
}

.hd-setup-checklist__item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.hd-setup-checklist__mark {
  width: 1.25rem;
  flex-shrink: 0;
  font-weight: 700;
  color: var(--hd-muted);
}

.hd-setup-checklist__item.is-done .hd-setup-checklist__mark {
  color: #15803d;
}

.hd-section-card {
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hd-section-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1.25rem rgba(28, 33, 51, 0.08) !important;
}

.hd-explore-card {
  color: inherit;
  border: 1px solid rgba(var(--bs-primary-rgb), 0.14) !important;
  box-shadow: 0 0.125rem 0.5rem rgba(28, 33, 51, 0.05);
}

.hd-explore-card:hover,
.hd-explore-card:focus-visible {
  border-color: rgba(var(--bs-primary-rgb), 0.35) !important;
  outline: none;
}

.hd-explore-card:hover .hd-explore-card__arrow,
.hd-explore-card:focus-visible .hd-explore-card__arrow {
  color: var(--hd-primary-solid);
  transform: translateX(3px);
}

.hd-explore-card__arrow {
  color: rgba(var(--bs-primary-rgb), 0.45);
  font-weight: 700;
  line-height: 1.2;
  transition: transform 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.hd-school-tabs .nav-link {
  color: var(--hd-muted);
  font-weight: 600;
}

.hd-school-tabs .nav-link.active {
  color: var(--hd-primary-solid);
}

/* Bulk add students — card layout on small screens */
@media (max-width: 991.98px) {
  .hd-bulk-students-wrap {
    overflow: visible;
  }

  .hd-bulk-students-table thead {
    display: none;
  }

  .hd-bulk-students-table,
  .hd-bulk-students-table tbody,
  .hd-bulk-students-table tr,
  .hd-bulk-students-table td {
    display: block;
    width: 100%;
  }

  .hd-bulk-students-table tr.hd-bulk-student-row {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid rgba(28, 33, 51, 0.1);
    border-radius: 0.75rem;
    background: #fff;
  }

  .hd-bulk-students-table td {
    padding: 0.35rem 0;
    border: none;
  }

  .hd-bulk-students-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hd-muted);
    margin-bottom: 0.25rem;
  }

  .hd-bulk-students-table td[data-label="Code"] .student-code-preview {
    font-size: 0.875rem;
  }

  .hd-bulk-students-table .form-control,
  .hd-bulk-students-table .form-select {
    width: 100%;
  }
}

.hd-admin-alert .alert-link {
  font-weight: 600;
}

.hd-guide-step__mark {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--hd-primary-solid);
  font-weight: 700;
  font-size: 0.875rem;
}

.hd-guide-step.is-done .hd-guide-step__mark {
  background: rgba(21, 128, 61, 0.12);
}

.hd-guide-step.is-optional {
  opacity: 0.95;
}

/* Label row + ? help: centre icon with text; panel drops on next line */
.hd-form-label-row,
.small:has(.hd-context-help__panel),
.h5:has(.hd-context-help__panel),
.h6:has(.hd-context-help__panel),
li:has(.hd-context-help__panel) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.25rem;
  row-gap: 0;
}

.hd-form-label-row {
  margin-bottom: 0.5rem;
}

.hd-form-label-row > .form-label {
  margin-bottom: 0;
  width: auto;
}

.hd-form-label-row > .hd-context-help-inline {
  margin-left: 0;
}

.hd-form-label-row > .hd-context-help__panel {
  flex-basis: 100%;
  width: 100%;
  margin-top: 0.375rem;
  margin-bottom: 0;
}

.hd-context-help-inline {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 1;
}

.hd-context-help__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.0625rem;
  height: 1.0625rem;
  min-width: 1.0625rem;
  min-height: 1.0625rem;
  margin: 0;
  padding: 0;
  border: 1.5px solid rgba(var(--bs-primary-rgb), 0.35);
  border-radius: 50%;
  background: transparent;
  color: rgba(var(--bs-primary-rgb), 0.5);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hd-context-help__btn:hover,
.hd-context-help__btn:focus-visible,
.hd-context-help__btn[aria-expanded="true"] {
  opacity: 1;
  color: var(--hd-primary-solid);
  border-color: rgba(var(--bs-primary-rgb), 0.7);
  background: rgba(var(--bs-primary-rgb), 0.06);
  outline: none;
}

.hd-context-help__panel {
  flex-basis: 100%;
  display: block;
  width: 100%;
  margin-top: 0.375rem;
  margin-bottom: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(var(--bs-primary-rgb), 0.06);
}

/* Table headers: keep cell layout, nudge icon to text centre */
th .hd-context-help-inline {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 0.35em;
}

.hd-context-help__panel.collapse.show,
.hd-context-help__panel.collapsing {
  display: block;
}

.hd-context-help__text {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  font-style: normal;
  color: var(--hd-muted);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.45;
}

/* ============================================================
   Teacher application shell (navigation rail)
   ============================================================ */

:root {
  --brand-blue: #6577e8;
  --brand-purple: #6552d8;
  --brand-purple-dark: #513fc3;
  --brand-purple-soft: #eeeafe;
  --brand-purple-pale: #f4f1ff;
  --text-primary: #22263a;
  --text-secondary: #6f7587;
  --text-muted: #858a9a;
  --workspace-background: #f7f7fc;
  --surface: #ffffff;
  --surface-muted: #f8f8fb;
  --border: #e7e8f1;
  --warning-background: #fff8e4;
  --warning-border: #f3df9b;
  --warning-text: #785510;
  --warning-icon: #a96d13;
  --hd-teacher-sidebar-width: 192px;
  --hd-teacher-appbar-height: 64px;
}

body.hd-teacher-app {
  background: var(--workspace-background);
}

.hd-teacher-appbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--hd-teacher-appbar-height);
  max-height: 68px;
  padding: 0 1.5rem;
  background: linear-gradient(90deg, #6577e8 0%, #705ed0 52%, #7950b5 100%);
  color: #fff;
}

.hd-teacher-appbar__brand {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-left: 0.25rem;
}

.hd-teacher-appbar__brand:hover,
.hd-teacher-appbar__brand:focus-visible {
  color: #fff;
  opacity: 0.92;
}

.hd-teacher-account__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0.25rem 0.35rem;
  border-radius: 999px;
}

.hd-teacher-account__btn:hover,
.hd-teacher-account__btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.hd-teacher-account__btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

.hd-teacher-account__name {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.95;
}

.hd-teacher-account__avatar {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hd-teacher-account__menu {
  min-width: 11rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(31, 34, 54, 0.12);
  padding: 0.4rem;
}

.hd-teacher-account__menu .dropdown-item {
  border-radius: 8px;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
}

.hd-teacher-shell {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - var(--hd-teacher-appbar-height));
}

/* Unified labelled teacher sidebar (replaces the 80px icon rail) */
.hd-teacher-sidebar {
  position: sticky;
  top: var(--hd-teacher-appbar-height);
  flex: 0 0 var(--hd-teacher-sidebar-width);
  width: var(--hd-teacher-sidebar-width);
  max-width: var(--hd-teacher-sidebar-width);
  align-self: flex-start;
  height: calc(100vh - var(--hd-teacher-appbar-height));
  /* d-lg-flex is row by default — column so the nav fills the rail */
  flex-direction: column;
  align-items: stretch;
  background: #ffffff;
  border-right: 1px solid #e7e8f1;
  z-index: 30;
}

.hd-teacher-sidebar-nav {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  flex: 1 1 auto;
  height: 100%;
  padding: 12px;
  min-height: 0;
  box-sizing: border-box;
}

.hd-teacher-sidebar-nav--drawer {
  min-height: calc(100vh - 4.5rem);
  height: auto;
  gap: 1.5rem;
}

.hd-teacher-sidebar-nav__top,
.hd-teacher-sidebar-nav__bottom {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hd-teacher-sidebar-nav__divider {
  height: 1px;
  margin: 8px 6px 10px;
  background: #e7e8f1;
}

.hd-teacher-sidebar-nav__logout {
  margin: 0;
}

.hd-teacher-sidebar-nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 46px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  color: #697084;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: 0;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.hd-teacher-sidebar-nav__item .hd-lucide {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: block;
}

.hd-teacher-sidebar-nav__item:hover,
.hd-teacher-sidebar-nav__item:focus-visible {
  background: #f4f1ff;
  color: #5947c8;
  outline: none;
}

.hd-teacher-sidebar-nav__item.is-active {
  background: #eeeafe;
  color: #5947c8;
  font-weight: 600;
}

.hd-teacher-sidebar-nav__item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #5947c8;
}

.hd-teacher-sidebar-nav__item--logout {
  cursor: pointer;
  font: inherit;
}

.hd-teacher-sidebar-nav__item--logout:hover,
.hd-teacher-sidebar-nav__item--logout:focus-visible {
  background: #fff1f1;
  color: #c7464b;
}

.hd-teacher-class-selector {
  position: relative;
  margin-bottom: 8px;
}

.hd-teacher-class-selector__trigger,
.hd-teacher-class-selector__label {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e7e8f1;
  background: #fafbfe;
  color: #20243a;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  box-sizing: border-box;
}

.hd-teacher-class-selector__trigger .hd-lucide,
.hd-teacher-class-selector__label .hd-lucide {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: block;
}

.hd-teacher-class-selector__chevron .hd-lucide {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
}

.hd-teacher-class-selector__trigger {
  cursor: pointer;
}

.hd-teacher-class-selector__trigger:hover,
.hd-teacher-class-selector__trigger:focus-visible {
  border-color: #d8d4f0;
  background: #f4f1ff;
  outline: none;
}

.hd-teacher-class-selector__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hd-teacher-class-selector__chevron {
  flex: 0 0 auto;
  color: #697084;
  display: inline-flex;
}

.hd-teacher-class-selector--static .hd-teacher-class-selector__label {
  cursor: default;
}

.hd-teacher-class-selector__menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  border: 1px solid #e7e8f1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 34, 54, 0.1);
}

.hd-teacher-class-selector__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #20243a;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.hd-teacher-class-selector__option:hover,
.hd-teacher-class-selector__option:focus-visible {
  background: #f4f1ff;
  color: #5947c8;
  outline: none;
}

.hd-teacher-class-selector__current {
  color: #5947c8;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hd-teacher-class-selector__sep {
  height: 1px;
  margin: 4px 6px;
  background: #e7e8f1;
}

.hd-teacher-drawer {
  --bs-offcanvas-width: 290px;
}

.hd-teacher-appbar__menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-right: 0.35rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.hd-teacher-appbar__menu:hover,
.hd-teacher-appbar__menu:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  outline: none;
}

.hd-teacher-appbar__leading {
  display: flex;
  align-items: center;
  min-width: 0;
}

.hd-teacher-workspace-frame {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--workspace-background);
}

.hd-teacher-messages {
  max-width: 1320px;
  margin-left: 0;
  margin-right: auto;
  padding: 1rem 2.5rem 0;
}

.hd-teacher-workspace-main {
  width: 100%;
  margin-left: 0;
  margin-right: auto;
  padding: 34px 40px 64px;
}

/* Teacher workspace width variants (left-aligned within the shell) */
.teacher-workspace {
  width: 100%;
  margin-left: 0;
  margin-right: auto;
}

.teacher-workspace--wide {
  max-width: 1320px;
}

.teacher-workspace--standard {
  max-width: 1140px;
}

.teacher-workspace--form {
  max-width: 1120px;
}

.teacher-workspace--reading {
  max-width: 820px;
}

.hd-teacher-page {
  width: 100%;
}

/* Student/parent pages share teacher surfaces inside diary/base container */
.hd-student-audience-shell {
  max-width: 1140px;
}

.hd-student-audience-shell--wide {
  max-width: 1320px;
}

.hd-student-audience-shell--reading {
  max-width: 42rem;
}

.hd-student-audience-chrome {
  margin: 0 0 1rem;
}

.hd-points-guide-page .hd-today-header {
  margin-bottom: 1.5rem;
}

.hd-points-guide-page .hd-student-section-nav {
  margin: 0 0 1.5rem;
}

.hd-points-guide-page .hd-teacher-surface {
  margin-bottom: 1.5rem;
}

.hd-points-guide-page .hd-teacher-surface:last-of-type {
  margin-bottom: 1rem;
}

.hd-homework-log-page .hd-today-header {
  margin-bottom: 1.5rem;
}

.hd-homework-log-page .hd-student-section-nav {
  margin: 0 0 1.5rem;
}

.hd-homework-log-page .hd-homework-log-form {
  margin-bottom: 0;
}

.hd-homework-log-affirmation {
  background: #f7f7fb;
  border-color: #eceef4 !important;
}

.hd-workspace-breadcrumb {
  margin-bottom: 1.15rem;
}

.hd-workspace-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.hd-workspace-breadcrumb__item:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: #c0c4d0;
}

.hd-workspace-breadcrumb__item a {
  color: var(--text-secondary);
  text-decoration: none;
}

.hd-workspace-breadcrumb__item a:hover {
  color: var(--brand-purple);
}

.hd-workspace-breadcrumb__item.is-current {
  color: var(--text-secondary);
}

.hd-today-header {
  margin-bottom: 1.85rem;
}

.hd-today-header--with-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.hd-today-header__copy {
  min-width: 0;
  flex: 1 1 16rem;
}

.hd-today-header__eyebrow {
  margin: 0 0 6px;
  color: #777c8f;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hd-today-header__title {
  margin: 0;
  color: #20243a;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hd-today-header__date {
  margin: 8px 0 0;
  color: #7b8091;
  font-size: 0.97rem;
  font-weight: 400;
}

.hd-today-header__meta {
  margin: 6px 0 0;
  color: #7b8091;
  font-size: 0.875rem;
  font-weight: 400;
}

.hd-today-header__actions {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 0.75rem;
}

.hd-setup-alert-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  min-height: 104px;
  max-width: 100%;
  margin-bottom: 1.75rem;
  padding: 1.1rem 1.35rem;
  border: 1px solid var(--warning-border);
  border-radius: 14px;
  background: var(--warning-background);
}

.hd-setup-alert-rail__body {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1 1 18rem;
  min-width: 0;
}

.hd-setup-alert-rail__icon {
  flex: 0 0 auto;
  color: var(--warning-icon);
  margin-top: 0.15rem;
}

.hd-setup-alert-rail__title {
  color: var(--warning-text);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.hd-setup-alert-rail__text {
  margin: 0;
  color: var(--warning-text);
  font-size: 0.875rem;
  line-height: 1.45;
  max-width: 42rem;
}

.hd-setup-alert-rail__btn {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1.5px solid var(--brand-purple);
  border-radius: 12px;
  color: var(--brand-purple);
  background: #fff;
  font-weight: 600;
  padding: 0.45rem 1rem;
}

.hd-setup-alert-rail__btn:hover,
.hd-setup-alert-rail__btn:focus-visible {
  color: var(--brand-purple-dark);
  border-color: var(--brand-purple-dark);
  background: #faf9ff;
}

.hd-day-status-rail__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.hd-day-status-rail__actions .hd-setup-alert-rail__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hd-exempt-lessons-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid #cfc6f3;
  border-radius: 10px;
  background: #faf9ff;
  color: #5947c8;
  font-weight: 600;
}

.hd-exempt-lessons-btn:hover,
.hd-exempt-lessons-btn:focus-visible {
  background: #f0eefa;
  border-color: #b9aef0;
  color: #4a39b5;
}

.hd-today-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.hd-today-toolbar .hd-student-search-wrap {
  flex: 1 1 14rem;
  min-width: 0;
  margin-bottom: 0 !important;
}

/* —— Side sheet (shared interaction language) —— */
body.hd-sheet-open {
  overflow: hidden;
}

.hd-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(28, 30, 45, 0.38);
  opacity: 0;
  transition: opacity 180ms ease;
}

.hd-sheet-backdrop.is-open {
  opacity: 1;
}

.hd-sheet {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  width: min(100vw, 34rem);
  max-width: 100vw;
  height: 100%;
  background: #fff;
  box-shadow: -12px 0 40px rgba(31, 34, 54, 0.16);
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.hd-sheet.is-open {
  transform: translateX(0);
}

.hd-sheet__form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.hd-sheet__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem 1rem;
  border-bottom: 1px solid #ececf4;
}

.hd-sheet__title {
  margin: 0;
  color: #22263a;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
}

.hd-sheet__subtitle {
  margin: 0.35rem 0 0;
  color: #6f7587;
  font-size: 0.9rem;
  line-height: 1.4;
}

.hd-sheet__close {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 10px;
  color: #5c6378;
}

.hd-sheet__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.15rem 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.hd-sheet__section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hd-sheet__label {
  margin: 0;
  color: #25293c;
  font-size: 0.92rem;
  font-weight: 650;
}

.hd-sheet__date-human {
  margin: 0;
  color: #6f7587;
  font-size: 0.88rem;
}

.hd-exempt-date-banner {
  margin-top: 0.15rem;
}

.hd-exempt-lesson-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hd-sheet__section .hd-hw-toggle-key {
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
}

.hd-exempt-reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hd-exempt-reason-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid #ddd7f7;
  border-radius: 999px;
  background: #faf9ff;
  color: #5947c8;
  font-size: 0.84rem;
  font-weight: 600;
}

.hd-exempt-reason-chip:hover,
.hd-exempt-reason-chip.is-active {
  background: #f0eefa;
  border-color: #b9aef0;
}

.hd-exempt-student-panel {
  margin-top: 0.35rem;
  padding: 0.75rem;
  border: 1px solid #e4e6ef;
  border-radius: 14px;
  background: #fff;
}

.hd-exempt-student-panel .form-control {
  border-radius: 10px;
  border-color: #e4e6ef;
}

.hd-exempt-student-checks {
  max-height: 16rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hd-exempt-student-checks .hd-exempt-student-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.35rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid #e4e6ef;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.hd-exempt-student-checks .hd-exempt-student-check:hover {
  background: #faf9ff;
  border-color: #ddd7f7;
}

.hd-exempt-student-checks .hd-exempt-student-check:has(input:checked) {
  background: #f4f1ff;
  border-color: #c7bdf5;
}

.hd-exempt-student-checks .hd-exempt-student-check .hd-teacher-check-row__control {
  display: flex;
  align-items: center;
  padding-top: 0;
}

.hd-exempt-student-checks .hd-exempt-student-check .form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex-shrink: 0;
  border: 1.5px solid #b7bcd0;
  border-radius: 0.3rem;
  background-color: #fff;
  background-image: none;
  appearance: none;
  -webkit-appearance: none;
  opacity: 1;
  position: static;
  float: none;
  cursor: pointer;
}

.hd-exempt-student-checks .hd-exempt-student-check .form-check-input:checked {
  background-color: #6552d8;
  border-color: #6552d8;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='m3.5 8.5 2.5 2.5 6-6'/%3e%3c/svg%3e");
  background-size: 0.75rem 0.75rem;
  background-position: center;
  background-repeat: no-repeat;
}

.hd-exempt-student-checks .hd-exempt-student-check .hd-teacher-check-row__label {
  font-size: 0.95rem;
  font-weight: 650;
  color: #25293c;
}

.hd-exempt-student-checks .hd-exempt-student-check .hd-teacher-check-row__help {
  font-size: 0.8rem;
  color: #8b91a3;
}

.hd-exempt-summary {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #f5f6fa;
  border: 1px solid #e7e8f1;
}

.hd-exempt-summary__list {
  margin: 0;
  padding-left: 1.1rem;
  color: #3a3f55;
  font-size: 0.9rem;
  line-height: 1.55;
}

.hd-exempt-summary__warn {
  margin: 0.65rem 0 0;
  color: #785510;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
}

.hd-sheet__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 0.9rem 1.35rem 1.15rem;
  border-top: 1px solid #ececf4;
  background: #fff;
}

@media (max-width: 767.98px) {
  .hd-sheet {
    width: 100vw;
  }

  .hd-sheet__footer {
    position: sticky;
    bottom: 0;
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
  }

  .hd-sheet__footer .btn-primary {
    flex: 1 1 auto;
  }
}

.hd-students-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.35rem;
}

.hd-students-section-head__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.hd-students-section-head__title {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.hd-students-section-head__count {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hd-neutral-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #eceef3;
  color: #666c7c;
  font-size: 0.72rem;
  font-weight: 500;
}

.hd-students-section-head__hint {
  margin: 0 0 1.1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.hd-att-key {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid rgba(28, 33, 51, 0.1);
  border-radius: 10px;
  background: #f6f7fa;
}

.hd-att-key__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.35rem 0.15rem 0.15rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(28, 33, 51, 0.08);
}

.hd-att-key__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.hd-att-key__mark--present {
  color: #2e7a51;
  background: rgba(46, 122, 81, 0.12);
}

.hd-att-key__mark--late {
  color: #a95b24;
  background: rgba(169, 91, 36, 0.12);
}

.hd-att-key__mark--absent {
  color: #c83e44;
  background: rgba(200, 62, 68, 0.12);
}

.hd-att-key__label {
  color: #5c6478;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  padding-right: 0.1rem;
}

.hd-student-name-link {
  color: #25293c;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.hd-student-name-link:hover {
  color: var(--brand-purple);
}

.hd-student-code {
  color: #7a8090;
  font-size: 0.875rem;
  font-weight: 400;
}

.hd-log-lesson-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.4rem 1.05rem;
  border: 0;
  border-radius: 10px;
  background: #5e4bd7;
  color: #fff !important;
  font-size: 0.9rem;
  font-weight: 600;
}

.hd-log-lesson-btn:hover,
.hd-log-lesson-btn:focus-visible {
  background: #513fc3;
  color: #fff !important;
}

.hd-row-menu-dropdown {
  min-width: 11.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(31, 34, 54, 0.12);
  padding: 0.35rem;
}

.hd-row-menu-dropdown .dropdown-item {
  border-radius: 8px;
  min-height: 2.6rem;
  display: flex;
  align-items: center;
}

/* ============================================================
   Today dense register table (unified across breakpoints)
   ============================================================ */

.hd-today-register-shell {
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-bottom: 0.35rem;
  outline: none;
}

.hd-today-register-shell:focus-visible {
  box-shadow: 0 0 0 2px rgba(101, 82, 216, 0.28);
  border-radius: 12px;
}

.hd-today-register-table {
  border-spacing: 0 0.35rem;
  width: 100%;
  min-width: 38rem;
}

.hd-today-register-table thead th {
  padding: 0.2rem 0.65rem 0.35rem;
  white-space: nowrap;
}

.hd-today-register-table tbody td {
  height: auto;
  min-height: 3.625rem; /* ~58px */
  padding: 0.4rem 0.55rem;
}

.hd-today-register-table .hd-today-col-student {
  width: 14rem;
  min-width: 11rem;
  max-width: 14.5rem;
}

.hd-today-register-table .hd-today-col-att {
  width: 1%;
  white-space: nowrap;
}

.hd-today-register-table thead .hd-today-col-att[colspan] {
  text-align: center;
}

.hd-today-register-table .hd-today-col-log,
.hd-today-register-table .hd-today-col-diary {
  width: 1%;
  white-space: nowrap;
}

.hd-today-register-table .hd-today-col-more {
  width: 3rem;
  min-width: 3rem;
  padding-right: 0.65rem;
}

.hd-today-student-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  min-width: 0;
  max-width: 13.5rem;
}

.hd-today-student-cell .hd-student-name-link {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  font-size: 0.9375rem;
  line-height: 1.25;
}

.hd-today-student-cell .hd-student-code {
  font-size: 0.75rem;
  line-height: 1.2;
}

.hd-today-student-cell .hd-status-chip {
  display: inline-flex;
  margin-top: 0.1rem;
  font-size: 0.65rem;
  padding: 0.12rem 0.4rem;
  line-height: 1.2;
  white-space: nowrap;
}

.hd-today-register-table .hd-att-btn {
  min-height: 2.35rem;
  min-width: 2.35rem;
  width: 2.35rem;
  padding: 0.2rem 0.35rem !important;
  gap: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hd-today-register-table .hd-att-btn[data-status="present"],
.hd-today-register-table .hd-att-btn[data-status="late"],
.hd-today-register-table .hd-att-btn[data-status="absent"] {
  min-width: 2.35rem;
}

.hd-today-register-table .hd-log-lesson-btn,
.hd-today-register-table .hd-diary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.45rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.hd-today-register-table .hd-row-menu {
  min-width: 2.45rem;
  min-height: 2.45rem;
}

/* Tablet/mobile: shared horizontal scroller (names scroll with the row) */
@media (max-width: 1024px) {
  .hd-today-register-shell {
    margin-inline: -0.15rem;
    padding-inline: 0.15rem;
    padding-bottom: 4.75rem;
  }

  /* Prefer existing Hifz Lens pattern: lift overflow while Bootstrap dropdown is open */
  .hd-today-register-shell:has(.dropdown.show),
  .hd-today-register-shell:has(.dropdown-menu.show) {
    overflow: visible;
  }

  .hd-today-register-table {
    min-width: 36rem;
    border-spacing: 0 0.3rem;
  }

  .hd-today-register-table tbody td {
    min-height: 3.875rem; /* ~62px */
    padding: 0.45rem 0.5rem;
  }

  .hd-today-register-table .hd-today-col-student {
    min-width: 10.25rem;
    max-width: 11.75rem;
    width: 11rem;
  }

  .hd-today-student-cell {
    max-width: 10.75rem;
  }
}

@media (max-width: 767.98px) {
  .hd-today-register-table {
    min-width: 34rem;
  }

  .hd-today-register-table .hd-today-col-student {
    min-width: 9.75rem;
    max-width: 11rem;
    width: 10.25rem;
  }

  .hd-today-student-cell {
    max-width: 9.85rem;
  }

  .hd-today-register-table tbody td {
    min-height: 4rem; /* ~64px */
  }
}

@media (min-width: 1025px) {
  .hd-today-register-shell {
    overflow-x: visible;
  }

  .hd-today-register-table {
    min-width: 0;
  }
}

.hd-teacher-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.15rem;
  padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.hd-teacher-bottom-nav::-webkit-scrollbar {
  display: none;
}

.hd-teacher-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex: 0 0 auto;
  min-width: 4.75rem;
  min-height: 44px;
  padding: 0.35rem 0.45rem;
  border-radius: 10px;
  color: #73798b;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.hd-teacher-bottom-nav__item.is-active {
  background: #eeeafe;
  color: #4e3bbe;
}

.hd-teacher-bottom-nav__item:focus-visible {
  outline: 2px solid rgba(101, 82, 216, 0.35);
  outline-offset: 2px;
}

@media (max-width: 1199.98px) and (min-width: 992px) {
  :root {
    --hd-teacher-sidebar-width: 180px;
  }
}

@media (max-width: 767.98px) {
  .hd-teacher-appbar {
    padding: 0 1rem;
  }

  .hd-teacher-account__name {
    display: none;
  }

  .hd-teacher-workspace-main {
    padding: 1.25rem 1rem 5.75rem;
  }

  .hd-teacher-messages {
    padding: 0.85rem 1rem 0;
  }

  .hd-today-header__title {
    font-size: 1.85rem;
  }

  .hd-setup-alert-rail {
    min-height: 0;
    padding: 0.95rem 1rem;
  }

  .hd-setup-alert-rail__btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hd-att-btn {
    transition: none;
  }

  .hd-att-btn:hover,
  .hd-att-btn:active {
    filter: none;
  }
}

/* ============================================================
   Teacher form pages (Homework settings and shared surfaces)
   ============================================================ */

.hd-settings-groups {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.hd-settings-index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 1.75rem;
}

.hd-settings-index-grid .hd-settings-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hd-settings-group > .hd-settings-row + .hd-settings-row {
  margin-top: 22px;
}

.hd-settings-group--full {
  grid-column: 1 / -1;
}

@media (max-width: 999px) {
  .hd-settings-index-grid {
    grid-template-columns: 1fr;
  }

  .hd-settings-group--full {
    grid-column: auto;
  }
}

.hd-settings-group__label {
  margin: 0 0 0.55rem;
  padding: 0 0.15rem;
  color: #777c8f;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hd-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 118px;
  padding: 22px 24px;
  border: 1px solid #e7e8f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(31, 34, 54, 0.035);
  text-decoration: none;
  color: inherit;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.hd-settings-row:hover,
.hd-settings-row:focus-visible {
  border-color: #d8d4f0;
  background: #fbfaff;
  box-shadow: 0 6px 18px rgba(31, 34, 54, 0.05);
  outline: none;
}

.hd-settings-row__copy {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.hd-settings-row__title {
  color: #20243a;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.25;
}

.hd-settings-row__desc {
  color: #7b8091;
  font-size: 0.9rem;
  line-height: 1.45;
}

.hd-settings-row__chevron {
  flex: 0 0 auto;
  color: #9aa0b2;
}

.hd-settings-row:hover .hd-settings-row__chevron,
.hd-settings-row:focus-visible .hd-settings-row__chevron {
  color: var(--brand-purple, #6552d8);
}

.hd-teacher-form {
  max-width: 880px;
}

/* —— Qur’an setup (dense class grid) —— */
.hd-hifz-setup-page {
  max-width: 1320px;
}

.hd-hifz-onboard {
  display: grid;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.hd-hifz-onboard-card {
  margin-bottom: 0;
}

.hd-hifz-onboard-card--ref {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.hd-hifz-onboard-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.hd-hifz-onboard-card__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--brand-purple, #6552d8);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.hd-hifz-onboard-card__title {
  margin: 0 0 0.2rem;
  color: #20243a;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.hd-hifz-onboard-card__lead {
  margin: 0;
  color: #6f7587;
  font-size: 0.9rem;
  line-height: 1.4;
}

.hd-hifz-onboard-benefits {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hd-hifz-onboard-benefits li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 1rem 0.65rem;
  text-align: center;
  border: 1px solid #eceef5;
  border-radius: 12px;
  background: #fafafc;
}

.hd-hifz-onboard-benefits__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: #f3f1fc;
  color: var(--brand-purple, #6552d8);
}

.hd-hifz-onboard-benefits__label {
  color: #30354a;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}

.hd-hifz-onboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.9fr);
  gap: 1rem;
  align-items: stretch;
}

.hd-hifz-onboard-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.2rem;
  min-width: 0;
}

.hd-hifz-onboard-flow__step {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #e0e2ef;
  border-radius: 10px;
  background: #f7f8fc;
}

.hd-hifz-onboard-flow__label {
  color: #30354a;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

.hd-hifz-onboard-flow__hint {
  color: #8a90a2;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hd-hifz-onboard-flow__arrow {
  display: inline-flex;
  color: #a8adc0;
  flex-shrink: 0;
}

.hd-hifz-onboard-note {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid #cfd8f6;
  background: #eef2ff;
  color: #3a4580;
}

.hd-hifz-onboard-note__icon {
  display: inline-flex;
  margin-top: 0.05rem;
  color: #4f63c7;
  flex-shrink: 0;
}

.hd-hifz-onboard-note__title {
  margin: 0 0 0.25rem;
  color: #2f3a73;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
}

.hd-hifz-onboard-note__body {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.hd-hifz-onboard-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.hd-hifz-onboard-stage {
  margin: 0;
  padding: 1.15rem 1.15rem 1.2rem;
  border-radius: 14px;
  border: 1px solid #e8eaf2;
  background: #fff;
}

.hd-hifz-onboard-stage__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.75rem;
  border-radius: 10px;
}

.hd-hifz-onboard-stage--beginner {
  border-color: #cfe8d6;
  background: #f4faf6;
}

.hd-hifz-onboard-stage--beginner .hd-hifz-onboard-stage__icon {
  background: #dff3e6;
  color: #15803d;
}

.hd-hifz-onboard-stage--progress {
  border-color: #f0e2b8;
  background: #fffbf0;
}

.hd-hifz-onboard-stage--progress .hd-hifz-onboard-stage__icon {
  background: #f7ebc8;
  color: #a16207;
}

.hd-hifz-onboard-stage--hafiz {
  border-color: #ddd6f8;
  background: #f7f5fd;
}

.hd-hifz-onboard-stage--hafiz .hd-hifz-onboard-stage__icon {
  background: #ebe6fb;
  color: var(--brand-purple, #6552d8);
}

.hd-hifz-onboard-stage__name {
  margin: 0 0 0.65rem;
  color: #20243a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.hd-hifz-onboard-stage__lines {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hd-hifz-onboard-stage__lines li {
  position: relative;
  margin: 0;
  padding-left: 0.85rem;
  color: #5b6174;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
}

.hd-hifz-onboard-stage__lines li + li {
  margin-top: 0.3rem;
}

.hd-hifz-onboard-stage__lines li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
}

.hd-hifz-onboard-ref > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  color: #30354a;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
}

.hd-hifz-onboard-ref > summary::-webkit-details-marker {
  display: none;
}

.hd-hifz-onboard-ref > summary::after {
  content: "▾";
  margin-left: auto;
  color: #8a90a2;
  font-weight: 500;
}

.hd-hifz-onboard-ref[open] > summary::after {
  content: "▴";
}

.hd-hifz-onboard-ref__wrap {
  margin-top: 0.85rem;
  overflow-x: auto;
  border: 1px solid #e8eaf2;
  border-radius: 12px;
  background: #fff;
}

.hd-hifz-onboard-ref__table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  min-width: 32rem;
}

.hd-hifz-onboard-ref__table th,
.hd-hifz-onboard-ref__table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid #eef0f6;
  text-align: left;
  vertical-align: top;
  font-size: 0.86rem;
  line-height: 1.4;
}

.hd-hifz-onboard-ref__table thead th {
  background: #f7f8fc;
  color: #6f7587;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hd-hifz-onboard-ref__table tbody th {
  color: #30354a;
  font-weight: 700;
  white-space: nowrap;
}

.hd-hifz-onboard-ref__table tbody td {
  color: #5b6174;
  font-weight: 500;
}

.hd-hifz-onboard-ref__table tbody tr:last-child th,
.hd-hifz-onboard-ref__table tbody tr:last-child td {
  border-bottom: 0;
}

.hd-hifz-onboard-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 1.35rem;
}

.hd-hifz-onboard-stat {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0;
  padding: 1rem 1.15rem;
}

.hd-hifz-onboard-stat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  flex-shrink: 0;
  border-radius: 10px;
  background: #f3f1fc;
  color: var(--brand-purple, #6552d8);
}

.hd-hifz-onboard-stat__label {
  margin: 0;
  color: #7b8091;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}

.hd-hifz-onboard-stat__value {
  margin: 0.15rem 0 0;
  color: #20243a;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

@media (max-width: 960px) {
  .hd-hifz-onboard-benefits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hd-hifz-onboard-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hd-hifz-onboard-benefits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hd-hifz-onboard-stages,
  .hd-hifz-onboard-stats {
    grid-template-columns: 1fr;
  }

  .hd-hifz-onboard-flow__arrow {
    display: none;
  }

  .hd-hifz-onboard-flow__step {
    width: 100%;
  }
}

.hd-hifz-setup-scroll-hint {
  display: none;
  margin: 0 0 0.75rem;
  color: #7b8091;
  font-size: 0.88rem;
}

.hd-hifz-setup-panel {
  background: #fff;
  border: 1px solid #e7e8f1;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(31, 34, 54, 0.035);
  overflow: hidden;
  margin-bottom: 1.35rem;
}

.hd-hifz-setup-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hd-hifz-setup-table {
  width: 100%;
  min-width: 48rem;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.hd-hifz-setup-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 0.85rem 0.75rem;
  background: #fafafd;
  color: #4d5365;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  vertical-align: bottom;
  border-bottom: 1px solid #e7e8f1;
  white-space: normal;
}

.hd-hifz-th-sub {
  display: block;
  margin-top: 0.2rem;
  color: #8a90a0;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.hd-hifz-setup-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid #f0f1f6;
  vertical-align: middle;
  background: #fff;
}

.hd-hifz-setup-table tbody tr:hover td {
  background: #fafafd;
}

.hd-hifz-setup-table th.hd-hifz-col-student,
.hd-hifz-setup-table td.hd-hifz-col-student {
  position: sticky;
  left: 0;
  z-index: 5;
  min-width: 9rem;
  max-width: 11rem;
  box-shadow: 2px 0 6px rgba(31, 34, 54, 0.04);
}

.hd-hifz-setup-table thead th.hd-hifz-col-student {
  z-index: 7;
  background: #fafafd;
}

.hd-hifz-student-name {
  display: block;
  color: #20243a;
  font-weight: 650;
}

.hd-hifz-needs-badge {
  display: inline-flex;
  margin-top: 0.3rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: #f5e7b8;
  color: #6a5a32;
  font-size: 0.72rem;
  font-weight: 650;
}

.hd-hifz-first-lesson-badge {
  display: inline-flex;
  margin-top: 0.3rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: #eceef5;
  color: #4a5168;
  font-size: 0.72rem;
  font-weight: 650;
}

.hd-hifz-setup-table tbody tr.hd-hifz-needs-setup td {
  background: #fff9e8;
}

.hd-hifz-setup-table tbody tr.hd-hifz-needs-setup:hover td {
  background: #fff4d6;
}

.hd-hifz-setup-table tbody tr.hd-hifz-needs-setup td.hd-hifz-col-student {
  background: #fff9e8;
}

.hd-hifz-setup-table tbody tr.hd-hifz-needs-setup:hover td.hd-hifz-col-student {
  background: #fff4d6;
}

.hd-hifz-col-mushaf {
  min-width: 8.5rem;
}

.hd-hifz-col-stage {
  min-width: 7.5rem;
}

.hd-hifz-col-wide {
  min-width: 8rem;
}

.hd-hifz-setup-table .hd-hifz-num-input,
.hd-hifz-setup-table .hd-hifz-text-input,
.hd-hifz-setup-table .hd-hifz-mushaf-select,
.hd-hifz-setup-table .hd-hifz-stage-select {
  width: 100%;
  min-height: 40px;
  padding: 0.4rem 0.65rem;
  border: 1px solid #d9dce7;
  border-radius: 9px;
  background: #fff;
  color: #20243a;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.hd-hifz-setup-table .hd-hifz-mushaf-select,
.hd-hifz-setup-table .hd-hifz-stage-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7084' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 0.9rem;
  padding-right: 1.85rem;
}

.hd-hifz-setup-table .hd-hifz-num-input:focus,
.hd-hifz-setup-table .hd-hifz-text-input:focus,
.hd-hifz-setup-table .hd-hifz-mushaf-select:focus,
.hd-hifz-setup-table .hd-hifz-stage-select:focus {
  outline: none;
  border-color: #6552d8;
  box-shadow: 0 0 0 3px rgba(101, 82, 216, 0.16);
}

/* —— Points settings —— */
.hd-points-settings-page {
  max-width: 880px;
}

.hd-points-settings-lead {
  margin: 0 0 1rem;
  color: #5b6174;
  font-size: 0.95rem;
  line-height: 1.5;
}

.hd-points-status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hd-points-status-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hd-points-status-list__label {
  color: #30354a;
  font-weight: 600;
  font-size: 0.95rem;
}

.hd-points-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #f1f2f6;
  color: #5b6174;
  font-size: 0.78rem;
  font-weight: 650;
}

.hd-points-status-chip--active {
  background: #eaf6ef;
  color: #27885a;
}

.hd-points-rules-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.hd-points-rules-table th,
.hd-points-rules-table td {
  padding: 0.7rem 0.35rem;
  border-bottom: 1px solid #eef0f5;
  font-size: 0.95rem;
}

.hd-points-rules-table th {
  color: #6b7084;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hd-points-rule-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hd-points-rule-rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #eef0f5;
  color: #30354a;
  font-size: 0.95rem;
}

.hd-points-rule-rows li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hd-points-settings-link {
  color: var(--brand-purple, #6552d8);
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
}

.hd-points-settings-link:hover {
  text-decoration: underline;
}

@media (max-width: 767.98px) {
  .hd-hifz-setup-scroll-hint {
    display: block;
  }

  .hd-teacher-form-actions {
    flex-direction: column-reverse;
  }

  .hd-teacher-form-actions__primary,
  .hd-teacher-form-actions__secondary {
    width: 100%;
  }
}

.hd-teacher-surface {
  background: #fff;
  border: 1px solid #e7e8f1;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(31, 34, 54, 0.035);
  padding: 1.5rem;
  margin-bottom: 1.35rem;
}

.hd-teacher-surface__header {
  margin-bottom: 1.15rem;
}

.hd-teacher-surface__title {
  margin: 0 0 0.35rem;
  color: var(--text-primary, #22263a);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}

.hd-teacher-surface__desc {
  margin: 0;
  color: var(--text-secondary, #6f7587);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Homework / Expectations — bulk update panel (fixed dock when students selected) */
.hd-hw-bulk-bar {
  position: fixed;
  /* Span the content column; avoid max-width + auto margin (breaks at browser zoom). */
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 1025;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0.9rem 1.05rem;
  border: 1px solid #dcd6f5;
  border-radius: 14px;
  background: #f7f5ff;
  box-shadow: 0 8px 28px rgba(31, 34, 54, 0.12);
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .hd-hw-bulk-bar {
    left: calc(var(--hd-teacher-sidebar-width, 192px) + 1rem);
    right: 1rem;
    bottom: 1rem;
  }
}

.hd-homework-manager.has-hw-bulk-bar {
  /* Clearance so last roster row / note sit above the fixed dock */
  padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
}

.hd-hw-bulk-bar__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.hd-hw-bulk-bar__count {
  min-width: min(100%, 11rem);
  flex: 1 1 14rem;
}

.hd-hw-bulk-bar__pillars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 2 1 18rem;
  min-width: 0;
}

.hd-hw-bulk-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  flex: 0 1 auto;
}

.hd-hw-bulk-toggle {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #d7dbe8;
  border-radius: 10px;
  background: #fff;
  color: #5c6378;
  font-size: 0.875rem;
  font-weight: 600;
}

.hd-hw-bulk-toggle.is-active {
  border-color: transparent;
  color: #fff;
}

.hd-hw-bulk-toggle.hd-hw-pillar-btn--new.is-active {
  background: #38835b;
  border-color: #38835b;
}

.hd-hw-bulk-toggle.hd-hw-pillar-btn--prev.is-active {
  background: #b56529;
  border-color: #b56529;
}

.hd-hw-bulk-toggle.hd-hw-pillar-btn--rev.is-active {
  background: #d64d52;
  border-color: #d64d52;
}

.hd-hw-bulk-toggle.hd-hw-pillar-btn--custom.is-active {
  background: #71648f;
  border-color: #71648f;
}

.hd-hw-bulk-toggle--other.is-active,
.hd-hw-bulk-toggle--other:hover {
  border-color: #71648f;
  background: #71648f;
  color: #fff;
}

.hd-hw-class-default__grid {
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 900px) {
  .hd-hw-class-default__grid {
    grid-template-columns: minmax(12rem, 1.2fr) minmax(10rem, 0.9fr) minmax(16rem, 1.6fr) auto;
    align-items: center;
  }

  /* Expectations page: intro | pillars (grow) | edit — no deadline column. */
  .hd-hw-class-default--pillars-led .hd-hw-class-default__grid {
    grid-template-columns: minmax(14rem, 0.85fr) minmax(0, 1fr) auto;
  }
}

.hd-hw-class-default--pillars-led .hd-hw-class-default__pillars {
  min-width: 0;
}

.hd-hw-class-default--pillars-led .hd-hw-class-default__action {
  justify-self: end;
  white-space: nowrap;
}

.hd-hw-meta-label {
  margin: 0 0 0.25rem;
  color: #73798b;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hd-hw-meta-value {
  margin: 0;
  color: #25293c;
  font-size: 0.975rem;
  font-weight: 650;
}

.hd-hw-pillar-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  padding-bottom: 0.1rem;
}

.hd-hw-pillar-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.35rem;
  min-height: 2.15rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid #e4e6ef;
  border-radius: 10px;
  background: #f7f8fb;
  color: #9aa0b2;
  font-size: 0.8125rem;
  font-weight: 600;
}

.hd-hw-pillar-chip.is-active.hd-hw-pillar-chip--new {
  background: #38835b;
  border-color: #38835b;
  color: #fff;
}

.hd-hw-pillar-chip.is-active.hd-hw-pillar-chip--prev {
  background: #b56529;
  border-color: #b56529;
  color: #fff;
}

.hd-hw-pillar-chip.is-active.hd-hw-pillar-chip--rev {
  background: #d64d52;
  border-color: #d64d52;
  color: #fff;
}

/* Matches diary Custom band (#71648f) — muted plum, distinct from core pillars + brand CTA */
.hd-hw-pillar-chip.is-active.hd-hw-pillar-chip--custom {
  background: #71648f;
  border-color: #71648f;
  color: #fff;
}

.hd-hw-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.hd-hw-stage-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hd-hw-stage-filter {
  min-height: 2.25rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid #e4e6ef;
  border-radius: 999px;
  background: #fff;
  color: #5c6378;
  font-size: 0.875rem;
  font-weight: 600;
}

.hd-hw-stage-filter.is-active {
  border-color: #cfc6f3;
  background: #f0eefa;
  color: #5947c8;
}

.hd-hw-table-shell {
  overflow-x: auto;
}

.hd-hw-roster-table .hd-hw-col-student {
  min-width: 11rem;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}

.hd-hw-roster-table thead .hd-hw-col-student {
  z-index: 2;
  /* Match other transparent thead cells — sticky must not paint a white square. */
  background: transparent;
}

.hd-hw-col-head {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  font-size: 0.8125rem;
}

.hd-hw-col-head--new {
  color: #2e7a51;
}

.hd-hw-col-head--prev {
  color: #a95b24;
}

.hd-hw-col-head--custom {
  color: #71648f;
}

/* Lessons Targets: pace + relearn columns */
.hd-lex-col-programme {
  min-width: 17rem;
}

.hd-lex-programme-cell {
  vertical-align: top;
  min-width: 17rem;
  max-width: 24rem;
}

.hd-lex-programme {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hd-lex-programme__block {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid #e7e8f1;
  border-radius: 12px;
  background: #fafbfe;
}

.hd-lex-programme__title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #73798b;
}

.hd-lex-programme__status {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #25293c;
}

.hd-lex-programme__form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  margin: 0;
}

.hd-lex-programme__form--row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.hd-lex-programme__form--row .form-select {
  flex: 1 1 6.5rem;
  min-width: 6rem;
  max-width: 9rem;
}

.hd-lex-programme__fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (min-width: 576px) {
  .hd-lex-programme__fields {
    grid-template-columns: 1fr 1fr;
  }
}

.hd-lex-programme__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.hd-lex-programme__label {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: #5c6378;
  white-space: normal;
}

.hd-lex-programme__field .form-control,
.hd-lex-programme__form .form-control {
  width: 100%;
  max-width: none;
}

.hd-lex-programme__form > .btn {
  align-self: flex-start;
}

.hd-hw-student-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.hd-hw-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  background: #efeaff;
  color: #5947c8;
  font-size: 0.75rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.hd-hw-student-name {
  display: block;
  font-weight: 650;
  color: #25293c;
}

.hd-hw-student-stage {
  display: block;
  color: #73798b;
  font-size: 0.8125rem;
}

.hd-hw-pillar-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.35rem;
  border: 1px solid #e7e8f1;
  border-radius: 10px;
  background: #fff;
  color: #c0c4d2;
}

/* Same traffic-light palette as Today attendance (present / late / absent). */
.hd-hw-pillar-btn.hd-hw-pillar-btn--new {
  color: #2e7a51;
  border-color: #55a878;
}

.hd-hw-pillar-btn.hd-hw-pillar-btn--prev {
  color: #a95b24;
  border-color: #c7773b;
}

.hd-hw-pillar-btn.hd-hw-pillar-btn--rev {
  color: #c83e44;
  border-color: #e25e63;
}

.hd-hw-pillar-btn.hd-hw-pillar-btn--custom {
  color: #71648f;
  border-color: #9a8fb3;
}

.hd-hw-pillar-btn.is-active.hd-hw-pillar-btn--new {
  background: #38835b;
  border-color: #38835b;
  color: #fff;
  box-shadow: 0 2px 8px rgba(56, 131, 91, 0.28);
}

.hd-hw-pillar-btn.is-active.hd-hw-pillar-btn--prev {
  background: #b56529;
  border-color: #b56529;
  color: #fff;
  box-shadow: 0 2px 8px rgba(181, 101, 41, 0.28);
}

.hd-hw-pillar-btn.is-active.hd-hw-pillar-btn--rev {
  background: #d64d52;
  border-color: #d64d52;
  color: #fff;
  box-shadow: 0 2px 8px rgba(214, 77, 82, 0.28);
}

.hd-hw-pillar-btn.is-active.hd-hw-pillar-btn--custom {
  background: #71648f;
  border-color: #71648f;
  color: #fff;
  box-shadow: 0 2px 8px rgba(113, 100, 143, 0.28);
}

.hd-hw-pillar-btn.is-paused {
  opacity: 0.9;
  background: #f4f5f8;
  color: #8b91a3;
  border-color: #d7dbe8;
  cursor: pointer;
}

.hd-hw-pillar-btn.is-paused:hover {
  border-color: #b56529;
  color: #a95b24;
  background: #fff8f1;
}

.hd-hw-paused-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hd-hw-pillar-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 7.5rem;
}

.hd-hw-guide-input {
  width: 100%;
  min-width: 7rem;
  max-width: 10.5rem;
  font-size: 0.75rem;
  line-height: 1.25;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  border-color: #dcd6f5;
  text-align: left;
}

.hd-hw-guide-input:focus {
  border-color: #9a8fb3;
  box-shadow: 0 0 0 0.15rem rgba(113, 100, 143, 0.18);
}

.hd-hw-guide-input.is-saving {
  opacity: 0.7;
}

.hd-hw-guide-input.is-error {
  border-color: #d64d52;
}

.hd-hw-other-cell {
  display: block;
  width: 100%;
  max-width: 11rem;
  padding: 0.35rem 0.5rem;
  border: 1px dashed transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.hd-hw-other-cell:hover {
  border-color: #d7dbe8;
  background: #fafafc;
}

.hd-hw-other-name {
  display: block;
  color: #25293c;
  font-size: 0.875rem;
  font-weight: 650;
}

.hd-hw-other-guide {
  display: block;
  color: #73798b;
  font-size: 0.75rem;
}

.hd-hw-other-empty {
  color: #a0a6b8;
  font-size: 0.8125rem;
}

.hd-hw-toggle-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.25rem;
  margin: 0 0 0.85rem;
  color: #5c6378;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.hd-hw-toggle-key__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hd-hw-toggle-key__swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 8px;
  flex: 0 0 auto;
}

.hd-hw-toggle-key__swatch--on {
  background: #38835b;
  border: 1px solid #38835b;
  color: #fff;
}

.hd-hw-toggle-key__swatch--off {
  background: #fff;
  border: 1px solid #55a878;
  color: #2e7a51;
}

.hd-hw-guidance-note {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  color: #73798b;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.hd-hw-more-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 991.98px) {
  .hd-hw-bulk-bar__count {
    flex: 1 1 100%;
  }

  .hd-hw-bulk-bar__actions {
    flex: 1 1 auto;
    justify-content: flex-end;
  }
}

@media (max-width: 767.98px) {
  .hd-hw-bulk-bar {
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  .hd-homework-manager.has-hw-bulk-bar {
    padding-bottom: calc(11.5rem + env(safe-area-inset-bottom, 0px));
  }

  .hd-hw-col-head span {
    display: none;
  }
}

/* Class insight / moment cards */
.hd-class-insight {
  position: relative;
  padding: 1.15rem 1.35rem;
}

.hd-class-insight__inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.hd-class-insight__dismiss {
  flex: 0 0 auto;
  margin: -0.15rem -0.35rem 0 auto;
  order: 3;
}

.hd-class-insight__dismiss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9aa0b0;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.hd-class-insight__dismiss-btn:hover,
.hd-class-insight__dismiss-btn:focus-visible {
  background: #f3f4f8;
  color: #5c6378;
  outline: none;
}

.hd-class-insight__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: rgba(var(--hd-primary-solid-rgb), 0.1);
  color: var(--hd-primary-solid);
}

.hd-class-insight__copy {
  min-width: 0;
  flex: 1 1 auto;
  padding-right: 0.25rem;
}

.hd-class-insight__kicker {
  margin: 0 0 0.2rem;
  color: #8a91a3;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hd-class-insight__title {
  margin: 0 0 0.4rem;
  color: var(--text-primary, #22263a);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.hd-class-insight__body {
  margin: 0 0 0.75rem;
  color: var(--text-secondary, #6f7587);
  font-size: 0.9rem;
  line-height: 1.45;
}

.hd-class-insight__body:last-child {
  margin-bottom: 0;
}

.hd-class-insight__link {
  color: var(--hd-primary-solid);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.hd-class-insight__link:hover {
  text-decoration: underline;
}

.hd-teacher-field__label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-primary, #22263a);
  font-size: 0.9rem;
  font-weight: 600;
}

.hd-teacher-field__help {
  margin: 0.45rem 0 0;
  color: var(--text-secondary, #6f7587);
  font-size: 0.84rem;
  line-height: 1.4;
}

.hd-teacher-time-input {
  max-width: 12rem;
  min-height: 2.75rem;
  border-radius: 10px;
  border-color: #e7e8f1;
}

.hd-teacher-time-input:focus {
  border-color: #6552d8;
  box-shadow: 0 0 0 0.2rem rgba(101, 82, 216, 0.18);
}

.hd-teacher-check-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hd-teacher-check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-height: 64px;
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid #e7e8f1;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.hd-teacher-check-row:hover {
  background: #faf9ff;
  border-color: #ddd7f7;
}

.hd-teacher-check-row:has(input:checked) {
  background: #f7f5ff;
  border-color: #cfc6f3;
}

.hd-teacher-check-row:has(input:focus-visible) {
  outline: 2px solid rgba(101, 82, 216, 0.35);
  outline-offset: 2px;
}

.hd-teacher-check-row__control {
  flex: 0 0 auto;
  padding-top: 0.1rem;
}

.hd-teacher-check-row__control .form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  border-radius: 0.3rem;
  border-color: #b7bcd0;
  cursor: pointer;
}

.hd-teacher-check-row__control .form-check-input:checked {
  background-color: #6552d8;
  border-color: #6552d8;
}

.hd-teacher-check-row__control .form-check-input[type="radio"] {
  border-radius: 50%;
}

.hd-teacher-check-row__control .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(101, 82, 216, 0.22);
}

.hd-teacher-check-row__copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.hd-teacher-check-row__label {
  color: var(--text-primary, #22263a);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.hd-teacher-check-row__help {
  color: var(--text-secondary, #6f7587);
  font-size: 0.84rem;
  line-height: 1.4;
}

.hd-teacher-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding-top: 0.35rem;
  padding-bottom: 0.5rem;
}

.hd-teacher-form-actions__primary {
  min-width: 8.5rem;
  min-height: 44px;
}

.hd-hifz-setup-page .hd-teacher-form-actions,
.hd-points-settings-page .hd-teacher-form-actions {
  justify-content: space-between;
}

.hd-teacher-form-actions__secondary {
  min-height: 44px;
  border-radius: 10px;
  padding-inline: 1rem;
}

@media (max-width: 767.98px) {
  .hd-teacher-surface {
    padding: 1.125rem;
  }

  .hd-teacher-form-actions {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 6rem;
  }

  .hd-teacher-form-actions__primary,
  .hd-teacher-form-actions__secondary {
    width: 100%;
  }

  .hd-teacher-time-input {
    max-width: none;
  }
}

/* —— Leaderboard (teacher shell) —— */
.hd-leaderboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-bottom: 1.75rem;
}

.hd-leaderboard-header__copy {
  flex: 1 1 16rem;
  min-width: 0;
}

.hd-leaderboard-season {
  flex: 0 1 16rem;
  min-width: 12rem;
}

.hd-leaderboard-season__label {
  display: block;
  margin: 0 0 0.35rem;
  color: #777c8f;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hd-leaderboard-season__select,
.hd-leaderboard-season__chip {
  min-height: 2.5rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #20243a;
}

.hd-leaderboard-season__select {
  border: 1px solid #e2e5ee;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7084' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 0.75rem center / 1rem;
  padding-right: 2.25rem;
  appearance: none;
  -webkit-appearance: none;
}

.hd-leaderboard-season__chip {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border: 1px solid transparent;
  background: #f3f4f8;
  color: #3a4054;
  cursor: default;
  user-select: none;
  pointer-events: none;
}

.hd-leaderboard-season__current {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.45rem 0 0;
  color: #27885a;
  font-size: 0.8rem;
  font-weight: 600;
}

.hd-leaderboard-season__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #27885a;
}

.hd-recog-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hd-recog-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hd-recog-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 860px;
}

.hd-recog-grid--1 {
  grid-template-columns: minmax(0, 420px);
}

.hd-recog-card {
  display: flex;
  flex-direction: column;
  min-height: 118px;
  max-height: 140px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #f7f5f1;
}

.hd-recog-card--gold {
  background: #fbf4e6;
  border-color: #f0e0c0;
}

.hd-recog-card--green {
  background: #eef7f2;
  border-color: #d3e8dc;
}

.hd-recog-card--purple {
  background: #f4f0f8;
  border-color: #e2d8ef;
}

.hd-recog-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: 0.55rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
}

.hd-recog-card--gold .hd-recog-card__icon {
  color: #b87512;
}

.hd-recog-card--green .hd-recog-card__icon {
  color: #27885a;
}

.hd-recog-card--purple .hd-recog-card__icon {
  color: #7a5aa8;
}

.hd-recog-card__label {
  margin: 0;
  color: #6b7084;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hd-recog-card__name {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #20243a;
  line-height: 1.25;
}

.hd-recog-card__name a {
  color: inherit;
  text-decoration: none;
}

.hd-recog-card__name a:hover {
  text-decoration: underline;
}

.hd-recog-card__metric {
  margin: 0.25rem 0 0;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #20243a;
  line-height: 1;
}

.hd-recog-card__detail {
  margin: 0.25rem 0 0;
  color: #7b8091;
  font-size: 0.78rem;
}

.hd-leaderboard-table thead th {
  border-bottom-color: #eceef4;
  color: #6b7084;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hd-leaderboard-table tbody td {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.hd-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
}

.hd-rank-badge--1 {
  background: #f5e4b8;
  color: #8a5a10;
}

.hd-rank-badge--2 {
  background: #e6e8ee;
  color: #555a6b;
}

.hd-rank-badge--3 {
  background: #efdcc8;
  color: #7a5230;
}

.hd-rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  color: #6b7084;
  font-weight: 600;
}

.hd-score-primary {
  font-weight: 700;
  color: #20243a;
  line-height: 1.2;
}

.hd-score-secondary {
  margin-top: 0.15rem;
  color: #8a90a0;
  font-size: 0.78rem;
}

.hd-recog-inline {
  display: inline-flex;
  margin-top: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #f1f2f6;
  color: #5b6174;
  font-size: 0.75rem;
  font-weight: 600;
}

.hd-recog-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #f1f2f6;
  color: #5b6174;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.hd-recog-pill--empty {
  background: transparent;
  color: #9aa0b2;
  padding-left: 0;
  font-weight: 500;
}

.hd-leaderboard-view {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: #5b6174;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.hd-leaderboard-view:hover {
  color: var(--brand-purple);
}

.hd-leaderboard-view__icon {
  opacity: 0.7;
}

.hd-leaderboard-notice {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid #f0e0b8;
  background: #fff8e8;
  color: #6a5a32;
  font-size: 0.9rem;
}

.hd-leaderboard-notice__link {
  color: #6a5a32;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hd-leaderboard-explain {
  margin: 0 0 1rem;
  border-radius: 12px;
  border: 1px solid #e8eaf1;
  background: #fff;
}

.hd-leaderboard-explain > summary {
  cursor: pointer;
  padding: 0.9rem 1.1rem;
  font-weight: 650;
  color: #30354a;
  list-style: none;
}

.hd-leaderboard-explain > summary::-webkit-details-marker {
  display: none;
}

.hd-leaderboard-explain__body {
  padding: 0 1.1rem 1.1rem;
  color: #5b6174;
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 42rem;
}

.hd-leaderboard-explain__body p:last-child {
  margin-bottom: 0;
}

.hd-leaderboard-empty {
  text-align: left;
  max-width: 28rem;
  padding: 2rem 0 1rem;
}

.hd-leaderboard-empty__icon {
  display: inline-flex;
  color: #9aa0b2;
  margin-bottom: 0.85rem;
}

.hd-leaderboard-empty__title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #20243a;
}

.hd-leaderboard-empty__text {
  margin: 0 0 1.25rem;
  color: #7b8091;
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (max-width: 767.98px) {
  .hd-leaderboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hd-leaderboard-season {
    max-width: none;
  }

  .hd-recog-grid--1,
  .hd-recog-grid--2,
  .hd-recog-grid--3 {
    display: flex;
    gap: 0.85rem;
    max-width: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }

  .hd-recog-card {
    flex: 0 0 min(78vw, 17.5rem);
    scroll-snap-align: start;
    max-height: none;
  }

  .hd-rank-badge {
    width: 40px;
    height: 40px;
  }
}

/* —— Teacher Home launcher (concept-aligned) —— */
.hd-teacher-appbar__leading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.hd-teacher-appbar__menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  padding: 0;
}

.hd-teacher-appbar__menu:hover,
.hd-teacher-appbar__menu:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

.hd-teacher-home {
  max-width: 860px;
  margin: 0;
  padding: 40px 32px 56px;
}

.hd-teacher-home__header {
  margin-bottom: 0;
}

.hd-teacher-home__title {
  margin: 0 0 0.4rem;
  color: #22263a;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hd-teacher-home__subtitle {
  margin: 0 0 0.75rem;
  color: #6f7587;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.hd-teacher-home__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
  margin: 0;
  color: #777d8e;
  font-size: 0.875rem;
}

.hd-teacher-home__summary-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hd-teacher-home__summary-sep {
  opacity: 0.7;
}

.hd-teacher-home__welcome {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  background: #f1effc;
  border: 1px solid #ddd6f8;
  border-radius: 14px;
}

.hd-teacher-home__welcome-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: #3d3480;
}

.hd-teacher-home__welcome-list {
  margin: 0;
  padding-left: 1.15rem;
  color: #4d4670;
  font-size: 0.92rem;
}

.hd-teacher-home__welcome-dismiss {
  border: 1px solid #c8c0ef;
  background: #fff;
  color: #5247a8;
  border-radius: 10px;
  min-height: 36px;
  padding: 0 0.85rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.hd-teacher-home__section {
  margin-top: 24px;
}

.hd-teacher-home__section-title {
  margin: 0 0 14px;
  color: #22263a;
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.hd-teacher-home__cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hd-class-summary-card {
  background: #fff;
  border: 1px solid #e8e9f1;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(31, 34, 54, 0.04);
  padding: 20px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.hd-class-summary-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.hd-class-summary-card__identity {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
}

.hd-class-summary-card__icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #eeeafe;
  color: #6552d8;
}

.hd-class-summary-card__name {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.hd-class-summary-card__name a {
  color: #25293c;
  text-decoration: none;
}

.hd-class-summary-card__name a:hover,
.hd-class-summary-card__name a:focus-visible {
  color: #6552d8;
}

.hd-class-summary-card__meta {
  margin: 0.15rem 0 0;
  color: #777d8e;
  font-size: 0.8125rem;
}

.hd-class-summary-card__open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: #5e4bd7;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  flex-shrink: 0;
}

.hd-class-summary-card__open:hover,
.hd-class-summary-card__open:focus-visible {
  background: #513fc3;
  color: #fff;
}

.hd-class-summary-card__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: auto;
}

.hd-class-summary-card__col {
  padding: 0 16px;
  border-left: 1px solid #ececf3;
  min-width: 0;
}

.hd-class-summary-card__col:first-child {
  padding-left: 0;
  border-left: 0;
}

.hd-class-summary-card__label {
  margin: 0 0 0.25rem;
  color: #70768a;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hd-class-summary-card__value {
  margin: 0;
  color: #25293c;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.hd-class-summary-card__value a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.hd-class-summary-card__value a:hover,
.hd-class-summary-card__value a:focus-visible {
  text-decoration: underline;
}

.hd-class-summary-card__value--warn {
  color: #b46918;
}

.hd-class-summary-card__value--ok {
  color: #27885a;
}

.hd-class-summary-card__hint {
  margin: 0.2rem 0 0;
  color: #7a8091;
  font-size: 0.75rem;
}

.hd-class-summary-card__empty {
  margin: auto 0 0;
  color: #7a8091;
  font-size: 0.9rem;
}

.hd-teacher-home__insights {
  margin-top: 20px;
}

.hd-teacher-home__insights a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #6552d8;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.hd-teacher-home__insights a:hover,
.hd-teacher-home__insights a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 1023.98px) {
  .hd-teacher-home {
    padding: 36px 24px 48px;
  }
}

@media (max-width: 819.98px) {
  .hd-class-summary-card__grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 0;
  }

  .hd-class-summary-card__col {
    padding: 0.35rem 12px 0.35rem 0;
    border-left: 0;
  }

  .hd-class-summary-card__col:nth-child(2) {
    padding-left: 12px;
    border-left: 1px solid #ececf3;
  }

  .hd-class-summary-card__col:nth-child(3) {
    grid-column: 1 / -1;
    padding-top: 0.65rem;
    border-top: 1px solid #ececf3;
  }
}

@media (max-width: 767.98px) {
  .hd-teacher-home {
    padding: 28px 18px 48px;
  }

  .hd-teacher-home__title {
    font-size: 1.7rem;
  }

  .hd-class-summary-card {
    min-height: 0;
  }

  .hd-class-summary-card__top {
    flex-direction: column;
    align-items: stretch;
  }

  .hd-class-summary-card__open {
    width: 100%;
    min-height: 44px;
  }

  .hd-teacher-account__name {
    display: none;
  }
}

/* —— Account settings (teacher launcher) —— */
.hd-account-settings-page {
  max-width: 760px;
  margin: 0;
  padding: 40px 32px 56px;
}

.hd-account-settings-page .hd-workspace-breadcrumb {
  margin-bottom: 1.25rem;
}

.hd-account-info-list {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem 1.5rem;
}

.hd-account-info-list__row {
  margin: 0;
}

.hd-account-info-list dt {
  margin: 0 0 0.25rem;
  color: #7a8091;
  font-size: 0.78rem;
  font-weight: 600;
}

.hd-account-info-list dd {
  margin: 0;
  color: #22263a;
  font-size: 0.98rem;
  font-weight: 600;
}

.hd-account-info-list__note {
  color: #7a8091;
  font-weight: 500;
  font-size: 0.85rem;
}

.hd-account-settings-page .hd-teacher-field {
  margin-bottom: 1.15rem;
}

.hd-account-settings-page .hd-account-input,
.hd-account-settings-page .form-control.hd-account-input {
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border: 1px solid #d9dce7;
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
}

.hd-account-settings-page .hd-account-input:focus,
.hd-account-settings-page .form-control.hd-account-input:focus {
  border-color: #6552d8;
  box-shadow: 0 0 0 3px rgba(101, 82, 216, 0.16);
  outline: none;
}

.hd-account-settings-actions {
  gap: 0.75rem;
}

.hd-account-settings-actions .hd-teacher-form-actions__primary {
  margin-left: 0;
}

@media (max-width: 767.98px) {
  .hd-account-settings-page {
    padding: 28px 18px 48px;
  }

  .hd-account-info-list {
    grid-template-columns: 1fr;
  }

  .hd-account-settings-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hd-account-settings-actions .hd-teacher-form-actions__primary,
  .hd-account-settings-actions .hd-teacher-form-actions__secondary {
    width: 100%;
    min-height: 44px;
  }
}

/* —— Log together (paired lesson logging) —— */
.hd-students-section-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.hd-log-together-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.25rem;
}

.hd-student-row.is-selected {
  background: #faf9ff !important;
  box-shadow: inset 0 0 0 1px #cfc7fa;
}

.hd-select-col {
  vertical-align: middle;
  width: 2.5rem;
}

.hd-log-together-check {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  cursor: pointer;
}

.hd-today-select {
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
}

.hd-log-together-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: var(--hd-primary-solid);
  color: #fff;
  box-shadow: 0 8px 24px rgba(91, 77, 201, 0.28);
}

.hd-log-together-bar__count {
  font-size: 0.95rem;
  font-weight: 600;
}

.hd-log-together-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hd-log-together-bar .btn-light {
  color: var(--hd-primary-solid);
  font-weight: 600;
}

.hd-log-together-bar .btn-light:disabled {
  opacity: 0.55;
}

.hd-teacher-page.is-log-together-selecting {
  padding-bottom: 5.5rem;
}

@media (max-width: 767.98px) {
  .hd-teacher-page.is-log-together-selecting ~ .hd-teacher-bottom-nav,
  body:has(.hd-teacher-page.is-log-together-selecting) .hd-teacher-bottom-nav {
    display: none !important;
  }

  .hd-log-together-bar {
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
}

.hd-back-to-today {
  color: #5c6478;
  text-decoration: none;
  font-size: 0.92rem;
}

.hd-back-to-today:hover {
  color: var(--hd-primary-solid);
}

.hd-log-together-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.hd-log-together-desk {
  scroll-margin-top: calc(var(--hd-teacher-appbar-height) + 5.5rem);
}

.hd-log-together-jump {
  display: none;
}

.hd-log-together-card-head__jump {
  display: none;
}

.hd-log-together-empty-desk {
  border: 1px dashed rgba(28, 33, 51, 0.18) !important;
  background: rgba(255, 255, 255, 0.55);
}

.hd-log-together-empty-desk .hd-add-second-btn {
  min-height: 44px;
}

@media (max-width: 1099.98px) {
  .hd-log-together-page:has(.hd-log-together-jump) {
    --hd-log-together-jump-height: 3.5rem;
  }

  .hd-log-together-jump {
    display: flex;
    gap: 0.5rem;
    position: sticky;
    top: var(--hd-teacher-appbar-height);
    z-index: 28;
    margin: 0 0 0.85rem;
    padding: 0.4rem;
    border: 1px solid #e7e8f1;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(31, 34, 54, 0.06);
  }

  .hd-log-together-jump__link {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 2.2rem;
    padding: 0.35rem 0.65rem;
    border-radius: 10px;
    border: 1px solid #d9dbe7;
    background: #f6f7fb;
    color: #2a2f45;
    font-size: 0.86rem;
    font-weight: 650;
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
  }

  .hd-log-together-jump__link:hover,
  .hd-log-together-jump__link:focus-visible {
    border-color: #b7b4e8;
    background: #eeeafe;
    color: #5947c8;
  }

  .hd-log-together-jump__link .hd-student-code {
    font-weight: 500;
    color: #7b8091;
  }

  .hd-log-together-card-head--sticky {
    position: sticky;
    top: calc(var(--hd-teacher-appbar-height) + var(--hd-log-together-jump-height, 0px) + 0.55rem);
    z-index: 20;
    margin: 0 -1rem 1rem;
    padding: 0.7rem 1rem 0.75rem;
    background: #ffffff;
    border-bottom: 1px solid rgba(28, 33, 51, 0.1);
    box-shadow: 0 6px 12px -8px rgba(31, 34, 54, 0.18);
  }

  @media (min-width: 768px) {
    .hd-log-together-card-head--sticky {
      margin-left: -1.5rem;
      margin-right: -1.5rem;
      padding-left: 1.5rem;
      padding-right: 1.5rem;
    }
  }

  .hd-log-together-page:not(:has(.hd-log-together-jump)) .hd-log-together-card-head--sticky {
    top: var(--hd-teacher-appbar-height);
  }

  .hd-log-together-card-head--sticky .hd-log-together-card-head__meta {
    display: none;
  }

  .hd-log-together-card-head__jump {
    display: inline-flex;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6552d8;
    text-decoration: none;
  }

  .hd-log-together-card-head__jump:hover,
  .hd-log-together-card-head__jump:focus-visible {
    color: #4d3db8;
    text-decoration: underline;
  }

  .hd-log-together-desk {
    scroll-margin-top: calc(var(--hd-teacher-appbar-height) + 6.75rem);
  }
}

@media (min-width: 1100px) {
  .hd-log-together-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
  }

  .hd-log-together-desk {
    scroll-margin-top: calc(var(--hd-teacher-appbar-height) + 1rem);
  }
}

.hd-log-together-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(28, 33, 51, 0.08);
}

.hd-log-together-card-head__main {
  min-width: 0;
  flex: 1 1 auto;
}

.hd-log-together-footer {
  position: sticky;
  bottom: 0;
  z-index: 25;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 -0.25rem;
  padding: 0.85rem 0.25rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(243, 242, 249, 0) 0%, var(--hd-page-bg) 28%);
}

.hd-log-together-page {
  padding-bottom: 2rem;
}

@media (max-width: 767.98px) {
  .hd-log-together-footer {
    gap: 0.5rem;
  }

  .hd-log-together-footer .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }
}

/* Dual-log launch on single lesson form */
.hd-dual-log-launch .hd-log-together-btn {
  flex-shrink: 0;
}

.hd-dual-log-picker .form-select {
  max-width: 100%;
}

.lesson-entry-card.is-just-saved {
  box-shadow: 0 0 0 1px rgba(46, 122, 81, 0.35), 0 8px 24px rgba(46, 122, 81, 0.08);
}

.lesson-entry-card.is-awaiting-student .hd-log-together-card-head {
  margin-bottom: 1rem;
  padding-bottom: 0;
  border-bottom: 0;
}

.hd-swap-station .form-select {
  min-width: 0;
  flex: 1 1 12rem;
}

.hd-swap-station--primary .form-select,
.hd-swap-station--primary .hd-swap-btn {
  min-height: 44px;
}

.hd-log-together-card-actions .btn {
  min-height: 44px;
}

/* Single lesson log — form + student context */
.hd-lesson-log-page .hd-today-header {
  margin-bottom: 0.35rem;
}

.hd-lesson-page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 1.15rem;
}

.hd-lesson-page-layout__context {
  grid-area: auto;
}

.hd-lesson-page-layout__form {
  grid-area: auto;
  min-width: 0;
  max-width: 760px;
}

.hd-lesson-context-panel {
  background: #ffffff;
  border: 1px solid #e7e8f1;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(31, 34, 54, 0.035);
  padding: 22px;
}

.hd-lesson-context-panel__title {
  margin: 0 0 0.15rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: #20243a;
}

.hd-lesson-context-section {
  padding: 14px 0;
  border-top: 1px solid #eef0f5;
}

.hd-lesson-context-section:first-of-type {
  border-top: 0;
  padding-top: 10px;
}

.hd-lesson-context-section__label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #777c8f;
}

.hd-lesson-context-section__value {
  margin: 0;
  font-size: 0.92rem;
  color: #20243a;
  line-height: 1.4;
}

.hd-lesson-context-section__value + .hd-lesson-context-section__value {
  margin-top: 4px;
}

.hd-lesson-context-section__muted {
  color: #7b8091;
  font-size: 0.88rem;
}

.hd-position-reanchor {
  font-weight: 500;
}

.hd-new-lesson-end-preview__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7b8091;
  margin-bottom: 0.35rem;
}

.hd-new-lesson-end-preview:not(.d-none) {
  margin-bottom: 0.75rem;
}

.hd-new-lesson-end-preview__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--hd-lesson-field-gap, 16px);
  width: 100%;
}

.hd-lesson-preview-stat {
  border: 1px solid rgba(28, 33, 51, 0.1);
  border-radius: 8px;
  background: #f6f7fa;
  padding: 0.45rem 0.5rem 0.5rem;
  text-align: center;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.05rem;
}

.hd-lesson-preview-stat__label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8a90a0;
  line-height: 1.2;
}

.hd-lesson-preview-stat__value {
  font-size: 0.88rem;
  font-weight: 700;
  color: #20243a;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.hd-lesson-preview-stat__sub {
  font-size: 0.65rem;
  color: #6b7280;
  line-height: 1.15;
}

.hd-position-reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.hd-lesson-context-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hd-lesson-context-actions .btn {
  justify-content: center;
}

.hd-lesson-context-actions__secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hd-lesson-context-actions__secondary .btn {
  flex: 1 1 auto;
}

.hd-lesson-context-dual {
  margin-top: 2px;
}

.hd-lesson-context-dual__lead {
  margin: 0 0 10px;
  font-size: 0.86rem;
  color: #7b8091;
  line-height: 1.4;
}

.hd-lesson-context-more {
  margin-top: 4px;
}

.hd-lesson-context-more > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: #6552d8;
  padding: 4px 0;
}

.hd-lesson-context-more > summary::-webkit-details-marker {
  display: none;
}

.hd-lesson-context-recent--desktop {
  display: none;
}

@media (min-width: 1050px) {
  .hd-lesson-page-layout {
    grid-template-columns: minmax(0, 740px) minmax(280px, 320px);
    grid-template-areas: "form context";
  }

  .hd-lesson-page-layout__form {
    grid-area: form;
    max-width: none;
  }

  .hd-lesson-page-layout__context {
    grid-area: context;
  }

  .hd-lesson-context-panel {
    position: sticky;
    top: 88px;
  }

  .hd-lesson-context-recent--desktop {
    display: block;
  }

  .hd-lesson-context-more {
    display: none;
  }
}

.hd-lesson-form-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 575.98px) {
  .hd-lesson-form-pair {
    grid-template-columns: 1fr;
  }
}

/* Compact numeric fields — short inputs side-by-side to cut empty width + scroll */
.lesson-entry-card {
  --hd-lesson-field-gap: 16px;
}

.lesson-entry-card > .mb-3,
.lesson-entry-card .hd-lesson-num-row {
  margin-bottom: 0.85rem !important;
}

.hd-lesson-field > .hd-lesson-num-row {
  margin-bottom: 0 !important;
}

.hd-lesson-num-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--hd-lesson-field-gap);
  align-items: start;
  width: 100%;
}

.hd-lesson-form-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--hd-lesson-field-gap);
  align-items: end;
  width: 100%;
}

.hd-lesson-num-row:empty,
.hd-lesson-num-row:not(:has(> :not(.d-none))) {
  display: none;
  margin-bottom: 0 !important;
}

.hd-lesson-num-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  width: auto;
  max-width: none;
}

.hd-lesson-num-field > .form-label,
.hd-lesson-num-field > .hd-form-label-row {
  margin-bottom: 0.35rem;
  min-height: 1.5rem;
}

.hd-lesson-num-field > .form-label {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.hd-lesson-num-field .hd-form-label-row {
  flex-wrap: wrap;
  align-items: center;
}

.hd-lesson-num-field .hd-form-label-row > .form-label {
  margin-bottom: 0;
  white-space: nowrap;
}

.hd-lesson-num-field .hd-form-label-row > .hd-context-help__panel {
  /* Expand in flow (don't overlay fields below) and use the full row when open */
  position: static;
  flex-basis: 100%;
  width: 100%;
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.hd-lesson-num-row > .hd-lesson-num-field:has(.hd-context-help__panel.show),
.hd-lesson-form-metrics > .hd-lesson-num-field:has(.hd-context-help__panel.show) {
  grid-column: 1 / -1;
}

.hd-lesson-num-field .form-control {
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.hd-new-lesson-pro-tip {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #e4e6ef;
  border-radius: 10px;
  background: #fafafc;
  line-height: 1.45;
}

.hd-new-lesson-pro-tip strong {
  color: #3a3f55;
}

/* —— Student section navigation (approved component; Strategy pilot first) —— */
.hd-student-section-nav {
  margin: 0 0 1.5rem;
}

.hd-student-section-nav__scroller {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.15rem;
}

.hd-student-section-nav__item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #d5d8e4;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  color: #6f7587;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.hd-student-section-nav__icon {
  flex: 0 0 auto;
  color: currentColor;
  opacity: 0.9;
}

.hd-student-section-nav__item:hover {
  color: var(--hd-primary-solid);
  background: rgba(var(--hd-primary-solid-rgb), 0.06);
  border-color: rgba(var(--hd-primary-solid-rgb), 0.4);
}

.hd-student-section-nav__item:focus-visible {
  outline: 2px solid var(--hd-primary-solid);
  outline-offset: 2px;
}

.hd-student-section-nav__item.is-active {
  color: var(--hd-primary-solid);
  background: rgba(var(--hd-primary-solid-rgb), 0.1);
  border-color: rgba(var(--hd-primary-solid-rgb), 0.45);
  font-weight: 600;
}

.hd-student-section-nav__item--secondary {
  color: #8a91a3;
  font-weight: 500;
}

/* —— Strategy page pilot rhythm —— */
.hd-strategy-page .hd-strategy-back {
  margin: 0 0 0.65rem;
}

.hd-strategy-page .hd-today-header {
  margin-bottom: 1rem;
}

.hd-strategy-briefing-context {
  margin: 0 0 1.5rem;
}

.hd-strategy-page .hd-student-section-nav {
  margin: 0 0 1.5rem;
}

.hd-strategy-briefing-context__period,
.hd-strategy-briefing-context__note {
  margin: 0;
  color: #6f7587;
  font-size: 0.9rem;
  line-height: 1.45;
}

.hd-strategy-briefing-context__note {
  margin-top: 0.35rem;
  font-size: 0.84rem;
}

.hd-strategy-page .hd-teacher-surface {
  margin-bottom: 1.5rem;
}

.hd-strategy-page .hd-teacher-surface:last-child {
  margin-bottom: 0;
}

.hd-strategy-section__label {
  margin: 0 0 0.65rem;
  color: #6f7587;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hd-strategy-divider {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid #e7e8f1;
}

.hd-strategy-section--last {
  margin-bottom: 0;
}

/* Tiles read as secondary inside teacher surfaces */
.hd-strategy-page .hd-teacher-surface .hd-ds-tile {
  background: #f7f7fb;
  border-color: #eceef4;
  box-shadow: none;
}

.hd-strategy-page .hd-teacher-surface .hd-ds-tile--on-light {
  background: #fff;
  border-color: #eceef4;
}

.hd-strategy-revision-table {
  margin: 0 0 1.5rem;
}

.hd-strategy-revision-footer {
  margin-top: 0.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e7e8f1;
}

/* —— Diary page pilot (teacher/admin shell only) —— */
.hd-diary-page .hd-diary-back {
  margin: 0 0 0.65rem;
}

.hd-diary-page .hd-today-header {
  margin-bottom: 1.5rem;
}

.hd-diary-context {
  margin: 0 0 1.5rem;
}

.hd-diary-context__desc {
  margin: 0;
  color: #6f7587;
  font-size: 0.9rem;
  line-height: 1.45;
}

.hd-diary-context .hd-standing-pause-row {
  margin-top: 0.75rem;
}

.hd-diary-page .hd-student-section-nav {
  margin: 0 0 1.5rem;
}

.hd-diary-parent-signoff {
  margin-bottom: 1.5rem;
}

.hd-diary-parent-signoff__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.hd-diary-view-control {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 1.25rem;
}

.hd-diary-view-control__label {
  margin: 0;
  color: #6f7587;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hd-diary-view-control__group {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #e7e8f1;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.hd-diary-view-control__option {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  color: #6f7587;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  border: 0;
  background: transparent;
  transition: color 120ms ease, background-color 120ms ease;
}

.hd-diary-view-control__option + .hd-diary-view-control__option {
  border-left: 1px solid #e7e8f1;
}

.hd-diary-view-control__option:hover {
  color: var(--hd-primary-solid);
  background: rgba(var(--hd-primary-solid-rgb), 0.06);
}

.hd-diary-view-control__option:focus-visible {
  outline: 2px solid var(--hd-primary-solid);
  outline-offset: 2px;
  z-index: 1;
}

.hd-diary-view-control__option.is-active {
  color: var(--hd-primary-solid);
  background: rgba(var(--hd-primary-solid-rgb), 0.1);
  font-weight: 600;
}

.hd-diary-page .hd-diary-day-grid {
  --bs-gutter-y: 1.5rem;
}

/* Day cards + nested lesson bands: Design Bible medium radius (14px) */
.hd-diary-page .hd-diary-day-grid > [class*="col-"] > .card,
.hd-diary-page .hd-day-card-inner > .card {
  border-radius: 14px;
  overflow: hidden;
}

/* Metric tiles inside lesson bands: Design Bible small radius (10px) */
.hd-diary-page .diary-stat-cell,
.hd-diary-page .hd-day-card-inner .rounded-3 {
  border-radius: 10px !important;
}

.hd-diary-page .hd-diary-table-surface {
  margin-bottom: 0;
  padding: 0;
  border-radius: 14px;
}

.hd-diary-week-table--teacher thead th {
  border-bottom-color: #e7e8f1;
  background: #f7f7fb;
}

.hd-diary-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* —— Profile page pilot (teacher/admin shell only) —— */
.hd-profile-page .hd-profile-back {
  margin: 0 0 0.65rem;
}

.hd-profile-page .hd-today-header {
  margin-bottom: 1.5rem;
}

.hd-profile-page .hd-student-section-nav {
  margin: 0 0 1.5rem;
}

.hd-profile-page .hd-profile-position {
  margin-bottom: 1.5rem;
}

.hd-profile-surface-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.hd-profile-surface-head--compact {
  margin-bottom: 0.85rem;
}

.hd-profile-surface-head__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: rgba(var(--hd-primary-solid-rgb), 0.1);
  color: var(--hd-primary-solid);
}

.hd-profile-surface-head--compact .hd-profile-surface-head__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
}

.hd-profile-surface-head .hd-teacher-surface__title {
  margin-bottom: 0.2rem;
}

.hd-profile-position__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
  align-items: start;
}

.hd-profile-position__col + .hd-profile-position__col {
  padding-left: 1.5rem;
  border-left: 1px solid #e7e8f1;
}

@media (max-width: 991.98px) {
  .hd-profile-position__grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hd-profile-position__col + .hd-profile-position__col {
    padding-left: 0;
    border-left: 0;
    padding-top: 1.15rem;
    border-top: 1px solid #e7e8f1;
  }
}

.hd-profile-position__kicker {
  margin: 0 0 0.4rem;
  color: #6f7587;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hd-profile-position__percent {
  margin: 0;
  color: var(--hd-primary-solid);
  font-size: 2.65rem;
  font-weight: 700;
  line-height: 1.1;
}

.hd-profile-position__juz {
  margin: 0;
  color: var(--text-primary, #22263a);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
}

@media (max-width: 575.98px) {
  .hd-profile-position__percent {
    font-size: 2.25rem;
  }

  .hd-profile-position__juz {
    font-size: 1.5rem;
  }
}

.hd-profile-position__support {
  margin: 0.55rem 0 0;
  color: #6f7587;
  font-size: 0.875rem;
  line-height: 1.4;
}

.hd-profile-position__details {
  margin: 0.15rem 0 0;
}

.hd-profile-position__detail {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #eceef4;
}

.hd-profile-position__detail:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hd-profile-position__detail dt {
  margin: 0;
  color: #6f7587;
  font-size: 0.84rem;
  font-weight: 500;
}

.hd-profile-position__detail dd {
  margin: 0;
  color: var(--text-primary, #22263a);
  font-size: 1.2rem;
  font-weight: 650;
  line-height: 1.2;
}

.hd-profile-health {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 767.98px) {
  .hd-profile-health {
    grid-template-columns: 1fr;
  }
}

.hd-profile-page .hd-profile-health__card {
  margin-bottom: 0;
}

.hd-profile-health__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.hd-profile-health__title {
  margin: 0;
  color: var(--text-primary, #22263a);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.3;
}

.hd-profile-health__subtitle {
  margin: 0.2rem 0 0;
  color: #6f7587;
  font-size: 0.84rem;
  font-weight: 500;
}

.hd-profile-health__score-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.85rem;
}

.hd-profile-health__metric {
  margin: 0;
  color: var(--text-primary, #22263a);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
}

.hd-profile-health__pct {
  margin: 0;
  color: #6f7587;
  font-size: 1rem;
  font-weight: 600;
}

.hd-profile-health__meta {
  margin: 0.55rem 0 0;
  color: #8a91a3;
  font-size: 0.84rem;
  line-height: 1.4;
}

.hd-profile-health__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.hd-profile-health__actions .btn {
  border-radius: 999px;
}

/* —— Points page pilot (teacher/admin shell only) —— */
.hd-points-page .hd-points-back {
  margin: 0 0 0.65rem;
}

.hd-points-page .hd-today-header {
  margin-bottom: 1.5rem;
}

.hd-points-page .hd-student-section-nav {
  margin: 0 0 1.5rem;
}

.hd-points-page .hd-points-hero {
  margin-bottom: 1.5rem;
}

.hd-points-hero__score-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.85rem;
}

.hd-points-hero__score {
  margin: 0;
  color: var(--hd-primary-solid);
  font-size: 2.65rem;
  font-weight: 700;
  line-height: 1.1;
}

@media (max-width: 575.98px) {
  .hd-points-hero__score {
    font-size: 2.25rem;
  }
}

.hd-points-hero__pct {
  margin: 0;
  color: #6f7587;
  font-size: 1.05rem;
  font-weight: 600;
}

.hd-points-hero__meta {
  margin: 0.55rem 0 0;
  color: #8a91a3;
  font-size: 0.84rem;
  line-height: 1.4;
}

.hd-points-hero__note {
  margin: 0.35rem 0 0;
  color: #6f7587;
  font-size: 0.84rem;
  line-height: 1.4;
}

.hd-points-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.hd-points-hero__actions .btn {
  border-radius: 999px;
}

.hd-points-breakdown {
  margin: 0 0 1.5rem;
}

.hd-points-breakdown__label {
  margin: 0 0 0.75rem;
  color: #6f7587;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hd-points-breakdown__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (max-width: 991.98px) {
  .hd-points-breakdown__grid {
    grid-template-columns: 1fr;
  }
}

.hd-points-page .hd-points-category {
  margin-bottom: 0;
  padding: 1.15rem 1.25rem;
}

.hd-points-category__title {
  margin: 0 0 0.75rem;
  color: var(--text-primary, #22263a);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.hd-points-category__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.15rem;
}

.hd-points-category__metric-label {
  display: block;
  margin-bottom: 0.15rem;
  color: #6f7587;
  font-size: 0.75rem;
  font-weight: 500;
}

.hd-points-category__metric-value {
  color: var(--text-primary, #22263a);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.hd-points-category__metric-value--earned {
  color: #1f7a45;
}

.hd-points-category__metric-value--penalty {
  color: #b42318;
}

.hd-points-category__na {
  margin: 0;
  color: #6f7587;
  font-size: 0.875rem;
  line-height: 1.4;
}

.hd-points-category__note {
  margin: 0.75rem 0 0;
  color: #6f7587;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.hd-points-page .hd-points-attendance {
  margin-bottom: 0;
}

.hd-points-attendance__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.hd-points-attendance__title {
  margin: 0;
  color: var(--text-primary, #22263a);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.hd-points-attendance__subtitle {
  margin: 0.2rem 0 0;
  color: #6f7587;
  font-size: 0.84rem;
  font-weight: 500;
}

.hd-points-attendance__rate {
  margin: 0.25rem 0 0;
  color: var(--text-primary, #22263a);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
}

.hd-points-attendance__rate--empty {
  color: #8a91a3;
  font-weight: 600;
}

.hd-points-attendance__meta,
.hd-points-attendance__breakdown {
  margin: 0.35rem 0 0;
  color: #6f7587;
  font-size: 0.875rem;
  line-height: 1.4;
}

.hd-points-attendance__note {
  margin: 0.65rem 0 0;
  color: #8a91a3;
  font-size: 0.84rem;
  line-height: 1.4;
}

/* —— Revision page consistency —— */
.hd-revision-page .hd-revision-back {
  margin: 0 0 0.65rem;
}

.hd-revision-page .hd-today-header {
  margin-bottom: 1.5rem;
}

.hd-revision-page .hd-student-section-nav {
  margin: 0 0 1.5rem;
}

.hd-revision-page .hd-revision-hero {
  margin-bottom: 0;
}

.hd-revision-hero__intro {
  padding: 1.25rem 1.4rem 1rem;
  border-bottom: 1px solid #e7e8f1;
}

.hd-revision-hero__meta {
  margin: 0.85rem 0 0;
  color: var(--text-primary, #22263a);
  font-size: 0.9rem;
}

.hd-revision-hero__note {
  margin: 0.35rem 0 0;
  color: #8a91a3;
  font-size: 0.84rem;
}

.hd-revision-legend {
  padding: 0.85rem 1.25rem 1rem;
  border-top: 1px solid #e7e8f1;
  background: #fafafc;
}

.hd-revision-legend__title {
  margin: 0 0 0.4rem;
  color: #6f7587;
  font-size: 0.78rem;
  font-weight: 600;
}

.hd-revision-legend__list {
  margin: 0;
  padding-left: 1.1rem;
  color: #6f7587;
  font-size: 0.82rem;
}

.hd-revision-legend__list li + li {
  margin-top: 0.2rem;
}

/* —— Analytics page consistency —— */
.hd-analytics-page .hd-analytics-back {
  margin: 0 0 0.65rem;
}

.hd-analytics-page .hd-today-header {
  margin-bottom: 1.5rem;
}

.hd-analytics-page .hd-student-section-nav {
  margin: 0 0 1.5rem;
}

.hd-analytics-range {
  margin: 0 0 1rem;
}

.hd-analytics-page .hd-analytics-range .hd-date-range-card {
  margin-bottom: 0;
  border: 1px solid #e7e8f1;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(31, 34, 54, 0.03);
}

.hd-analytics-page .hd-analytics-range .hd-date-range-card .card-body {
  padding: 1rem 1.15rem;
}

.hd-analytics-page .hd-analytics-range .hd-date-range-card h2 {
  font-size: 0.95rem;
}

.hd-analytics-page .hd-teacher-surface {
  margin-bottom: 1.5rem;
}

.hd-analytics-page .hd-teacher-surface:last-child {
  margin-bottom: 0;
}

.hd-analytics-page .hd-analytics-attendance {
  margin-bottom: 1rem;
  padding: 1.1rem 1.25rem;
}

.hd-analytics-page .hd-analytics-attendance .hd-points-attendance__rate {
  font-size: 1.55rem;
}

.hd-analytics-page .hd-analytics-hero {
  margin-bottom: 1.5rem;
}

.hd-analytics-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.hd-analytics-metrics--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hd-analytics-metric {
  background: #f7f7fb;
  border: 1px solid #eceef4;
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.hd-analytics-metric--split {
  padding: 0;
  background: transparent;
  border: 0;
}

.hd-analytics-metric--split > * {
  height: 100%;
}

@media (max-width: 767.98px) {
  .hd-analytics-metrics,
  .hd-analytics-metrics--3 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Weekly teacher notes (Diary)
   ============================================================ */

.hd-status-chip--shared {
  color: #2e7a51;
  background: #e7f5ec;
  font-size: 0.75rem;
  font-weight: 600;
}

.hd-weekly-notes-summary {
  width: 100%;
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border, #ececf3);
  border-radius: 12px;
  background: #fff;
}

.hd-weekly-notes-summary__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.55rem;
}

.hd-weekly-notes-summary__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: #25293c;
}

.hd-weekly-notes-summary__count {
  display: inline-block;
  margin-left: 0.35rem;
  color: #73798b;
  font-weight: 600;
}

.hd-weekly-notes-summary__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.hd-weekly-notes-summary__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.hd-weekly-notes-summary__meta {
  margin: 0 0 0.15rem;
  font-size: 0.75rem;
  color: #73798b;
}

.hd-weekly-notes-summary__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #25293c;
}

.hd-weekly-notes-summary__empty {
  font-size: 0.875rem;
  color: #73798b;
}

.hd-weekly-notes-panel {
  width: 100%;
  margin: 0 0 1.5rem;
}

.hd-weekly-notes-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.hd-weekly-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hd-weekly-notes-list__item {
  padding: 0.9rem 0;
  border-top: 1px solid var(--border, #ececf3);
}

.hd-weekly-notes-list__item:first-child {
  border-top: 0;
  padding-top: 0.15rem;
}

.hd-weekly-notes-list__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin-bottom: 0.35rem;
}

.hd-weekly-notes-list__date {
  font-weight: 700;
  font-size: 0.9rem;
  color: #25293c;
}

.hd-weekly-notes-list__author,
.hd-weekly-notes-list__edited {
  font-size: 0.8rem;
  color: #73798b;
}

.hd-weekly-notes-list__text {
  margin: 0 0 0.55rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hd-weekly-notes-list__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.hd-weekly-notes-empty {
  padding: 0.35rem 0 0.5rem;
}

.hd-weekly-notes-older {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #ececf3);
}

.hd-weekly-notes-older-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 650;
}

.hd-weekly-note-form-surface {
  max-width: 36rem;
}

.hd-weekly-note-form .form-check {
  margin-bottom: 0.35rem;
}

@media (max-width: 767.98px) {
  .hd-weekly-notes-panel__head .btn {
    width: 100%;
  }
}

/* —— Insights Overview (Phase 1) —— */
.hd-insights-page .hd-insights-section-nav,
.hd-lessons-page .hd-lessons-section-nav {
  margin: 0 0 1rem;
}

.hd-lessons-page .hd-lessons-intro {
  margin: 0 0 1.5rem;
}

.hd-lessons-page .hd-lessons-intro .hd-teacher-surface__desc {
  color: #3f3a4a;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Pace & relearn roster — compact controls, top-aligned columns */
.hd-lex-targets-table > thead > tr > th.hd-lex-col-programme {
  min-width: 12rem;
  white-space: nowrap;
}

.hd-lex-targets-table .hd-lex-programme-cell {
  vertical-align: top;
  min-width: 0;
  max-width: none;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.hd-lex-pace-form {
  margin: 0;
}

.hd-lex-pace-form__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.75rem;
}

.hd-lex-pace-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hd-lex-pace-form__label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: #5c6378;
}

.hd-lex-pace-form__input {
  width: 4.75rem;
  max-width: 4.75rem;
  text-align: center;
}

.hd-lex-pace-form__action {
  display: flex;
  align-items: flex-end;
  padding-bottom: 1px;
}

.hd-lex-relearn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: 100%;
}

.hd-lex-relearn__status {
  margin: 0;
  min-height: 1.2rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #25293c;
}

.hd-lex-relearn__row,
.hd-lex-relearn__mark {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.hd-lex-relearn__select {
  width: 6.5rem;
  max-width: 6.5rem;
}

.hd-lex-relearn__input {
  width: 11rem;
  max-width: 100%;
}

.hd-lex-relearn__clear {
  margin: 0;
}

.hd-lex-targets-table .hd-lex-programme__block {
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
}


.hd-insights-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 1.5rem;
}

.hd-insights-period__chips,
.hd-insights-period__custom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.hd-insights-period__chip {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: #6f7587;
  font-size: 0.88rem;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  text-decoration: none;
  line-height: 1.2;
}

.hd-insights-period__chip:hover {
  color: var(--hd-primary-solid);
  background: rgba(var(--hd-primary-solid-rgb), 0.06);
}

.hd-insights-period__chip.is-active {
  color: var(--hd-primary-solid);
  background: rgba(var(--hd-primary-solid-rgb), 0.1);
  font-weight: 600;
}

.hd-insights-period__custom .form-control {
  width: auto;
  min-width: 8.5rem;
  border-radius: 10px;
}

.hd-insights-period__range {
  margin-left: auto;
}

.hd-insights-diagnosis {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: flex-start;
}

.hd-insights-diagnosis__text {
  color: #6f7587;
  font-size: 0.95rem;
  max-width: 42rem;
}

.hd-insights-snapshot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.35rem;
}

.hd-insights-snapshot__item {
  background: #fff;
  border: 1px solid #e7e8f1;
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.hd-insights-snapshot__value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.hd-insights-snapshot__label {
  font-size: 0.78rem;
  color: #6f7587;
  margin-top: 0.15rem;
}

.hd-insights-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0;
}

.hd-insights-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hd-insights-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.55rem 0;
  border-bottom: 1px solid #eef0f5;
  font-size: 0.92rem;
}

.hd-insights-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hd-insights-list a {
  flex: 0 0 auto;
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--hd-primary-solid);
  font-weight: 600;
}

.hd-insights-attention {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hd-insights-attention__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.85rem 0;
  border-bottom: 1px solid #eef0f5;
}

.hd-insights-attention__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hd-insights-attention__name {
  font-weight: 650;
  margin-bottom: 0.15rem;
}

.hd-insights-attention__why {
  color: #6f7587;
  font-size: 0.88rem;
}

.hd-insights-attention__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}

.hd-insights-categories {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hd-insights-categories li {
  display: grid;
  grid-template-columns: 1.2fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid #eef0f5;
  font-size: 0.92rem;
}

.hd-insights-categories li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hd-insights-categories a {
  text-decoration: none;
  color: var(--hd-primary-solid);
  font-weight: 600;
  font-size: 0.85rem;
}

@media (max-width: 767.98px) {
  .hd-insights-snapshot {
    grid-template-columns: 1fr 1fr;
  }

  .hd-insights-split {
    grid-template-columns: 1fr;
  }

  .hd-insights-period__range {
    margin-left: 0;
    width: 100%;
  }

  .hd-insights-attention__row {
    flex-direction: column;
  }

  .hd-insights-attention__actions {
    justify-content: flex-start;
  }

  .hd-insights-categories li {
    grid-template-columns: 1fr auto;
  }

  .hd-insights-categories li a {
    grid-column: 2;
    grid-row: 1;
  }
}

.hd-insights-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin: 0 0 0.75rem;
}

.hd-insights-toolbar__search {
  max-width: 16rem;
  width: 100%;
  border-radius: 10px;
}

.hd-insights-chips-scroller {
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.hd-insights-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  width: max-content;
  max-width: none;
  padding-bottom: 0.15rem;
}

.hd-insights-chips .hd-insights-period__chip {
  flex: 0 0 auto;
  white-space: nowrap;
}

.hd-insights-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.hd-insights-bar__track {
  height: 9px;
  background: #e6e7f0;
  border-radius: 999px;
  overflow: hidden;
  min-width: 0;
}

.hd-insights-bar__fill {
  height: 100%;
  background: #9aa0b0;
  border-radius: 999px;
}

/* Status fills — Design Bible traffic colours (not brand purple). */
.hd-insights-bar__fill--good { background: #2f9e66; }
.hd-insights-bar__fill--warn { background: #c4a035; }
.hd-insights-bar__fill--risk { background: #c45c5c; }
.hd-insights-bar__fill--muted { background: #9aa0b0; }

.hd-insights-bar__label {
  font-size: 0.8rem;
  color: #6f7587;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hd-insights-table {
  font-size: 0.88rem;
}

.hd-insights-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6f7587;
  font-weight: 700;
  border-bottom-color: #e7e8f1;
  white-space: nowrap;
}

.hd-insights-table td {
  vertical-align: middle;
  border-bottom-color: #eef0f5;
}

.hd-insights-table .hd-insights-bar {
  min-width: 6.5rem;
  max-width: 9rem;
}

.hd-insights-row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
}

.hd-insights-mobile-metric {
  margin-bottom: 0.5rem;
}

.hd-insights-mobile-rank {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  background: #fff;
  border: 1px solid #e7e8f1;
  border-radius: 14px;
  overflow: hidden;
}

.hd-insights-mobile-rank__item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: stretch;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #eef0f5;
  font-size: 0.9rem;
}

.hd-insights-mobile-rank__item:last-child {
  border-bottom: 0;
}

.hd-insights-mobile-rank__item--status {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.hd-insights-mobile-rank__name {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  min-width: 0;
}

.hd-insights-mobile-rank__metric {
  min-width: 0;
  width: 100%;
}

.hd-insights-mobile-rank__item--status .hd-insights-mobile-rank__metric {
  width: auto;
  flex: 0 0 auto;
}

.hd-insights-lesson-sel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 1rem;
}

.hd-insights-dist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hd-insights-dist li {
  display: grid;
  grid-template-columns: 9.5rem 2rem 1fr;
  gap: 0.55rem;
  align-items: center;
  margin: 0.4rem 0;
  font-size: 0.88rem;
}

.hd-insights-dist__count {
  font-variant-numeric: tabular-nums;
  color: #6f7587;
}

.hd-insights-dist__track {
  height: 12px;
  background: #e6e7f0;
  border-radius: 6px;
  overflow: hidden;
}

.hd-insights-dist__track > i {
  display: block;
  height: 100%;
  background: var(--hd-primary-solid, #5b4dc9);
}

.hd-insights-primary-stat {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0.75rem 0 0;
}

.hd-insights-trend {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  min-height: 7.5rem;
  padding: 0.5rem 0 0;
}

.hd-insights-trend__col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.hd-insights-trend__bar {
  width: 100%;
  max-width: 2.5rem;
  min-height: 4px;
  background: rgba(var(--hd-primary-solid-rgb, 91, 77, 201), 0.45);
  border-radius: 4px 4px 0 0;
  align-self: center;
}

.hd-insights-trend__label,
.hd-insights-trend__pct {
  font-size: 0.68rem;
  color: #6f7587;
  text-align: center;
}

.hd-insights-trend-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #5c6378;
  white-space: nowrap;
}

.hd-insights-trend-chip--improving { color: #1f7a4c; }
.hd-insights-trend-chip--declining { color: #a13d3d; }
.hd-insights-trend-chip--stable { color: #5c6378; }
.hd-insights-trend-chip--muted { color: #8a91a3; font-weight: 500; }

@media (max-width: 767.98px) {
  .hd-insights-dist li {
    grid-template-columns: 7rem 1.5rem 1fr;
  }

  .hd-insights-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hd-insights-toolbar__search {
    max-width: none;
  }

  .hd-insights-period {
    flex-direction: column;
    align-items: stretch;
  }

  .hd-insights-period__chips,
  .hd-insights-period__custom {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    padding-bottom: 0.15rem;
  }

  .hd-insights-period__chip {
    flex: 0 0 auto;
  }

  .hd-insights-period__custom .form-control {
    min-width: 7.5rem;
  }
}


