:root {
  --ink: #24313e;
  --ink-2: #44515e;
  --muted: #65717c;
  --paper: #f7f6f2;
  --card: #ffffff;
  --line: #e3e5e4;
  --line-2: #cbd2d3;
  --forest: #147d80;
  --forest-2: #106367;
  --mint: #e7f2f1;
  --mint-2: #b8dbd8;
  --coral: #dc654d;
  --coral-soft: #fbe7e1;
  --amber: #a96918;
  --amber-soft: #fbefd9;
  --blue: #315f7d;
  --shadow: 0 10px 35px rgba(35, 49, 62, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--paper);
  max-width: 100%;
  overflow-x: clip;
}
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;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: clip;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  color: inherit;
}
a {
  color: var(--forest-2);
}
.hide {
  display: none !important;
}
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
:focus-visible {
  outline: 3px solid rgba(49, 120, 96, 0.35);
  outline-offset: 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: -0.035em;
  font-size: 20px;
}
/* On the sign-in page the logo goes back to the website. */
.brand-link {
  color: var(--ink);
  text-decoration: none;
  width: fit-content;
}
.brand-link:hover {
  color: var(--forest-2);
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--forest);
  box-shadow: none;
}
.brand-mark svg {
  width: 18px;
  height: 18px;
}
.trial-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--forest-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
}
.trial-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2d9b73;
}

/* Authentication */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(420px, 560px);
  background: #efeee7;
}
.auth-story {
  padding: clamp(42px, 7vw, 96px);
  color: var(--ink);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.auth-story::after {
  content: '';
  position: absolute;
  width: 620px;
  height: 620px;
  right: -260px;
  bottom: -280px;
  border-radius: 50%;
  border: 110px solid rgba(20, 125, 128, 0.055);
  box-shadow: 0 0 0 75px rgba(20, 125, 128, 0.035);
}
.auth-story .brand {
  position: relative;
  z-index: 1;
}
.story-copy {
  max-width: 620px;
  position: relative;
  z-index: 1;
  /* Centre the headline in the space below the logo. */
  margin: auto 0;
  padding: 60px 0;
}
.story-copy h1 {
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.98;
  margin: 0 0 24px;
  letter-spacing: -0.065em;
  max-width: 760px;
}
.story-copy p {
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.65;
  max-width: 560px;
  margin: 0;
}
.auth-panel {
  background: var(--paper);
  padding: clamp(24px, 6vw, 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  min-width: 0;
}
.auth-mobile-brand {
  display: none;
  margin-bottom: 42px;
}
.auth-card h2 {
  font-size: 32px;
  letter-spacing: -0.045em;
  margin: 0 0 8px;
}
.auth-card > .muted {
  font-size: 15px;
  margin: 0 0 28px;
}

/* Forms and controls */
.field {
  margin-bottom: 17px;
  min-width: 0;
}
.field label,
.field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 7px;
  color: var(--ink-2);
}
input,
textarea,
select {
  width: 100%;
  min-height: 47px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition:
    border 0.15s,
    box-shadow 0.15s;
}
input:focus,
textarea:focus,
select:focus {
  border-color: #55937f;
  box-shadow: 0 0 0 3px rgba(85, 147, 127, 0.13);
  outline: 0;
}
textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 12px;
  min-width: 0;
}
.form-grid > * {
  min-width: 0;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  color: var(--ink-2);
}
.check-row input[type='checkbox'] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--forest-2);
}
.check-row span {
  display: grid;
  gap: 2px;
}
.check-row b {
  font-size: 13px;
}
.check-row span.inline-text {
  display: block;
}
.reg-consent .check-row span {
  font-size: 13px;
}
.reg-consent {
  display: grid;
  gap: 10px;
  margin: 4px 0 16px;
}
.check-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.button {
  border: 0;
  border-radius: 12px;
  min-height: 46px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 0.12s,
    background 0.15s,
    opacity 0.15s;
  text-decoration: none;
}
.button:hover {
  transform: translateY(-1px);
}
.button:active {
  transform: translateY(0);
}
.button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}
.button.primary {
  background: var(--forest);
  color: white;
}
.button.primary:hover {
  background: var(--forest-2);
}
.button.mint {
  background: var(--mint);
  color: var(--forest);
}
.button.secondary {
  background: #fff;
  border: 1px solid var(--line-2);
}
.button.danger {
  background: var(--coral-soft);
  color: #a53d2d;
}
.button.full {
  width: 100%;
}
.button.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 10px;
}
.link-button {
  border: 0;
  padding: 4px;
  background: none;
  color: var(--forest-2);
  cursor: pointer;
  font-weight: 700;
}
.note {
  padding: 11px 13px;
  border-radius: 11px;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
}
.note.err {
  background: var(--coral-soft);
  color: #9b3728;
}
.note.ok {
  background: var(--mint);
  color: var(--forest-2);
}
.deletion-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--coral-soft);
  color: #9b3728;
  font-size: 14px;
}
.account-section {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.account-section summary {
  cursor: pointer;
  font-weight: 750;
}
.account-section summary small {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 500;
}
.account-section[open] summary {
  margin-bottom: 12px;
}
.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.check-row.account-row {
  justify-content: flex-start;
}
.account-row > .button {
  flex: none;
  white-space: nowrap;
}
.account-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.danger-zone summary {
  color: #9b3728;
}
.auth-switch {
  text-align: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}
.demo-card {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #bfd9ce;
  border-radius: 14px;
  background: #edf8f3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.demo-card b {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}
.demo-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.spin {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.button.secondary .spin {
  border-color: var(--line-2);
  border-top-color: currentColor;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Desktop application shell */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}
.sidebar {
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 25px 18px;
  background: #ffffff;
  color: var(--ink);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  padding: 0 8px 28px;
}
.sidebar .trial-pill {
  margin: 0 8px 25px;
  align-self: flex-start;
  background: var(--mint);
  color: var(--forest-2);
}
.sidebar .trial-pill.warn {
  background: var(--coral-soft);
  color: var(--coral);
}
.trial-pill.warn::before {
  background: var(--coral);
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.side-nav button {
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  text-align: left;
}
.side-nav button svg {
  width: 19px;
  height: 19px;
  opacity: 0.8;
}
.side-nav button.on {
  background: var(--mint);
  color: var(--forest-2);
}
.side-nav button:hover {
  background: #f2f5f4;
}
.side-nav button.on svg {
  opacity: 1;
}
.side-profile {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 18px 8px 0;
}
.side-profile b {
  font-size: 13px;
  display: block;
}
.side-profile span {
  font-size: 11px;
  color: var(--muted);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}
.deletion-banner.calm {
  background: var(--mint);
  color: var(--forest-2);
}
.side-profile .link-button {
  color: var(--forest-2);
  padding: 10px 0 0;
  font-size: 12px;
}
.app-main {
  min-width: 0;
}
.topbar {
  height: 82px;
  padding: 0 clamp(24px, 4vw, 54px);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 243, 237, 0.92);
  backdrop-filter: blur(15px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.mobile-brand {
  display: none;
}
.page-heading {
  min-width: 0;
}
.page-heading h1 {
  font-size: 23px;
  letter-spacing: -0.035em;
  margin: 0 0 3px;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 9px;
}
.content {
  padding: 32px clamp(24px, 4vw, 54px) 70px;
  max-width: 1500px;
  margin: 0 auto;
}
.mobile-nav {
  display: none;
}

/* Common content */
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-head h2 {
  margin: 0 0 4px;
  font-size: 21px;
  letter-spacing: -0.035em;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 3px 15px rgba(27, 48, 41, 0.045);
}
.card-head {
  min-height: 59px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-head h3 {
  font-size: 14px;
  margin: 0;
  letter-spacing: -0.01em;
}
.card-head .count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.card-body {
  padding: 18px;
}
.empty {
  padding: 42px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat {
  padding: 18px;
  min-height: 112px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  display: none;
  content: '';
  position: absolute;
  width: 75px;
  height: 75px;
  right: -24px;
  top: -25px;
  border-radius: 50%;
  background: var(--mint);
  opacity: 0.65;
}
.stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.stat-value {
  font-size: 28px;
  font-weight: 820;
  letter-spacing: -0.045em;
  margin: 10px 0 3px;
}
.stat-meta {
  color: var(--muted);
  font-size: 11px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}
.stack {
  display: grid;
  gap: 18px;
}

/* Rows */
.lesson-row,
.student-row,
.homework-row,
.payment-row,
.schedule-row,
.attention-row {
  min-height: 70px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.lesson-row + .lesson-row,
.student-row + .student-row,
.homework-row + .homework-row,
.payment-row + .payment-row,
.schedule-row + .schedule-row,
.attention-row + .attention-row {
  border-top: 1px solid var(--line);
}
.time-box {
  width: 58px;
  flex: none;
  text-align: center;
  padding: 7px 4px;
  border-radius: 10px;
  background: #f0f2ed;
  font-size: 13px;
  font-weight: 800;
}
.time-box small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
  font-weight: 600;
}
.row-main {
  flex: 1;
  min-width: 0;
}
.row-main b {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-main span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.35;
}
.avatar {
  width: 39px;
  height: 39px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--forest);
  font-size: 12px;
  font-weight: 850;
}
.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.icon-button {
  width: 35px;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-button:hover {
  background: #f3f4ef;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.pill.owing {
  background: var(--coral-soft);
  color: #a63c2d;
}
.pill.paid {
  background: var(--mint);
  color: var(--forest-2);
}
.pill.neutral {
  background: #eff0ec;
  color: var(--muted);
}
.attention-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 850;
  background: var(--amber-soft);
  color: var(--amber);
}
.attention-row.danger .attention-icon {
  background: var(--coral-soft);
  color: var(--coral);
}
.attention-value {
  font-size: 13px;
  font-weight: 800;
}
.check-button {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  border: 2px solid var(--line-2);
  background: white;
  cursor: pointer;
  flex: none;
}
.check-button.on {
  background: var(--forest-2);
  border-color: var(--forest-2);
}

/* Students, payments and settings */
.student-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
  gap: 18px;
  align-items: start;
}
/* Settings: a menu of sections beside one section's cards, in one column so
   nothing leaves a gap. The menu stays in view while a long section scrolls. */
.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 760px);
  gap: 22px;
  align-items: start;
}
.settings-nav {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 4px;
}
.settings-nav button {
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.settings-nav button:hover {
  background: var(--paper-2);
}
.settings-nav button.on {
  background: var(--mint);
  color: var(--forest-2);
}
.settings-nav button.hide {
  display: none;
}
.payment-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.money-feature {
  padding: 22px;
}
.money-feature b {
  font-size: 32px;
  letter-spacing: -0.05em;
  display: block;
  margin-top: 8px;
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.segmented {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: #e9ebe5;
  border-radius: 11px;
}
.segmented button {
  border: 0;
  background: transparent;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 750;
  color: var(--muted);
  cursor: pointer;
}
.segmented button.on {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}
.data-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.data-links a {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
  background: white;
}
.workspace-tabs {
  margin-bottom: 18px;
}
.workspace-tabs .segmented {
  width: max-content;
}
.directory-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.directory-tools.family-tools {
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.family-tools p {
  max-width: 60ch;
}
.progress-controls {
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}
.progress-controls.report-controls {
  border-top: 1px solid var(--line);
}
.progress-controls .field {
  margin: 0;
  min-width: 190px;
  flex: 1;
}
.progress-controls .field:first-child {
  flex: 2;
}
.progress-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.progress-stat {
  padding: 16px;
  min-height: 100px;
}
.progress-stat b {
  display: block;
  font-size: 25px;
  letter-spacing: -0.04em;
  margin: 8px 0 3px;
}
.progress-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: start;
}
.progress-overview {
  padding: 18px;
}
.progress-overview h3 {
  margin: 0 0 5px;
  font-size: 16px;
}
.progress-overview > p {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.month-chart {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}
.month-bar-row {
  display: grid;
  grid-template-columns: 32px minmax(80px, 1fr) 88px;
  gap: 9px;
  align-items: center;
  font-size: 11px;
}
.month-bar-row > span:first-child {
  color: var(--muted);
  font-weight: 750;
}
.month-bar-row > small {
  color: var(--muted);
  text-align: right;
}
.month-track {
  height: 11px;
  background: #e8ece7;
  border-radius: 999px;
  overflow: hidden;
}
.month-fill {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest-2), #65aa8c);
}
.learning-snapshot {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.snapshot-row {
  padding: 12px;
  border-radius: 11px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.snapshot-row span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
}
.snapshot-row b {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}
.batch-card {
  margin-bottom: 18px;
}
.batch-layout {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
  gap: 20px;
  align-items: center;
}
.batch-fields {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.batch-fields .field {
  margin: 0;
  flex: 1;
  min-width: 155px;
}
.batch-summary {
  padding: 15px;
  border-radius: 12px;
  background: var(--mint);
  border: 1px solid var(--mint-2);
}
.batch-summary b {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}
.batch-summary span {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.45;
}
.batch-student-breakdown {
  border-top: 1px solid var(--line);
  padding: 16px 18px 18px;
}
.batch-student-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.batch-student-heading b {
  font-size: 13px;
}
.batch-student-heading span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}
.student-finance-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.student-finance-row {
  min-height: 66px;
  padding: 11px 14px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) repeat(3, minmax(95px, 0.45fr));
  gap: 14px;
  align-items: center;
}
.student-finance-row + .student-finance-row {
  border-top: 1px solid var(--line);
}
.student-finance-name b {
  display: block;
  font-size: 13px;
}
.student-finance-name span,
.student-finance-money small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.student-finance-money {
  text-align: right;
}
.student-finance-money b {
  display: block;
  font-size: 13px;
}
.student-finance-money.paid b {
  color: var(--forest-2);
}
.student-finance-money.due b {
  color: var(--coral);
}
.tax-export-panel {
  margin: 0 18px 18px;
  padding: 16px;
  border-radius: 13px;
  background: linear-gradient(120deg, var(--forest), #245e50);
  color: white;
  display: flex;
  align-items: center;
  gap: 13px;
}
.tax-export-mark {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: #bde5d5;
  font-size: 12px;
  font-weight: 850;
}
.tax-export-copy {
  flex: 1;
  min-width: 0;
}
.tax-export-copy b {
  display: block;
  font-size: 13px;
}
.tax-export-copy span {
  display: block;
  color: #b9d1c8;
  font-size: 10px;
  line-height: 1.45;
  margin-top: 4px;
}
.tax-export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tax-export-actions a {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
}
.tax-export-actions a:first-child {
  background: white;
  color: var(--forest);
}
.tax-export-actions a:last-child {
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: white;
}
code {
  background: #eef0eb;
  border-radius: 7px;
  padding: 3px 6px;
  font-size: 12px;
}
.search-input {
  width: 220px;
  min-height: 38px;
  padding: 7px 11px;
  font-size: 12px;
}
.onboarding {
  padding: 20px;
  margin-bottom: 20px;
  background: linear-gradient(120deg, var(--forest), #245e50);
  color: white;
  border: 0;
}
.onboarding h3 {
  margin: 0 0 5px;
  font-size: 18px;
}
.onboarding > p {
  color: #c1d8cf;
  margin: 0 0 17px;
  font-size: 12px;
}
.onboard-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.onboard-step {
  padding: 11px;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.09);
  color: inherit;
  display: flex;
  align-items: center;
  gap: 9px;
  font: 700 11px inherit;
  text-align: left;
  cursor: pointer;
}
.onboard-step:disabled {
  cursor: default;
}
.onboard-step:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.16);
}
.onboard-step i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  font-style: normal;
  flex: none;
}
.onboard-step.done {
  color: #bfe6d7;
}
.onboard-step.done i {
  background: #4aa782;
  color: white;
}
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(125px, 1fr));
  min-width: 875px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
/* Month view: whole weeks, Monday first. */
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.month-weekday {
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.month-day {
  min-height: 112px;
  min-width: 0;
  padding: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.month-day.outside {
  background: transparent;
}
.month-day.outside .month-date {
  color: var(--muted);
  opacity: 0.6;
}
.month-day.today {
  background: #f1f8f4;
}
.month-date {
  border: 0;
  background: none;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}
.month-date:hover {
  background: var(--mint);
}
.month-day.today .month-date {
  background: var(--forest);
  color: white;
}
.month-items {
  display: grid;
  gap: 3px;
  margin-top: 4px;
}
.month-item {
  border: 0;
  border-left: 3px solid var(--forest-2);
  border-radius: 6px;
  padding: 3px 6px;
  background: var(--mint);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.month-item.done {
  border-left-color: var(--line-2);
  background: #f0f2f1;
  color: var(--muted);
}
.month-item.blocked {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}
.month-more {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  padding-left: 6px;
}
.month-count {
  display: none;
}
@media (max-width: 700px) {
  /* On phones each day shows a count; tap the date to open that week. */
  .month-day {
    min-height: 58px;
    padding: 4px 2px;
    text-align: center;
  }
  .month-items {
    display: none;
  }
  .month-count {
    display: block;
    margin: 4px auto 0;
    width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 999px;
    background: var(--mint);
    color: var(--forest-2);
    font-size: 11px;
    font-weight: 800;
  }
  .month-weekday {
    padding: 8px 2px;
    text-align: center;
  }
}
.pager {
  display: flex;
  gap: 4px;
}
.calendar-scroll {
  overflow-x: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}
.day-column {
  min-height: 430px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}
.day-column.today {
  background: #f1f8f4;
}
.day-head {
  height: 58px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.day-head b {
  color: var(--ink);
  font-size: 17px;
  margin-top: 2px;
  letter-spacing: -0.03em;
}
.calendar-lessons {
  padding: 7px;
  display: grid;
  gap: 7px;
}
.calendar-lesson {
  border: 1px solid #c7ddd3;
  border-left: 3px solid var(--forest-2);
  border-radius: 9px;
  padding: 8px;
  background: #f8fffb;
  cursor: pointer;
  text-align: left;
}
.calendar-lesson:hover {
  border-color: #78aa96;
}
.calendar-lesson b {
  display: block;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calendar-lesson span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
}
.calendar-lesson.done {
  border-color: var(--line);
  border-left-color: #87a198;
  background: #f4f4f0;
  color: var(--muted);
}
.calendar-block {
  border: 1px dashed #d8b26f;
  border-left: 3px solid var(--amber);
  border-radius: 9px;
  padding: 8px;
  background: var(--amber-soft);
  cursor: pointer;
  text-align: left;
}
.calendar-block:hover {
  border-color: var(--amber);
}
.calendar-block b {
  display: block;
  color: #70450e;
  font-size: 11px;
}
.calendar-block span {
  display: block;
  color: #8b642d;
  font-size: 9px;
  margin-top: 3px;
}
.activity-list {
  display: grid;
}
.activity-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
}
.activity-item:last-child {
  border-bottom: 0;
}
.activity-item time {
  color: var(--muted);
  font-size: 10px;
  width: 82px;
  flex: none;
}
.activity-item span {
  font-size: 11px;
  line-height: 1.4;
}
.danger-text {
  color: var(--coral) !important;
}

/* Dialog / sheets */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(11, 30, 25, 0.55);
  backdrop-filter: blur(5px);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade 0.16s ease-out;
}
.dialog {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  background: var(--paper);
  border-radius: 22px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.26);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop 0.18s ease-out;
}
.dialog.wide {
  width: min(880px, 100%);
}
.dialog-head {
  min-height: 72px;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 13px 19px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.dialog-head h2 {
  font-size: 18px;
  margin: 0 0 3px;
  letter-spacing: -0.025em;
}
.dialog-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.dialog-close {
  margin-left: auto;
  width: 37px;
  height: 37px;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 21px;
  cursor: pointer;
}
.draft-state {
  margin-left: auto;
  color: #c8ddd5;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.dialog-body {
  padding: 20px;
  overflow-y: auto;
}
.dialog-foot {
  padding: 13px 20px;
  background: rgba(245, 243, 237, 0.96);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}
.dialog-section {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  margin-bottom: 13px;
}
.dialog-section:last-child {
  margin-bottom: 0;
}
.dialog-section h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0 0 13px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chip {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}
.chip.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}
.earlier-homework {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.earlier-homework-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
.earlier-homework-row .row-main {
  min-width: 0;
}
.earlier-homework-row .row-main b {
  display: block;
  font-size: 13px;
}
.earlier-homework-row .row-main span {
  font-size: 12px;
  color: var(--muted);
}
.earlier-homework-row .chips {
  flex-wrap: nowrap;
}
.insert-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.insert-label {
  font-size: 11px;
  font-weight: 750;
  color: var(--muted);
  margin-right: 2px;
}
.chip[aria-pressed='true'] {
  color: white;
  background: var(--forest);
  border-color: var(--forest);
}
.chip.warn[aria-pressed='true'] {
  background: var(--amber);
  border-color: var(--amber);
}
.chip.danger[aria-pressed='true'] {
  background: var(--coral);
  border-color: var(--coral);
}
.rating-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 15px;
}
.rating-option {
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.rating-option b {
  display: block;
  font-size: 12px;
  margin-bottom: 3px;
}
.rating-option small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.rating-option[aria-pressed='true'] {
  background: var(--forest);
  border-color: var(--forest);
  color: white;
}
.rating-option[aria-pressed='true'] small {
  color: #c7ddd4;
}
.observation-help {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  margin: -4px 0 11px;
}
.summary-box {
  border-color: var(--mint-2);
  background: var(--mint);
}
.summary-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 8px;
}
.timeline {
  position: relative;
  padding-left: 18px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}
.timeline-item {
  position: relative;
  padding: 0 0 20px 15px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--forest-2);
  left: -17px;
  top: 4px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-item b {
  font-size: 13px;
}
.timeline-item p {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 6px 0 0;
}
.timeline-item small {
  color: var(--muted);
  font-size: 10px;
}
.import-preview {
  overflow: auto;
  max-height: 330px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.import-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
  font-size: 12px;
}
.import-table th,
.import-table td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.import-table th {
  position: sticky;
  top: 0;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.import-table tr.invalid {
  background: var(--coral-soft);
}
.import-table tr.warning {
  background: var(--amber-soft);
}
.feedback-entry {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.feedback-entry:first-child {
  border-top: 0;
}
.feedback-entry p {
  margin: 5px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  white-space: pre-wrap;
}
.feedback-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--muted);
  text-transform: capitalize;
}
.feedback-actions {
  display: flex;
  gap: 7px;
  margin-top: 8px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 110;
  max-width: 360px;
  background: var(--forest);
  color: white;
  border-radius: 13px;
  padding: 13px 16px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.22s;
}
.toast.show {
  transform: none;
  opacity: 1;
}
.toast small {
  display: block;
  color: #b8d0c7;
  margin-top: 3px;
  font-weight: 500;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.975) translateY(8px);
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .sidebar {
    padding-inline: 12px;
  }
  .student-layout,
  .settings-layout,
  .dashboard-grid,
  .progress-grid,
  .batch-layout {
    grid-template-columns: 1fr;
  }
  /* On narrower screens the sections are a row of chips that scrolls sideways. */
  .settings-nav {
    position: static;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .settings-nav button {
    flex: none;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    white-space: nowrap;
  }
  .dashboard-grid .stack {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 760px) {
  .auth-shell {
    display: block;
    background: var(--paper);
  }
  .auth-story {
    display: none;
  }
  .auth-panel {
    min-height: 100vh;
    padding: 28px 20px 60px;
    align-items: flex-start;
  }
  .auth-mobile-brand {
    display: flex;
  }
  .auth-card {
    padding-top: 10px;
  }
  .auth-card h2 {
    font-size: 28px;
  }
  .app-shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .app-main {
    padding-bottom: 76px;
  }
  .topbar {
    height: 70px;
    padding: 0 15px;
    gap: 11px;
  }
  .mobile-brand {
    display: grid;
    width: 36px;
    height: 36px;
    flex: none;
  }
  .page-heading h1 {
    font-size: 18px;
  }
  .page-heading p {
    display: none;
  }
  .top-actions .button.secondary {
    display: none;
  }
  .top-actions .button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 12px;
  }
  .content {
    padding: 19px 14px 25px;
  }
  .mobile-nav {
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    height: 67px;
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
    background: rgba(255, 254, 250, 0.96);
    border-top: 1px solid var(--line);
    display: flex;
    backdrop-filter: blur(16px);
  }
  .mobile-nav button {
    flex: 1;
    border: 0;
    background: none;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 9px;
    font-weight: 750;
    cursor: pointer;
  }
  .mobile-nav button svg {
    width: 19px;
    height: 19px;
  }
  .mobile-nav button.on {
    color: var(--forest-2);
  }
  .section-head {
    align-items: center;
  }
  .section-head h2 {
    font-size: 18px;
  }
  .section-head p {
    display: none;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
  }
  .stat {
    min-height: 96px;
    padding: 14px;
  }
  .stat:last-child {
    grid-column: 1/-1;
    min-height: 82px;
  }
  .stat-value {
    font-size: 23px;
    margin-top: 7px;
  }
  .dashboard-grid,
  .dashboard-grid .stack,
  .student-layout,
  .settings-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .card {
    border-radius: 15px;
  }
  .lesson-row,
  .student-row,
  .homework-row,
  .payment-row,
  .schedule-row {
    padding: 11px 12px;
    gap: 10px;
  }
  #paymentHistory .payment-row {
    flex-wrap: wrap;
  }
  #paymentHistory .payment-row .row-main {
    flex: 1 1 220px;
  }
  #paymentHistory .payment-row .button {
    flex: 1 1 72px;
    min-width: 0;
  }
  .row-actions .button.secondary {
    padding: 0 9px;
  }
  .row-actions .button.secondary .desktop-only {
    display: none;
  }
  .payment-stats {
    gap: 10px;
  }
  .money-feature {
    padding: 16px;
  }
  .money-feature b {
    font-size: 25px;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .overlay {
    padding: 0;
    align-items: stretch;
  }
  .dialog,
  .dialog.wide {
    width: 100%;
    max-height: none;
    height: 100%;
    border-radius: 0;
  }
  .dialog-head {
    min-height: 65px;
    padding: 11px 14px;
  }
  .dialog-body {
    padding: 14px 14px 100px;
  }
  .dialog-foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 25px rgba(20, 38, 32, 0.08);
  }
  .dialog-foot .button {
    flex: 1;
  }
  .dialog-section {
    padding: 14px;
  }
  .toast {
    left: 14px;
    right: 14px;
    bottom: 82px;
    max-width: none;
  }
  .data-links {
    grid-template-columns: 1fr;
  }
  .progress-stats {
    grid-template-columns: 1fr 1fr;
  }
  .progress-stat {
    min-height: 86px;
    padding: 13px;
  }
  .progress-stat b {
    font-size: 21px;
  }
  .progress-controls .field {
    min-width: 130px;
  }
  .rating-grid {
    grid-template-columns: 1fr;
  }
  .directory-tools .toolbar {
    width: 100%;
  }
  .directory-tools .toolbar .segmented {
    margin-left: auto;
  }
  .batch-fields .button {
    width: 100%;
  }
  .batch-student-heading {
    display: block;
  }
  .batch-student-heading span {
    display: block;
    text-align: left;
    margin-top: 4px;
    line-height: 1.4;
  }
  .student-finance-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .student-finance-name {
    grid-column: 1/-1;
  }
  .student-finance-money {
    text-align: left;
  }
  .tax-export-panel {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .tax-export-copy {
    min-width: calc(100% - 56px);
  }
  .tax-export-actions {
    width: 100%;
  }
  .tax-export-actions a {
    flex: 1;
  }
  .search-input {
    width: 100%;
    order: 3;
  }
  #view-calendar .section-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
  }
  #view-calendar .section-head .toolbar {
    width: 100%;
    flex-wrap: nowrap;
  }
  #view-calendar .section-head .toolbar .button {
    flex: 1;
    min-width: 0;
    padding: 0 8px;
  }
  .onboard-steps {
    grid-template-columns: 1fr;
  }
  .week-grid {
    display: block;
    min-width: 0;
    border: 0;
  }
  .calendar-scroll {
    overflow: visible;
  }
  .day-column {
    min-height: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
  }
  .day-column:last-child {
    border-bottom: 0;
  }
  .day-column.empty-day {
    display: none;
  }
  .day-head {
    height: auto;
    min-height: 48px;
    padding: 10px 13px;
    border-bottom: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }
  .day-head b {
    margin: 0;
    font-size: 13px;
  }
  .calendar-lessons {
    padding: 0 10px 10px;
  }
  .calendar-lesson {
    padding: 10px;
  }
  .calendar-lesson b {
    font-size: 12px;
  }
  .calendar-lesson span {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* LessonWrap: everyday tasks first, optional detail on demand. */
.daily-lessons {
  margin-bottom: 20px;
}
.stats {
  margin: 0 0 20px;
}
.card-head-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-head.end {
  justify-content: flex-end;
}
.saved-note {
  margin-left: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--forest-2);
}

.optional-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 14px;
  background: var(--card);
}
.optional-section > summary {
  padding: 16px;
  cursor: pointer;
  font-weight: 750;
  color: var(--forest-2);
  min-height: 50px;
}
.optional-section > summary small {
  font-weight: 400;
  color: var(--muted);
  margin-left: 8px;
}
.optional-section[open] > summary {
  border-bottom: 1px solid var(--line);
}
.optional-section > .dialog-section {
  border: 0;
  margin: 0;
  border-radius: 0 0 14px 14px;
}
.wrap-intro {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 16px;
}
.quick-lesson-facts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.quick-lesson-facts b {
  font-size: 17px;
}
.quick-lesson-facts .link-button {
  margin-left: auto;
}
.closeout-dialog .dialog-head {
  flex-wrap: wrap;
}
.closeout-dialog .dialog-head > div {
  flex: 1;
  min-width: 140px;
}
.draft-state {
  font-size: 11px;
  max-width: 140px;
}
.more-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.sidebar .brand {
  letter-spacing: -0.02em;
}
.day-progress {
  margin-left: auto;
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 700;
}
.closeout-dialog .dialog-foot .primary {
  min-width: 160px;
}
@media (max-width: 600px) {
  .mobile-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .closeout-dialog .dialog-head {
    gap: 6px;
  }
  .closeout-dialog .dialog-head h2 {
    font-size: 18px;
  }
  .optional-section > summary small {
    display: block;
    margin: 4px 0 0 16px;
  }
  .closeout-dialog .dialog-body {
    padding-bottom: 100px;
  }
  .closeout-dialog .chips {
    gap: 7px;
  }
  .closeout-dialog .chip {
    min-height: 44px;
  }
}

/* Payments: dated movements, quiet surfaces and semantic status colours. */
.dialog-close {
  background: #f0f3f2;
  color: var(--ink);
}
.draft-state {
  color: var(--muted);
}
.payment-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.payment-stats .money-feature b {
  font-size: 26px;
}
.payment-period {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.payment-period p {
  margin: 0 0 8px;
  max-width: 520px;
}
.payment-period .field {
  margin: 0;
  max-width: 200px;
}
.ledger-card {
  margin: 18px 0;
}
.ledger-list .payment-row {
  flex-wrap: wrap;
}
.ledger-list .row-main {
  flex: 1 1 180px;
}
.ledger-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}
.ledger-amount.refund {
  color: #a04435;
}
.ledger-amount small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  margin-top: 4px;
}
.ledger-note {
  padding: 0 16px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.ledger-card .card-head {
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}
.ledger-card .card-head a {
  margin-left: auto;
  font-size: 12px;
}
.ledger-footer {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
}
.payment-history-dialog {
  margin-top: 22px;
}
.payment-history-dialog h3 {
  font-size: 15px;
}
.payment-help {
  line-height: 1.6;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}
.cash-summary {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding: 14px 0 20px;
}
.cash-summary small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
}
.payments-report {
  margin: 20px 0;
}
.payments-report > summary {
  padding: 16px;
  cursor: pointer;
  font-weight: 750;
}
.paid-pill {
  background: #edf5ed;
  color: #386644;
}
@media (max-width: 900px) {
  .payment-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .payment-stats .money-feature {
    padding: 14px;
  }
  .payment-stats .money-feature b {
    font-size: 23px;
  }
  .payment-period {
    align-items: start;
  }
  .ledger-amount {
    font-size: 14px;
  }
}

.followup-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.followup-row .row-main {
  min-width: 0;
  overflow-wrap: anywhere;
}
.followup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.followup-actions button {
  min-height: 34px;
  padding: 0 12px;
}
.followup-summary {
  padding-top: 12px;
  padding-bottom: 12px;
}
.followup-summary p {
  margin: 0;
}
#paymentTerms {
  max-width: 180px;
}
@media (max-width: 600px) {
  .followup-actions button {
    min-height: 44px;
  }
  .followup-row {
    padding: 14px;
  }
}
/* The sidebar already links to these pages; the shortcuts are for phones. */
@media (min-width: 761px) {
  .more-shortcuts {
    display: none;
  }
}
.settings-subhead {
  margin: 8px 0 4px;
  font-size: 14px;
}
/* Small utilities. Markup uses these instead of inline styles so the
   Content-Security-Policy can forbid inline styles. !important matches the
   precedence the inline styles had. */
.m-0 {
  margin: 0 !important;
}
.mt-0 {
  margin-top: 0 !important;
}
.mt-10 {
  margin-top: 10px !important;
}
.mt-12 {
  margin-top: 12px !important;
}
.mt-18 {
  margin-top: 18px !important;
}
.mb-0 {
  margin-bottom: 0 !important;
}
.mb-14 {
  margin-bottom: 14px !important;
}
.toolbar.spread {
  justify-content: space-between !important;
}
.check-row.spaced {
  margin: 4px 0 18px !important;
}
.stat-text {
  font-size: 15px !important;
  line-height: 1.3 !important;
}
.big-figure {
  margin: 4px 0 !important;
  font-size: 26px !important;
  font-weight: 850 !important;
}
.section-title {
  margin: 18px 0 8px !important;
}
.row-button {
  width: 100% !important;
  border: 0 !important;
  background: transparent !important;
  text-align: left !important;
}
/* Families tab: one card per household. */
.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  align-items: start;
}
.family-card-head {
  display: flex;
  align-items: center;
  gap: 13px;
}
.family-card-head .row-main {
  flex: 1;
  min-width: 0;
}
.family-balance {
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.family-balance.owing {
  color: var(--coral);
}
.family-contact {
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.sent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sent-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.sent-list li:last-child {
  border-bottom: 0;
}
.sent-list small {
  color: var(--muted);
  white-space: nowrap;
}
.card-intro {
  margin: 0;
  padding: 0 18px 12px;
}
.terms-changes {
  margin: 0 0 14px;
  padding-left: 20px;
  line-height: 1.5;
}
@media (max-width: 600px) {
  .terms-gate-foot {
    flex-wrap: wrap;
  }
  .terms-gate-foot > * {
    flex: 1 1 0;
  }
  .terms-gate-foot #termsGateAccept {
    order: -1;
    flex-basis: 100%;
  }
}

/* Sign-up bot trap: off-screen, never focusable, hidden from screen readers. */
/* Password rules under new-password fields; app.js ticks each one as it is met. */
.pw-rules {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
}
.pw-rules li::before {
  content: '○';
  display: inline-block;
  width: 1.4em;
}
.pw-rules li.met {
  color: var(--forest);
}
.pw-rules li.met::before {
  content: '✓';
}
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Setup screen, email choices and the calendar link (emails.js) */
.check-row input[type='radio'] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--forest-2);
}
.plain-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.field-legend {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.choice-list {
  display: grid;
  gap: 8px;
  margin: 6px 0 12px;
}
.choice-list .check-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--card);
}
.choice-list .check-row:has(input:checked) {
  border-color: var(--forest-2);
  background: var(--mint);
}
.setup-dialog {
  width: min(640px, 100%);
}
.setup-step {
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.setup-step:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}
.setup-step h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 15px;
}
.setup-step h3 i {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--forest);
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
}
.copy-row {
  display: flex;
  gap: 8px;
}
.copy-row input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.calendar-steps {
  margin: 4px 0 10px;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--ink-2);
  font-size: 13px;
}
.sent-line {
  color: var(--forest);
  font-weight: 600;
}
#emailsCard .settings-subhead {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.check-row .soon-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}
/* Show/hide password button inside password fields (app.js addPasswordToggle) */
.pw-wrap {
  position: relative;
}
.pw-wrap input {
  width: 100%;
  padding-right: 48px;
}
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.pw-toggle:hover,
.pw-toggle[aria-pressed='true'] {
  color: var(--ink);
  background: var(--paper-2);
}
.pw-toggle:focus-visible {
  outline: 2px solid var(--forest-2);
  outline-offset: 1px;
}
.pw-toggle svg {
  width: 20px;
  height: 20px;
}
/* Plans page (billing.html) */
.plans-body {
  background: var(--paper);
}
.plans-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}
.plans-page h1 {
  margin: 10px 0 6px;
}
.plans-back {
  color: var(--forest);
  font-weight: 600;
  text-decoration: none;
}
.plans-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
}
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.plans-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.plans-card.featured {
  border-color: var(--forest);
  box-shadow: var(--shadow);
}
.plans-card.current {
  outline: 2px solid var(--forest-2);
}
.plans-card h2 {
  margin: 0;
  font-size: 22px;
}
.plans-badge {
  align-self: flex-start;
  margin: 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.plans-price {
  margin: 0;
  color: var(--muted);
}
.plans-price b {
  color: var(--ink);
  font-size: 28px;
}
.plans-students {
  margin: 0;
  font-weight: 600;
}
.plans-points {
  flex: 1;
  align-content: start;
  margin: 6px 0 12px;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--ink-2);
  font-size: 14px;
}
.plans-current,
.plans-later {
  display: block;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  background: var(--paper-2);
  color: var(--ink-2);
}
.plans-current {
  background: var(--mint);
  color: var(--ink);
}
.plans-foot {
  margin-top: 18px;
}
/* Switching plan (billing.js): which students stay on Lite. */
.plans-switch {
  margin: 0 0 18px;
  padding: 20px;
  border: 1px solid var(--forest);
  border-radius: 16px;
  background: var(--card);
}
.plans-switch h2 {
  margin: 0 0 8px;
  font-size: 20px;
}
.plans-switch-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.plans-switch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.plans-controls .segmented button {
  color: var(--ink-2);
  font-size: 13px;
}
/* Family page (family.html) */
.fam-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}
.fam-head h1 {
  margin: 4px 0 6px;
}
.fam-business {
  margin: 0;
  color: var(--forest);
  font-weight: 700;
}
.fam-card {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.fam-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}
.fam-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.fam-card-head h2 {
  margin: 0;
}
.fam-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.fam-row:first-child {
  border-top: 0;
}
.fam-row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.fam-row-main span {
  color: var(--muted);
  font-size: 14px;
}
.fam-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fam-pending,
.fam-status {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.fam-status.approved {
  background: var(--mint);
}
.fam-status.declined {
  background: var(--paper-2);
}
.fam-overdue {
  color: var(--coral) !important;
  font-weight: 600;
}
.fam-money-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.fam-total {
  border-bottom: 0;
  font-size: 17px;
}
.fam-pay {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--mint);
}
.fam-pay p {
  margin: 2px 0;
}
.fam-pay-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.fam-summary {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.fam-summary:first-child {
  border-top: 0;
}
.fam-summary p {
  margin: 0;
  line-height: 1.55;
}
.fam-summary-head {
  margin-bottom: 4px !important;
  font-weight: 700;
}
.fam-empty {
  margin: 0;
}
.fam-foot {
  margin-top: 20px;
}
.dialog-section h3 .soon-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-size: 11px;
  vertical-align: 2px;
}
/* Requests from families on the Today page (family-admin.js) */
.requests-card {
  margin-bottom: 16px;
}
.request-row {
  display: grid;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.request-row .row-main {
  display: grid;
  gap: 2px;
}
.request-row .row-main span {
  color: var(--muted);
  font-size: 13px;
}
.request-row q {
  color: var(--ink-2);
  font-style: italic;
}
.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fam-code-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin: 10px 0;
}
.fam-code-form .field {
  margin: 0;
}
.fam-code-form input {
  width: 9em;
  font-size: 20px;
  letter-spacing: 0.2em;
}

/* Family page shell: tabs down the side, along the top on phones (family.js) */
.fam-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}
.fam-side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 25px 16px;
  background: var(--card);
  border-right: 1px solid var(--line);
}
.fam-family {
  margin: 2px 0 22px;
  font-size: 18px;
  font-weight: 800;
}
.fam-main {
  max-width: 860px;
  width: 100%;
  padding: 28px 24px 48px;
  outline: none;
}
.fam-main-head h1 {
  margin: 0 0 4px;
}
.fam-main-head p {
  margin: 0;
}
/* A small count on a navigation item, shown only when it isn't zero. */
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}
[data-theme='dark'] .nav-badge {
  color: #1b1414;
}
.fam-tiles {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.fam-tile {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.fam-tile:hover {
  border-color: var(--forest);
}
.fam-tile-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.fam-tile b {
  font-size: 18px;
}
.fam-tile-detail {
  color: var(--muted);
  font-size: 13px;
}
.fam-msg {
  display: grid;
  gap: 6px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.fam-msg:first-child {
  border-top: 0;
}
.fam-msg.new {
  margin: 0 -12px;
  padding: 14px 12px;
  border-radius: 12px;
  background: var(--mint);
}
.fam-msg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fam-msg-line,
.fam-msg-meta {
  margin: 0;
}
.fam-msg-meta {
  color: var(--muted);
  font-size: 13px;
}
.fam-reply {
  padding: 10px 12px;
  border-left: 3px solid var(--forest);
  border-radius: 0 10px 10px 0;
  background: var(--paper);
}
.fam-reply p {
  margin: 2px 0 0;
}
.fam-reply-name {
  font-size: 13px;
  font-weight: 700;
}
.fam-prefs {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
@media (max-width: 760px) {
  .fam-shell {
    display: block;
  }
  .fam-side {
    position: static;
    height: auto;
    padding: 16px 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .fam-family {
    margin-bottom: 10px;
  }
  .fam-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
  }
  .fam-nav button {
    width: auto;
    min-height: 40px;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .fam-main {
    padding: 20px 16px 40px;
  }
}
.request-row.done .pill {
  justify-self: start;
}
.request-answer {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}
/* "Plus" / "Pro" next to a feature the tutor's plan doesn't include (app.js planTag). */
.plan-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  vertical-align: 1px;
  white-space: nowrap;
}
/* The main area takes focus when a tab is chosen, for screen readers; no ring around the whole page. */
.fam-main:focus,
.fam-main:focus-visible {
  outline: none;
  box-shadow: none;
}
.check-row span.plan-tag {
  display: inline-block;
}
.check-row span.plan-tag.hide {
  display: none;
}
.fam-logo {
  display: block;
  max-width: 180px;
  max-height: 64px;
  margin-bottom: 8px;
  object-fit: contain;
}
/* Settings: the logo field spans the form grid; its preview. */
.form-grid .field-wide {
  grid-column: 1 / -1;
}
.logo-preview {
  display: block;
  max-width: 200px;
  max-height: 72px;
  margin: 6px 0 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}
/* Two-step sign-in set-up: the key and the recovery codes. */
.setup-key code {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--paper-2);
  font-size: 17px;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}
.recovery-codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.recovery-codes code {
  font-size: 15px;
}
/* A household's email choices (unsubscribe.html). */
.choices-list {
  display: grid;
  gap: 10px;
  min-width: 0; /* fieldsets otherwise refuse to shrink on narrow phones */
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}
.choices-list legend {
  margin-bottom: 8px;
  font-weight: 700;
}
