:root {
  color-scheme: light;
  --main: #2275fc;
  --white: #fff;
  --heading: #111;
  --body-text: #575864;
  --style: #ff5200;
  --green: #22c55e;
  --input: #ecf0f4;
  --icon: #cbd5e1;
  --note: #95989d;
  --text-holder: #858b93;
  --stroke: #ecf0f4;
  --backdrop: #f2f7fb;
  --hover: #edf1f5;
  --blue-soft: #ecf3ff;
  --orange-soft: #fff2ed;
  --shadow: 0 4px 24px rgba(20, 25, 38, .05);
  font-family: "Inter", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --main: #6ca4ff;
  --white: #1e293b;
  --heading: #f8fafc;
  --body-text: #cbd5e1;
  --style: #ff8662;
  --green: #4ade80;
  --input: #324055;
  --icon: #94a3b8;
  --note: #94a3b8;
  --text-holder: #94a3b8;
  --stroke: #324055;
  --backdrop: #121923;
  --hover: #273445;
  --blue-soft: #223b61;
  --orange-soft: #493128;
  --shadow: 0 4px 24px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--backdrop);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--body-text);
  background: var(--backdrop);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
textarea { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(34, 117, 252, .2);
  outline-offset: 2px;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.is-hidden { display: none !important; }

/* Auth ------------------------------------------------------------------- */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 30px 15px;
  background: var(--backdrop);
}

.auth-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  gap: 30px;
}

.auth-brand {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}

.auth-wordmark {
  color: var(--heading);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1;
}

.auth-site { color: var(--note); font-size: 12px; font-weight: 500; }

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 30px;
  text-align: left;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  color: var(--heading);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
}

.auth-tabs {
  display: flex;
  gap: 24px;
  margin-top: -10px;
  border-bottom: 1px solid var(--stroke);
}

.auth-tab {
  position: relative;
  padding: 0 0 13px;
  color: var(--note);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: color .2s ease;
}

.auth-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--main);
  transform: scaleX(0);
  transition: transform .3s ease;
}

.auth-tab:hover,
.auth-tab.is-active { color: var(--main); }
.auth-tab.is-active::after { transform: scaleX(1); }
.auth-form, .field { display: flex; flex-direction: column; }
.auth-form { gap: 24px; }
.field { gap: 10px; }

.field label,
.section-note,
.chip-label {
  color: var(--heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.field input,
.drawer-search input,
.search-line input,
.review-form textarea {
  width: 100%;
  min-width: 0;
  color: var(--heading);
  background: transparent;
  border: 1px solid var(--input);
  border-radius: 12px;
  outline: 0;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.field input,
.drawer-search input,
.search-line input {
  min-height: 50px;
  padding: 14px 22px;
  font-size: 14px;
  line-height: 20px;
}

.field input:focus,
.drawer-search input:focus,
.search-line input:focus,
.review-form textarea:focus {
  border-color: var(--main);
  box-shadow: 0 0 0 3px rgba(34, 117, 252, .12);
}

.field input::placeholder,
.drawer-search input::placeholder,
.search-line input::placeholder,
.review-form textarea::placeholder { color: var(--text-holder); }

.field input[readonly] { color: var(--note); background: var(--hover); }
.auth-code-help { margin-top: -12px; color: var(--note); font-size: 12px; line-height: 1.4; }
.auth-reset-code { align-self: flex-start; margin-top: -12px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 14px 22px;
  color: var(--heading);
  background: transparent;
  border: 1px solid var(--input);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  transition: color .25s ease, background-color .25s ease, border-color .25s ease, transform .25s ease;
}

.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.button-wide { width: 100%; }
.button-dark { color: var(--white); background: var(--main); border-color: var(--main); font-weight: 700; }
.button-dark:hover { color: var(--main); background: var(--white); }
.ui-icon { display: block; flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.button-icon, .logout-icon, .logout-arrow { display: inline-flex; align-items: center; justify-content: center; }
.button-icon .ui-icon { width: 17px; height: 17px; }

.form-status {
  display: none;
  margin: 0;
  padding: 12px 16px;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.form-status.is-visible { display: block; }
.form-status:not(.is-error) { color: #15803d; background: #dcfce7; }

/* App shell ------------------------------------------------------------- */
.app-screen { min-height: 100vh; background: var(--backdrop); }

.app-layout {
  display: block;
  align-items: start;
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 24px));
  height: 100vh;
  min-height: 0;
  padding: 30px 24px 24px;
  overflow-y: auto;
  background: var(--white);
  border-left: 1px solid var(--stroke);
  border-radius: 18px 0 0 18px;
  box-shadow: -18px 0 50px rgba(20, 25, 38, .16);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .3s cubic-bezier(.16, 1, .3, 1), visibility 0s linear .3s;
}

.sidebar.is-open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--stroke); }
.menu-title { color: var(--heading); font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.menu-close { display: grid; width: 38px; height: 38px; place-items: center; padding: 0; color: var(--note); background: transparent; border: 1px solid var(--input); border-radius: 50%; cursor: pointer; transition: color .2s ease, background-color .2s ease, border-color .2s ease; }
.menu-close:hover { color: var(--heading); background: var(--hover); border-color: var(--main); }
.menu-close .ui-icon { width: 18px; height: 18px; }
.brand { display: inline-flex; align-items: baseline; }
.brand strong { color: var(--heading); font-size: 20px; font-weight: 800; letter-spacing: -.045em; line-height: 1; }

.group-chip {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 24px;
  padding: 14px 15px;
  color: var(--heading);
  text-align: left;
  background: transparent;
  border: 1px solid var(--input);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}

.group-chip:hover { background: var(--hover); border-color: var(--main); }
.chip-leading, .chip-arrow { display: grid; place-items: center; color: var(--main); }
.chip-leading .ui-icon, .chip-arrow .ui-icon { width: 18px; height: 18px; }
.chip-copy { min-width: 0; }
.group-chip .chip-label { display: block; margin-bottom: 4px; color: var(--note); font-size: 11px; font-weight: 600; text-transform: none; }
.group-chip strong { display: block; font-size: 15px; font-weight: 700; }
.chip-arrow { justify-self: end; }
.main-nav { display: grid; gap: 8px; }

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 14px;
  color: var(--body-text);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  transition: color .2s ease, background-color .2s ease;
}

.nav-item:hover, .nav-item.is-active { color: var(--main); background: var(--blue-soft); }
.nav-label { display: flex; align-items: center; gap: 11px; min-width: 0; }
.nav-icon { color: var(--main); opacity: .82; }
.nav-icon .ui-icon { width: 17px; height: 17px; }
.nav-arrow { display: grid; place-items: center; width: 16px; color: var(--main); opacity: 0; transition: opacity .2s ease, transform .2s ease; }
.nav-arrow .ui-icon { width: 15px; height: 15px; }
.nav-item:hover .nav-arrow, .nav-item.is-active .nav-arrow { opacity: 1; transform: translateX(2px); }

.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding: 20px 0 0; color: var(--note); border-top: 1px solid var(--stroke); font-size: 12px; overflow-wrap: anywhere; }
.quiet-button, .text-button, .clear-button { padding: 0; color: var(--main); background: transparent; border: 0; cursor: pointer; font-size: 13px; font-weight: 600; }
.text-button { display: inline-flex; align-items: center; gap: 7px; text-decoration: underline; text-underline-offset: 4px; }
.text-button .ui-icon { width: 15px; height: 15px; }
.logout-button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 10px; color: var(--style); background: transparent; border: 1px solid var(--style); border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 700; line-height: 1.2; transition: color .2s ease, background-color .2s ease, transform .2s ease; }
.logout-button:hover { color: var(--white); background: var(--style); transform: translateY(-1px); }
.logout-button .ui-icon { width: 15px; height: 15px; }
.logout-button-wide { display: flex; width: 100%; justify-content: flex-start; gap: 9px; margin-top: 24px; padding: 13px 15px; border-radius: 12px; font-size: 13px; }
.logout-button-wide .logout-arrow { margin-left: auto; }
.main-content { max-width: 1120px; min-width: 0; margin: 0 auto; padding: 6px 0 32px; }
.mobile-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.mobile-group { display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; max-width: 220px; padding: 8px 0; overflow: hidden; color: var(--main); background: transparent; border: 0; border-bottom: 1px solid var(--main); cursor: pointer; font-size: 12px; font-weight: 600; line-height: 1.35; text-align: right; }
.mobile-group #mobile-group-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-group .ui-icon { width: 15px; height: 15px; }
.menu-toggle { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; padding: 0; color: var(--heading); background: var(--white); border: 1px solid var(--input); border-radius: 50%; box-shadow: var(--shadow); cursor: pointer; transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease; }
.menu-toggle:hover { color: var(--main); background: var(--blue-soft); border-color: var(--main); transform: translateY(-1px); }
.menu-toggle .ui-icon { width: 20px; height: 20px; }
.menu-backdrop { position: fixed; z-index: 70; inset: 0; background: rgba(17, 17, 17, .36); }
body.menu-open { overflow: hidden; }
.view { animation: reveal .35s ease both; }

.view-intro { display: flex; align-items: center; justify-content: space-between; min-height: 58px; margin-bottom: 20px; }
.view-intro h1 { color: var(--heading); font-size: 32px; font-weight: 700; letter-spacing: -.045em; line-height: 1.25; }

.date-strip { display: flex; align-items: center; min-height: 50px; margin-bottom: 20px; padding: 14px 18px; color: var(--heading); background: var(--white); border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; }
.date-icon { display: grid; place-items: center; margin-right: 10px; color: var(--main); }
.date-icon .ui-icon { width: 17px; height: 17px; }
.content-stack { min-width: 0; }
.loading-panel { min-height: 184px; }
.schedule-loader { min-height: 184px; padding: 20px; background: var(--white); border: 1px solid var(--stroke); border-radius: 14px; box-shadow: var(--shadow); }
.loader-head { display: flex; align-items: center; gap: 9px; color: var(--heading); font-size: 13px; font-weight: 600; }
.loader-calendar { display: grid; width: 28px; height: 28px; place-items: center; color: var(--main); background: var(--blue-soft); border-radius: 8px; }
.loader-calendar .ui-icon { width: 16px; height: 16px; }
.loader-dots { display: inline-flex; gap: 4px; margin-left: auto; }
.loader-dots i { display: block; width: 4px; height: 4px; background: var(--style); border-radius: 50%; animation: loader-dot 1.1s ease-in-out infinite; }
.loader-dots i:nth-child(2) { animation-delay: .12s; }
.loader-dots i:nth-child(3) { animation-delay: .24s; }
.loader-table { display: grid; gap: 8px; margin-top: 20px; }
.loader-row { display: grid; grid-template-columns: 36px 92px minmax(0, 1fr); align-items: center; gap: 10px; }
.loader-cell { position: relative; height: 14px; overflow: hidden; background: var(--input); border-radius: 5px; }
.loader-cell::after { position: absolute; inset: 0; content: ""; background: var(--hover); transform: translateX(-105%); animation: skeleton-sweep 1.45s cubic-bezier(.16, 1, .3, 1) infinite; }
.loader-cell-number { width: 24px; }
.loader-cell-time { width: 80px; }
.loader-cell-main { width: min(100%, 280px); }
.loader-track { height: 3px; margin-top: 20px; overflow: hidden; background: var(--stroke); border-radius: 999px; }
.loader-track span { display: block; width: 35%; height: 100%; background: var(--style); animation: loader-sweep 1.4s cubic-bezier(.16, 1, .3, 1) infinite; }
.loading.compact-loading { display: flex; flex-direction: row; justify-content: flex-start; min-height: 80px; padding: 16px; }
.loading.compact-loading .loading-icon { color: var(--main); }
.loading.compact-loading .ui-icon { width: 17px; height: 17px; }
.loading.compact-loading > span { display: inline; width: auto; height: auto; background: transparent; border-radius: 0; animation: none; }

.empty-state { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; min-height: 180px; padding: 28px 24px; color: var(--note); background: var(--white); border-radius: 14px; box-shadow: var(--shadow); }
.empty-state strong { color: var(--heading); font-size: 20px; font-weight: 700; }
.empty-state span { font-size: 13px; line-height: 1.5; }
.empty-state.is-error-state { align-items: center; text-align: center; }
.retry-button { margin-top: 8px; }

.day-lead, .section-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 0 2px; color: var(--body-text); font-size: 13px; font-weight: 600; }
.day-lead strong { color: var(--green); font-size: 12px; }
.lesson-list, .week-lessons { overflow: hidden; background: var(--white); border: 1px solid var(--stroke); border-radius: 14px; box-shadow: var(--shadow); }

.lesson { display: grid; grid-template-columns: 42px 110px minmax(0, 1fr); gap: 16px; padding: 19px 20px; border-bottom: 1px solid var(--stroke); }
.lesson:last-child { border-bottom: 0; }
.lesson.is-changed { padding-left: 16px; background: var(--orange-soft); border-left: 4px solid var(--style); }
.lesson-number { color: var(--heading); font-size: 15px; font-weight: 700; line-height: 1.45; }
.lesson-time { padding-top: 1px; color: var(--body-text); font-size: 13px; line-height: 1.45; }
.lesson-main { min-width: 0; }
.lesson-main h3 { margin: 0 0 6px; color: var(--heading); font-size: 15px; font-weight: 700; line-height: 1.4; }
.lesson-parity { display: inline-block; margin-bottom: 5px; color: var(--style); font-size: 11px; font-weight: 600; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--body-text); font-size: 12px; line-height: 1.45; }
.lesson-meta span { color: var(--note); }
.change-note { display: grid; gap: 3px; margin-top: 12px; padding: 10px 12px; color: var(--body-text); background: rgba(255, 255, 255, .6); border-radius: 8px; font-size: 12px; line-height: 1.45; }
.change-note span { color: var(--style); font-size: 11px; font-weight: 700; }

/* Week, replacements and bells ----------------------------------------- */
.week-toolbar, .teacher-week-toolbar { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 12px; min-height: 64px; margin-bottom: 20px; padding: 7px 12px; color: var(--body-text); background: var(--white); border-radius: 14px; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; text-align: center; }
.arrow-button { display: grid; width: 36px; height: 36px; place-items: center; padding: 0; color: var(--main); background: var(--blue-soft); border: 0; border-radius: 10px; cursor: pointer; font-size: 18px; transition: color .2s ease, background-color .2s ease, transform .2s ease; }
.arrow-button:hover { color: var(--white); background: var(--main); }
.arrow-button:hover .ui-icon { transform: scale(1.08); }
.week-list { display: grid; gap: 16px; }
.week-day { overflow: hidden; background: var(--white); border: 1px solid var(--stroke); border-radius: 14px; box-shadow: var(--shadow); }
.week-day-head, .subheading { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; }
.week-day-head { padding: 18px 20px 15px; border-bottom: 1px solid var(--stroke); }
.week-day-head strong, .subheading h2, .subheading h3 { color: var(--heading); font-size: 17px; font-weight: 700; line-height: 1.35; }
.week-day-head span { display: block; margin-top: 3px; color: var(--note); font-size: 12px; }
.week-day-head em, .subheading span { color: var(--note); font-size: 12px; font-style: normal; white-space: nowrap; }
.week-day .lesson { grid-template-columns: 36px 100px minmax(0, 1fr); padding: 16px 20px; }
.no-classes { padding: 18px 20px; color: var(--note); font-size: 13px; }

.replacement-day, .bell-set, .settings-card, .teacher-detail, .teacher-toolbar { margin-top: 20px; background: var(--white); border-radius: 14px; box-shadow: var(--shadow); }
.replacement-day, .bell-set, .settings-card, .teacher-detail { overflow: hidden; }
.replacement-day { border-top: 3px solid var(--style); }
.bell-set { border-top: 3px solid var(--main); }
.replacement-day + .replacement-day, .bell-set + .bell-set { margin-top: 16px; }
.subheading { min-height: 58px; padding: 18px 20px 14px; border-bottom: 1px solid var(--stroke); }

.replacement-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 18px; padding: 19px 20px; border-bottom: 1px solid var(--stroke); }
.replacement-card:last-child { border-bottom: 0; }
.replacement-period { color: var(--style); font-size: 14px; font-weight: 700; }
.replacement-period small { display: block; margin-top: 5px; color: var(--note); font-size: 11px; font-weight: 400; }
.replacement-card h3 { margin: 0 0 6px; color: var(--heading); font-size: 15px; font-weight: 700; }
.replacement-card p { color: var(--body-text); font-size: 13px; line-height: 1.5; }
.bell-row { display: grid; grid-template-columns: 48px 1fr auto; align-items: baseline; gap: 13px; padding: 16px 20px; border-bottom: 1px solid var(--stroke); }
.bell-row:last-child { border-bottom: 0; }
.bell-row strong { color: var(--heading); font-size: 15px; font-weight: 700; }
.bell-row sup { font-size: 10px; }
.bell-row span { color: var(--body-text); font-size: 14px; }
.bell-row small { color: var(--note); font-size: 12px; }

/* Teachers and reviews -------------------------------------------------- */
.teacher-toolbar { padding: 24px 20px 20px; border-top: 3px solid var(--main); }
.teacher-toolbar > label { display: block; margin-bottom: 8px; color: var(--heading); font-size: 20px; font-weight: 700; }
.teacher-toolbar > span { display: block; margin: 0 0 18px; color: var(--body-text); font-size: 13px; }
.search-line { display: flex; align-items: center; gap: 10px; }
.search-line input { border: 1px solid var(--input); }
.search-glyph { display: grid; flex: 0 0 18px; width: 18px; height: 18px; place-items: center; color: var(--main); }
.search-glyph .ui-icon { width: 18px; height: 18px; }
.clear-button { display: none; color: var(--note); font-size: 22px; font-weight: 400; }
.clear-button.is-visible { display: block; }
.clear-button .ui-icon { width: 17px; height: 17px; }
.teacher-results { display: grid; margin-top: 16px; overflow: hidden; background: var(--white); border: 1px solid var(--stroke); border-radius: 14px; box-shadow: var(--shadow); }
.teacher-option, .group-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 15px 20px; color: var(--heading); text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--stroke); cursor: pointer; font-size: 14px; font-weight: 600; transition: color .2s ease, background-color .2s ease; }
.teacher-option:last-child { border-bottom: 0; }
.teacher-option:hover, .group-option:hover { color: var(--main); background: var(--blue-soft); }
.option-label { display: flex; align-items: center; gap: 10px; min-width: 0; }
.option-label .ui-icon { width: 17px; height: 17px; color: var(--main); }
.option-label > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.option-arrow { display: grid; place-items: center; color: var(--main); }
.option-arrow .ui-icon { width: 16px; height: 16px; }
.results-note { padding: 20px; color: var(--note); font-size: 13px; }
.teacher-detail { border-top: 3px solid var(--green); }
.teacher-detail-head { padding: 22px 20px 24px; border-bottom: 1px solid var(--stroke); }
.teacher-detail-head h2 { margin-top: 16px; color: var(--heading); font-size: clamp(24px, 4vw, 36px); font-weight: 700; letter-spacing: -.045em; line-height: 1.2; }
.detail-tabs { display: flex; gap: 24px; padding: 0 20px; border-bottom: 1px solid var(--stroke); }
.detail-tab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 15px 0 13px; color: var(--note); background: transparent; border: 0; cursor: pointer; font-size: 14px; font-weight: 600; }
.detail-tab .ui-icon { width: 16px; height: 16px; }
.detail-tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; content: ""; background: var(--main); transform: scaleX(0); transition: transform .25s ease; }
.detail-tab.is-active { color: var(--main); }
.detail-tab.is-active::after { transform: scaleX(1); }
.teacher-panel { padding: 0 20px 20px; }
.teacher-week-toolbar { margin: 20px -8px 7px; box-shadow: none; border: 1px solid var(--stroke); }
.teacher-day { border-bottom: 1px solid var(--stroke); }
.teacher-day .subheading { padding: 16px 0 12px; }
.teacher-day .lesson { grid-template-columns: 36px 100px minmax(0, 1fr); padding: 15px 0; }
.review-summary { display: flex; align-items: baseline; gap: 12px; padding: 22px 0 17px; border-bottom: 1px solid var(--stroke); }
.review-summary strong { color: var(--heading); font-size: 28px; font-weight: 700; }
.review-summary strong small { color: var(--style); font-size: 18px; }
.review-summary span { color: var(--note); font-size: 12px; }
.review-list { display: grid; }
.review-card { position: relative; padding: 18px 0 19px 28px; border-bottom: 1px solid var(--stroke); }
.review-card::before { position: absolute; top: 12px; left: 0; content: "“"; color: var(--main); font-size: 32px; font-weight: 700; line-height: 1; }
.review-card-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: var(--style); font-size: 13px; }
.review-card-top small { color: var(--note); font-size: 11px; }
.review-card p { color: var(--body-text); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.review-form { display: grid; gap: 16px; margin-top: 20px; padding: 20px; background: var(--blue-soft); border-radius: 12px; }
.form-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.form-heading h3 { color: var(--heading); font-size: 17px; font-weight: 700; }
.form-heading span { color: var(--body-text); font-size: 11px; }
.review-form textarea { min-height: 105px; padding: 14px 16px; resize: vertical; font-size: 13px; line-height: 1.5; }
.rating-row { display: flex; align-items: center; gap: 10px; color: var(--body-text); font-size: 12px; font-weight: 600; }
.rating-button { padding: 0 2px; color: var(--icon); background: transparent; border: 0; cursor: pointer; font-size: 20px; transition: color .2s ease, transform .2s ease; }
.rating-button:hover, .rating-button.is-active { color: var(--style); transform: translateY(-1px); }
.privacy-note { margin: 0; color: var(--body-text); font-size: 11px; line-height: 1.45; }

/* Settings -------------------------------------------------------------- */
.settings-content { margin-top: 20px; }
.settings-card { padding: 0 20px 20px; border-top: 3px solid var(--main); }
.profile-line { display: flex; align-items: center; gap: 14px; padding: 22px 0; border-bottom: 1px solid var(--stroke); }
.profile-mark { display: grid; flex: 0 0 44px; width: 44px; height: 44px; place-items: center; color: var(--white); background: var(--main); border-radius: 50%; font-size: 18px; font-weight: 700; }
.profile-line strong, .profile-line small { display: block; }
.profile-line strong { color: var(--heading); font-size: 17px; font-weight: 700; }
.profile-line small { margin-top: 3px; color: var(--note); font-size: 12px; overflow-wrap: anywhere; }
.settings-section { padding-top: 22px; }
.section-note { display: block; padding: 0 0 8px; color: var(--note); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.claim-form { display: grid; gap: 16px; padding-top: 5px; }
.claim-form > p { color: var(--body-text); font-size: 13px; line-height: 1.5; }
.setting-row, .setting-link { display: flex; align-items: center; justify-content: space-between; gap: 15px; width: 100%; padding: 16px 0; color: var(--heading); text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--stroke); }
.setting-row span, .setting-link span { min-width: 0; }
.setting-leading { display: grid; flex: 0 0 22px; place-items: center; color: var(--main); }
.setting-leading .ui-icon { width: 18px; height: 18px; }
.setting-copy { flex: 1; min-width: 0; }
.setting-row strong, .setting-row small, .setting-link strong, .setting-link small { display: block; }
.setting-row strong, .setting-link strong { font-size: 14px; font-weight: 600; }
.setting-row small, .setting-link small { margin-top: 4px; color: var(--note); font-size: 12px; line-height: 1.4; }
.setting-link { cursor: pointer; }
.setting-link:hover strong { color: var(--main); }
.setting-arrow { display: grid; flex: 0 0 18px; place-items: center; color: var(--main); }
.setting-arrow .ui-icon { width: 16px; height: 16px; }
.setting-state { flex: 0 0 auto; padding: 5px 8px; color: var(--main); border: 1px solid currentColor; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.setting-link-static { cursor: default; }
.setting-link-static:hover strong { color: inherit; }
.setting-row { position: relative; cursor: pointer; }
.setting-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle { position: relative; flex: 0 0 38px; width: 38px; height: 22px; background: var(--input); border-radius: 20px; transition: background-color .2s ease; }
.toggle::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; content: ""; background: var(--white); border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); transition: left .2s ease; }
.setting-row input:checked + .toggle { background: var(--main); }
.setting-row input:checked + .toggle::after { left: 19px; }
.site-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 35px; padding-top: 17px; color: var(--note); border-top: 1px solid var(--stroke); font-size: 11px; }

/* Group picker and feedback -------------------------------------------- */
.drawer-backdrop { position: fixed; z-index: 70; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(17, 17, 17, .36); }
.group-drawer { width: min(100%, 600px); max-height: min(82vh, 700px); padding: 30px; overflow: auto; color: var(--body-text); background: var(--white); border-radius: 20px; box-shadow: 0 18px 55px rgba(20, 25, 38, .18); animation: drawer-in .25s ease both; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; }
.drawer-head h2 { color: var(--heading); font-size: 24px; font-weight: 700; }
.close-button { display: grid; width: 36px; height: 36px; place-items: center; padding: 0; color: var(--note); background: transparent; border: 0; border-radius: 50%; cursor: pointer; font-size: 0; transition: color .2s ease, background-color .2s ease; }
.close-button:hover { color: var(--heading); }
.close-button:hover { background: var(--hover); }
.close-button .ui-icon { width: 18px; height: 18px; }
.drawer-search { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.drawer-search input { border: 1px solid var(--input); }
.group-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--stroke); border-radius: 12px; }
.group-option { border-radius: 0; }
.group-option:nth-child(odd) { border-right: 1px solid var(--stroke); }
.group-option:last-child, .group-option:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.group-results .empty-state { grid-column: 1 / -1; box-shadow: none; border-radius: 0; }
.global-loader { position: fixed; top: 0; right: 0; left: 0; z-index: 90; height: 3px; background: var(--main); animation: loader 1s infinite; }
.toast { position: fixed; right: 20px; bottom: 20px; left: 20px; z-index: 100; width: min(410px, calc(100% - 40px)); margin: auto; padding: 13px 15px; color: var(--white); background: var(--heading); border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .25s ease, transform .25s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes drawer-in { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes loader-dot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes skeleton-sweep { to { transform: translateX(105%); } }
@keyframes loader-sweep { from { transform: translateX(-120%); } to { transform: translateX(300%); } }
@keyframes loader { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }

@media (max-width: 900px) {
  .app-layout { width: min(100% - 30px, 760px); padding: 15px 0 28px; }
  .sidebar { width: min(360px, calc(100vw - 24px)); padding: 24px 18px 20px; }
  .mobile-header { margin-bottom: 20px; }
  .mobile-group { max-width: 190px; }
  .main-nav { display: grid; gap: 6px; }
  .main-content { padding-top: 0; }
  .view-intro { min-height: 50px; margin-bottom: 16px; }
  .view-intro h1 { font-size: 28px; }
  .site-footer { margin-top: 28px; }
}

@media (max-width: 620px) {
  .auth-screen { align-items: flex-start; padding: 30px 15px; }
  .auth-layout { margin-top: 10vh; gap: 22px; }
  .auth-card { padding: 24px 20px; border-radius: 16px; }
  .auth-tabs { gap: 18px; }
  .group-drawer { align-self: end; max-height: 84vh; padding: 24px 18px; border-radius: 16px 16px 0 0; }
  .group-results { grid-template-columns: 1fr; }
  .group-option:nth-child(odd) { border-right: 0; }
  .group-option:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--stroke); }
  .lesson, .week-day .lesson, .teacher-day .lesson { grid-template-columns: 30px 78px minmax(0, 1fr); gap: 9px; padding: 16px 14px; }
  .lesson.is-changed { padding-left: 10px; }
  .lesson-time, .lesson-meta, .replacement-card p, .bell-row span { font-size: 12px; }
  .lesson-main h3 { font-size: 14px; }
  .week-day .lesson, .teacher-day .lesson { padding-right: 0; padding-left: 0; }
  .week-day-head, .subheading { padding-right: 14px; padding-left: 14px; }
  .replacement-card { grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding-right: 14px; padding-left: 14px; }
  .bell-row { grid-template-columns: 40px 1fr; padding-right: 14px; padding-left: 14px; }
  .bell-row small { grid-column: 2; }
  .teacher-toolbar, .settings-card, .teacher-detail { border-radius: 12px; }
  .teacher-toolbar { padding-right: 14px; padding-left: 14px; }
  .teacher-panel { padding-right: 14px; padding-left: 14px; }
  .teacher-week-toolbar { margin-right: -2px; margin-left: -2px; }
  .form-heading { display: block; }
  .form-heading span { display: block; margin-top: 4px; }
}

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