:root {
  --ink: #171a3a;
  --muted: #77738f;
  --paper: #fff9fd;
  --surface: #ffffff;
  --line: #e6def1;
  --teal: #7562e8;
  --teal-soft: #f0ecff;
  --coral: #e35f8f;
  --coral-soft: #ffeaf2;
  --green: #319b68;
  --green-soft: #e8f8ef;
  --amber: #a76a17;
  --amber-soft: #fff2d9;
  --lavender: #b9a9ff;
  --pink: #ffc9dc;
  --peach: #ffe3c5;
  --shadow: 0 16px 42px rgba(91, 71, 145, 0.12);
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

.auth-intro {
  min-height: 100vh;
  padding: clamp(40px, 7vw, 100px);
  background: #dce9e7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 38px;
}

.brand-mark span { background: var(--teal); }
.brand-mark span:nth-child(2) { background: var(--coral); }
.brand-mark span:nth-child(3) { background: #d3a33b; }
.brand-mark span:nth-child(4) { background: var(--green); }

.auth-intro h1 {
  margin: 0;
  max-width: 680px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.98;
  font-weight: 500;
}

.intro-copy {
  max-width: 600px;
  margin: 28px 0 42px;
  color: #42565b;
  font-size: 18px;
  line-height: 1.6;
}

.calendar-visual {
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid rgba(23, 98, 115, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.calendar-top, .visual-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-top span { color: var(--muted); font-size: 13px; }

.calendar-days {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.calendar-days span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.calendar-days .active { background: var(--teal); color: white; }
.visual-slot { padding-top: 16px; border-top: 1px solid var(--line); }
.visual-slot strong { color: var(--green); font-size: 13px; }

.auth-panel {
  padding: clamp(32px, 7vw, 96px);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f5f4;
}

.segmented button {
  min-height: 44px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.segmented button.active { color: var(--ink); background: var(--surface); box-shadow: 0 2px 8px rgba(24, 40, 45, 0.08); }

.auth-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.auth-heading h2 { margin: 0; font-size: 28px; }

.text-button, .quiet-button {
  border: 0;
  padding: 8px 0;
  color: var(--teal);
  background: transparent;
  font-weight: 700;
}
.social-login { margin-top: 16px; display: grid; gap: 8px; }
.social-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
}
.social-button:hover { border-color: var(--teal); }

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field span { color: var(--muted); font-size: 13px; font-weight: 700; }

.field.is-disabled { opacity: 0.62; }

.field input, .field select, .field textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.field.is-disabled select { cursor: not-allowed; background: #f4f0f5; }

.field textarea {
  min-height: 126px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(23, 98, 115, 0.12); }

.primary-button {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.primary-button:disabled { opacity: 0.55; cursor: wait; }

.public-tools {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.public-tools-heading {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.public-tools-heading small { color: var(--green); font-size: 11px; }

.public-tool-entry {
  min-height: 78px;
  padding: 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: linear-gradient(100deg, #fff3f8, #f7f2ff);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.public-tool-entry:hover,
.public-tool-entry:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 10px 24px rgba(91, 71, 145, 0.12);
  transform: translateY(-1px);
}

.public-tool-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--teal);
}

.public-tool-copy { min-width: 0; display: grid; gap: 4px; }
.public-tool-copy strong { font-size: 14px; }
.public-tool-copy small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.public-tool-arrow { color: var(--teal); font-size: 28px; line-height: 1; text-align: center; }

.app-view { min-height: 100vh; padding-bottom: 76px; }

.app-header {
  min-height: 112px;
  padding: 26px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.app-header h1 { margin: 0; font-size: 28px; }
.account-actions { display: flex; align-items: center; gap: 18px; }
.account-actions span { color: var(--muted); font-size: 14px; }

.app-content { width: min(980px, 100%); margin: 0 auto; padding: 40px 24px 80px; }
.screen-lead { margin-bottom: 32px; color: var(--muted); }
.screen-lead p { margin: 0; line-height: 1.6; }
.teacher-lead-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.teacher-lead { display: flex; justify-content: space-between; align-items: center; gap: 18px; }

.form-section { margin-bottom: 34px; }
.section-label { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-label span { font-weight: 800; }
.section-label small { color: var(--muted); }
.lesson-preset-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #fff7fb 0%, #fbf8ff 100%);
}
.lesson-preset-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
}
.lesson-preset-controls select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-picker {
  max-width: 620px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.calendar-controls {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  text-align: center;
}

.calendar-arrow {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--teal);
  background: var(--surface);
  font-size: 28px;
  line-height: 1;
}

.calendar-arrow:disabled { color: #aab2b3; background: #f0f2f1; cursor: not-allowed; }

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.weekday-row span {
  padding: 5px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.date-button, .time-button {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}

.date-button.empty { visibility: hidden; pointer-events: none; }
.date-button:disabled, .time-button:disabled { color: #aeb5b6; background: #f2f3f2; cursor: not-allowed; }
.date-button.today { box-shadow: inset 0 0 0 1px var(--coral); }

.date-button span { display: block; color: var(--muted); font-size: 12px; }
.date-button strong { display: block; margin-top: 3px; font-size: 19px; }
.date-button.active, .time-button.active { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }

.time-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.time-button { min-height: 48px; }
.availability-message { grid-column: 1 / -1; margin: 0; padding: 14px 0; color: var(--muted); }
.error-text { color: var(--coral); }
.two-column { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; }
.two-column.equal { grid-template-columns: 1fr 1fr; }
.three-column { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.recurrence-days-field { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.recurrence-days-field legend { padding: 0 6px; font-weight: 800; }
.recurrence-days-field p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.recurrence-days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.recurrence-day-option { position: relative; }
.recurrence-day-option input { position: absolute; opacity: 0; pointer-events: none; }
.recurrence-day-option span { min-height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.recurrence-day-option input:checked + span { border-color: var(--teal); color: white; background: var(--teal); font-weight: 800; }
.recurrence-day-option input:disabled + span { color: #aeb5b6; background: #f2f3f2; cursor: not-allowed; }
.file-field input { padding: 10px; }
.file-field small { color: var(--muted); font-size: 12px; }
.booking-submit { max-width: 320px; }
.forgot-pin-button { margin-top: 12px; }
.account-panel {
  max-width: 640px;
  padding: 22px;
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(91, 71, 145, 0.07);
}
.account-panel .primary-button { width: min(260px, 100%); }
.dialog-help { margin: 0 0 14px; color: var(--muted); line-height: 1.55; }

.lesson-list { display: grid; gap: 14px; }
.student-upcoming {
  margin: 18px 0 32px;
  padding: 22px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(91, 71, 145, 0.08);
}
.student-upcoming .weekly-planner-grid { width: 100%; }
.student-upcoming-grid { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.student-snapshot { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.student-snapshot + .student-snapshot { padding-left: 18px; border-left: 1px solid rgba(117, 98, 232, 0.22); }
.student-snapshot.empty { color: var(--muted); }
.lesson-filter-panel {
  margin: 0 0 14px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}
.lesson-filter-panel label { display: grid; gap: 6px; margin: 0; min-width: 0; }
.lesson-filter-panel span { color: var(--muted); font-size: 12px; font-weight: 800; }
.lesson-filter-panel select,
.lesson-filter-panel input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font: inherit;
}
.lesson-filter-panel .filter-reset { min-height: 40px; padding: 0 10px; white-space: nowrap; }
.lesson-sort-bar { margin: 0 0 16px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.lesson-sort-bar label { color: var(--muted); font-size: 13px; font-weight: 800; }
.lesson-sort-bar select { width: min(240px, 100%); min-height: 42px; }
.lesson-sort-bar select[id$="direction"] { width: min(150px, 100%); }
.collapsible-panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.collapse-toggle {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  color: var(--ink);
  background: #fbfdfc;
  font-weight: 800;
  text-align: left;
}
.collapse-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.collapse-icon { transition: transform 160ms ease; }
.collapsible-panel.is-collapsed .collapse-icon { transform: rotate(-90deg); }
.collapsible-content { padding: 14px; border-top: 1px solid var(--line); }
.collapsible-panel.is-collapsed .collapsible-content { display: none; }
.collapsible-panel .lesson-filter-panel,
.collapsible-panel .availability-panel { margin-bottom: 0; border: 0; padding: 0; background: transparent; }
.collapsible-panel .lesson-sort-bar { margin: 14px 0 0; }
.upcoming-card-copy h2 { margin: 2px 0 8px; font-size: 22px; }
.upcoming-card-copy p { margin: 3px 0; color: var(--muted); font-size: 13px; }
.upcoming-card-side { display: flex; align-items: center; gap: 10px; }
.weekly-overview { margin-bottom: 32px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.weekly-overview-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.weekly-overview-heading h2 { margin: 4px 0 0; font-size: 22px; }
.weekly-overview-heading .eyebrow { color: var(--teal); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.weekly-total { color: var(--muted); font-size: 13px; font-weight: 700; }
.weekly-overview-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.weekly-heading-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}
.weekly-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.weekly-planner-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  min-height: 260px;
  overflow-x: auto;
  border: 1px solid rgba(117, 98, 232, 0.16);
  border-radius: 8px;
  background: linear-gradient(145deg, #fffaf4 0%, #fff8fb 55%, #f8f4ff 100%);
}
.planner-day {
  min-width: 132px;
  display: grid;
  grid-template-rows: auto 1fr;
  border-left: 1px solid rgba(117, 98, 232, 0.16);
}
.planner-day:first-child { border-left: 0; }
.planner-day header {
  min-height: 48px;
  padding: 9px 8px;
  display: grid;
  gap: 2px;
  place-items: center;
  text-align: center;
  background: rgba(255, 219, 145, 0.55);
}
.planner-day header strong { font-size: 12px; letter-spacing: 0; }
.planner-day header span { color: var(--muted); font-size: 11px; font-weight: 700; }
.planner-items {
  min-height: 210px;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.planner-lesson {
  padding: 9px;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(117, 98, 232, 0.16);
  border-radius: 8px;
  color: inherit;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(91, 71, 145, 0.06);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.planner-lesson:hover,
.planner-lesson:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 12px 24px rgba(91, 71, 145, 0.12);
  transform: translateY(-1px);
  outline: 0;
}
.planner-lesson time { color: var(--teal); font-size: 12px; font-weight: 900; }
.planner-lesson strong { font-size: 13px; line-height: 1.2; }
.planner-lesson span { color: var(--muted); font-size: 11px; line-height: 1.25; }
.planner-lesson .status { width: fit-content; margin-top: 3px; font-style: normal; }
.planner-lesson.is-past {
  border-color: #d7d7d7;
  color: #707070;
  background: #f3f3f3;
  box-shadow: none;
}
.planner-lesson.is-past time,
.planner-lesson.is-past strong,
.planner-lesson.is-past span {
  color: #707070;
}
.planner-lesson.is-past:hover,
.planner-lesson.is-past:focus-visible {
  border-color: #bdbdbd;
  background: #ececec;
  box-shadow: 0 8px 18px rgba(34, 34, 34, 0.08);
}
.planner-empty { margin: 0; color: rgba(89, 84, 116, 0.48); text-align: center; font-weight: 800; }
.weekly-mobile-summary { display: none; }
.mobile-today-card,
.mobile-week-list {
  border: 1px solid rgba(117, 98, 232, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}
.mobile-today-card {
  min-height: 260px;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 14px;
  aspect-ratio: 1 / 1;
}
.mobile-today-card h3,
.mobile-week-list h3 {
  margin: 4px 0 0;
  font-size: 18px;
}
.mobile-today-card > span {
  justify-self: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.mobile-today-lessons,
.mobile-week-list {
  display: grid;
  gap: 10px;
}
.mobile-week-list {
  padding: 14px;
}
.mobile-primary-lesson,
.mobile-week-lesson {
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid rgba(117, 98, 232, 0.16);
  border-radius: 8px;
  color: inherit;
  background: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.mobile-primary-lesson:hover,
.mobile-primary-lesson:focus-visible,
.mobile-week-lesson:hover,
.mobile-week-lesson:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
  transform: translateY(-1px);
  outline: 0;
}
.mobile-primary-lesson time,
.mobile-week-lesson time { color: var(--teal); font-size: 12px; font-weight: 900; }
.mobile-primary-lesson strong,
.mobile-week-lesson strong { font-size: 14px; line-height: 1.25; }
.mobile-primary-lesson span,
.mobile-week-lesson span { color: var(--muted); font-size: 12px; }
.mobile-primary-lesson .status,
.mobile-week-lesson .status { width: fit-content; font-style: normal; }
.mobile-primary-lesson.is-past,
.mobile-week-lesson.is-past {
  border-color: #d7d7d7;
  color: #707070;
  background: #f3f3f3;
}
.weekly-swipe-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.lesson-card-title-link {
  color: inherit;
  text-decoration: none;
}
.lesson-card-title-link:hover,
.lesson-card-title-link:focus-visible {
  color: var(--teal);
  text-decoration: underline;
  outline: 0;
}
.student-last-lesson { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.updates-dashboard {
  margin: 18px 0 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(91, 71, 145, 0.07);
}
.updates-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.updates-heading h2 { margin: 3px 0 0; font-size: 18px; }
.updates-heading > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.updates-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.update-item {
  min-width: 0;
  padding: 12px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: #fff;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.update-item:hover,
.update-item:focus-visible {
  border-color: var(--coral);
  background: var(--coral-soft);
  transform: translateY(-1px);
  outline: 0;
}
.update-item time { color: var(--muted); font-size: 11px; font-weight: 800; }
.update-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.update-item span,
.update-item em { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-style: normal; }
.weekly-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.weekly-columns > section + section { padding-left: 24px; border-left: 1px solid var(--line); }
.weekly-columns h3 { display: flex; justify-content: space-between; margin: 0 0 10px; font-size: 15px; }
.weekly-columns h3 span { color: var(--muted); }
.weekly-lesson-list { margin: 0; padding: 0; list-style: none; }
.weekly-lesson-list li { display: grid; grid-template-columns: minmax(120px, auto) 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.weekly-lesson-list time { color: var(--muted); font-size: 12px; font-weight: 700; }
.weekly-lesson-details { display: grid; gap: 3px; min-width: 0; }
.weekly-lesson-details strong, .weekly-lesson-details span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weekly-lesson-details strong { font-size: 14px; }
.weekly-lesson-details span { color: var(--muted); font-size: 12px; }
.weekly-empty { margin: 0; padding: 16px 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }
.fee-summary { margin-bottom: 32px; display: grid; grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr); gap: 14px; align-items: stretch; }
.fee-summary-card, .fee-month-panel, .fee-student-panel { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(110deg, #fff8fb, #f7f3ff); }
.fee-summary h2 { margin: 5px 0; font-size: 26px; }
.fee-summary p { margin: 0; color: var(--muted); font-size: 13px; }
.fee-student-panel { grid-column: 1 / -1; }
.fee-student-list { display: grid; gap: 10px; margin-top: 12px; }
.fee-student-row {
  min-height: 58px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(117, 98, 232, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}
.fee-student-row div { min-width: 0; display: grid; gap: 2px; }
.fee-student-row strong { color: var(--ink); }
.fee-student-row div span,
.fee-student-row > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.fee-student-row > strong { color: var(--teal); text-align: right; }
.fee-month-panel { min-width: 0; overflow: hidden; }
.fee-month-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.fee-month-heading > span:last-child { color: var(--muted); font-size: 12px; font-weight: 800; }
.fee-month-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 2px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.fee-month-card {
  flex: 0 0 min(280px, 82%);
  scroll-snap-align: start;
  padding: 16px;
  border: 1px solid rgba(117, 98, 232, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 22px rgba(91, 71, 145, 0.06);
}
.booking-restriction {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--amber);
  border-radius: 8px;
  color: #815312;
  background: var(--amber-soft);
  font-weight: 700;
}
.profile-panel { margin: 0 0 22px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.profile-panel-heading { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.profile-panel-heading h2 { margin: 3px 0 0; font-size: 20px; }
.profile-panel-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.profile-chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.profile-chip { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--teal); background: #fbfdfc; font-weight: 800; }
.profile-form { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 12px; }
.profile-form .field { margin-bottom: 0; }
.profile-wide { grid-column: span 2; }
.profile-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.teacher-lesson-form-grid { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 12px; }
.teacher-lesson-form-grid .field { margin-bottom: 0; }
.teacher-lesson-wide { grid-column: 1 / -1; }
.teacher-lesson-dialog .primary-button,
.teacher-profile-dialog .primary-button { margin-top: 16px; }
.student-management-panel { margin-bottom: 32px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.student-management-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.student-management-heading h2 { margin: 4px 0 0; font-size: 22px; }
.student-management-list { display: grid; gap: 12px; }
.student-card { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfc; }
.student-card-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.student-card h3 { margin: 0; font-size: 17px; }
.student-card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.student-stats { margin: 14px 0 0; display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); gap: 8px; }
.student-stats div { padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.student-stats dt { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.student-stats dd { margin: 3px 0 0; font-size: 13px; font-weight: 800; }
.student-lessons-summary { margin-top: 12px !important; }
.student-account-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
}
.student-account-grid label { display: grid; gap: 6px; }
.student-account-grid span { color: var(--muted); font-size: 12px; font-weight: 800; }
.student-account-grid input { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.student-profile-details { margin: 12px 0 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.student-profile-details li { padding: 10px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.student-profile-details strong { font-size: 13px; }
.student-profile-details span, .student-profile-details em { color: var(--muted); font-size: 12px; font-style: normal; }
.student-profile-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.danger-link { color: var(--coral) !important; }
.student-control-grid { margin-top: 12px; display: grid; grid-template-columns: 150px 150px 1fr; gap: 10px; }
.student-control-grid label { display: grid; gap: 6px; }
.student-control-grid span { color: var(--muted); font-size: 12px; font-weight: 800; }
.student-control-grid input { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.student-card-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.status.approved { color: var(--green); background: var(--green-soft); }
.status.pending { color: var(--amber); background: var(--amber-soft); }
.status.blocked { color: var(--coral); background: var(--coral-soft); }
.availability-panel { margin-bottom: 32px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.availability-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.availability-heading h2 { margin: 0; font-size: 20px; }
.availability-heading p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.availability-save { width: auto; min-width: 170px; }
.availability-rule-section { margin: 22px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.availability-rule-section h3 { margin: 0; font-size: 16px; }
.availability-rule-section p { margin: 5px 0 14px; color: var(--muted); font-size: 13px; }
.day-off-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day-off-option { position: relative; }
.day-off-option input { position: absolute; opacity: 0; }
.day-off-option span { min-height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.day-off-option input:checked + span { border-color: var(--coral); color: var(--coral); background: var(--coral-soft); font-weight: 800; }
.availability-grid { display: grid; gap: 12px; }
.availability-day { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.availability-day.day-off { opacity: 0.52; background: #f7f4f6; }
.availability-day legend { padding: 0 6px; font-weight: 800; }
.availability-day-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.mini-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal);
  background: #faf7ff;
  font-size: 12px;
  font-weight: 800;
}
.mini-button:hover { border-color: var(--teal); background: var(--teal-soft); }
.availability-options { display: grid; grid-template-columns: repeat(7, minmax(74px, 1fr)); gap: 8px; }
.availability-option { position: relative; }
.availability-option input { position: absolute; opacity: 0; pointer-events: none; }
.availability-option span { display: block; padding: 10px 6px; border: 1px solid var(--line); border-radius: 5px; text-align: center; cursor: pointer; }
.availability-option input:checked + span { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); font-weight: 800; }
.availability-option input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.exception-controls { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; }
.period-controls { grid-template-columns: repeat(4, minmax(120px, 1fr)) auto auto; }
.period-whole-day { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.period-whole-day input { width: 18px; height: 18px; accent-color: var(--teal); }
.period-controls .action-button { min-height: 44px; }
.compact-field { margin: 0; }
.exception-list { margin-top: 14px; display: grid; gap: 8px; }
.exception-item { min-height: 48px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fffafd; }
.exception-item span { color: var(--muted); font-size: 13px; }
.lesson-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.lesson-card-head { display: flex; justify-content: space-between; gap: 20px; }
.lesson-card h3 { margin: 0; font-size: 18px; }
.lesson-card p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.lesson-statuses { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.status { padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status.confirmed { color: var(--teal); background: var(--teal-soft); }
.status.unpaid { color: var(--amber); background: var(--amber-soft); }
.status.scheduled { color: var(--teal); background: var(--teal-soft); }
.status.proof_uploaded { color: var(--coral); background: var(--coral-soft); }
.status.paid { color: var(--green); background: var(--green-soft); }
.status.cancelled { color: #5d6567; background: #e8ebea; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.series-note { margin-top: 14px !important; }
.series-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.series-toggle {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--teal);
  background: #f7faf9;
  font-weight: 800;
  text-align: left;
  padding: 0 14px;
}
.series-toggle:hover { border-color: var(--teal); }
.occurrence-list { margin-top: 18px; border-top: 1px solid var(--line); }
.occurrence-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, auto);
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.occurrence-row:last-child { border-bottom: 0; padding-bottom: 0; }
.occurrence-main { display: grid; gap: 4px; }
.occurrence-main span { color: var(--muted); font-size: 14px; }
.lesson-materials {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.lesson-materials summary {
  width: fit-content;
  cursor: pointer;
  color: var(--teal);
  font-weight: 800;
}
.lesson-material-body {
  margin-top: 8px;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdfc;
}
.lesson-materials p { margin: 0; white-space: pre-wrap; }
.lesson-materials strong { color: var(--ink); }
.material-link-list { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-link {
  padding: 0;
  border: 0;
  color: var(--teal);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.lesson-row-link {
  color: var(--ink);
  text-decoration: none;
}
.lesson-row-link:hover,
.lesson-detail-link:hover {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.series-card,
.lesson-card,
.occurrence-list { overflow: visible; }
.occurrence-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.action-menu {
  position: relative;
  display: inline-block;
  justify-self: end;
}
.action-menu[open] { z-index: 35; }
.action-menu summary {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--teal);
  border-radius: 5px;
  color: var(--teal);
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.action-menu[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.action-menu-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: min(268px, calc(100vw - 32px));
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.series-actions .action-menu-list {
  left: 0;
  right: auto;
}
.occurrence-actions .action-menu-list {
  left: auto;
  right: 0;
}
.action-menu-list .action-button,
.action-menu-list .fee-editor {
  width: 100%;
  justify-content: center;
}
.action-menu-list .fee-editor {
  display: grid;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.action-menu-list .fee-editor input { width: 100%; }
.occurrence-row.is-focused {
  animation: lesson-focus-pulse 2.4s ease;
  border-radius: 8px;
}
@keyframes lesson-focus-pulse {
  0%, 100% { background: transparent; box-shadow: none; }
  20%, 70% { background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
}
@media (prefers-reduced-motion: reduce) {
  .occurrence-row.is-focused {
    animation: none;
    background: var(--teal-soft);
    box-shadow: inset 0 0 0 1px var(--teal);
  }
}
.fee-editor { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.fee-editor > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.fee-editor input { width: 92px; min-height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; }
.fee-editor small { color: var(--muted); font-size: 12px; font-weight: 800; }
.change-window-closed { align-self: center; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.action-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--teal);
  border-radius: 5px;
  color: var(--teal);
  background: var(--surface);
  font-weight: 700;
}
.action-button.solid { color: white; background: var(--teal); }
.action-button.danger { border-color: var(--coral); color: var(--coral); }
.empty-state { padding: 34px 0; color: var(--muted); border-top: 1px solid var(--line); }

.bottom-nav {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(420px, calc(100% - 28px));
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.bottom-nav button { min-height: 46px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-weight: 800; }
.bottom-nav button.active { color: white; background: var(--teal); }

.proof-dialog { width: min(620px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 8px; box-shadow: var(--shadow); }
.proof-dialog::backdrop, .reschedule-dialog::backdrop, .material-dialog::backdrop, .material-viewer-dialog::backdrop { background: rgba(16, 27, 31, 0.7); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.proof-dialog img { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #eef0ef; }
.reschedule-dialog, .material-dialog { width: min(460px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 8px; box-shadow: var(--shadow); }
.teacher-lesson-dialog,
.teacher-profile-dialog { width: min(760px, calc(100% - 24px)); }
.material-viewer-dialog { width: min(960px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 8px; box-shadow: var(--shadow); }
.dialog-content { padding: 20px; }
.dialog-content > p { margin: 0 0 20px; color: var(--muted); line-height: 1.5; }
.material-viewer-body { min-height: min(70vh, 720px); padding: 14px; display: grid; place-items: center; background: #f7faf9; }
.material-viewer-body img { max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: 8px; background: white; }
.material-viewer-body iframe { width: 100%; height: min(72vh, 760px); border: 1px solid var(--line); border-radius: 8px; background: white; }
.material-viewer-body p { color: var(--muted); }

.toast {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 50%;
  transform: translate(-50%, calc(-100% - 24px));
  max-width: calc(100% - 28px);
  padding: 12px 16px;
  border-radius: 6px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 180ms ease;
}
.toast.show { transform: translate(-50%, 18px); }
.toast.error { background: var(--coral); }

/* Soft learning-app visual system */
body { background: linear-gradient(135deg, #fff9fd 0%, #faf8ff 55%, #fffaf3 100%); }
.eyebrow { color: var(--teal); letter-spacing: 0; text-transform: uppercase; }

.auth-intro {
  position: relative;
  align-items: center;
  padding: clamp(34px, 5vw, 72px);
  text-align: center;
  background: linear-gradient(145deg, #fff1f7 0%, #f4efff 48%, #fff4e6 100%);
}
.auth-intro::after {
  content: "\2726";
  position: absolute;
  top: 8%;
  right: 10%;
  color: rgba(117, 98, 232, 0.28);
  font-size: 34px;
}
.brand-lockup {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  color: var(--teal);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.05;
  white-space: nowrap;
}
.brand-icon {
  display: inline-grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--teal);
  box-shadow: 0 8px 18px rgba(117, 98, 232, 0.2);
  font-size: 16px;
}
.brand-name { display: inline-block; min-width: 0; overflow-wrap: normal; letter-spacing: 0; }
.auth-hero-copy { position: relative; z-index: 1; margin-top: 28px; }
.auth-intro h1 { max-width: 760px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 6vw, 78px); line-height: 1; color: #4d3eb9; }
.intro-copy { max-width: 520px; margin: 18px auto 12px; color: #595474; font-size: 17px; }
.lesson-star { width: min(330px, 62%); aspect-ratio: 1; margin: 6px auto 10px; border-radius: 50%; object-fit: cover; box-shadow: 0 20px 50px rgba(119, 91, 189, 0.16); }
.hero-pills { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.hero-pills span { padding: 8px 12px; border: 1px solid rgba(117, 98, 232, 0.14); border-radius: 999px; color: #5e5679; background: rgba(255, 255, 255, 0.76); font-size: 12px; font-weight: 700; }

.auth-panel { background: rgba(255, 255, 255, 0.94); }
.language-control { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--muted); font-size: 13px; font-weight: 700; }
.language-control select, .app-language-select { min-height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: white; }
.app-language-select { min-width: 58px; }
.segmented { padding: 5px; border-color: #e8e0f3; background: #f8f4fb; }
.segmented button.active { color: white; background: var(--teal); box-shadow: 0 6px 16px rgba(117, 98, 232, 0.24); }
.auth-heading h2 { color: var(--ink); }
.field input, .field select { border-color: var(--line); background: #fffdfd; }
.field input:focus, .field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(117, 98, 232, 0.12); }
.primary-button { border-color: var(--teal); background: var(--teal); box-shadow: 0 8px 18px rgba(117, 98, 232, 0.2); }
.primary-button:hover { background: #6652db; }

.app-header { border-bottom-color: #eadff1; background: linear-gradient(100deg, #fff5f9 0%, #f4efff 55%, #fff4e7 100%); }
.app-header::before { content: "\2726"; display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--teal); box-shadow: 0 8px 18px rgba(117, 98, 232, 0.2); font-size: 19px; }
.app-header > div:first-of-type { margin-right: auto; }
.app-content { width: min(1080px, 100%); }
.screen-lead { padding: 14px 16px; border: 1px solid #eee4f4; border-radius: 8px; color: #625d78; background: linear-gradient(90deg, #fff3f8, #faf7ff); }

.calendar-picker, .lesson-card, .availability-panel, .weekly-overview { border-color: var(--line); box-shadow: 0 10px 26px rgba(91, 71, 145, 0.07); }
.calendar-picker { max-width: 680px; background: #fffefe; }
.calendar-arrow { border-color: #e5dcf0; color: var(--teal); background: #faf7ff; }
.date-button, .time-button { border-color: #e7dff0; }
.date-button.today { box-shadow: inset 0 0 0 1px var(--pink); }
.date-button.active, .time-button.active { border-color: var(--teal); color: white; background: var(--teal); box-shadow: 0 7px 14px rgba(117, 98, 232, 0.2); }
.section-label > span { color: var(--ink); }

.location-fields { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 18px; align-items: start; margin-bottom: 8px; }
.address-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}
.address-control input { min-width: 0; }
.map-button {
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  color: var(--teal);
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}
.map-button:hover { background: var(--teal-soft); }
.field small,
.address-control + small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.online-reminder { align-self: center; margin: 22px 0 18px; padding: 13px 15px; border: 1px solid #dcd2f2; border-radius: 8px; color: #5f5682; background: #f5f1ff; font-size: 13px; }
.online-reminder span { color: var(--teal); font-weight: 900; }
.lesson-location { margin-top: 10px !important; color: #625b7c !important; }
.lesson-location span { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 4px; border-radius: 50%; color: var(--teal); background: var(--teal-soft); font-size: 11px; }

.weekly-overview { background: linear-gradient(145deg, #fff5f9 0%, #faf7ff 60%, #fff 100%); }
.weekly-overview-heading .eyebrow { color: var(--coral); }
.weekly-columns h3 span { display: inline-grid; min-width: 24px; height: 24px; place-items: center; border-radius: 50%; color: var(--teal); background: var(--teal-soft); }
.weekly-lesson-list li { border-top-color: #e9e1f2; }
.availability-panel { background: #fff; }
.availability-day { border-color: #e9e1f2; background: #fffdfd; }
.availability-option span { border-color: #e8e0f1; background: #fff; }
.availability-option input:checked + span { border-color: var(--teal); color: white; background: var(--teal); }
.series-toggle { border-color: #e5dbf0; color: var(--teal); background: #faf7ff; }
.action-button { border-color: var(--teal); color: var(--teal); }
.action-button.solid { background: var(--teal); }
.bottom-nav { border-color: #e4daee; background: rgba(255, 253, 255, 0.96); box-shadow: 0 12px 30px rgba(78, 59, 124, 0.18); }
.bottom-nav button.active { background: var(--teal); }

@media (max-width: 820px) {
  .auth-view { display: block; }
  .auth-intro { min-height: auto; padding: 36px 24px 30px; }
  .brand-mark { width: 36px; height: 36px; margin-bottom: 24px; }
  .auth-intro h1 { font-size: 46px; }
  .intro-copy { margin: 18px 0 26px; font-size: 15px; }
  .lesson-star { width: min(260px, 68%); }
  .brand-lockup { align-self: center; font-size: 13px; }
  .brand-icon { flex-basis: 28px; width: 28px; height: 28px; font-size: 15px; }
  .calendar-visual { padding: 16px; }
  .auth-panel { padding: 32px 24px 48px; }
  .segmented { margin-bottom: 28px; }
  .calendar-picker { max-width: none; }
  .time-grid { grid-template-columns: repeat(3, 1fr); }
  .two-column { grid-template-columns: 1fr; gap: 0; }
  .three-column { grid-template-columns: 1fr; gap: 0; }
  .occurrence-row { grid-template-columns: 1fr auto; }
  .occurrence-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .availability-options { grid-template-columns: repeat(4, minmax(68px, 1fr)); }
  .day-off-grid { grid-template-columns: repeat(4, 1fr); }
  .exception-controls { grid-template-columns: 1fr; }
  .period-controls { grid-template-columns: 1fr 1fr; }
  .period-controls .action-button { grid-column: 1 / -1; }
  .recurrence-days-grid { grid-template-columns: repeat(4, 1fr); }
  .student-upcoming-grid { grid-template-columns: 1fr; }
  .student-snapshot + .student-snapshot { padding: 16px 0 0; border-top: 1px solid rgba(117, 98, 232, 0.22); border-left: 0; }
  .updates-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fee-summary { grid-template-columns: 1fr; }
  .fee-month-card { flex-basis: 86%; }
  .fee-student-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 6px;
  }
  .fee-student-row > strong { text-align: left; }
  .student-upcoming { align-items: flex-start; }
  .upcoming-card-side { flex-direction: column; align-items: flex-end; }
  .location-fields { grid-template-columns: 1fr; gap: 0; }
  .address-control { grid-template-columns: 1fr; }
  .map-button { width: 100%; }
  .online-reminder { margin-top: 0; }
  .lesson-preset-controls { grid-template-columns: 1fr 1fr; }
  .lesson-preset-controls select { grid-column: 1 / -1; }
  .weekly-planner-grid {
    display: none;
  }
  .weekly-mobile-summary {
    display: grid;
    gap: 14px;
    touch-action: pan-y;
  }
  .weekly-overview,
  .student-upcoming {
    margin-bottom: 28px;
    overflow: visible;
  }
  .mobile-today-card {
    min-height: auto;
    aspect-ratio: auto;
  }
  .mobile-primary-lesson,
  .mobile-week-lesson {
    overflow-wrap: anywhere;
  }
  .weekly-heading-actions {
    justify-items: start;
    margin-top: 12px;
  }
  .weekly-controls { justify-content: flex-start; }
  .planner-day {
    min-width: 0;
    border-left: 0;
    border-top: 1px solid rgba(117, 98, 232, 0.16);
  }
  .planner-day:first-child { border-top: 0; }
  .planner-day header {
    min-height: 42px;
    grid-template-columns: 1fr auto;
    place-items: center stretch;
    padding: 10px 12px;
    text-align: left;
  }
  .planner-day header span { justify-self: end; }
  .planner-items {
    min-height: auto;
    padding: 10px 12px 14px;
  }
  .planner-empty { text-align: left; }
  .planner-lesson {
    grid-template-columns: auto 1fr;
    align-items: start;
    column-gap: 10px;
  }
  .planner-lesson time {
    grid-row: span 3;
    min-width: 46px;
  }
  .planner-lesson .status,
  .planner-lesson .inline-link {
    grid-column: 2;
  }
  .weekly-columns { grid-template-columns: 1fr; gap: 20px; }
  .weekly-columns > section + section { padding: 20px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 560px) {
  .app-header { min-height: 90px; padding: 18px; }
  .app-header h1 { font-size: 22px; }
  .app-header::before { flex-basis: 36px; width: 36px; height: 36px; }
  .account-actions span { display: none; }
  .account-actions { gap: 8px; }
  .app-language-select { min-width: 50px; padding: 0 6px; }
  .app-content { padding: 26px 16px 76px; }
  .date-grid { gap: 7px; }
  .date-button { min-height: 52px; }
  .date-button strong { font-size: 16px; }
  .weekday-row { gap: 3px; }
  .time-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .booking-submit { max-width: none; }
  .lesson-card-head { display: block; }
  .lesson-card-head > .status { display: inline-flex; margin-top: 12px; }
  .occurrence-row { grid-template-columns: 1fr; gap: 10px; }
  .occurrence-actions { grid-column: auto; }
  .action-menu {
    width: 100%;
    justify-self: stretch;
  }
  .action-menu summary {
    width: 100%;
    justify-content: center;
  }
  .action-menu-list {
    position: static;
    width: 100%;
    margin-top: 8px;
  }
  .availability-heading { display: block; }
  .availability-save { width: 100%; margin-top: 16px; }
  .availability-options { grid-template-columns: repeat(3, minmax(68px, 1fr)); }
  .period-controls { grid-template-columns: 1fr; }
  .period-controls .action-button { grid-column: auto; }
  .recurrence-days-grid { grid-template-columns: repeat(3, 1fr); }
  .student-management-heading { display: block; }
  .student-management-heading .action-button { margin-top: 10px; }
  .student-card-main { display: block; }
  .student-card-main .status { display: inline-flex; margin-top: 10px; }
  .student-stats { grid-template-columns: 1fr 1fr; }
  .student-account-grid { grid-template-columns: 1fr; }
  .student-account-grid .action-button { width: 100%; }
  .student-control-grid { grid-template-columns: 1fr; }
  .profile-form { grid-template-columns: 1fr; }
  .profile-wide { grid-column: auto; }
  .teacher-lesson-form-grid { grid-template-columns: 1fr; }
  .teacher-lesson-wide { grid-column: auto; }
  .lesson-filter-panel { grid-template-columns: 1fr; }
  .lesson-filter-panel .filter-reset { width: 100%; }
  .lesson-sort-bar { align-items: stretch; flex-direction: column; }
  .lesson-sort-bar select { width: 100%; }
  .lesson-sort-bar select[id$="direction"] { width: 100%; }
  .lesson-preset-controls { grid-template-columns: 1fr; }
  .lesson-preset-controls select { grid-column: auto; }
  .lesson-preset-controls .action-button { width: 100%; }
  .weekly-overview { padding: 18px; }
  .weekly-overview-heading { display: block; }
  .weekly-total { display: inline-block; margin-top: 8px; }
  .updates-dashboard { padding: 16px; }
  .updates-heading { display: block; }
  .updates-heading > span { display: inline-block; margin-top: 8px; }
  .updates-list { grid-template-columns: 1fr; }
  .fee-month-heading { display: block; }
  .fee-month-heading > span:last-child { display: block; margin-top: 4px; }
  .fee-month-card { flex-basis: 90%; }
  .weekly-planner-grid { border-radius: 10px; }
  .planner-day header strong { font-size: 13px; }
  .planner-lesson { grid-template-columns: 1fr; }
  .planner-lesson time,
  .planner-lesson .status,
  .planner-lesson .inline-link {
    grid-column: auto;
    grid-row: auto;
  }
  .weekly-lesson-list li { grid-template-columns: 1fr auto; }
  .weekly-lesson-list time { grid-column: 1 / -1; }
  .hero-pills span { padding: 7px 9px; font-size: 11px; }
}

/* Airbnb-inspired design-md override */
:root {
  --ink: #222222;
  --muted: #6a6a6a;
  --paper: #f7f7f7;
  --surface: #ffffff;
  --line: #dddddd;
  --teal: #ff385c;
  --teal-soft: #fff1f3;
  --coral: #ff385c;
  --coral-soft: #fff1f3;
  --green: #008a5b;
  --green-soft: #e8f6ef;
  --amber: #b26a00;
  --amber-soft: #fff4df;
  --lavender: #ff8a9f;
  --pink: #ffd1da;
  --peach: #fff7ed;
  --shadow: 0 10px 28px rgba(34, 34, 34, 0.08);
}

html,
body {
  background: var(--paper);
}

body {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.auth-intro {
  background: linear-gradient(145deg, #ffffff 0%, #fff7f8 52%, #f7f7f7 100%);
}

.auth-intro::after {
  content: none;
}

.brand-lockup {
  color: var(--ink);
  font-weight: 800;
}

.brand-icon,
.app-header::before {
  color: #ffffff;
  background: var(--coral);
  box-shadow: 0 10px 24px rgba(255, 56, 92, 0.24);
}

.auth-intro h1 {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 750;
  letter-spacing: 0;
}

.intro-copy {
  color: var(--muted);
}

.lesson-star {
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(34, 34, 34, 0.12);
}

.hero-pills span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(34, 34, 34, 0.06);
}

.hero-pills span::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: var(--coral);
}

.hero-pills span:nth-child(2)::before {
  background: #008a5b;
}

.hero-pills span:nth-child(3)::before {
  background: #b26a00;
}

.auth-panel {
  background: #ffffff;
}

.language-control select,
.app-language-select,
.field input,
.field select,
.field textarea,
.lesson-filter-panel select,
.lesson-filter-panel input,
.student-account-grid input,
.student-control-grid input,
.fee-editor input {
  border-color: var(--line);
  color: var(--ink);
  background: #ffffff;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.lesson-filter-panel select:focus,
.lesson-filter-panel input:focus,
.student-account-grid input:focus,
.student-control-grid input:focus,
.fee-editor input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 56, 92, 0.14);
  outline: 0;
}

.segmented {
  border-color: var(--line);
  background: #f7f7f7;
}

.segmented button.active {
  color: #ffffff;
  background: var(--coral);
  box-shadow: 0 8px 18px rgba(255, 56, 92, 0.22);
}

.text-button,
.quiet-button,
.calendar-arrow,
.action-button,
.action-menu summary,
.map-button,
.mini-button,
.series-toggle,
.inline-link {
  color: var(--coral);
}

.primary-button,
.action-button.solid {
  border-color: var(--coral);
  color: #ffffff;
  background: var(--coral);
  box-shadow: 0 8px 18px rgba(255, 56, 92, 0.2);
}

.primary-button:hover,
.action-button.solid:hover {
  background: #e00b41;
}

.social-button:hover,
.mini-button:hover,
.action-button:hover,
.action-menu summary:hover,
.map-button:hover,
.series-toggle:hover {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.app-header {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.screen-lead,
.weekly-overview,
.student-upcoming,
.updates-dashboard,
.fee-summary-card,
.fee-month-panel {
  border-color: var(--line);
  background: #ffffff;
}

.calendar-picker,
.lesson-card,
.availability-panel,
.weekly-overview,
.student-upcoming,
.updates-dashboard,
.student-management-panel,
.student-card,
.account-panel {
  border-color: var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.calendar-arrow {
  border-color: var(--line);
  background: #ffffff;
}

.date-button,
.time-button,
.recurrence-day-option span,
.availability-option span,
.day-off-option span {
  border-color: var(--line);
  background: #ffffff;
}

.date-button.today {
  box-shadow: inset 0 0 0 1px var(--coral);
}

.date-button.active,
.time-button.active,
.recurrence-day-option input:checked + span,
.availability-option input:checked + span,
.bottom-nav button.active {
  border-color: var(--coral);
  color: #ffffff;
  background: var(--coral);
  box-shadow: 0 7px 14px rgba(255, 56, 92, 0.2);
}

.day-off-option input:checked + span,
.action-button.danger,
.status.blocked,
.status.proof_uploaded {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--coral-soft);
}

.status.scheduled {
  color: var(--coral);
  background: var(--coral-soft);
}

.online-reminder {
  border-color: var(--line);
  color: var(--ink);
  background: #f7f7f7;
}

.online-reminder span,
.lesson-location span,
.weekly-overview-heading .eyebrow,
.lesson-row-link:hover,
.lesson-detail-link:hover {
  color: var(--coral);
}

.action-menu summary,
.map-button {
  border-color: var(--coral);
}

.action-menu-list {
  border-color: var(--line);
  background: #ffffff;
}

.occurrence-row.is-focused {
  animation-name: lesson-focus-pulse-airbnb;
}

@keyframes lesson-focus-pulse-airbnb {
  0%, 100% { background: transparent; box-shadow: none; }
  20%, 70% { background: var(--coral-soft); box-shadow: inset 0 0 0 1px var(--coral); }
}

.lesson-location span,
.weekly-columns h3 span {
  background: var(--coral-soft);
}

.weekly-planner-grid {
  border-color: var(--line);
  background: #ffffff;
}

.planner-day {
  border-color: var(--line);
}

.planner-day header {
  background: #fff1f3;
}

.planner-lesson {
  border-color: #ebebeb;
  background: #ffffff;
}

.planner-lesson:hover,
.planner-lesson:focus-visible {
  border-color: var(--coral);
  background: var(--coral-soft);
  box-shadow: 0 12px 24px rgba(34, 34, 34, 0.1);
}

.planner-lesson.is-past {
  border-color: #d7d7d7;
  color: #707070;
  background: #f3f3f3;
  box-shadow: none;
}

.planner-lesson.is-past:hover,
.planner-lesson.is-past:focus-visible {
  border-color: #bdbdbd;
  background: #ececec;
}

.fee-month-track {
  scrollbar-color: var(--coral) #f2f2f2;
}

.bottom-nav {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 30px rgba(34, 34, 34, 0.16);
}

@media (max-width: 560px) {
  .auth-intro h1 {
    font-size: 42px;
  }
}

@media (max-width: 820px) {
  .weekly-planner-grid {
    display: none;
  }

  .weekly-mobile-summary {
    display: grid;
    gap: 14px;
    touch-action: pan-y;
  }

  .weekly-overview,
  .student-upcoming {
    margin-bottom: 28px;
    overflow: visible;
  }

  .mobile-today-card {
    min-height: auto;
    aspect-ratio: auto;
  }

  .mobile-primary-lesson,
  .mobile-week-lesson {
    overflow-wrap: anywhere;
  }

  .weekly-overview > .weekly-empty,
  .student-upcoming > .weekly-empty {
    display: none;
  }
}
