:root {
  --app-bg: #f4f0e8;
  --app-surface: rgba(255, 255, 255, 0.95);
  --app-text: #1f2937;
  --app-muted: #64748b;
  --app-green: #16803c;
  --app-green-dark: #106530;
  --app-green-soft: rgba(22, 128, 60, 0.08);
  --app-border: rgba(22, 128, 60, 0.14);
  --app-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --z-footer: 5;
  --z-hero-content: 10;
  --z-search: 30;
  --z-header: 40;
  --z-dropdown: 60;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--app-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

main:focus {
  outline: none;
}

.bg-app {
  background:
    radial-gradient(circle at top right, rgba(22, 128, 60, 0.08), transparent 36rem),
    var(--app-bg);
}

.app-header {
  z-index: var(--z-header);
  background: rgba(244, 240, 232, 0.92);
  backdrop-filter: blur(12px);
}

.app-header .navbar {
  min-height: 62px;
}

.brand-avatar {
  width: 38px;
  height: 38px;
  object-fit: cover;
}

.footer-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 0.85rem;
  box-shadow: 0 0 0 1px rgba(22, 128, 60, 0.12);
}

.app-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: rgba(31, 41, 55, 0.86);
  background: rgba(244, 240, 232, 0.58);
  border-top: 1px solid rgba(22, 128, 60, 0.12);
  border-radius: 1.1rem 1.1rem 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 -0.75rem 2.25rem rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
  padding-block: 0.85rem !important;
}

.app-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.app-footer a {
  color: var(--app-green-dark);
  font-weight: 800;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.app-footer .container-xl {
  position: relative;
  z-index: 1;
}

.footer-heart {
  display: inline-block;
  color: #be123c;
  font-size: 0.85em;
  font-weight: 900;
  animation: heartPulse 1.8s ease-in-out infinite;
}

@keyframes heartPulse {
  0%,
  100% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.12);
  }
}

.navbar-brand {
  font-size: 1.12rem;
}

.datalab-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-fluid {
  min-height: calc(100svh - 62px);
  display: flex;
  flex-direction: column;
  isolation: isolate;
  margin-top: 0;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-image {
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 82% center;
}

.hero-shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(244, 240, 232, 0.995) 0%, rgba(244, 240, 232, 0.97) 36%, rgba(244, 240, 232, 0.78) 52%, rgba(244, 240, 232, 0.32) 72%, rgba(244, 240, 232, 0.06) 100%),
    linear-gradient(180deg, rgba(244,240,232,.06) 0%, rgba(244,240,232,.26) 100%);
}

.min-vh-hero {
  min-height: auto;
}

.hero-content {
  position: relative;
  z-index: var(--z-hero-content);
  flex: 1 0 auto;
  display: flex;
}

.hero-content > .row {
  flex: 1 0 auto;
  width: 100%;
}

.hero-fluid > .app-footer {
  position: relative;
  z-index: var(--z-footer);
  flex: 0 0 auto;
  margin: 0 clamp(0.75rem, 2vw, 1.5rem);
}

.hero-copy {
  max-width: 44rem;
  padding-block: clamp(1.5rem, 4vh, 3.25rem);
}

.hero-eyebrow {
  letter-spacing: 0.08em;
}

.hero-dot,
.tiny-dot {
  display: inline-block;
  border-radius: 50%;
  background: var(--app-green);
}

.hero-dot {
  width: 0.65rem;
  height: 0.65rem;
  box-shadow: 0 0 0 0.35rem rgba(22, 128, 60, 0.12);
}

.tiny-dot {
  width: 0.45rem;
  height: 0.45rem;
  flex: 0 0 auto;
}

.fw-black {
  font-weight: 900;
}

.hero-title {
  max-width: 39rem;
  font-size: clamp(2.35rem, 4.45vw, 4.8rem);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.hero-title-where {
  position: relative;
  display: inline-block;
}

.hero-lead {
  max-width: 34rem;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.55;
}

.fun-stamp {
  display: inline-block;
  color: var(--app-green-dark);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(22, 128, 60, 0.22);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: clamp(1rem, 1.65vw, 1.3rem);
  font-weight: 900;
  line-height: 1;
  transform: rotate(-2deg);
  box-shadow: 0 0.35rem 0.9rem rgba(22, 128, 60, 0.08);
}

.hero-title-stamp {
  position: absolute;
  top: -0.42em;
  left: calc(100% + 0.12em);
  z-index: 1;
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
  transform: rotate(-3deg);
}

.search-card {
  position: relative;
  z-index: var(--z-search);
  width: min(100%, 48rem);
  background: var(--app-surface);
  backdrop-filter: blur(16px);
}

.card,
.search-card {
  box-shadow: var(--app-shadow) !important;
}

.search-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9.5rem, 0.28fr);
  gap: 0.95rem;
  align-items: end;
}

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

.form-label {
  color: var(--app-text);
  font-size: 0.9rem;
}

.btn-search {
  width: 100%;
  min-height: 4.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  letter-spacing: -0.01em;
}

.btn-search-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.search-helper {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 0.85rem;
}

.hero-hint {
  text-shadow: 0 1px 2px rgba(255,255,255,.8);
}

.results-shell {
  background:
    linear-gradient(180deg, rgba(244,240,232,0.96), rgba(244,240,232,1)),
    var(--app-bg);
}

.results-shell[hidden] {
  display: none !important;
}

.tracking {
  letter-spacing: 0.08em;
}

.result-card,
.summary-card,
.privacy-note {
  background: var(--app-surface);
}

.result-card {
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
}

.result-card:focus {
  outline: 3px solid rgba(22, 128, 60, 0.22);
  outline-offset: 3px;
}

.result-card-current {
  border-color: rgba(22, 128, 60, 0.28) !important;
}

.result-card-upcoming {
  border-color: rgba(245, 158, 11, 0.36) !important;
}

.result-card-future {
  border-color: rgba(59, 130, 246, 0.32) !important;
}

.result-card-empty {
  border-color: rgba(100, 116, 139, 0.28) !important;
}

.result-card .card-body {
  background:
    radial-gradient(circle at top right, rgba(22, 128, 60, 0.065), transparent 16rem),
    rgba(255, 255, 255, 0.72);
}

.result-title {
  max-width: 44rem;
  font-size: clamp(1.7rem, 2.45vw, 2.65rem);
  letter-spacing: -0.025em;
}

.status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--app-green);
  box-shadow: 0 0 0 0.35rem rgba(22, 128, 60, 0.12);
}

.result-card-upcoming .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 0.35rem rgba(245, 158, 11, 0.15);
}

.result-card-future .status-dot {
  background: #2563eb;
  box-shadow: 0 0 0 0.35rem rgba(37, 99, 235, 0.13);
}

.result-card-empty .status-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 0.35rem rgba(148, 163, 184, 0.16);
}

.result-card-upcoming #resultKicker,
.result-card-upcoming #resultModeBadge {
  color: #92400e !important;
}

.result-card-upcoming #resultModeBadge {
  background-color: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.22) !important;
}

.result-card-future #resultKicker,
.result-card-future #resultModeBadge {
  color: #1d4ed8 !important;
}

.result-card-future #resultModeBadge {
  background-color: rgba(37, 99, 235, 0.12) !important;
  border-color: rgba(37, 99, 235, 0.18) !important;
}

.result-card-empty #resultKicker,
.result-card-empty #resultModeBadge {
  color: #475569 !important;
}

.result-card-empty #resultModeBadge {
  background-color: rgba(100, 116, 139, 0.13) !important;
  border-color: rgba(100, 116, 139, 0.18) !important;
}

.result-subtitle:empty {
  display: none;
}

.result-card-upcoming .result-subtitle,
.result-card-empty .result-subtitle {
  display: inline-flex;
  max-width: 42rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(100, 116, 139, 0.14);
  border-left: 0.28rem solid rgba(100, 116, 139, 0.42);
  border-radius: 0.85rem;
  color: #475569 !important;
  background: rgba(248, 250, 252, 0.72);
  font-weight: 650 !important;
  line-height: 1.4;
}

.teacher-current {
  width: min(100%, 32rem);
  max-width: 100%;
  min-height: 7rem;
  background: var(--app-green-soft);
  border: 1px solid var(--app-border);
}

.teacher-current img {
  width: 88px;
  height: 104px;
  object-fit: cover;
  object-position: center 22%;
  background: rgba(255, 255, 255, 0.74);
}

.professor-detail-lines {
  gap: 0.08rem;
}

.professor-detail-lines span:last-child {
  color: #475569;
}

.metadata-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.room-box {
  width: min(100%, 280px);
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.25rem;
  margin-inline: auto;
  border-radius: 1.35rem;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent),
    linear-gradient(180deg, #1c8b45 0%, #116530 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 1rem 2rem rgba(22, 128, 60, 0.16);
}

.result-card-upcoming .room-box {
  background:
    linear-gradient(180deg, rgba(255,255,255,.1), transparent),
    linear-gradient(180deg, #d97706 0%, #92400e 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 1rem 2rem rgba(245, 158, 11, 0.14);
}

.result-card-future .room-box {
  background:
    linear-gradient(180deg, rgba(255,255,255,.1), transparent),
    linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 1rem 2rem rgba(37, 99, 235, 0.14);
}

.result-card-empty .room-box {
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent),
    linear-gradient(180deg, #64748b 0%, #475569 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 1rem 2rem rgba(100, 116, 139, 0.12);
}

.room-type {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  opacity: 0.9;
}

.room-code {
  display: block;
  font-size: clamp(2.5rem, 4vw, 3.8rem);
  line-height: 1;
  font-weight: 900;
}

.summary-card p {
  font-size: 1rem;
}

.summary-next {
  background: linear-gradient(180deg, rgba(22, 128, 60, 0.06), rgba(255, 255, 255, 0.94));
}

.summary-next.summary-muted {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none !important;
  opacity: 0.74;
}

.summary-week {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.06), rgba(255, 255, 255, 0.92));
}

.summary-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.next-event-grid {
  display: grid;
  gap: 0.18rem;
}

.next-event-day {
  width: fit-content;
  color: var(--app-green-dark);
  background: var(--app-green-soft);
  border-radius: 999px;
  padding: 0.16rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.next-event-grid strong {
  color: var(--app-text);
  font-size: 1rem;
  line-height: 1.25;
}

.next-event-grid span:last-child {
  color: var(--app-muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.week-list li {
  display: grid;
  grid-template-columns: 5.8rem 6rem minmax(7rem, 0.7fr) minmax(0, 1.3fr);
  gap: 0.7rem;
  align-items: center;
  padding: 0.42rem 0;
  border-top: 1px dashed rgba(148, 163, 184, 0.38);
  font-size: 0.92rem;
}

.week-list li:first-child {
  border-top: 0;
}

.week-list em {
  color: var(--app-text);
  font-style: normal;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-chip {
  width: fit-content;
  max-width: 100%;
  border: 0;
  color: var(--app-green-dark);
  background: var(--app-green-soft);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  line-height: 1.15;
}

.course-chip:hover,
.course-chip:focus {
  background: rgba(22, 128, 60, 0.14);
  outline: none;
}

.privacy-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
}

.about-page {
  min-height: calc(100vh - 62px);
  background:
    linear-gradient(180deg, rgba(244,240,232,0.98), rgba(244,240,232,1)),
    var(--app-bg);
}

.about-wrap {
  max-width: 48rem;
  padding-block: clamp(1.25rem, 5vh, 4rem);
}

.about-wrap h1 {
  max-width: 42rem;
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.035em;
}

.about-content {
  max-width: 42rem;
  color: var(--app-text);
  font-size: 1.04rem;
  line-height: 1.7;
}

/* Tom Select: stable and readable selected states */
.ts-wrapper .ts-control,
.ts-wrapper.single .ts-control {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  border-radius: 1rem;
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: none;
  padding: 0.55rem 0.72rem;
  background: #fff;
}

.ts-wrapper.single .ts-control .item {
  width: 100%;
}

.ts-control > input {
  min-width: 7rem !important;
  line-height: 1.2;
}

.ts-wrapper.focus .ts-control {
  border-color: rgba(22, 128, 60, 0.5);
  box-shadow: 0 0 0 0.22rem rgba(22, 128, 60, 0.12);
}

.ts-dropdown {
  overflow: hidden;
  border-radius: 1rem;
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 1.35rem 2.5rem rgba(15, 23, 42, 0.14);
}

.teacher-option,
.day-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.teacher-photo,
.teacher-photo-sm {
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 50%;
}

.teacher-photo {
  width: 42px;
  height: 42px;
}

.teacher-photo-sm {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(22, 128, 60, 0.12);
}

.teacher-copy,
.teacher-item-copy,
.day-item-copy {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.teacher-copy strong,
.day-option strong,
.teacher-item-copy strong,
.day-item-copy strong {
  display: block;
  color: var(--app-text);
  font-size: 0.92rem;
  line-height: 1.12;
}

.teacher-copy span,
.day-option span,
.teacher-item-copy span,
.day-item-copy span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.15;
  white-space: nowrap;
}

.teacher-item,
.day-item {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.62rem;
}

.teacher-item-copy span,
.day-item-copy span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
  max-width: 100%;
}

.teacher-tags em {
  display: inline-flex;
  max-width: min(100%, 16rem);
  color: var(--app-green-dark);
  background: var(--app-green-soft);
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-badge {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--app-green-dark);
  background: var(--app-green-soft);
  border-radius: 0.9rem;
  font-weight: 800;
}

.min-w-0 {
  min-width: 0;
}

.result-reveal {
  animation: resultReveal 0.45s ease-out;
}

@keyframes resultReveal {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 1200px) and (max-height: 850px) {
  .hero-title {
    font-size: clamp(2.35rem, 4.2vw, 4.4rem);
  }

  .hero-copy {
    padding-block: 1.8rem;
  }

  .hero-lead {
    font-size: 1rem;
  }

  .search-card {
    width: min(100%, 48rem);
  }

  .room-box {
    min-height: 140px;
  }
}

@media (max-height: 850px) and (min-width: 992px) {
  .app-header .navbar {
    min-height: 54px;
    padding-block: 0.28rem !important;
  }

  .brand-avatar {
    width: 34px;
    height: 34px;
  }

  .navbar-brand {
    font-size: 1.04rem;
  }

  .hero-fluid {
    min-height: calc(100svh - 54px);
  }

  .hero-image {
    object-position: 86% center;
  }

  .hero-copy {
    max-width: 41rem;
    padding-block: clamp(0.8rem, 2.4vh, 1.6rem);
  }

  .hero-eyebrow {
    margin-bottom: 0.55rem !important;
    font-size: 0.72rem;
  }

  .hero-dot {
    width: 0.5rem;
    height: 0.5rem;
    box-shadow: 0 0 0 0.26rem rgba(22, 128, 60, 0.12);
  }

  .hero-title {
    max-width: 34rem;
    margin-bottom: 0.65rem !important;
    font-size: clamp(2rem, 3.8vw, 3.75rem);
  }

  .fun-stamp {
    padding: 0.28rem 0.7rem;
    font-size: 1rem;
  }

  .hero-title-stamp {
    top: -0.45em;
    left: calc(100% + 0.08em);
    font-size: 0.95rem;
  }

  .hero-lead {
    max-width: 31rem;
    margin-bottom: 1rem !important;
    font-size: 0.98rem;
    line-height: 1.42;
  }

  .search-card {
    width: min(100%, 43rem);
  }

  .search-card .card-body {
    padding: 1rem !important;
  }

  .search-helper {
    margin-top: 0.7rem !important;
    padding-top: 0.65rem;
    line-height: 1.35;
  }

  .btn-search,
  .ts-wrapper .ts-control,
  .ts-wrapper.single .ts-control {
    height: 3.65rem;
    min-height: 3.65rem;
    max-height: 3.65rem;
  }

  .teacher-item,
  .day-item {
    height: 2.65rem;
    max-height: 2.65rem;
  }

  .hero-hint {
    display: none !important;
  }

  .app-footer {
    margin-inline: clamp(0.75rem, 1.5vw, 1.25rem);
    padding-block: 0.62rem !important;
  }

  .footer-logo {
    width: 28px;
    height: 28px;
  }
}

@media (max-height: 760px) and (min-width: 992px) {
  .app-header .navbar {
    min-height: 50px;
    padding-block: 0.2rem !important;
  }

  .hero-fluid {
    min-height: calc(100svh - 50px);
  }

  .hero-copy {
    max-width: 38rem;
    padding-block: 0.6rem 0.85rem;
  }

  .hero-title {
    max-width: 31rem;
    font-size: clamp(1.85rem, 3.35vw, 3.25rem);
  }

  .hero-lead {
    margin-bottom: 0.8rem !important;
    font-size: 0.92rem;
  }

  .search-card .card-body {
    padding: 0.85rem !important;
  }

  .search-helper {
    font-size: 0.78rem;
  }

  .btn-search,
  .ts-wrapper .ts-control,
  .ts-wrapper.single .ts-control {
    height: 3.4rem;
    min-height: 3.4rem;
    max-height: 3.4rem;
  }

  .teacher-photo-sm {
    width: 32px;
    height: 32px;
  }

  .app-footer {
    padding-block: 0.5rem !important;
  }
}

@media (max-width: 1199.98px) {
  .search-grid {
    grid-template-columns: minmax(0, 1fr) minmax(9.5rem, 0.32fr);
  }

  .search-field-button {
    align-self: stretch;
  }
}

@media (max-width: 991.98px) {
  .hero-fluid {
    min-height: auto;
    display: flex;
    flex-direction: column;
  }

  .hero-image {
    position: relative;
    inset: auto;
    z-index: 0;
    order: 1;
    height: clamp(230px, 46vw, 360px);
    object-fit: cover;
    object-position: center right;
  }

  .hero-shade {
    display: none;
  }

  .hero-content {
    order: 2;
  }

  .min-vh-hero {
    min-height: auto;
  }

  .hero-copy {
    padding-block: 1.35rem 1.75rem;
    max-width: none;
  }

  .hero-title {
    max-width: 45rem;
  }

  .search-card {
    width: 100%;
  }

  .room-box {
    width: 100%;
  }

  .week-list li {
    grid-template-columns: 5.8rem 1fr;
  }

  .week-list em,
  .week-list .course-chip {
    grid-column: 2;
  }
}

@media (max-width: 575.98px) {
  .app-footer {
    background: rgba(244, 240, 232, 0.78);
  }

  .hero-fluid > .app-footer {
    margin-inline: 0.75rem;
  }

  .brand-avatar {
    width: 34px;
    height: 34px;
  }

  .navbar-brand {
    font-size: 1rem;
  }

  .hero-image {
    height: 220px;
    object-position: 68% center;
  }

  .hero-title {
    font-size: clamp(2.05rem, 10vw, 3rem);
  }

  .hero-title-stamp {
    top: -0.62em;
    left: calc(100% - 0.25em);
    font-size: 0.82rem;
  }

  .hero-lead {
    font-size: 0.98rem;
  }

  .search-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .btn-search,
  .ts-wrapper .ts-control,
  .ts-wrapper.single .ts-control {
    min-height: 4rem;
  }

  .teacher-photo-sm,
  .calendar-badge {
    width: 34px;
    height: 34px;
  }

  .teacher-copy strong,
  .day-option strong,
  .teacher-item-copy strong,
  .day-item-copy strong {
    font-size: 0.9rem;
  }

  .teacher-copy span,
  .day-option span,
  .teacher-item-copy span,
  .day-item-copy span {
    font-size: 0.74rem;
  }

  .result-title {
    font-size: 1.65rem;
  }

  .teacher-current {
    width: 100%;
  }

  .teacher-current img {
    width: 76px;
    height: 90px;
  }

  .week-list li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .week-list em,
  .week-list .course-chip {
    grid-column: auto;
  }
}


/* v8 polish: Tom Select fixed-height stability, campus label, favicon-ready UI */
.hero-image {
  transform: none;
  transform-origin: right center;
}

.search-grid {
  align-items: end;
}

.search-field {
  display: grid;
}

.ts-wrapper,
.ts-wrapper.single {
  width: 100%;
}

.ts-wrapper .ts-control,
.ts-wrapper.single .ts-control {
  height: 4.25rem;
  min-height: 4.25rem;
  max-height: 4.25rem;
  overflow: hidden;
  flex-wrap: nowrap;
  align-content: center;
}

.ts-wrapper.single .ts-control .item,
.ts-control .item {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.ts-wrapper.single.has-items .ts-control > input {
  width: 2px !important;
  min-width: 2px !important;
  max-width: 2px !important;
  opacity: 0;
  padding: 0;
  margin: 0;
}

.ts-wrapper:not(.has-items) .ts-control > input {
  min-width: 10rem !important;
}

.teacher-item,
.day-item {
  height: 3rem;
  max-height: 3rem;
  overflow: hidden;
}

.teacher-item-copy,
.day-item-copy {
  min-width: 0;
  overflow: hidden;
}

.teacher-item-copy strong,
.day-item-copy strong,
.teacher-item-copy span,
.day-item-copy span {
  max-width: 100%;
}

.ts-dropdown .option {
  padding: 0.62rem 0.75rem;
}

.btn-search {
  height: 4.25rem;
  min-height: 4.25rem;
  max-height: 4.25rem;
}

.room-box {
  gap: 0.25rem;
}

.room-campus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.92);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.search-card:focus-within {
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12) !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .result-reveal {
    animation: none;
  }

  .footer-heart {
    animation: none;
  }
}

@media (min-width: 1200px) and (max-height: 850px) {
  .hero-image {
    transform: none;
  }
}

@media (max-width: 991.98px) {
  .hero-image {
    transform: none;
  }
}

@media (max-width: 575.98px) {
  .ts-wrapper .ts-control,
  .ts-wrapper.single .ts-control,
  .btn-search {
    height: 4.05rem;
    min-height: 4.05rem;
    max-height: 4.05rem;
  }

  .teacher-item,
  .day-item {
    height: 2.85rem;
    max-height: 2.85rem;
  }
}


/* v9 final polish: clear button, validation, and selection-change UX */
.ts-wrapper.plugin-clear_button .clear-button,
.ts-wrapper.plugin-clear_button.single .clear-button {
  right: 2.35rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  opacity: 0.75;
  font-size: 1.15rem;
  line-height: 1;
  border-radius: 999px;
  width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ts-wrapper.plugin-clear_button .clear-button:hover,
.ts-wrapper.plugin-clear_button.single .clear-button:hover,
.ts-wrapper.plugin-clear_button .clear-button:focus,
.ts-wrapper.plugin-clear_button.single .clear-button:focus {
  opacity: 1;
  color: var(--app-green-dark);
  background: var(--app-green-soft);
  outline: none;
}

.ts-wrapper.has-items .ts-control {
  padding-right: 4.1rem;
}

.ts-wrapper.is-invalid .ts-control {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.22rem rgba(220, 53, 69, 0.12);
}

.search-feedback {
  color: #b42318;
  min-height: 1rem;
}

.search-feedback:empty {
  display: none !important;
}

.search-card.has-warning {
  box-shadow: 0 18px 42px rgba(180, 35, 24, 0.12) !important;
}

@media (max-width: 575.98px) {
  .ts-wrapper.has-items .ts-control {
    padding-right: 3.65rem;
  }

  .ts-wrapper.plugin-clear_button .clear-button,
  .ts-wrapper.plugin-clear_button.single .clear-button {
    right: 2.05rem;
  }
}


/* v11 final fix: stable external clear button, working hero, calmer search highlight */
.professor-select-wrap {
  position: relative;
  z-index: var(--z-search);
}

.professor-select-wrap .ts-wrapper.dropdown-active {
  z-index: var(--z-dropdown);
}

.professor-select-wrap .ts-dropdown,
.ts-dropdown {
  z-index: var(--z-dropdown);
}

.professor-select-wrap .ts-wrapper.has-items .ts-control {
  padding-right: 3.7rem;
}

.professor-clear-btn {
  position: absolute;
  right: 2.35rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 1.35rem;
  height: 1.35rem;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.68;
  transition: opacity .15s ease, background-color .15s ease, color .15s ease;
}

.professor-clear-btn:hover,
.professor-clear-btn:focus {
  opacity: 1;
  color: var(--app-green-dark);
  background: rgba(22, 128, 60, 0.08);
  outline: none;
}

.professor-clear-btn[hidden] {
  display: none !important;
}

/* Neutralize Tom Select's strong matching highlight */
.ts-dropdown .highlight,
.ts-dropdown mark {
  color: inherit;
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}

.ts-dropdown .active .highlight,
.ts-dropdown .active mark {
  color: inherit;
  background: transparent;
}

@media (max-width: 575.98px) {
  .professor-select-wrap .ts-wrapper.has-items .ts-control {
    padding-right: 3.35rem;
  }

  .professor-clear-btn {
    right: 2.05rem;
  }
}


/* Keep the working v9 hero behavior: do not replace the campus background with the standalone map asset */
.hero-image {
  object-fit: cover;
}

@media (max-width: 991.98px) {
  .hero-image {
    object-fit: cover;
  }
}

/* Final viewport-fit pass: keep laptop-height screens intentional, not oversized. */
@media (max-height: 850px) and (min-width: 992px) {
  .btn-search,
  .ts-wrapper .ts-control,
  .ts-wrapper.single .ts-control {
    height: 3.65rem;
    min-height: 3.65rem;
    max-height: 3.65rem;
  }

  .teacher-item,
  .day-item {
    height: 2.65rem;
    max-height: 2.65rem;
  }

  .teacher-photo-sm {
    width: 32px;
    height: 32px;
  }

  .professor-clear-btn {
    right: 2.1rem;
  }
}

@media (max-height: 760px) and (min-width: 992px) {
  .btn-search,
  .ts-wrapper .ts-control,
  .ts-wrapper.single .ts-control {
    height: 3.4rem;
    min-height: 3.4rem;
    max-height: 3.4rem;
  }

  .teacher-item,
  .day-item {
    height: 2.45rem;
    max-height: 2.45rem;
  }

  .professor-clear-btn {
    right: 2rem;
  }
}
