:root {
  --alfa-primary: #245844;
  --alfa-primary-hover: #1d4938;
  --alfa-primary-active: #173b2e;
  --alfa-primary-soft: #edf5f1;
  --alfa-primary-border: #bfd6cc;
  --alfa-bg: #f5f8f6;
  --alfa-surface: #ffffff;
  --alfa-surface-secondary: #f8fafc;
  --alfa-text: #171a24;
  --alfa-text-secondary: #667085;
  --alfa-text-muted: #8a94a6;
  --alfa-border: #e6e8ef;
  --alfa-border-strong: #d6dae4;
  --alfa-success: #047857;
  --alfa-success-soft: #ecfdf5;
  --alfa-success-border: #a7f3d0;
  --alfa-warning: #b45309;
  --alfa-warning-soft: #fff7ed;
  --alfa-warning-border: #fed7aa;
  --alfa-danger: #b42318;
  --alfa-danger-soft: #fef3f2;
  --alfa-info: #0369a1;
  --alfa-info-soft: #eff6ff;
  --alfa-info-border: #bfdbfe;
  --lesson-practice: #f7f9f8;
  --lesson-practice-border: #d8e2dd;
  --lesson-offsite: #f3f8f5;
  --lesson-offsite-border: #c9ddd3;
  --alfa-radius-sm: 8px;
  --alfa-radius-md: 12px;
  --alfa-radius-lg: 14px;
  --alfa-radius-xl: 16px;
  --alfa-shadow-sm: 0 1px 2px rgb(16 24 40 / 4%);
  --alfa-shadow-md: 0 12px 30px rgb(28 70 54 / 8%);
  --alfa-transition: 160ms ease;
  --page-width: 1240px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--alfa-text);
  background: var(--alfa-bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 88% -12%, rgb(36 88 68 / 4%), transparent 28rem),
    radial-gradient(circle at 8% 2%, rgb(36 88 68 / 6%), transparent 24rem),
    var(--alfa-bg);
  color: var(--alfa-text);
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.lesson-button:focus-visible,
.mobile-event:focus-visible,
.special-event:focus-visible {
  outline: 3px solid rgb(36 88 68 / 22%);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 16px;
  border-radius: var(--alfa-radius-sm);
  background: var(--alfa-primary);
  color: white;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  border-bottom: 1px solid rgb(230 232 239 / 80%);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(calc(100% - 40px), var(--page-width));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--alfa-primary);
  box-shadow: 0 7px 18px rgb(36 88 68 / 18%);
  color: white;
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-copy {
  display: grid;
  line-height: 1.2;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: 0.025em;
}

.brand-copy span {
  margin-top: 3px;
  color: var(--alfa-text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.term-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--alfa-primary-border);
  border-radius: 999px;
  background: var(--alfa-primary-soft);
  color: var(--alfa-primary-active);
  font-size: 14px;
  font-weight: 600;
}

.term-badge svg,
.ghost-button svg,
.search-box svg,
.dialog-close svg,
.empty-state svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-shell {
  width: min(calc(100% - 40px), var(--page-width));
  margin: 0 auto;
  padding: 34px 0 62px;
}

.intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--alfa-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.intro h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.intro p:not(.eyebrow) {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--alfa-text-secondary);
  font-size: 16px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 9px 16px;
  margin-bottom: 18px;
  color: var(--alfa-text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--alfa-border-strong);
}

.legend-dot.practice {
  border: 1px solid var(--lesson-practice-border);
  background: var(--lesson-practice);
}

.legend-dot.offsite {
  border: 1px solid var(--lesson-offsite-border);
  background: var(--lesson-offsite);
}

.exam-mini,
.exam-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--alfa-primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.control-panel {
  position: sticky;
  z-index: 30;
  top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid rgb(230 232 239 / 90%);
  border-radius: var(--alfa-radius-lg);
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 8px 24px rgb(28 70 54 / 7%);
  backdrop-filter: blur(20px);
}

.selector-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1.05fr;
  gap: 12px;
}

.field {
  min-width: 0;
  color: var(--alfa-text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.field > span:first-child {
  display: block;
  margin-bottom: 7px;
}

.select-wrap {
  position: relative;
  display: block;
}

.select-wrap select {
  width: 100%;
  height: 44px;
  appearance: none;
  padding: 0 42px 0 13px;
  overflow: hidden;
  border: 1px solid var(--alfa-border);
  border-radius: 9px;
  background: var(--alfa-surface-secondary);
  color: var(--alfa-text);
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  transition: border-color var(--alfa-transition), box-shadow var(--alfa-transition), background var(--alfa-transition);
}

.select-wrap select:hover,
.select-wrap select:focus {
  border-color: var(--alfa-primary-border);
  background: white;
}

.select-wrap select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.start-state {
  margin-top: 0;
}

.select-wrap svg {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--alfa-text-secondary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.search-area {
  min-width: 0;
}

.search-box {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--alfa-border);
  border-radius: 9px;
  background: var(--alfa-surface-secondary);
  transition: border-color var(--alfa-transition), box-shadow var(--alfa-transition), background var(--alfa-transition);
}

.search-box:focus-within {
  border-color: var(--alfa-primary);
  background: white;
  box-shadow: 0 0 0 4px rgb(36 88 68 / 10%);
}

.search-box svg {
  flex: 0 0 auto;
  color: var(--alfa-text-muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--alfa-text);
  font-size: 15px;
}

.search-box input::placeholder {
  color: var(--alfa-text-muted);
}

.search-modes {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.search-modes::-webkit-scrollbar {
  display: none;
}

.mode-chip {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--alfa-text-secondary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--alfa-transition);
}

.mode-chip:hover {
  background: var(--alfa-surface-secondary);
  color: var(--alfa-text);
}

.mode-chip.is-active {
  border-color: var(--alfa-primary-border);
  background: var(--alfa-primary-soft);
  color: var(--alfa-primary-active);
}

.plan-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 2px 15px;
}

.plan-toolbar h2 {
  margin-bottom: 3px;
  font-size: 23px;
  letter-spacing: -0.02em;
}

.plan-toolbar p {
  margin-bottom: 0;
  color: var(--alfa-text-secondary);
  font-size: 14px;
}

.ghost-button,
.secondary-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--alfa-border);
  border-radius: 12px;
  background: white;
  color: var(--alfa-text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--alfa-transition);
}

.ghost-button:hover,
.secondary-button:hover {
  border-color: var(--alfa-primary-border);
  background: var(--alfa-primary-soft);
  color: var(--alfa-primary-active);
}

.ghost-button svg {
  width: 18px;
  height: 18px;
}

.schedule-root {
  display: grid;
  gap: 22px;
}

.month-section {
  border: 1px solid var(--alfa-border);
  border-radius: var(--alfa-radius-lg);
  background: var(--alfa-surface);
  box-shadow: var(--alfa-shadow-sm);
  overflow: hidden;
}

.month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--alfa-border);
  background: linear-gradient(90deg, var(--alfa-primary-soft), white 72%);
}

.month-header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.month-header span {
  color: var(--alfa-text-secondary);
  font-size: 13px;
}

.weekend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}

.weekend-card {
  min-width: 0;
  border: 1px solid var(--alfa-border);
  border-radius: var(--alfa-radius-lg);
  background: white;
  overflow: hidden;
}

.weekend-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--alfa-border);
  background: white;
}

.weekend-title strong {
  font-size: 14px;
}

.weekend-title span {
  color: var(--alfa-text-secondary);
  font-size: 12px;
}

.calendar-days {
  display: grid;
  grid-template-columns: 34px repeat(var(--day-count, 2), minmax(0, 1fr));
  border-bottom: 3px solid var(--alfa-primary);
  background: var(--alfa-primary-soft);
}

.calendar-corner {
  display: grid;
  place-items: end center;
  padding-bottom: 11px;
  border-right: 1px solid var(--alfa-primary-border);
  color: var(--alfa-primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.calendar-day {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 10px 12px;
  border-right: 1px solid var(--alfa-primary-border);
  text-align: left;
}

.calendar-day:last-child {
  border-right: 0;
}

.calendar-day-name {
  color: var(--alfa-primary-active);
  font-size: 13px;
  font-weight: 750;
  text-transform: capitalize;
}

.calendar-day time {
  min-width: 54px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 10px;
  background: white;
  box-shadow: 0 1px 3px rgb(28 70 54 / 10%);
  color: var(--alfa-primary-active);
}

.calendar-day time strong {
  font-size: 24px;
  line-height: 1;
}

.calendar-day time span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.special-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
  background: linear-gradient(180deg, rgb(236 253 245 / 70%), white);
}

.special-section-label {
  padding: 9px 12px;
  border-top: 1px solid var(--alfa-border);
  border-bottom: 1px solid var(--alfa-border);
  background: var(--alfa-primary-soft);
  color: var(--alfa-primary-active);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.special-day-grid {
  display: grid;
  grid-template-columns: repeat(var(--special-day-count, 2), minmax(0, 1fr));
  border-bottom: 1px solid var(--alfa-border);
}

.special-day {
  min-width: 0;
  border-right: 1px solid var(--alfa-border);
}

.special-day:last-child {
  border-right: 0;
}

.special-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 2px solid var(--alfa-primary);
  background: var(--alfa-primary-soft);
  color: var(--alfa-primary-active);
}

.special-day-header strong {
  font-size: 13px;
  text-transform: capitalize;
}

.special-day-header time {
  padding: 4px 8px;
  border-radius: 8px;
  background: white;
  font-size: 11px;
  font-weight: 750;
}

.special-event {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--alfa-success-border);
  border-radius: 11px;
  background: var(--alfa-success-soft);
  color: var(--alfa-text);
  text-align: left;
}

.special-event time {
  grid-column: 1 / -1;
}

.special-event:hover {
  border-color: #6ee7b7;
  transform: translateY(-1px);
}

.special-event time {
  color: var(--alfa-success);
  font-size: 12px;
  font-weight: 700;
}

.special-event .special-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: normal;
}

.group-pill {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--alfa-primary-border);
  border-radius: 999px;
  background: white;
  color: var(--alfa-primary-active);
  font-size: 11px;
  font-weight: 700;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.schedule-table col.lesson-number-col {
  width: 34px;
}

.schedule-table th,
.schedule-table td {
  border-right: 1px solid var(--alfa-border);
  border-bottom: 1px solid var(--alfa-border);
}

.schedule-table tr:last-child td,
.schedule-table tr:last-child th {
  border-bottom: 0;
}

.schedule-table th:last-child,
.schedule-table td:last-child {
  border-right: 0;
}

.schedule-table thead:not(.visually-hidden) th {
  height: 51px;
  padding: 6px 5px;
  background: white;
  vertical-align: middle;
}

.schedule-table .lp-heading,
.schedule-table .period-number {
  width: 34px;
  background: var(--alfa-surface-secondary);
  color: var(--alfa-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.day-heading {
  line-height: 1.25;
  text-align: center;
}

.day-heading strong {
  display: block;
  font-size: 12px;
  text-transform: capitalize;
}

.day-heading span {
  color: var(--alfa-text-secondary);
  font-size: 11px;
}

.schedule-table tbody tr {
  height: 34px;
}

.schedule-table td.lesson-cell {
  height: 34px;
  padding: 3px;
  background: white;
  vertical-align: middle;
}

.schedule-table td.lesson-cell.is-empty {
  background: linear-gradient(135deg, #fff 0 48%, #fafbfc 48% 52%, #fff 52%);
}

.lesson-button {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 5px;
  border: 1px solid var(--alfa-border);
  border-radius: 9px;
  background: white;
  color: var(--alfa-text);
  line-height: 1.15;
  text-align: center;
  transition: border-color var(--alfa-transition), background var(--alfa-transition), transform var(--alfa-transition), box-shadow var(--alfa-transition);
}

.parallel-lesson-grid {
  width: 100%;
  min-height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--parallel-count, 2), minmax(0, 1fr));
  gap: 4px;
}

.lesson-button:hover {
  z-index: 1;
  border-color: var(--alfa-primary-border);
  box-shadow: 0 6px 18px rgb(20 30 60 / 8%);
  transform: translateY(-1px);
}

.lesson-button.has-groups {
  min-height: 28px;
  flex-direction: row;
  gap: 5px;
  padding: 3px 5px;
}

.lesson-button.has-groups .lesson-meta {
  flex: 0 0 auto;
}

.lesson-button.has-groups .group-pill {
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
}

.lesson-name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
}

.lesson-button.kind-practice {
  border-color: var(--lesson-practice-border);
  background: var(--lesson-practice);
}

.lesson-button.kind-offsite {
  border-color: var(--lesson-offsite-border);
  background: var(--lesson-offsite);
}

.lesson-button.is-exam {
  border-color: var(--alfa-primary);
  box-shadow: inset 3px 0 0 var(--alfa-primary);
}

.lesson-button .exam-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
}

.mobile-schedule {
  display: none;
}

.mobile-day {
  border: 1px solid var(--alfa-border);
  border-radius: var(--alfa-radius-lg);
  background: white;
  overflow: hidden;
}

.mobile-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border-bottom: 3px solid var(--alfa-primary);
  background: var(--alfa-primary-soft);
}

.mobile-day-header strong {
  color: var(--alfa-primary-active);
  text-transform: capitalize;
}

.mobile-day-header time {
  padding: 5px 9px;
  border-radius: 8px;
  background: white;
  color: var(--alfa-primary-active);
  font-size: 12px;
  font-weight: 700;
}

.mobile-event-list {
  display: grid;
}

.mobile-event-row {
  display: grid;
  border-bottom: 1px solid var(--alfa-border);
}

.mobile-event-row:last-child {
  border-bottom: 0;
}

.mobile-event-row.is-concurrent {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--alfa-border);
}

.mobile-event-row.is-concurrent .mobile-event {
  min-height: 100px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 6px;
  border-bottom: 0;
}

.mobile-event-row.is-concurrent .mobile-event-time {
  grid-column: 1 / -1;
}

.mobile-event-row.is-concurrent .mobile-event-copy strong {
  white-space: normal;
}

.mobile-event-row.is-concurrent .mobile-event-copy span {
  display: none;
}

.mobile-event-list.is-group-schedule {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--alfa-border);
}

.mobile-event-list.is-group-schedule .mobile-event {
  min-height: 92px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 6px;
  border-bottom: 0;
}

.mobile-event-list.is-group-schedule .mobile-event-time {
  grid-column: 1 / -1;
}

.mobile-event-list.is-group-schedule .mobile-event-copy strong {
  white-space: normal;
}

.mobile-event-list.is-group-schedule .mobile-event-copy span {
  display: none;
}

.mobile-event {
  width: 100%;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid var(--alfa-border);
  background: white;
  color: var(--alfa-text);
  text-align: left;
}

.mobile-event:last-child {
  border-bottom: 0;
}

.mobile-event:hover,
.mobile-event:active {
  background: var(--alfa-primary-soft);
}

.mobile-event-time {
  color: var(--alfa-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.mobile-event-copy {
  min-width: 0;
}

.mobile-event-copy strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-event-copy span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--alfa-text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  padding: 70px 20px;
  border: 1px dashed var(--alfa-border-strong);
  border-radius: var(--alfa-radius-xl);
  background: white;
  text-align: center;
}

.empty-state svg {
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  color: var(--alfa-primary);
}

.empty-state h2 {
  margin-bottom: 6px;
  font-size: 21px;
}

.empty-state p {
  margin-bottom: 20px;
  color: var(--alfa-text-secondary);
}

.app-footer {
  width: min(calc(100% - 40px), var(--page-width));
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 22px 0 32px;
  border-top: 1px solid var(--alfa-border);
  color: var(--alfa-text-secondary);
  font-size: 13px;
}

.app-footer p {
  margin: 0;
}

.hover-card {
  position: fixed;
  z-index: 100;
  width: min(360px, calc(100vw - 30px));
  padding: 16px;
  border: 1px solid var(--alfa-border);
  border-radius: var(--alfa-radius-md);
  background: rgb(255 255 255 / 98%);
  box-shadow: 0 18px 52px rgb(20 30 60 / 18%);
  pointer-events: none;
}

.detail-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--alfa-primary);
  font-size: 12px;
  font-weight: 700;
}

.detail-title {
  margin-bottom: 14px;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-item {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: var(--alfa-surface-secondary);
}

.detail-item span {
  display: block;
  margin-bottom: 3px;
  color: var(--alfa-text-muted);
  font-size: 11px;
  font-weight: 600;
}

.detail-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 650;
}

.activity-details {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.activity-detail {
  padding: 12px;
  border: 1px solid var(--alfa-border);
  border-radius: 12px;
}

.activity-detail h4 {
  margin: 0 0 7px;
  font-size: 14px;
}

.activity-detail p {
  margin: 2px 0 0;
  color: var(--alfa-text-secondary);
  font-size: 12px;
}

.lesson-dialog {
  width: min(540px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 50px));
  padding: 26px;
  border: 0;
  border-radius: var(--alfa-radius-xl);
  background: white;
  box-shadow: 0 26px 80px rgb(20 30 60 / 26%);
  color: var(--alfa-text);
  overflow: auto;
}

.lesson-dialog::backdrop {
  background: rgb(17 24 39 / 45%);
  backdrop-filter: blur(3px);
}

.dialog-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--alfa-surface-secondary);
  color: var(--alfa-text-secondary);
}

.dialog-close:hover {
  background: var(--alfa-primary-soft);
  color: var(--alfa-primary);
}

.dialog-close svg {
  width: 19px;
  height: 19px;
}

.dialog-handle {
  display: none;
}

@media (max-width: 1040px) {
  .control-panel {
    grid-template-columns: 1fr;
  }

  .weekend-grid {
    grid-template-columns: 1fr;
  }

  .intro {
    align-items: start;
    flex-direction: column;
  }

  .legend {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .header-inner,
  .page-shell,
  .app-footer {
    width: min(calc(100% - 24px), var(--page-width));
  }

  .header-inner {
    min-height: 64px;
  }

  .brand-copy span,
  .term-badge {
    display: none;
  }

  .page-shell {
    padding-top: 24px;
  }

  .intro {
    gap: 15px;
    margin-bottom: 15px;
  }

  .intro h1 {
    font-size: 32px;
  }

  .legend {
    white-space: normal;
    margin-bottom: 15px;
  }

  .control-panel {
    position: relative;
    top: 0;
    gap: 16px;
    padding: 16px;
    border-radius: var(--alfa-radius-lg);
  }

  .selector-grid {
    grid-template-columns: 1fr 1fr;
  }

  .selector-grid .field:last-child {
    grid-column: 1 / -1;
  }

  .plan-toolbar {
    align-items: flex-start;
    padding-top: 27px;
  }

  .plan-toolbar h2 {
    font-size: 20px;
  }

  .ghost-button {
    width: 42px;
    padding: 0;
    flex: 0 0 42px;
  }

  .ghost-button svg {
    margin: 0;
  }

  .ghost-button {
    font-size: 0;
  }

  .month-header {
    padding: 16px;
  }

  .weekend-grid,
  .desktop-schedule {
    display: none;
  }

  .special-day-grid {
    grid-template-columns: 1fr;
  }

  .mobile-schedule {
    display: grid;
    gap: 12px;
    padding: 14px;
  }

  .app-footer {
    flex-direction: column;
    gap: 4px;
  }

  .hover-card {
    display: none !important;
  }

  .lesson-dialog {
    width: 100%;
    max-width: none;
    max-height: 86vh;
    margin: auto 0 0;
    padding: 30px 18px 24px;
    border-radius: 22px 22px 0 0;
  }

  .dialog-handle {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 42px;
    height: 5px;
    display: block;
    border-radius: 999px;
    background: var(--alfa-border-strong);
    transform: translateX(-50%);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .selector-grid {
    grid-template-columns: 1fr;
  }

  .selector-grid .field:first-child,
  .selector-grid .field:last-child {
    grid-column: auto;
  }

  .search-modes {
    margin-right: -6px;
  }

  .mobile-event {
    grid-template-columns: 68px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
