/* Мини-приложение «Расписание ПГУ» */
:root {
  --bg: var(--tg-theme-bg-color, #f4f6fb);
  --bg-soft: var(--tg-theme-secondary-bg-color, #ffffff);
  --card: var(--tg-theme-secondary-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #101828);
  --hint: var(--tg-theme-hint-color, #7c8698);
  --link: var(--tg-theme-link-color, #2f7cf6);
  --accent: var(--tg-theme-button-color, #3b7cff);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --line: rgba(16, 24, 40, 0.08);
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.09);
  --shadow-soft: 0 4px 14px rgba(16, 24, 40, 0.06);
  --radius: 22px;
  --ok: #17b26a;
  --ok-soft: rgba(23, 178, 106, 0.13);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.13);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior: none; }
.hidden { display: none !important; }

.app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  background:
    radial-gradient(120% 46% at 50% -10%, rgba(79, 140, 255, 0.14), transparent 70%),
    var(--bg);
}

/* ---------------- top bar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}
@supports not (background: color-mix(in srgb, white 82%, transparent)) {
  .topbar { background: var(--bg); }
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.4px;
  color: #fff;
  background: linear-gradient(135deg, #4f8cff, #7b5cff 90%);
  box-shadow: 0 8px 20px rgba(79, 140, 255, 0.34);
  flex: none;
}

.logo.big {
  width: 84px;
  height: 84px;
  border-radius: 26px;
  font-size: 25px;
  margin: 0 auto 14px;
  box-shadow: 0 16px 40px rgba(79, 140, 255, 0.38);
}

.brand-title { font-size: 16px; font-weight: 800; line-height: 1.1; letter-spacing: -0.2px; }

.group-chip {
  margin-top: 4px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--link);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 60vw;
}
.group-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, opacity 0.2s;
  font-family: inherit;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn.spinning svg { animation: spin 0.9s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- layout ---------------- */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 2px 16px calc(96px + env(safe-area-inset-bottom));
  scroll-behavior: smooth;
}

.view { animation: fade-up 0.28s ease; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.section-title { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; margin: 14px 2px 4px; }
.section-sub { color: var(--hint); font-size: 14px; margin: 0 2px 16px; }
.muted { color: var(--hint); font-size: 14px; line-height: 1.55; }

/* ---------------- loader / fatal ---------------- */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 90px 20px;
  color: var(--hint);
  font-size: 14px;
}
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
.fatal { text-align: center; padding: 56px 22px; }
.fatal-emoji { font-size: 52px; margin-bottom: 8px; }
.fatal h2 { margin: 0 0 8px; font-size: 22px; }
.fatal p { color: var(--hint); font-size: 15px; line-height: 1.5; margin-bottom: 22px; }

/* ---------------- segmented ---------------- */
.segmented {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 4px;
  margin: 8px 0 14px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.seg {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--hint);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  padding: 10px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.seg.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.1);
}

/* ---------------- hero ---------------- */
.hero {
  position: relative;
  border-radius: 26px;
  padding: 20px;
  margin-bottom: 16px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(140deg, #4f8cff 0%, #6a5cff 55%, #8a4dff 100%);
  box-shadow: 0 16px 36px rgba(79, 108, 255, 0.32);
}
.hero::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -70px;
  top: -90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}
.hero::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: 40px;
  bottom: -80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}
.hero-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  z-index: 1;
}
.hero-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; opacity: 0.82; }
.hero-date { font-size: 23px; font-weight: 800; letter-spacing: -0.3px; margin-top: 3px; line-height: 1.15; }
.hero-week {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 10px;
}
.hero-week .dot { background: #fff; }

.hero-pill {
  flex: none;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  white-space: nowrap;
  z-index: 1;
}

.now-box {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  padding: 14px 15px;
  border-radius: 18px;
  background: rgba(9, 16, 40, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.now-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  opacity: 0.9;
}
.now-label .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7dffb2;
  box-shadow: 0 0 0 0 rgba(125, 255, 178, 0.8);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(125, 255, 178, 0.7); }
  70% { box-shadow: 0 0 0 9px rgba(125, 255, 178, 0); }
  100% { box-shadow: 0 0 0 0 rgba(125, 255, 178, 0); }
}
.now-subject { font-size: 16px; font-weight: 700; line-height: 1.35; margin-top: 5px; }
.now-meta { font-size: 12.5px; font-weight: 600; opacity: 0.88; margin-top: 6px; }
.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  margin-top: 10px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a6ffcc, #ffffff);
  transition: width 0.6s ease;
}
.hero-empty { font-size: 14px; font-weight: 600; opacity: 0.92; margin-top: 6px; }

/* ---------------- week controls ---------------- */
.week-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 12px;
}
.week-range { font-size: 14px; font-weight: 700; color: var(--hint); }
.week-arrow {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.week-arrow:active { transform: scale(0.95); }

.week-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
}
.week-strip::-webkit-scrollbar { display: none; }
.day-pill {
  flex: none;
  min-width: 46px;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  color: var(--hint);
  font-family: inherit;
  padding: 9px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: all 0.18s ease;
}
.day-pill span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.day-pill b { font-size: 16px; font-weight: 800; color: var(--text); }
.day-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
}
.day-pill.has-classes i { opacity: 1; }
.day-pill.active {
  background: var(--accent);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 38%, transparent);
}
.day-pill.active span, .day-pill.active b { color: var(--accent-text); }
.day-pill.active i { background: var(--accent-text); }

/* ---------------- lessons ---------------- */
.schedule { display: flex; flex-direction: column; gap: 10px; }

.lesson-card {
  display: flex;
  gap: 13px;
  background: var(--card);
  border-radius: 20px;
  padding: 14px 15px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.lesson-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: transparent;
}
.lesson-card.current {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 18%, transparent);
}
.lesson-card.current::before { background: var(--accent); }
.lesson-card.past { opacity: 0.55; }

.lesson-left {
  flex: none;
  width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-top: 1px;
}
.pair-num {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
@supports not (background: color-mix(in srgb, red 12%, transparent)) {
  .pair-num { background: rgba(47, 124, 246, 0.12); }
}
.lesson-card.current .pair-num { background: var(--accent); color: var(--accent-text); }
.lesson-time { font-size: 10.5px; color: var(--hint); font-weight: 700; line-height: 1.35; text-align: center; }
.lesson-time b { display: block; color: var(--text); font-size: 11.5px; }

.lesson-main { flex: 1; min-width: 0; }
.lesson-title { font-size: 15px; font-weight: 650; line-height: 1.38; word-wrap: break-word; }
.lesson-sub { font-size: 12.5px; color: var(--hint); margin-top: 3px; line-height: 1.4; }
.lesson-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--hint);
}
.tag.room { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .tag.room { background: rgba(47, 124, 246, 0.1); }
}
.tag.now { color: #fff; background: var(--accent); }
.tag.done { color: var(--ok); background: var(--ok-soft); }

.lesson-progress {
  margin-top: 9px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.lesson-progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* ---------------- dated ---------------- */
.dated-group { margin-bottom: 10px; }
.dated-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--warn);
  margin: 6px 3px 7px;
}
.dated-item {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 16px;
  background: var(--warn-soft);
  margin-bottom: 7px;
  font-size: 14px;
  line-height: 1.45;
}
.dated-item .d-time { flex: none; font-weight: 800; color: var(--warn); font-size: 11.5px; padding-top: 2px; min-width: 44px; }
.dated-item .tag { margin-top: 5px; }

.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--hint);
  background: var(--card);
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}
.empty .emoji { font-size: 42px; margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 17px; }
.empty p { margin: 0; font-size: 14px; line-height: 1.5; }

/* ---------------- changes ---------------- */
.change-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
}
.change-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.change-date { font-size: 12px; color: var(--hint); font-weight: 600; }
.change-kind {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 4px 8px;
  border-radius: 7px;
}
.change-item { padding: 9px 0; border-top: 1px dashed var(--line); }
.change-item:first-of-type { border-top: 0; }
.change-item-head { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.change-line { font-size: 13px; line-height: 1.5; display: flex; gap: 8px; }
.change-line .mark { flex: none; font-weight: 800; }
.change-line.added { color: var(--ok); }
.change-line.removed { color: var(--danger); }

/* ---------------- cards / settings ---------------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
}
.card-title { margin: 0 0 12px; font-size: 15px; font-weight: 800; }

.row { display: flex; align-items: center; gap: 13px; }
.row + .row { margin-top: 14px; }
.row.sub-row { padding-top: 14px; border-top: 1px solid var(--line); }
.row-ico {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--bg);
  flex: none;
}
.row-body { flex: 1; min-width: 0; }
.row-label { font-size: 14px; font-weight: 700; }
.row-value { font-size: 12.5px; color: var(--hint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }

.btn {
  border: 0;
  border-radius: 13px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: var(--bg);
  color: var(--text);
  transition: transform 0.15s, opacity 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 32%, transparent); }
.btn.ghost { background: var(--bg); color: var(--link); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.small { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn-row .btn { flex: 1; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line);
  transition: 0.25s;
  cursor: pointer;
}
.slider::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: 0.25s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.time-input {
  border: 0;
  background: var(--bg);
  color: var(--text);
  border-radius: 11px;
  padding: 9px 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
}

.link-card { margin-top: 4px; }
.app-foot { text-align: center; color: var(--hint); font-size: 12px; padding: 18px 0 8px; }

/* ---------------- admin ---------------- */
.admin-card { border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); }
.card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--bg); border-radius: 14px; padding: 10px 12px; }
.stat b { display: block; font-size: 19px; font-weight: 800; }
.stat span { font-size: 11px; color: var(--hint); font-weight: 600; }
.broadcast { margin-top: 12px; }
.broadcast summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--link); padding: 6px 0; }
.broadcast textarea {
  width: 100%;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}
.broadcast .btn { width: 100%; }

/* ---------------- about ---------------- */
.about-hero { text-align: center; padding: 18px 8px 20px; }
.about-hero h1 { margin: 0 0 8px; font-size: 26px; font-weight: 800; letter-spacing: -0.4px; }
.about-hero p { color: var(--hint); font-size: 14px; line-height: 1.55; margin: 0 auto 12px; max-width: 340px; }
.version-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 5px 11px;
  border-radius: 999px;
}
.feature-list { list-style: none; margin: 0; padding: 0; }
.feature-list li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  font-size: 14px;
  border-bottom: 1px dashed var(--line);
}
.feature-list li:last-child { border-bottom: 0; }
.feature-list li span { font-size: 17px; width: 24px; text-align: center; }

/* ---------------- tabbar ---------------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 680px;
  display: flex;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  z-index: 20;
}
@supports not (background: color-mix(in srgb, white 86%, transparent)) {
  .tabbar { background: var(--card); }
}
.tab {
  flex: 1;
  border: 0;
  background: none;
  color: var(--hint);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.2s;
}
.tab-ico { font-size: 20px; filter: grayscale(0.55); opacity: 0.68; transition: all 0.2s; }
.tab.active { color: var(--accent); }
.tab.active .tab-ico { filter: none; opacity: 1; transform: translateY(-1px); }

/* ---------------- modal sheet ---------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 12, 20, 0.45);
  backdrop-filter: blur(3px);
  z-index: 40;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 680px;
  max-height: 86vh;
  max-height: 86dvh;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -18px 50px rgba(9, 12, 20, 0.3);
  animation: sheet-up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes sheet-up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }

.sheet-handle { width: 42px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 800; }

.search {
  width: 100%;
  border: 0;
  background: var(--card);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 15px;
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.search::placeholder { color: var(--hint); }

.faculty-chips, .course-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}
.faculty-chips::-webkit-scrollbar, .course-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  background: var(--card);
  color: var(--hint);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--line);
}
.chip.active { background: var(--accent); color: var(--accent-text); box-shadow: none; }

.group-list { overflow-y: auto; flex: 1; padding: 2px 0 8px; }
.group-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  padding: 13px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.group-code { font-size: 15px; font-weight: 700; }
.group-meta { font-size: 11.5px; color: var(--hint); margin-top: 2px; }
.group-row.active .group-code { color: var(--accent); }
.group-check { color: var(--accent); font-weight: 800; }

/* ---------------- toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(94px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(16, 24, 40, 0.92);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 13px;
  z-index: 60;
  max-width: 84vw;
  text-align: center;
  animation: fade-in 0.2s ease;
  pointer-events: none;
}

/* ---------------- dark scheme tweaks ---------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --line: rgba(255, 255, 255, 0.09);
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.28);
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--line) 25%, transparent 37%, var(--line) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: 10px;
  height: 14px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (min-width: 560px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
