:root {
  color-scheme: light;
  --page: #f7f6f0;
  --surface: #fffefa;
  --ink: #1b2b24;
  --muted: #5c695f;
  --line: #e3e5d9;
  --field-line: #d9dfd4;
  --green: #255947;
  --green-hover: #1b4537;
  --green-pale: #e9f0e8;
  --danger: #a43730;
  --body-font: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --title-font: "STZhongsong", "Noto Serif CJK SC", "Songti SC", SimSun, serif;
  font-family: var(--body-font);
  font-size: 14px;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .57; }
a { color: inherit; }
:focus-visible { outline: 2px solid #3c8668; outline-offset: 3px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

[data-icon] { display: inline-grid; flex: none; place-items: center; }
[data-icon] svg { display: block; width: 18px; height: 18px; }
.shell { width: min(1216px, calc(100% - 88px)); margin-inline: auto; }

.masthead {
  border-bottom: 1px solid #e7e6db;
  background: #fcfbf6;
}
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .09em;
  text-decoration: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #f5f0d9;
  background: var(--green);
}
.brand-mark svg { width: 22px; height: 22px; }
.storage {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.storage svg { width: 16px; height: 16px; color: var(--green); }

main { padding-block: 34px 54px; }
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 237px;
  align-items: center;
  overflow: hidden;
  border-radius: 20px;
  background: #183d31;
  color: #fffdf0;
}
.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 32%;
  background:
    linear-gradient(90deg, #183d31 0%, #183d31c7 14%, #183d311f 44%, transparent 68%),
    url("/study-room.webp") 62% 58% / cover no-repeat;
  content: "";
}
.hero-content { padding: 32px 44px; }
.hero h1 {
  font: 700 clamp(38px, 4.1vw, 57px)/1.18 var(--title-font);
  letter-spacing: .075em;
}
.library-stats {
  display: flex;
  margin-top: 28px;
  font-size: 13px;
  color: #e3e7d8;
}
.library-stats > div {
  display: grid;
  gap: 7px;
  min-width: 113px;
}
.library-stats > div + div {
  padding-inline-start: 24px;
  border-inline-start: 1px solid #e2ebd23d;
}
.library-stats dd {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1;
  color: #fffdf0;
}
.library-stats small { font-size: 13px; font-weight: 400; color: #e3e7d8; }

.directory { margin-top: 30px; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-heading h2 { font-size: 23px; line-height: 1.35; letter-spacing: .025em; }
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.button.primary { border-color: var(--green); background: var(--green); color: white; }
.button.primary:hover:not(:disabled) { border-color: var(--green-hover); background: var(--green-hover); }
.button.secondary { border-color: var(--field-line); background: var(--surface); }
.button.secondary:hover:not(:disabled) { background: var(--page); border-color: #bfc9bd; }
.button.quiet { color: var(--green); }
.button.quiet:hover:not(:disabled) { background: var(--green-pale); }
.button.danger-text { padding-inline: 10px; color: var(--danger); }
.button.danger-text:hover:not(:disabled) { background: #f9ebe8; }
.button.danger { color: white; background: var(--danger); }
.button.danger:hover:not(:disabled) { background: #872923; }

.directory-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 3px 9px #3b433007;
}
.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px 18px;
}
.search-field, .select-with-icon {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--field-line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}
.search-field { width: min(100%, 298px); padding-inline: 12px 8px; }
.search-field input {
  width: 100%;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
}
.search-field:focus-within, .select-with-icon:focus-within {
  outline: 2px solid #3c8668;
  outline-offset: 1px;
}
.filter-selects { display: flex; gap: 10px; }
.select-with-icon { position: relative; min-width: 132px; }
.select-with-icon > [data-icon] { position: absolute; inset-inline-start: 11px; pointer-events: none; }
.select-with-icon select {
  width: 100%;
  max-width: 180px;
  height: 38px;
  padding-inline: 36px 29px;
  border: 0;
  outline: none;
  background-color: transparent;
  color: var(--ink);
  text-overflow: ellipsis;
  cursor: pointer;
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #657368 50%),
    linear-gradient(135deg, #657368 50%, transparent 50%);
  background-position: calc(100% - 15px) 53%, calc(100% - 11px) 53%;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}
.filter-count { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.button.clear-filters { min-height: 38px; padding-inline: 9px; font-size: 13px; }

.list-surface { border-top: 1px solid var(--line); }
.teacher-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.name-col { width: 16%; }
.subject-col { width: 18.5%; }
.fee-col { width: 11%; }
.time-col { width: 22.5%; }
.holiday-col { width: 13.5%; }
.action-col { width: 5%; }
.teacher-table thead { background: #f1f3eb; }
.teacher-table th, .teacher-table td { padding: 13px 12px; text-align: left; }
.teacher-table th:first-child, .teacher-table td:first-child { padding-inline-start: 19px; }
.teacher-table th { font-size: 13px; color: #4c5b50; font-weight: 650; }
.teacher-table td {
  border-top: 1px solid #ebede4;
  vertical-align: middle;
  overflow-wrap: anywhere;
  line-height: 1.55;
}
.teacher-table tbody tr:hover { background: #fafbf6; }
.teacher-table .row-actions { padding-inline: 4px 12px; text-align: right; }
.teacher-cell { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 680; }
.avatar {
  display: grid;
  flex: none;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px;
  background: #e4ece1;
  color: #2c634b;
  font-size: 16px;
  line-height: 1;
}
.avatar.tone-1 { background: #f2e9db; color: #795332; }
.avatar.tone-2 { background: #e6ecef; color: #3d5c6b; }
.avatar.tone-3 { background: #eee9f0; color: #65516e; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--green-pale);
  color: #325743;
  font-size: 12px;
  line-height: 1.5;
}
.fee { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.fee-unit { margin-inline-start: 4px; color: var(--muted); font-weight: 400; font-size: 12px; }
.slot-list { display: grid; gap: 4px; }
.slot-label { display: flex; flex-wrap: wrap; column-gap: 7px; font-size: 13px; }
.slot-hours { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.more-slots summary {
  width: fit-content;
  margin-block: 3px;
  color: var(--green);
  font-size: 12px;
  cursor: pointer;
}
.status {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 5px;
  background: #f0f1eb;
  color: #556258;
  font-size: 12px;
  white-space: nowrap;
}
.status.available { color: #315b45; background: var(--green-pale); }
.status.partial { color: #775523; background: #f6edda; }
.status.unavailable { color: #7e5049; background: #f6eae5; }
.holiday-note {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.muted { color: var(--muted); font-size: 13px; }
.icon-button {
  display: inline-grid;
  flex: none;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #4a5e50;
  transition: background-color .15s;
}
.icon-button:hover:not(:disabled) { background: var(--green-pale); color: var(--green); }
.icon-button svg { display: block; width: 18px; height: 18px; }

.empty-state {
  display: grid;
  min-height: 232px;
  justify-items: center;
  align-content: center;
  padding: 34px 18px;
  text-align: center;
}
.empty-icon {
  width: 51px;
  height: 51px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--green-pale);
  color: var(--green);
}
.empty-icon svg { width: 26px; height: 26px; }
.empty-title { font-size: 17px; font-weight: 700; }
.empty-note { margin-top: 6px; color: var(--muted); font-size: 13px; }
.retry { margin-top: 14px; }

dialog {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0;
}
dialog::backdrop { background: #16292163; }
.teacher-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(554px, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border-block: 0;
  border-inline-end: 0;
  box-shadow: -18px 0 55px #15291d25;
}
.teacher-dialog[open] { animation: drawer-in .19s ease-out; }
@keyframes drawer-in { from { transform: translateX(22px); opacity: .75; } }
.teacher-form { display: flex; height: 100%; flex-direction: column; }
.dialog-heading {
  display: flex;
  height: 76px;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-inline: 26px 21px;
  border-bottom: 1px solid var(--line);
}
.dialog-heading h2 { font-size: 23px; }
.form-body { flex: 1; overflow-y: auto; padding: 24px 26px 28px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 7px; font-weight: 650; }
.field :is(input, select), .holiday-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--field-line);
  border-radius: 8px;
  background-color: var(--surface);
  font-weight: 400;
}
.field select { padding-inline-end: 27px; cursor: pointer; }
input::placeholder, textarea::placeholder { color: #68766a; opacity: 1; }
.unit-field, .subject-entry {
  display: flex;
  align-items: center;
  border: 1px solid var(--field-line);
  border-radius: 8px;
}
.unit-field input, .subject-entry input { border: 0; background: transparent; outline: none; }
.unit-field:focus-within, .subject-entry:focus-within { outline: 2px solid #3c8668; outline-offset: 2px; }
.unit-field > span { flex: none; padding-inline-end: 11px; color: var(--muted); font-size: 12px; font-weight: 400; }
.subject-field { margin-top: 18px; }
.subject-entry { padding-inline-end: 4px; }
.subject-entry .button { min-height: 32px; flex: none; padding-inline: 11px; font-size: 13px; }
.selected-subjects { display: flex; flex-wrap: wrap; gap: 6px; }
.selected-subjects:empty { display: none; }
.selected-subjects .tag { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.tag button {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
}
.tag button:hover { background: #d5e5d8; }
.tag button svg { width: 14px; height: 14px; }
.form-section { margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-section h3 { font-size: 16px; }
.availability-trigger {
  display: grid;
  width: 100%;
  grid-template-columns: 32px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--field-line);
  border-radius: 9px;
  background: #f8faf4;
  text-align: left;
  font-weight: 650;
}
.availability-trigger:hover { border-color: #9fb7a4; background: #f0f5eb; }
.availability-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--green-pale);
  color: var(--green);
}
.availability-trigger > [data-icon="chevron"] { color: var(--green); }
.availability-trigger > [data-icon="chevron"] svg { width: 16px; height: 16px; }
.availability-count { color: var(--muted); font-size: 13px; font-weight: 400; white-space: nowrap; }
.availability-field .week-intervals { margin-top: 9px; }
.week-dialog {
  width: min(870px, calc(100% - 48px));
  height: min(810px, calc(100dvh - 44px));
  max-width: none;
  max-height: none;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 14px 55px #15291d38;
}
.week-dialog[open] { display: flex; flex-direction: column; }
.week-dialog-heading {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px 13px 22px;
  border-bottom: 1px solid var(--line);
}
.week-dialog-heading h2 { font-size: 21px; }
.week-dialog-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 12px 22px 4px;
}
.week-toolbar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.button.adjust-hour { min-height: 36px; padding-inline: 10px; background: var(--green-pale); font-size: 13px; }
.button.adjust-hour:hover:not(:disabled) { background: #dbe9db; }
.button.adjust-hour svg { width: 16px; height: 16px; }
.week-hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.week-touch-hint { display: none; }
.week-viewport {
  min-height: 0;
  flex: 1;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  scrollbar-color: #bcc8b9 transparent;
  scrollbar-width: thin;
  scroll-padding-top: 35px;
  touch-action: pan-y;
}
.week-grid {
  width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  text-align: center;
  user-select: none;
}
.week-grid thead {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #eef2e8;
}
.week-grid thead th {
  height: 35px;
  padding: 0;
  border-bottom: 1px solid #d8e1d4;
  color: #405548;
  font-size: 13px;
}
.week-grid thead th:first-child { width: 58px; }
.week-grid thead th:nth-last-child(-n+2) { background: #e7eee2; }
.week-grid tbody :is(th, td) {
  height: 27px;
  padding: 0;
  border-right: 1px solid #e5e9df;
  border-bottom: 1px solid #e5e9df;
}
.week-grid tbody td:last-child { border-right: 0; }
.week-grid tbody th {
  background: #f7f8f1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.week-grid tbody td:nth-last-child(-n+2) { background: #f6f8f2; }
.hour-cell {
  position: relative;
  display: block;
  width: 100%;
  height: 26px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
}
.hour-cell:hover { background: #e8eee3; }
.hour-cell[aria-pressed="true"] { background: #eaf1e5; }
.hour-cell:focus-visible, .hour-cell.is-current[aria-pressed="true"] {
  outline: 2px solid #2c6d53;
  outline-offset: -2px;
}
.hour-band {
  position: absolute;
  inset-inline: 3px;
  min-height: 2px;
  background: #599478;
  pointer-events: none;
}
.hour-cell.is-partial .hour-band { background: #377d60; border-radius: 3px; }
.week-result {
  display: grid;
  height: 53px;
  flex: none;
  grid-template-columns: max-content minmax(0, 1fr);
  align-content: start;
  align-items: start;
  gap: 10px;
  margin-top: 9px;
}
.week-count { padding-block: 3px; color: var(--muted); font-size: 13px; }
.week-intervals {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
  max-height: 82px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.week-intervals li {
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--green-pale);
  color: var(--green);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.week-result .week-intervals { max-height: 48px; }
.week-dialog-footer {
  flex: none;
  padding: 11px 22px;
  border-top: 1px solid var(--line);
}
.holiday-fields { margin-top: 12px; }
.holiday-field textarea {
  display: block;
  resize: vertical;
  margin-top: 7px;
  line-height: 1.55;
}
.dialog-footer {
  flex: none;
  border-top: 1px solid var(--line);
  padding: 13px 26px max(13px, env(safe-area-inset-bottom));
}
.footer-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.save-actions { display: flex; justify-content: flex-end; gap: 8px; margin-inline-start: auto; }
.save-actions .primary { min-width: 98px; }
.form-error {
  margin-block-end: 9px;
  padding: 8px 11px;
  border-radius: 6px;
  color: #922e27;
  background: #faece8;
  line-height: 1.5;
}
.confirm-dialog, .minute-dialog { width: min(414px, calc(100% - 32px)); padding: 23px; border-radius: 15px; box-shadow: 0 14px 55px #15291d38; }
.confirm-dialog h2, .minute-dialog h2 { font-size: 20px; }
.confirm-dialog p { margin-block: 12px 19px; color: var(--muted); overflow-wrap: anywhere; line-height: 1.55; }
.confirm-dialog .form-error { color: var(--danger); }
.minute-hour { margin: 6px 0 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.minute-ranges { display: grid; gap: 13px; }
.minute-range { min-width: 0; margin: 0; padding: 0; border: 0; }
.minute-range-label { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.minute-range input { font-variant-numeric: tabular-nums; }
.minute-preview {
  margin-block: 12px;
  color: var(--green);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.minute-dialog .form-error { margin-top: 12px; }
.minute-dialog .save-actions { margin-top: 16px; }
.toast {
  position: fixed;
  z-index: 5;
  inset: auto 24px 24px auto;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 48px);
  padding: 12px 16px;
  border-radius: 10px;
  background: #214a3b;
  color: white;
  box-shadow: 0 5px 20px #132e243d;
}

@media (max-width: 1000px) {
  .shell { width: calc(100% - 48px); }
  .fee-unit { display: block; margin-inline-start: 0; }
}
@media (max-width: 875px) {
  .teacher-table, .teacher-table tbody { display: block; }
  .teacher-table thead, .teacher-table colgroup { display: none; }
  .teacher-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 19px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
  }
  .teacher-table tbody tr:last-child { border-bottom: 0; }
  .teacher-table tbody td, .teacher-table td:first-child { padding: 0; border: 0; }
  .teacher-table td[data-label]::before {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
  }
  .teacher-table td:first-child { grid-column: 1 / -1; padding-inline-end: 40px; }
  .teacher-table .row-actions { position: absolute; inset: 14px 14px auto auto; padding: 0; }
  .fee-unit { display: inline; margin-inline-start: 4px; }
}

.public-link { color: var(--green); font-weight: 650; text-decoration: none; }
.public-link:hover { text-decoration: underline; }
.login-main { width: min(430px, calc(100% - 32px)); margin-inline: auto; padding-top: clamp(40px, 11vh, 108px); }
.login-card { padding: clamp(22px, 6vw, 32px); border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.login-card h1 { margin-bottom: 23px; color: var(--green); font: 700 31px/1.25 var(--title-font); }
.login-card form { display: grid; gap: 16px; }
.login-card input { min-height: 44px; font-size: 16px; }
.login-card .form-error { margin: 0; }
.login-card .button { min-height: 44px; margin-top: 2px; }
.directory-actions { display: flex; gap: 8px; }
a.button { text-decoration: none; }
.application-shell { width: min(900px, calc(100% - 48px)); margin-inline: auto; }
.study-intro-button { color: var(--green); }
.study-intro-dialog {
  width: min(760px, calc(100% - 32px));
  max-width: none;
  max-height: min(760px, calc(100dvh - 36px));
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 14px 55px #15291d38;
}
.study-intro-dialog[open] { display: flex; flex-direction: column; }
.study-intro-heading {
  display: flex;
  flex: none;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(16px, 4vw, 26px);
  border-bottom: 1px solid var(--line);
}
.study-intro-heading h2 { font-size: 20px; }
.study-intro-close { width: 42px; height: 42px; font: 400 26px/1 sans-serif; }
.study-intro-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px clamp(16px, 4vw, 26px) 26px;
  font-size: 15px;
  line-height: 1.85;
}
.study-intro-content h3 { margin-bottom: 11px; color: var(--green); font-size: clamp(18px, 4vw, 23px); line-height: 1.5; }
.study-intro-content p + p { margin-top: 13px; }
.study-intro-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
  align-items: start;
  gap: 14px 24px;
  margin-top: 19px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf4;
}
.study-intro-contact figure { margin: 0; }
.study-intro-contact figcaption { color: var(--green); font-weight: 650; }
.study-intro-contact img { display: block; width: 100%; max-width: 190px; height: auto; margin-top: 5px; border-radius: 7px; }
.application-hero { min-height: 205px; }
.application-hero .hero-content > p { margin-bottom: 10px; color: #e0e9d8; font-size: 15px; letter-spacing: .13em; }
.application-hero h1 { font-size: clamp(32px, 5vw, 53px); }
.application-form, .application-status { margin-top: 22px; }
.application-card, .application-submit, .application-status {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}
.application-card { margin-bottom: 16px; padding: 23px 26px 28px; }
.application-card h2 {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 19px;
  color: var(--green);
  font-size: 20px;
}
.question-grid, .answer-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.full-question { grid-column: 1 / -1; }
.question { min-width: 0; align-content: start; }
.question textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--field-line);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 400;
  resize: vertical;
}
.question legend { padding: 0; margin-bottom: 8px; font-weight: 650; }
.choice-question { margin: 0; padding: 0; border: 0; }
.choice-options { display: flex; flex-wrap: wrap; gap: 7px; }
.choice {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--field-line);
  border-radius: 8px;
  cursor: pointer;
}
.choice:has(input:checked) { background: var(--green-pale); border-color: #84a48e; color: var(--green); }
.choice input, .consent input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); flex: none; }
.application-submit { display: grid; justify-items: start; gap: 14px; padding: 19px 25px; }
.consent { display: flex; align-items: flex-start; gap: 9px; line-height: 1.55; cursor: pointer; }
.consent input { margin-top: 3px; }
.application-status { padding: 22px 25px; color: var(--muted); }
.application-success h2 { margin-bottom: 8px; color: var(--green); }

.review-main { width: min(1040px, calc(100% - 48px)); }
.review-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; }
.review-heading h1 { font: 700 clamp(27px, 4.3vw, 42px)/1.25 var(--title-font); }
.review-list { display: grid; gap: 11px; }
.review-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.review-summary { display: flex; align-items: center; gap: 12px; padding: 9px 13px 9px 7px; }
.review-details-button {
  display: grid;
  flex: 1;
  min-width: 0;
  grid-template-columns: minmax(115px, 1fr) minmax(54px, .7fr) minmax(0, 1.55fr) 16px;
  align-items: center;
  gap: 13px;
  padding: 6px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
}
.review-details-button:hover { background: #f3f7ef; }
.review-details-button:disabled { opacity: 1; cursor: default; }
.review-name { display: flex; align-items: center; gap: 9px; overflow-wrap: anywhere; }
.review-grade, .review-contact { min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.review-chevron { display: grid; place-items: center; color: var(--muted); }
.review-chevron svg { width: 16px; height: 16px; }
.review-details-button[aria-expanded="true"] .review-chevron { transform: rotate(90deg); }
.review-details { display: grid; gap: 17px; padding: 17px 20px 21px; border-top: 1px solid var(--line); }
.answer-section h2 { margin-bottom: 10px; font-size: 16px; color: var(--green); }
.answer-list { gap: 10px 15px; }
.answer-list dt { margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.answer-list dd { overflow-wrap: anywhere; white-space: pre-wrap; }
.teacher-dialog.import-dialog {
  inset: 0;
  width: min(600px, calc(100% - 28px));
  height: min(760px, calc(100dvh - 36px));
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  animation: none;
}
.import-notes {
  margin: 0 0 16px;
  padding: 10px 12px 10px 28px;
  border-radius: 8px;
  background: #f5efe0;
  color: #5f492a;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 32px); }
  .masthead-inner { min-height: 61px; }
  .brand { gap: 9px; font-size: 16px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
  main { padding-block: 18px 30px; }
  .hero { min-height: 200px; border-radius: 14px; }
  .hero::before {
    inset-inline-start: 12%;
    background-image: linear-gradient(90deg, #183d31 3%, #183d31a6 53%, #183d3130), url("/study-room.webp");
    background-position: 68% 56%;
  }
  .hero-content { padding: 24px; }
  .hero h1 { font-size: clamp(32px, 8.5vw, 42px); }
  .library-stats { margin-top: 22px; }
  .library-stats > div { min-width: 90px; }
  .library-stats > div + div { padding-inline-start: 18px; }
  .library-stats dd { font-size: 25px; }
  .directory { margin-top: 21px; }
  .section-heading h2 { font-size: 21px; }
  .directory-card { border-radius: 12px; }
  .filters { gap: 8px; padding: 12px; }
  .search-field { width: 100%; }
  .filter-selects { width: 100%; gap: 8px; }
  .select-with-icon { flex: 1; min-width: 0; }
  .select-with-icon select { max-width: none; }
  .teacher-table tbody tr { gap: 12px 14px; padding-inline: 13px; }
  .teacher-dialog { border: none; }
  .dialog-heading { height: 65px; padding-inline: 17px 12px; }
  .form-body { padding: 19px 16px 24px; }
  .dialog-footer { padding-inline: 16px; }
  .week-dialog { width: calc(100% - 20px); height: calc(100dvh - 24px); border-radius: 12px; }
  .week-dialog-heading { padding: 8px 9px 8px 13px; }
  .week-dialog-heading h2 { font-size: 19px; }
  .week-dialog-body { padding: 9px 10px 5px; }
  .week-dialog-footer { padding-inline: 10px; }
  .week-result { height: 69px; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .week-count { padding: 0; }
  .week-grid thead th:first-child { width: 43px; }
  .week-grid tbody th { font-size: 11px; }
  .week-grid tbody :is(th, td) { height: 32px; }
  .hour-cell { height: 31px; }
  .application-shell, .review-main { width: calc(100% - 28px); }
  .study-intro-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .study-intro-contact { grid-template-columns: minmax(0, 1fr); }
  .application-hero { min-height: 165px; }
  .application-card { padding: 17px 14px 20px; }
  .question-grid { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .question :is(input, textarea) { font-size: 16px; }
  .application-submit, .application-status { padding: 16px; }
  .application-submit .button { width: 100%; }
  .review-summary { gap: 7px; padding: 7px; }
  .review-details-button { grid-template-columns: minmax(0, 1fr) minmax(0, .56fr) minmax(0, 1.12fr) 12px; gap: 6px; padding: 6px 5px; }
  .review-name { gap: 5px; }
  .review-name .avatar { display: none; }
  .review-grade, .review-contact { font-size: 12px; }
  .import-button { padding-inline: 8px; }
  .review-details { padding-inline: 13px; }
  .directory-actions { gap: 5px; }
  .directory-actions .button { padding-inline: 8px; }
}
@media (pointer: coarse) {
  .week-mouse-hint { display: none; }
  .week-touch-hint { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
