:root {
  color-scheme: light;
  --surface: #fff;
  --link: #824c50;
  --hover: #f0e7e9;
  --subtle: #faf7f8;
  --border-soft: #e9e2e5;
  --field-border: #cfc1c7;
  --avatar-bg: #eee4e7;
  --positive-bg: #eee9eb;
  --positive-ink: #625057;
  --neutral-bg: #eee9eb;
  --danger-bg: #fbefef;
  --danger-border: #e3c9cc;
  --error-bg: #f8e7e8;
  --note-bg: #f2eaec;
  --note-border: #dfcdd3;
  --note-ink: #604c54;
  --warning-bg: #fbf0da;
  --warning-note-bg: #fff9ec;
  --warning-border: #ecdfc0;
  --warning-ink: #79551e;
  --banner-bg: #f0e4e7;
  --banner-ink: #61464e;
  --banner-border: #d9c2c9;
  --today-bg: #f8eff1;
  --today-ink: #89545e;
  --lesson-bg: #f3e8ec;
  --lesson-border: #dfc6d0;
  --lesson-accent: #a87580;
  --lesson-hover: #eedce2;

  --ink: #352d31;
  --muted: #766b71;
  --primary: #824c50;
  --highlight: #e1b9bb;
  --line: #ded7da;
  --bg: #f6f3f4;
  --white: #fff;
  --amber: #956015;
  --red: #ae4141;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
}
a {
  color: var(--link);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 2rem;
  letter-spacing: -0.045em;
  font-weight: 650;
  margin-bottom: 0.5rem;
}
h2 {
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  font-weight: 650;
}
h3 {
  font-size: 1rem;
}
p {
  line-height: 1.6;
}
small,
.small {
  font-size: 0.875rem;
}
button {
  border: 0;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.7rem;
}
.loading {
  padding: 4rem;
  text-align: center;
}
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #30292c;
  color: #eee5e8;
  padding: 2rem 1.2rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  padding: 0 0.5rem;
  margin-bottom: 2.7rem;
}
.wordmark {
  font: 400 26px/1 "DejaVu Sans", sans-serif;
  letter-spacing: -0.8px;
  -webkit-text-stroke: 0.4px currentColor;
  white-space: nowrap;
}
.wordmark img {
  /* Align the bottom of the drawn initials with the lowercase baseline. */
  width: 1.31em;
  height: auto;
  vertical-align: -0.07em;
}
.brand small {
  display: block;
  font-size: 0.75rem;
  color: #c1abb4;
  margin-top: 0.3rem;
}
.nav {
  display: grid;
  gap: 0.45rem;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: 7px;
  background: transparent;
  color: #d1bfc6;
  text-align: left;
  font-size: 0.92rem;
}
.nav button:hover {
  background: #49363d;
}
.nav button.active {
  background: var(--highlight);
  color: #4a3035;
  font-weight: 650;
}
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}
.sidebar-foot {
  margin-top: auto;
  padding: 0.9rem 0.5rem 0;
  font-size: 0.875rem;
}
.sidebar-foot p {
  color: #c1abb4;
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}
.sidebar-foot button {
  background: none;
  color: #fff;
  padding: 0;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--avatar-bg);
  color: var(--link);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  flex: none;
}
.sidebar .avatar {
  background: #5b3c47;
  color: #efdae1;
}
.user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.user small {
  display: block;
  color: #c1abb4;
  font-size: 0.75rem;
  margin-top: 0.2rem;
}
.main {
  min-width: 0;
}
.topbar {
  height: 76px;
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}
.topbar strong {
  color: var(--ink);
  font-weight: 500;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.content {
  padding: 2.2rem 2.5rem;
  max-width: 1600px;
  margin: auto;
}
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.pagehead p {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  padding: 0.7rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--hover);
}
.btn.primary {
  background: var(--primary);
  color: white;
  border-color: var(--link);
}
.btn.primary:hover {
  background: #955e68;
}
.btn.danger {
  color: var(--red);
  background: var(--danger-bg);
  border-color: var(--danger-border);
}
.btn.subtle {
  padding: 0.45rem 0.65rem;
  background: transparent;
  border-color: transparent;
}
.btn.small {
  font-size: 0.8rem;
  padding: 0.45rem 0.7rem;
}
.actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
}
.metric .label {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.metric strong {
  font-size: 1.85rem;
  letter-spacing: -0.045em;
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.metric small {
  font-size: 0.75rem;
  color: var(--muted);
}
.metric.featured {
  background: var(--primary);
  color: white;
  border-color: var(--link);
}
.metric.featured .label,
.metric.featured small {
  color: #ecdce1;
}
.metric.featured strong {
  color: var(--highlight);
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 1.5rem;
}
.stack {
  display: grid;
  align-content: start;
  gap: 1.5rem;
}
.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  min-width: 0;
  overflow: hidden;
}
.cardhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid var(--line);
  gap: 1rem;
}
.cardhead h2,
.cardhead p {
  margin: 0;
}
.cardhead p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}
.pad {
  padding: 1.4rem;
}
.listrow {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.listrow:last-child {
  border-bottom: 0;
}
.listrow .grow {
  flex: 1;
  min-width: 0;
}
.listrow strong {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.listrow p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}
.time {
  font-size: 0.875rem;
  font-weight: 600;
  width: 48px;
  flex: none;
}
.badge {
  font-size: 0.875rem;
  line-height: 1.4;
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
  background: var(--positive-bg);
  color: var(--positive-ink);
  white-space: nowrap;
}
.badge.amber {
  color: var(--amber);
  background: var(--warning-bg);
}
.badge.red {
  color: var(--red);
  background: var(--error-bg);
}
.badge.gray {
  color: var(--muted);
  background: var(--neutral-bg);
}
.empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.note {
  padding: 1rem 1.2rem;
  border: 1px solid var(--note-border);
  background: var(--note-bg);
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--note-ink);
  margin-bottom: 1.3rem;
}
.note.amber {
  background: var(--warning-note-bg);
  border-color: var(--warning-border);
  color: var(--warning-ink);
}
.note p:last-child {
  margin: 0;
}
.test-banner {
  background: var(--banner-bg);
  color: var(--banner-ink);
  text-align: center;
  font-size: 0.8rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--banner-border);
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
  white-space: nowrap;
}
th {
  padding: 0.9rem 1.25rem;
  background: var(--subtle);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
td small {
  display: block;
  color: var(--muted);
  margin-top: 0.3rem;
  font-size: 0.75rem;
}
.person {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.person strong {
  font-weight: 550;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.toolbar input {
  max-width: 280px;
}
.segmented {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}
.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  min-width: 1050px;
}
.day {
  border-right: 1px solid var(--line);
  min-height: 380px;
  padding: 0.75rem;
}
.day:last-child {
  border: 0;
}
.dayhead {
  text-align: center;
  padding: 0.45rem 0 1rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.dayhead strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 550;
  color: var(--ink);
  margin-top: 0.3rem;
}
.day.today {
  background: var(--today-bg);
}
.day.today .dayhead strong {
  color: var(--today-ink);
}
.lesson {
  border: 1px solid var(--lesson-border);
  border-left: 3px solid var(--lesson-accent);
  background: var(--lesson-bg);
  border-radius: 6px;
  padding: 0.75rem 0.65rem;
  margin-bottom: 0.6rem;
  display: block;
  text-align: left;
  width: 100%;
  color: var(--ink);
  font-size: 0.875rem;
}
.lesson strong {
  display: block;
  margin: 0.4rem 0;
  font-weight: 600;
}
.lesson .muted {
  font-size: 0.75rem;
}
.lesson:hover {
  background: var(--lesson-hover);
}
.gap {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  padding: 0.25rem 0 0.8rem;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.date-control {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
}
.date-control > input { min-width: 0; }
.toolbar .date-control > input { width: 8.5em; }
.date-picker { position: relative; }
.date-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}
.date-picker button { height: 100%; }
.field label {
  font-weight: 550;
}
.field small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}
input,
select,
textarea {
  border: 1px solid var(--field-border);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
  min-width: 0;
  width: 100%;
  background: var(--surface);
  color: var(--ink);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23657570' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2rem;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--link);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.check input {
  margin-top: 0.2rem;
  flex: none;
}
.formfoot {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.3rem;
}
.error {
  color: var(--red);
  background: var(--error-bg);
  padding: 0.8rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.error:empty {
  display: none;
}
dialog {
  background: var(--surface);
  border: 0;
  border-radius: 12px;
  padding: 1.8rem;
  width: min(560px, calc(100vw - 2rem));
  color: var(--ink);
  max-height: 90vh;
  box-shadow: 0 20px 100px #25171c33;
}
dialog::backdrop {
  background: #18161999;
  backdrop-filter: blur(2px);
}
dialog h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}
dialog > p {
  font-size: 0.875rem;
  color: var(--muted);
}
dialog pre {
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.7;
}
.modal-close {
  float: right;
  background: transparent;
  font-size: 1.5rem;
  padding: 0 0.3rem;
  color: var(--muted);
}
#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 0.9rem 1.4rem;
  border-radius: 8px;
  box-shadow: 0 8px 35px #25171c30;
  font-size: 0.875rem;
  z-index: 100;
  max-width: 90vw;
}
#toast:empty {
  display: none;
}
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
}
.auth-story {
  background: #30292c;
  padding: 3rem 4rem;
  color: #f1e4e9;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-story:after {
  content: "";
  position: absolute;
  border: 1px solid #ffffff15;
  border-radius: 50%;
  width: 480px;
  height: 480px;
  bottom: -180px;
  right: -190px;
  box-shadow:
    0 0 0 60px #ffffff03,
    0 0 0 120px #ffffff03;
}
.auth-story h1 {
  font-size: 3.5rem;
  line-height: 1.12;
  letter-spacing: -0.05em;
  max-width: 480px;
  font-weight: 500;
}
.auth-story h1 span {
  color: var(--highlight);
}
.auth-story p {
  color: #d0b8c1;
  max-width: 420px;
}
.auth-story .brand {
  margin: 0;
  padding: 0;
}
.auth-story footer {
  font-size: 0.8rem;
  color: #c8adb8;
}
.auth-form {
  padding: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.auth-inner {
  max-width: 380px;
  width: 100%;
}
.auth-inner h2 {
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.04em;
}
.auth-inner > p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.8rem;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  border-radius: 7px;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}
.auth-tabs button {
  background: transparent;
  padding: 0.65rem;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.875rem;
}
.auth-tabs button.active {
  background: var(--surface);
  box-shadow: 0 1px 5px #352d3112;
  color: var(--link);
  font-weight: 600;
}
.auth-inner .primary {
  width: 100%;
}
.auth-inner footer {
  margin-top: 1.8rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.student-main {
  max-width: 1100px;
  margin: auto;
  padding: 2.5rem 1.5rem;
}
.portal-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.portal-header .brand {
  margin: 0;
}
.portal-header .brand small {
  color: var(--muted);
}
.student-main .metrics {
  grid-template-columns: repeat(3, 1fr);
}
.offer-page {
  max-width: 600px;
  padding: 3rem 1.5rem;
  margin: auto;
}
.offer-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.offer-times div {
  padding: 1.2rem;
  background: var(--bg);
  border-radius: 7px;
}
.offer-times strong {
  display: block;
  margin-top: 0.5rem;
  line-height: 1.6;
}
.search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.mobile-title {
  display: none;
}
.spaced {
  margin-top: 1.5rem;
}
.footer-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1.4rem;
  line-height: 1.7;
}
.wrap {
  white-space: normal;
  max-width: 350px;
}
.outbox-body {
  white-space: pre-wrap;
}
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 1.5rem;
}
@media (min-width: 1500px) {
  .content {
    padding-top: 2.7rem;
  }
  .metric {
    padding: 1.5rem;
  }
  .columns {
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .content {
    padding: 1.7rem;
  }
  .topbar {
    padding: 0 1.7rem;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .columns,
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    padding: 1.8rem 0.8rem;
  }
  .auth-story {
    padding: 3rem;
  }
  .auth-story h1 {
    font-size: 2.8rem;
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 1rem;
    gap: 0.7rem;
  }
  .sidebar .brand {
    margin: 0;
  }
  .sidebar .studio-tagline {
    display: none;
  }
  .nav {
    display: flex;
    overflow: auto;
    gap: 0.25rem;
    padding-top: 0.4rem;
  }
  .nav button {
    padding: 0.6rem 0.8rem;
    white-space: nowrap;
    font-size: 0.8rem;
    gap: 0.4rem;
  }
  .nav .icon {
    width: 16px;
    height: 16px;
  }
  .sidebar-foot {
    display: none;
  }
  .topbar {
    height: 55px;
    padding: 0 1rem;
    font-size: 0.75rem;
  }
  .topbar .avatar {
    display: none;
  }
  .mobile-title {
    display: inline;
  }
  .content {
    padding: 1.4rem 1rem;
  }
  .pagehead {
    align-items: flex-start;
  }
  .pagehead h1 {
    font-size: 1.7rem;
  }
  .pagehead p {
    font-size: 0.85rem;
  }
  .metrics {
    gap: 0.65rem;
  }
  .metric {
    padding: 1rem;
  }
  .metric strong {
    font-size: 1.6rem;
  }
  .metric .label {
    font-size: 0.75rem;
    min-height: 28px;
    margin-bottom: 0.5rem;
  }
  .metric .icon {
    display: none;
  }
  .metric small {
    font-size: 0.7rem;
  }
  .cardhead {
    padding: 1rem;
  }
  .listrow {
    padding: 1rem;
    gap: 0.65rem;
  }
  .listrow .avatar {
    display: none;
  }
  .auth {
    display: block;
  }
  .auth-story {
    padding: 1.5rem;
  }
  .auth-story > div:nth-child(2),
  .auth-story footer {
    display: none;
  }
  .auth-form {
    padding: 2rem 1.5rem;
  }
  .auth-inner {
    max-width: 420px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .student-main {
    padding: 1.8rem 1rem;
  }
  .student-main .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .student-main .metrics .metric:last-child {
    grid-column: 1/-1;
  }
  .portal-header {
    padding: 1rem;
  }
  .portal-header .wordmark {
    font-size: 22px;
  }
  .topbar-right {
    gap: 0.5rem;
  }
  .offer-times {
    grid-template-columns: 1fr;
  }
  .toolbar input {
    max-width: 100%;
  }
  .pagehead > .actions {
    justify-content: flex-end;
  }
  .pagehead > .actions .btn {
    padding: 0.65rem;
  }
  .pagehead > .actions .btn .icon {
    display: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .btn,
  .nav button {
    transition: background 0.15s;
  }
  dialog[open] {
    animation: appear 0.15s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
.auth-story .story-kicker {
  color: #d5b5c1;
}
/* The student ledger becomes self-contained cards on phones, keeping cancellation
   and money details visible without needing a horizontal table scroll. */
@media (max-width: 760px) {
  .student-ledger table,
  .student-ledger tbody {
    display: block;
    white-space: normal;
  }
  .student-ledger thead {
    display: none;
  }
  .student-ledger tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 1rem;
    border-bottom: 1px solid var(--line);
  }
  .student-ledger tr:last-child {
    border-bottom: 0;
  }
  .student-ledger td {
    display: block;
    border: 0;
    padding: 0.5rem 0.25rem;
  }
  .student-ledger td:first-child,
  .student-ledger td:nth-child(2),
  .student-ledger td:last-child {
    grid-column: 1 / -1;
  }
  .student-ledger td:first-child {
    font-weight: 600;
  }
  .student-ledger td:first-child::before,
  .student-ledger td:nth-child(2)::before {
    display: none;
  }
  .student-ledger td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.75rem;
  }
  .student-ledger td:last-child:empty {
    display: none;
  }
}

/* Explicit preference takes precedence over the system preference (theme.js). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #8d5358;
  --highlight: #edc3c6;
  --ink: #e6e0e1;
  --muted: #bcb2b6;
  --bg: #242326;
  --surface: #2d2b2f;
  --line: #484348;
  --link: #dbadb1;
  --hover: #44373d;
  --subtle: #333035;
  --border-soft: #443d43;
  --field-border: #75646c;
  --avatar-bg: #4b3b42;
  --positive-bg: #3d363a;
  --positive-ink: #d9d0d2;
  --neutral-bg: #3b353a;
  --amber: #f0c57c;
  --red: #ffb4ad;
  --danger-bg: #493137;
  --danger-border: #80525d;
  --error-bg: #493137;
  --note-bg: #3c3238;
  --note-border: #64505b;
  --note-ink: #e0cbd3;
  --warning-bg: #423722;
  --warning-note-bg: #352e22;
  --warning-border: #6b5734;
  --warning-ink: #f0d59d;
  --banner-bg: #40343a;
  --banner-ink: #e2cdd5;
  --banner-border: #6b5360;
  --today-bg: #3b2f36;
  --today-ink: #e1bccb;
  --lesson-bg: #44333b;
  --lesson-border: #785365;
  --lesson-accent: #bc879c;
  --lesson-hover: #543d49;
}
.footer-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.auth-inner .footer-tools {
  justify-content: center;
}


fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
fieldset:disabled {
  opacity: 0.7;
}
[hidden] {
  display: none !important;
}
.lesson.cancelled {
  opacity: 0.75;
  border-style: dashed;
  background: var(--neutral-bg);
}
.absence-label {
  color: var(--red);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.student-main > .stack {
  margin-bottom: 1.5rem;
}

/* A personal calendar needs no horizontal scrolling on a phone. */
@media (max-width: 760px) {
  .student-main .week {
    min-width: 0;
    grid-template-columns: 1fr;
  }
  .student-main .day {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .student-main .day:last-child {
    border-bottom: 0;
  }
  .student-main .dayhead {
    text-align: left;
    padding: 0.3rem 0;
  }
  .student-main .dayhead strong {
    display: inline;
    margin-left: 0.5rem;
    font-size: 1rem;
  }
  .student-main .day .empty {
    padding: 0.3rem 0;
    text-align: left;
    font-size: 0.875rem;
  }
}
/* The help guide shares portal styles and theme, with no app data or extra JS. */
.nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: 7px;
  color: #d1bfc6;
  text-decoration: none;
  font-size: 0.92rem;
}
.nav .nav-link:hover {
  background: #49363d;
}
.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem max(1rem, calc((100vw - 1160px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.help-brand {
  text-decoration: none;
  color: var(--ink);
}
.help-page {
  max-width: 1160px;
  margin: auto;
  padding: 2rem 1.5rem 3rem;
}
.help-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 2rem;
}
.help-section {
  margin-bottom: 2rem;
  scroll-margin-top: 1rem;
}
.help-section > h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
}
.help-page p {
  font-size: 0.9375rem;
}
.help-page figure {
  margin: 1.25rem 0 0;
}
.help-page figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.help-page figure a {
  display: block;
}
.help-page figcaption {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 0.65rem;
}
.help-summary {
  margin: 1.25rem 0 0;
  color: var(--muted);
}
@media (max-width: 760px) {
  .help-grid {
    grid-template-columns: 1fr;
  }
  .help-page {
    padding: 1.5rem 1rem 2rem;
  }
  .nav .nav-link {
    padding: 0.6rem 0.8rem;
    gap: 0.4rem;
    white-space: nowrap;
    font-size: 0.8rem;
  }
  .help-header {
    padding: 1rem;
  }
}
.message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
  font-size: 1rem;
}

.site-footer {
  padding: 1rem max(1rem, calc((100vw - 1160px) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
}
.site-footer nav, .site-footer > div, #theme-preferences {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem 1rem;
}
.site-footer > div { margin-top: .5rem; }
.policy-page { max-width: 56rem; margin: auto; padding: 2rem 1rem; }
.policy-page section { margin-top: 2rem; }
.policy-page h1 { line-height: 1.1; }
.policy-page dt { font-weight: 600; margin-top: .75rem; }
.policy-page dd { margin: .2rem 0; }
.privacy-record { border-top: 1px solid var(--line); padding: .85rem 0; overflow-wrap: anywhere; }
.privacy-record summary { cursor: pointer; }
.privacy-record form { margin: .8rem 0; }

#theme-preferences { margin-top: .8rem; }
#theme-preferences legend { font-weight: 600; }
#theme-preferences select { width: auto; padding: .35rem 1.8rem .35rem .6rem; }
#theme-preferences label { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; }
