:root {
  --background: #f7f8fa;
  --surface: #ffffff;
  --foreground: #1f2937;
  --muted-foreground: #6b7280;
  --border: #dfe3e8;
  --primary: #2463eb;
  --primary-hover: #174fc6;
  --primary-soft: #eaf1ff;
  --success: #178a5b;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --radius: 8px;
  --shadow: 0 1px 3px rgb(15 23 42 / 8%), 0 8px 24px rgb(15 23 42 / 5%);
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--foreground);
  background: var(--background);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); }
button, input, select, textarea { font: inherit; }
.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 40px; }
.text-small { font-size: 13px; }
.text-muted { color: var(--muted-foreground); }
.auth-layout { display: grid; min-height: 100vh; place-items: center; padding: 32px 0; }
.auth-card { width: min(100%, 420px); padding: 28px; }
.auth-brand { margin-bottom: 28px; }
.auth-card h1 { margin: 0 0 8px; font-size: 24px; }
.auth-card > .text-muted { margin: 0 0 22px; }
.auth-card .alert { margin-bottom: 16px; }
.auth-logout { margin-top: 10px; }

.app-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; border-bottom: 1px solid var(--border); }
.brand, .main-nav, .user-area, .page-heading, .schedule-meta, .booking-heading, .hold-line, .success-heading { display: flex; align-items: center; gap: 8px; }
.brand { min-width: 0; font-weight: 600; }
.brand-mark { display: inline-grid; width: 22px; height: 22px; place-items: center; border: 2px solid var(--primary); border-radius: 6px; color: var(--primary); font-size: 13px; }
.main-nav { flex: 1; justify-content: center; }
.nav-item { padding: 21px 8px 18px; color: var(--muted-foreground); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav-item.is-active { color: var(--foreground); border-bottom-color: var(--primary); }
.nav-item.is-disabled { opacity: .62; }
.user-area { color: var(--muted-foreground); white-space: nowrap; }

.page-tools { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.45fr) 250px; align-items: end; gap: 20px; margin: 22px 0 18px; }
.page-heading { margin-bottom: 4px; font-size: 18px; font-weight: 600; }
.selected-direction-summary { min-width: 0; text-align: center; }
.selected-direction-label { margin-bottom: 3px; color: var(--muted-foreground); font-size: 12px; font-weight: 500; }
.selected-direction-name { margin: 0; overflow-wrap: anywhere; font-size: 24px; line-height: 1.18; }
.direction-control { width: 250px; }
.form-label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 500; }
.form-select, .form-control { width: 100%; border: 1px solid #cfd5dd; border-radius: 7px; background: var(--surface); color: var(--foreground); outline: none; transition: border-color .15s, box-shadow .15s; }
.form-select { height: 38px; padding: 0 34px 0 11px; }
.form-control { min-height: 38px; padding: 8px 10px; }
textarea.form-control { resize: vertical; }
.form-select:focus, .form-control:focus, .btn:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px rgb(36 99 235 / 18%); }

.alert-stack { margin-bottom: 10px; }
.schedule-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); gap: 18px; align-items: start; }
.schedule-area { min-width: 0; }
.schedule-meta { justify-content: space-between; min-height: 22px; margin-bottom: 8px; color: var(--muted-foreground); }
.htmx-indicator { visibility: hidden; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { visibility: visible; }
.date-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgb(255 255 255 / 35%); }
.date-column { min-width: 0; min-height: 310px; padding: 13px 9px 15px; }
.date-column + .date-column { border-left: 1px solid var(--border); }
.date-label { margin-bottom: 3px; font-weight: 600; }
.date-caption { margin-bottom: 12px; color: var(--muted-foreground); }
.slots { display: grid; gap: 7px; }
.slots form { margin: 0; }
.slot-empty { padding: 10px 0; color: var(--muted-foreground); text-align: center; }
.schedule-footer { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted-foreground); }
.empty-note { color: var(--muted-foreground); text-align: center; }

.card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.booking-card { min-height: 310px; padding: 17px; }
.booking-heading { justify-content: space-between; margin-bottom: 5px; font-weight: 600; }
.viz-badge { padding: 3px 7px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 600; }
.booking-placeholder { color: var(--muted-foreground); }
.booking-placeholder .booking-heading { color: var(--foreground); }
.placeholder-icon { margin: 60px 0 12px; color: var(--primary); font-size: 28px; text-align: center; }
.booking-placeholder p { max-width: 250px; margin: 0 auto; text-align: center; }
.selected-slot { margin-bottom: 4px; }
.hold-line { margin-bottom: 14px; color: var(--muted-foreground); }
.hold-time { color: var(--foreground); font-variant-numeric: tabular-nums; font-weight: 600; }
.form-stack { display: grid; gap: 11px; }
.field-row { display: grid; grid-template-columns: 1fr 86px; gap: 8px; }
.form-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 2px; }
.stage-note { margin: -2px 0 0; color: var(--muted-foreground); }

.btn { display: inline-flex; min-height: 37px; align-items: center; justify-content: center; border: 1px solid #cfd5dd; border-radius: 7px; padding: 7px 11px; background: var(--surface); color: var(--foreground); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: #aeb7c2; background: #f8fafc; }
.btn:disabled { cursor: not-allowed; opacity: .5; }
.btn-block, .slot-button { width: 100%; }
.slot-button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.btn-primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.btn-primary:hover { border-color: var(--primary-hover); background: var(--primary-hover); }
.btn-ghost { border-color: transparent; background: transparent; }

.state-panel { display: grid; min-height: 310px; place-content: center; gap: 10px; padding: 24px; border-block: 1px solid var(--border); color: var(--muted-foreground); text-align: center; }
.state-error { color: var(--danger); }
.booking-error { display: grid; gap: 12px; }
.alert { display: grid; gap: 4px; padding: 12px; border-radius: var(--radius); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: #e7f7ef; color: var(--success); }
.maintenance-banner { margin-bottom: 14px; }
.settings-nav { display: flex; gap: 4px; margin: -5px 0 18px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.settings-nav-item { padding: 10px 12px; border-bottom: 2px solid transparent; color: var(--muted-foreground); text-decoration: none; white-space: nowrap; }
.settings-nav-item.is-active { border-bottom-color: var(--primary); color: var(--foreground); font-weight: 600; }
.admin-layout { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.55fr); gap: 18px; align-items: start; }
.admin-side-stack { display: grid; gap: 14px; }
.admin-create-card { padding: 18px; }
.admin-create-card h2 { margin: 0 0 5px; font-size: 17px; }
.admin-create-card > p { margin: 0 0 16px; }
.admin-users-list { display: grid; gap: 10px; }
.user-card { display: grid; gap: 13px; padding: 16px; }
.user-card.is-archived { opacity: .68; }
.user-card-heading, .user-badges, .user-actions, .user-edit-form { display: flex; align-items: center; gap: 8px; }
.user-card-heading { justify-content: space-between; align-items: flex-start; }
.user-badges { flex-wrap: wrap; justify-content: flex-end; }
.status-badge { padding: 3px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-badge.is-active { background: #e7f7ef; color: var(--success); }
.status-badge.is-blocked { background: var(--danger-soft); color: var(--danger); }
.status-badge.is-muted { background: #eef0f3; color: var(--muted-foreground); }
.user-edit-form { align-items: end; }
.user-edit-form label:first-of-type { flex: 1; }
.user-edit-form label:nth-of-type(2) { width: 170px; }
.user-actions { justify-content: flex-end; }
.user-actions form { margin: 0; }
.btn-danger { border-color: #efb4ae; color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.user-protection-note { margin: 0; }
.direction-card { display: grid; gap: 13px; padding: 16px; }
.direction-card.is-inactive { background: #fbfbfc; }
.settings-number-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.subject-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.checkbox-list { display: grid; max-height: 190px; gap: 5px; padding: 8px; border: 1px solid var(--border); border-radius: 7px; overflow-y: auto; }
.check-row { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.check-row input { flex: 0 0 auto; }
.mapping-details { border-radius: 7px; background: #f7f8fa; }
.mapping-details summary { padding: 9px 10px; cursor: pointer; font-size: 13px; font-weight: 600; }
.mapping-details .subject-fieldset { padding: 0 8px 8px; }
.direction-actions, .diagnostics-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.direction-activation-card, .direction-config-card { display: grid; gap: 18px; padding: 20px; }
.section-heading-row, .selected-direction-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-heading-row h2, .direction-config-card h2 { margin: 0 0 5px; font-size: 18px; }
.section-heading-row p, .direction-config-card > div > p { margin: 0; }
.direction-checkbox-grid { display: grid; max-height: 520px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 2px; overflow-y: auto; }
.direction-check-row { display: flex; min-width: 0; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.direction-check-row:hover { border-color: #b9c4d2; }
.direction-check-row.is-selected { border-color: #a7c0f7; background: var(--primary-soft); }
.direction-check-row input { flex: 0 0 auto; margin-top: 3px; }
.direction-check-copy { display: grid; min-width: 0; gap: 2px; }
.direction-check-copy strong { overflow-wrap: anywhere; font-size: 13px; }
.direction-settings-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .62fr); gap: 18px; align-items: start; margin-top: 18px; }
.direction-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.direction-edit-form { padding-top: 2px; }
.form-actions-end { display: flex; justify-content: flex-end; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty-admin-card { padding: 24px; text-align: center; }
.diagnostics-card { padding: 20px; }
.diagnostics-heading { align-items: flex-start; margin-bottom: 18px; }
.diagnostics-heading h2 { margin: 0 0 4px; font-size: 18px; }
.diagnostics-heading p { margin: 0; }
.diagnostics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; border: 1px solid var(--border); background: var(--border); }
.diagnostics-grid > div { min-width: 0; padding: 14px; background: var(--surface); }
.diagnostics-grid dt { margin-bottom: 5px; color: var(--muted-foreground); font-size: 13px; }
.diagnostics-grid dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.diagnostics-warnings { margin-top: 20px; }
.diagnostics-warnings h3 { margin: 0 0 10px; font-size: 16px; }
.diagnostics-warning-list { display: grid; gap: 8px; }
.diagnostics-warning-list article { display: grid; gap: 4px; padding: 11px 12px; border: 1px solid #f0d4a8; border-radius: 7px; background: #fff9ed; }
.diagnostics-note { margin: 14px 0 0; }
.diagnostics-section { margin-top: 24px; }
.diagnostics-section h3 { margin: 0 0 10px; font-size: 16px; }
.diagnostics-section-heading, .teacher-diagnostic-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.knowledge-area-list { display: flex; flex-wrap: wrap; gap: 7px; }
.knowledge-area-chip { padding: 5px 8px; border: 1px solid var(--border); border-radius: 999px; background: #f8fafc; font-size: 13px; }
.knowledge-area-chip small { color: var(--muted-foreground); }
.teacher-diagnostics-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.teacher-diagnostic-card { display: grid; gap: 11px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.teacher-diagnostic-card.has-warning { border-color: #f0d4a8; background: #fffdf8; }
.teacher-warning { padding: 8px 9px; border-radius: 6px; background: #fff3dc; color: #78520a; }
.teacher-diagnostic-values { display: grid; gap: 8px; margin: 0; }
.teacher-diagnostic-values div { display: grid; gap: 2px; }
.teacher-diagnostic-values dt { color: var(--muted-foreground); font-size: 12px; }
.teacher-diagnostic-values dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 600; }
.teacher-diagnostic-values ul { margin: 0; padding-left: 18px; }
.review-list { display: grid; gap: 9px; }
.review-list-card { display: grid; grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(170px, .8fr)) auto; gap: 14px; align-items: center; padding: 15px; color: var(--foreground); text-decoration: none; }
.review-list-card:hover { border-color: #bdc7d4; }
.review-list-action { display: grid; gap: 5px; justify-items: end; }
.review-warning { margin-bottom: 16px; }
.review-state-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.review-state-card { padding: 18px; }
.review-state-card.is-observed { border-color: #efb4ae; }
.review-state-card h2, .review-resolution-card h2 { margin: 0 0 14px; font-size: 17px; }
.review-values { display: grid; gap: 10px; margin: 14px 0 0; }
.review-values div { display: grid; gap: 3px; }
.review-values dt { color: var(--muted-foreground); font-size: 12px; }
.review-values dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.review-reason { margin: 14px 0 0; padding: 10px; border-radius: 7px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.review-resolution-card { display: grid; gap: 12px; margin-top: 16px; padding: 18px; }
.review-resolution-card h2, .review-resolution-card p, .review-resolution-card form { margin: 0; }
.booking-filters { display: grid; grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(135px, .7fr)) auto; gap: 10px; align-items: end; margin-bottom: 16px; padding: 14px; }
.booking-list { display: grid; gap: 9px; }
.booking-list-card { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) minmax(120px, .7fr) auto; gap: 14px; align-items: center; padding: 15px; color: var(--foreground); text-decoration: none; }
.booking-list-card:hover { border-color: #bdc7d4; }
.booking-list-main, .booking-list-status { display: grid; gap: 4px; }
.booking-list-status { justify-items: end; }
.booking-status.is-scheduled { background: #e7f7ef; color: var(--success); }
.booking-status.is-cancelled, .booking-status.is-failed { background: #eef0f3; color: var(--muted-foreground); }
.booking-status.is-requires_review { background: var(--danger-soft); color: var(--danger); }
.booking-status.is-creating, .booking-status.is-rescheduling, .booking-status.is-cancelling { background: #fff5d8; color: #8a6200; }
.back-link { display: inline-block; margin-bottom: 9px; color: var(--primary); text-decoration: none; font-size: 13px; }
.booking-detail-heading { margin-top: 5px; }
.booking-detail-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 16px; align-items: start; }
.booking-info-card, .booking-history-card, .reschedule-confirm-card { padding: 18px; }
.booking-info-card h2, .booking-history-card h2, .reschedule-confirm-card h2 { margin: 0 0 15px; font-size: 17px; }
.booking-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0; border: 1px solid var(--border); background: var(--border); }
.booking-info-grid > div { padding: 12px; background: var(--surface); }
.booking-info-grid dt { margin-bottom: 4px; color: var(--muted-foreground); font-size: 12px; }
.booking-info-grid dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.booking-comment { margin-top: 15px; }
.booking-comment p { margin: 0; white-space: pre-wrap; }
.booking-detail-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.cancel-form { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.cancel-form .btn { justify-self: start; }
.booking-history { display: grid; gap: 14px; }
.booking-history article { display: grid; grid-template-columns: 10px 1fr; gap: 9px; }
.history-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--primary); }
.reschedule-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr); gap: 16px; align-items: start; }
.reschedule-grid-card { overflow: hidden; }
.reschedule-grid-card .schedule-meta { padding: 13px 13px 5px; }
.reschedule-confirm-card p { margin: 0 0 14px; }
.success-heading { margin-bottom: 14px; font-weight: 600; }
.success-icon { display: inline-grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #e7f7ef; color: var(--success); }
.success-list { display: grid; gap: 9px; margin: 0 0 16px; }
.success-row { display: grid; grid-template-columns: 98px 1fr; gap: 8px; }
.success-row dt { color: var(--muted-foreground); }
.success-row dd { margin: 0; font-weight: 600; }

.calendar-filter-panel { position: sticky; z-index: 8; top: 0; margin-bottom: 16px; overflow: hidden; }
.calendar-filter-panel > summary { display: none; padding: 12px 14px; cursor: pointer; font-weight: 600; }
.calendar-filters { display: grid; grid-template-columns: repeat(2, minmax(130px, .65fr)) repeat(4, minmax(155px, 1fr)) auto auto; gap: 9px; align-items: end; padding: 14px; }
.calendar-warning { margin-bottom: 12px; border: 1px solid #f0d4a8; background: #fff9ed; color: #78520a; }
.calendar-scroll { max-width: 100%; border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; background: var(--surface); box-shadow: var(--shadow); }
.calendar-grid { display: grid; gap: 1px; background: var(--border); }
.calendar-days-1 { min-width: 322px; grid-template-columns: 72px repeat(1, minmax(250px, 1fr)); }
.calendar-days-2 { min-width: 572px; grid-template-columns: 72px repeat(2, minmax(250px, 1fr)); }
.calendar-days-3 { min-width: 822px; grid-template-columns: 72px repeat(3, minmax(250px, 1fr)); }
.calendar-days-4 { min-width: 1072px; grid-template-columns: 72px repeat(4, minmax(250px, 1fr)); }
.calendar-days-5 { min-width: 1322px; grid-template-columns: 72px repeat(5, minmax(250px, 1fr)); }
.calendar-days-6 { min-width: 1572px; grid-template-columns: 72px repeat(6, minmax(250px, 1fr)); }
.calendar-days-7 { min-width: 1822px; grid-template-columns: 72px repeat(7, minmax(250px, 1fr)); }
.calendar-days-8 { min-width: 2072px; grid-template-columns: 72px repeat(8, minmax(250px, 1fr)); }
.calendar-days-9 { min-width: 2322px; grid-template-columns: 72px repeat(9, minmax(250px, 1fr)); }
.calendar-days-10 { min-width: 2572px; grid-template-columns: 72px repeat(10, minmax(250px, 1fr)); }
.calendar-days-11 { min-width: 2822px; grid-template-columns: 72px repeat(11, minmax(250px, 1fr)); }
.calendar-days-12 { min-width: 3072px; grid-template-columns: 72px repeat(12, minmax(250px, 1fr)); }
.calendar-days-13 { min-width: 3322px; grid-template-columns: 72px repeat(13, minmax(250px, 1fr)); }
.calendar-days-14 { min-width: 3572px; grid-template-columns: 72px repeat(14, minmax(250px, 1fr)); }
.calendar-corner, .calendar-day-heading, .calendar-hour-label, .calendar-hour-cell { background: var(--surface); }
.calendar-corner, .calendar-day-heading { position: sticky; z-index: 3; top: 0; min-height: 61px; }
.calendar-corner { left: 0; z-index: 4; }
.calendar-day-heading { display: grid; align-content: center; gap: 2px; padding: 10px 12px; }
.calendar-day-heading span { color: var(--muted-foreground); font-size: 12px; }
.calendar-hour-label { position: sticky; left: 0; z-index: 2; padding: 12px 9px; color: var(--muted-foreground); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.calendar-hour-cell { display: grid; min-height: 94px; align-content: start; gap: 7px; padding: 7px; }
.calendar-item { display: grid; min-width: 0; gap: 4px; padding: 9px; border: 1px solid #bfd1f8; border-left: 4px solid var(--primary); border-radius: 8px; background: #f7faff; color: var(--foreground); font-size: 13px; text-decoration: none; }
.calendar-item:hover { border-color: var(--primary); }
.calendar-item strong, .calendar-item span { overflow-wrap: anywhere; }
.calendar-item-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.calendar-item-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; }
.calendar-item.is-requires_review, .calendar-item.is-creating, .calendar-item.is-rescheduling, .calendar-item.is-cancelling { border-color: #e6bf6f; border-left-color: #bb7b00; background: #fff9ed; }
.calendar-item.is-cancelled, .calendar-item.is-failed { border-color: #d5d9df; border-left-color: #8a929d; background: #f5f6f7; color: var(--muted-foreground); }
.calendar-item.duration-30 { border-style: dashed; }
.calendar-item.duration-50 { border-bottom-width: 3px; }
.calendar-unconfirmed { padding: 5px 6px; border-radius: 5px; background: var(--danger-soft); color: var(--danger); font-size: 12px; font-weight: 600; }
.calendar-item-external { border-color: #d4d8de; border-left-color: #7b8491; background: #f3f4f6; }
.calendar-item-external > summary { display: grid; gap: 4px; cursor: pointer; list-style-position: inside; }
.calendar-external-detail { display: grid; gap: 5px; margin-top: 4px; padding-top: 8px; border-top: 1px solid #d4d8de; color: var(--muted-foreground); font-size: 12px; }
.calendar-agenda { display: none; }
.agenda-day { margin-bottom: 18px; }
.agenda-day h2 { margin: 0 0 8px; font-size: 16px; }
.agenda-items { display: grid; gap: 8px; }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 24px, 680px); }
  .app-bar { align-items: flex-start; flex-wrap: wrap; }
  .page-tools { grid-template-columns: 1fr; align-items: start; gap: 14px; }
  .page-title-group { order: 1; }
  .direction-control { order: 2; }
  .selected-direction-summary { order: 3; text-align: left; }
  .selected-direction-name { font-size: 22px; }
  .main-nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; }
  .nav-item { padding-block: 8px; }
  .direction-control { width: 100%; }
  .schedule-layout { grid-template-columns: 1fr; }
  .admin-layout, .direction-settings-layout { grid-template-columns: 1fr; }
  .direction-checkbox-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booking-filters { grid-template-columns: repeat(2, 1fr); }
  .booking-list-card { grid-template-columns: 1fr 1fr; }
  .booking-list-status { justify-items: start; }
  .booking-detail-layout, .reschedule-layout { grid-template-columns: 1fr; }
  .diagnostics-grid { grid-template-columns: repeat(2, 1fr); }
  .review-list-card { grid-template-columns: 1fr 1fr; }
  .review-list-action { justify-items: start; }
  .review-state-grid { grid-template-columns: 1fr; }
  .teacher-diagnostics-list { grid-template-columns: 1fr; }
  .date-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-column { min-height: 220px; }
  .date-column:nth-child(3) { border-left: 0; }
  .date-column:nth-child(n+3) { border-top: 1px solid var(--border); }
  .calendar-filter-panel { position: static; }
  .calendar-filter-panel > summary { display: block; }
  .calendar-filter-panel:not([open]) .calendar-filters { display: none; }
  .calendar-filters { grid-template-columns: 1fr; padding-top: 2px; }
  .calendar-desktop { display: none; }
  .calendar-agenda { display: block; }
  .calendar-item { width: 100%; }
}

@media (max-width: 430px) {
  .user-label { display: none; }
  .date-grid, .field-row { grid-template-columns: 1fr; }
  .user-edit-form { align-items: stretch; flex-direction: column; }
  .user-edit-form label, .user-edit-form label:nth-of-type(2), .user-edit-form .btn { width: 100%; }
  .settings-number-grid, .diagnostics-grid, .direction-checkbox-grid { grid-template-columns: 1fr; }
  .direction-checkbox-grid { max-height: 420px; }
  .direction-picker { grid-template-columns: 1fr; }
  .direction-picker .btn, .form-actions-end .btn { width: 100%; }
  .booking-filters, .booking-list-card, .booking-info-grid { grid-template-columns: 1fr; }
  .review-list-card { grid-template-columns: 1fr; }
  .teacher-diagnostic-heading { align-items: stretch; flex-direction: column; }
  .date-column { min-height: 0; }
  .date-column + .date-column { border-top: 1px solid var(--border); border-left: 0; }
}
