/* Minimal black and white interface */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #666666;
  --line: #e5e5e5;
  --strong-line: #d9d9d9;
  --primary: #111111;
  --primary-soft: #f2f2f2;
  --success: #111111;
  --warning: #f5f5f5;
  --danger: #111111;
  --list-bg: var(--paper);
  --surface: var(--paper);
  --surface-strong: var(--paper);
  --text: var(--ink);
  --text-sub: var(--muted);
  --border: var(--line);
  --accent: var(--primary);
  --accent-2: var(--primary);
  --accent-3: var(--primary);
  --accent-soft: var(--primary-soft);
  --brand: #10a37f;
  --brand-soft: #eaf7f3;
  --nav-bg: var(--paper);
  --shadow: none;
  --shadow-soft: none;
  --blur: none;
}

body.dark-mode {
  --bg: #181818;
  --bg-soft: #1f1f1f;
  --paper: #181818;
  --ink: #e8e8e8;
  --muted: #a6a6a6;
  --line: #2b2b2b;
  --strong-line: #3b3b3b;
  --primary: #e8e8e8;
  --primary-soft: #252525;
  --success: #4daafc;
  --warning: #1f1f1f;
  --danger: #f48771;
  --brand: #4daafc;
  --brand-soft: #1c3347;
  --nav-bg: var(--paper);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 82px;
}

body {
  min-height: 100vh;
  padding-top: 72px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
}

body::before {
  display: none;
}

body.services-open {
  overflow: hidden;
}

a,
button,
input,
summary {
  font-family: inherit;
}

::selection {
  background: var(--brand);
  color: #ffffff;
}

/* Header */
.promo-bar,
.university-clock {
  display: none;
}

.navbar {
  top: 0;
  min-height: 72px;
  padding: 0;
  background: var(--paper) !important;
  border-bottom: 0;
  box-shadow: none;
}

.navbar .container-fluid {
  width: min(100%, 1080px);
  min-height: 71px;
  margin: 0 auto;
  padding-inline: 20px !important;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink) !important;
  font-size: .95rem;
  font-weight: 700;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: #ffffff;
  font-size: .75rem;
}

.navbar-nav .nav-link {
  margin: 0;
  padding: 9px 12px !important;
  border-radius: 9px;
  color: var(--muted) !important;
  font-size: .8rem;
  font-weight: 600;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background: var(--primary-soft);
  color: var(--ink) !important;
}

#theme-toggle,
.navbar-toggler {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--ink);
  box-shadow: none;
  font-size: .8rem;
}

/* Intro */
.hero-section {
  width: min(calc(100% - 40px), 1080px);
  display: block;
  margin: 24px auto 0;
  padding: 72px 32px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: var(--paper);
  text-align: center;
}

.hero-section::before,
.hero-summary {
  display: none;
}

.hero-copy {
  max-width: 780px;
  margin: 0 auto;
}

.hero-kicker,
.section-index,
.section-eyebrow {
  display: block;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--brand);
  box-shadow: none;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-title {
  max-width: 780px;
  margin: 0 auto 18px;
  color: var(--ink);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: 1.04;
}

.hero-subtitle {
  max-width: 650px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hero-kicker,
body.dark-mode .hero-kicker {
  width: max-content;
  display: inline-flex;
  margin: 0 auto 18px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  box-shadow: none;
}

body.dark-mode .hero-section {
  border-color: var(--line);
  background: var(--bg-soft);
}

.btn-primary-action,
.btn-secondary-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}

.btn-primary-action {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff !important;
}

.btn-secondary-action {
  background: var(--paper);
  color: var(--ink) !important;
}

.btn-primary-action:hover,
.btn-secondary-action:hover {
  opacity: .72;
  transform: none;
  box-shadow: none;
}

/* Services */
.motivation-widget {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 1400;
  width: min(330px, calc(100% - 48px));
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  align-items: start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .12);
  animation: motivationIn .5s cubic-bezier(.2, .8, .2, 1) both;
}

.motivation-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .82rem;
}

.motivation-content {
  min-width: 0;
  transition: opacity .15s ease, transform .15s ease;
}

.motivation-widget.is-changing .motivation-content {
  opacity: 0;
  transform: translateY(4px);
}

.motivation-label {
  display: block;
  margin: 1px 0 4px;
  color: var(--brand);
  font-size: .57rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.motivation-content p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  margin: 0;
  color: var(--ink);
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.45;
}

.motivation-content small,
.motivation-content a {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .58rem;
  text-decoration: none;
}

.motivation-content a:hover {
  color: var(--brand);
  text-decoration: underline !important;
}

#motivation-refresh {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: .68rem;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .3s ease;
}

#motivation-refresh:hover {
  background: var(--brand-soft);
  color: var(--brand);
  transform: rotate(90deg);
}

body.dark-mode .motivation-widget {
  box-shadow: 0 14px 44px rgba(0, 0, 0, .4);
}

@keyframes motivationIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.services-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1500;
  min-width: 278px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid rgba(16, 163, 127, .25);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .16);
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.services-launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .2);
}

.services-launcher-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--brand);
  color: #ffffff;
  font-size: .95rem;
}

.services-launcher-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.services-launcher-copy small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--brand);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.services-launcher-copy small::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.services-launcher-copy strong {
  margin-top: 2px;
  font-size: .83rem;
  font-weight: 700;
}

.services-launcher-copy > span {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: .62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.services-launcher-count {
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .67rem;
  font-weight: 800;
}

.services-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1600;
  visibility: hidden;
  background: rgba(0, 0, 0, .42);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: opacity .22s ease, visibility .22s ease;
}

.services-backdrop.is-open {
  visibility: visible;
  opacity: 1;
}

.services-section {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1700;
  width: min(calc(100% - 48px), 960px);
  max-height: calc(100vh - 48px);
  margin: 0;
  padding: 30px;
  overflow-y: auto;
  visibility: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translateY(24px) scale(.98);
  transform-origin: right bottom;
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.services-section.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.services-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--ink);
  cursor: pointer;
}

.services-close:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.services-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.services-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 700;
}

.services-heading p {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.5;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  border-top: 0;
}

.service-entry {
  position: relative;
  min-height: 286px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  perspective: 1100px;
}

.service-entry:first-child {
  border-left: 0;
}

.service-card-inner {
  height: 100%;
  display: grid;
  transform-style: preserve-3d;
  transition: transform .62s cubic-bezier(.2, .75, .25, 1);
}

.service-entry.is-flipped .service-card-inner {
  transform: rotateY(180deg);
}

.service-card-face {
  min-width: 0;
  display: flex;
  flex-direction: column;
  grid-area: 1 / 1;
  padding: 26px 24px 22px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--bg-soft);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.service-card-back {
  transform: rotateY(180deg);
}

.service-number {
  position: static;
  display: block;
  margin-bottom: 20px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
}

.service-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper) !important;
  color: var(--ink);
  font-size: .78rem;
}

.service-entry:nth-child(1) .service-icon {
  border-color: #fed7aa;
  background: #fff7ed !important;
  color: #ea580c;
}

.service-entry:nth-child(1) .service-card-face {
  background: #fffaf5;
}

.service-entry:nth-child(2) .service-icon {
  border-color: #bfdbfe;
  background: #eff6ff !important;
  color: #2563eb;
}

.service-entry:nth-child(2) .service-card-face {
  background: #f7faff;
}

.service-entry:nth-child(3) .service-icon {
  border-color: #ddd6fe;
  background: #f5f3ff !important;
  color: #7c3aed;
}

.service-entry:nth-child(3) .service-card-face {
  background: #faf8ff;
}

body.dark-mode .service-entry:nth-child(1) .service-card-face,
body.dark-mode .service-entry:nth-child(2) .service-card-face,
body.dark-mode .service-entry:nth-child(3) .service-card-face {
  background: var(--bg-soft);
}

body.dark-mode .service-entry:nth-child(1) .service-icon {
  border-color: #7c2d12;
  background: #431407 !important;
  color: #fb923c;
}

body.dark-mode .service-entry:nth-child(2) .service-icon {
  border-color: #1e40af;
  background: #172554 !important;
  color: #60a5fa;
}

body.dark-mode .service-entry:nth-child(3) .service-icon {
  border-color: #5b21b6;
  background: #2e1065 !important;
  color: #a78bfa;
}

.service-entry h3 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 700;
}

.service-card-front > p {
  min-height: 58px;
  margin: 0;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.55;
}

.service-flip-trigger,
.service-flip-back {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: .7rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.service-flip-trigger i {
  color: var(--brand);
  font-size: .56rem;
  transition: transform .2s ease;
}

.service-flip-trigger:hover i {
  transform: translateX(3px);
}

.service-back-label {
  margin-bottom: 8px;
  color: var(--brand);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.service-card-back h3 {
  font-size: 1.05rem;
}

.service-card-back ul {
  display: grid;
  gap: 10px;
  margin: 10px 0 20px;
  padding: 0;
  list-style: none;
}

.service-card-back li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.4;
}

.service-card-back li i {
  margin-top: 2px;
  color: var(--brand);
  font-size: .64rem;
}

.service-flip-back {
  color: var(--brand);
}

.service-flip-back i {
  font-size: .62rem;
}

.service-contact {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink) !important;
  font-size: .72rem;
  font-weight: 700;
}

.service-contact i {
  color: var(--brand);
}

/* Library */
main.container {
  max-width: 1080px;
  padding: 66px 0 80px;
  border: 0;
}

.catalog-layout {
  display: block;
}

.catalog-sidebar {
  display: none;
}

.catalog-main {
  min-width: 0;
  scroll-margin-top: 90px;
}

.library-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 22px;
}

.library-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.library-heading p {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.5;
}

.resource-toolbar {
  max-width: none;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent !important;
  box-shadow: none;
  backdrop-filter: none;
}

.search-box {
  height: 46px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--bg-soft);
  box-shadow: none;
}

.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
  transform: none;
}

.search-box input {
  color: var(--ink);
  font-size: .78rem;
  font-weight: 500;
}

.search-box input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.search-box i,
#clear-search {
  color: var(--muted);
}

.semester-tabs-container {
  position: static;
  justify-content: flex-start;
  max-width: none;
  margin: 0 0 22px;
  padding: 0;
  overflow-x: auto;
  background: transparent;
}

.semester-tabs {
  width: 100%;
  min-width: 650px;
  gap: 3px;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: var(--bg-soft);
  box-shadow: none;
}

.semester-tabs .nav-item {
  flex: 1 0 auto;
}

.semester-tabs .nav-link {
  padding: 10px 9px;
  border-right: 0;
  border-radius: 9px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  text-align: center;
}

.semester-tabs .nav-item:last-child .nav-link {
  border-right: 0;
}

.semester-tabs .nav-link:hover {
  background: var(--primary-soft);
  color: var(--ink);
}

.semester-tabs .nav-link.active,
body.dark-mode .semester-tabs .nav-link.active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: none;
  transform: none;
}

.tab-content,
.global-results {
  max-width: none;
  padding: 0;
}

/* Course rows */
.course-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-top: 0;
}

.course-item {
  min-width: 0;
  min-height: 128px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 14px;
  padding: 20px;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--bg-soft);
  box-shadow: none;
}

.course-item:nth-child(odd) {
  border-left: 1px solid transparent;
}

.course-item::before {
  display: none;
}

.course-item:hover,
body.dark-mode .course-item:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  background: var(--paper);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .05);
  transform: translateY(-1px);
}

.course-icon,
.bg-gradient-1,
.bg-gradient-2,
.bg-gradient-3,
.bg-gradient-4,
.bg-gradient-5,
.bg-gradient-6 {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
  font-size: .95rem;
}

.course-icon.bg-gradient-1 {
  background: #fff1f2;
  color: #e11d48;
}

.course-icon.bg-gradient-2 {
  background: #eff6ff;
  color: #2563eb;
}

.course-icon.bg-gradient-3 {
  background: #ecfdf5;
  color: #059669;
}

.course-icon.bg-gradient-4 {
  background: #f5f3ff;
  color: #7c3aed;
}

.course-icon.bg-gradient-5 {
  background: #fffbeb;
  color: #d97706;
}

.course-icon.bg-gradient-6 {
  background: #fdf2f8;
  color: #db2777;
}

body.dark-mode .course-icon.bg-gradient-1 {
  background: #4c0519;
  color: #fb7185;
}

body.dark-mode .course-icon.bg-gradient-2 {
  background: #172554;
  color: #60a5fa;
}

body.dark-mode .course-icon.bg-gradient-3 {
  background: #022c22;
  color: #34d399;
}

body.dark-mode .course-icon.bg-gradient-4 {
  background: #2e1065;
  color: #a78bfa;
}

body.dark-mode .course-icon.bg-gradient-5 {
  background: #451a03;
  color: #fbbf24;
}

body.dark-mode .course-icon.bg-gradient-6 {
  background: #500724;
  color: #f472b6;
}

body.dark-mode .course-item:hover {
  border-color: #3b3b3b;
  background: #252525;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

body.dark-mode .services-launcher {
  border-color: rgba(77, 170, 252, .35);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .42);
}

body.dark-mode .services-backdrop {
  background: rgba(0, 0, 0, .68);
}

.course-item:hover .course-icon {
  transform: none;
}

.course-info {
  min-width: 0;
  display: block;
  padding: 0;
  overflow: visible;
}

.course-info h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 700;
}

.course-info p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.45;
  white-space: normal;
}

.tags {
  gap: 4px;
  margin-top: 8px;
}

.badge-tag,
.highlight-alert,
.highlight-success,
.hot-tag,
.new-tag,
.semester-tag,
.course-status,
body.dark-mode .highlight-alert,
body.dark-mode .hot-tag,
body.dark-mode .course-status {
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: .56rem;
  font-weight: 600;
}

.highlight-alert,
.hot-tag,
.course-status,
body.dark-mode .highlight-alert,
body.dark-mode .hot-tag,
body.dark-mode .course-status {
  border-color: transparent;
  background: #fff1f2;
  color: #e11d48;
}

.highlight-success,
.new-tag,
body.dark-mode .highlight-success,
body.dark-mode .new-tag {
  border-color: transparent;
  background: var(--brand-soft);
  color: var(--brand);
}

body.dark-mode .highlight-alert,
body.dark-mode .hot-tag,
body.dark-mode .course-status {
  background: #4c0519;
  color: #fb7185;
}

.course-status,
body.dark-mode .course-status {
  border-color: transparent;
  background: #fff7ed;
  color: #c2410c;
}

body.dark-mode .course-status {
  background: #431407;
  color: #fb923c;
}

.course-action {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: .65rem;
}

.course-action::before {
  display: none;
}

.course-tools {
  top: 7px;
  right: 7px;
  gap: 3px;
  opacity: 0;
}

.course-item:hover .course-tools,
.course-item:focus-within .course-tools {
  opacity: 1;
}

.course-tool {
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--muted);
  font-size: .6rem;
}

.course-tool:hover,
.course-tool.is-bookmarked {
  border-color: var(--strong-line);
  background: var(--ink);
  color: var(--paper);
}

.results-header {
  padding: 8px 0 14px;
}

.results-count {
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-soft);
  box-shadow: none;
}

/* Dialogs and footer */
#back-to-top {
  right: 18px;
  bottom: 112px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
}

.course-modal {
  padding: 24px;
  overflow-y: auto;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(7px);
}

.modal-card {
  width: min(650px, 100%);
  max-width: 650px;
  margin-top: 4vh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .24);
}

.modal-close {
  top: 18px;
  right: 18px;
  z-index: 4;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--ink);
  box-shadow: none;
}

.modal-close:hover {
  background: var(--primary-soft);
  color: var(--brand);
  transform: none;
}

.modal-course-hero {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 28px 76px 23px 28px;
  border-bottom: 1px solid var(--line);
}

.modal-course-hero .course-icon {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 16px;
  font-size: 1.2rem;
}

.modal-course-title {
  min-width: 0;
}

.modal-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--brand);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.modal-course-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.025em;
}

.modal-course-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.45;
}

.course-modal-content {
  padding: 20px 28px 24px;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.modal-tags .badge-tag {
  padding: 4px 7px;
  background: var(--bg-soft);
}

.modal-tags .semester-tag {
  border-color: transparent;
  background: var(--brand-soft);
  color: var(--brand);
}

.modal-info-list {
  display: grid;
}

.modal-info-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 13px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.modal-info-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .8rem;
}

.modal-info-item h3 {
  margin: 1px 0 5px;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 750;
}

.modal-info-item p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.58;
}

.modal-meta-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.modal-meta-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 13px;
  background: var(--bg-soft);
  color: var(--ink);
}

.modal-meta-item > i {
  color: var(--brand);
  font-size: .84rem;
}

.modal-meta-item.is-ready > i {
  color: #10a37f;
}

.modal-meta-item.is-pending > i {
  color: #f59e0b;
}

.modal-meta-item div {
  min-width: 0;
}

.modal-meta-item span,
.modal-meta-item strong {
  display: block;
}

.modal-meta-item span {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: .57rem;
  font-weight: 650;
  text-transform: uppercase;
}

.modal-meta-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: .68rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 15px 28px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.modal-actions a,
.modal-actions button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
  font-size: .7rem;
  font-weight: 700;
}

.modal-actions a:hover,
.modal-actions button:hover {
  border-color: var(--strong-line);
  background: var(--paper);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

.modal-actions .modal-action-primary {
  margin-left: auto;
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.modal-actions .modal-action-primary:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  opacity: .88;
}

.modal-actions .modal-action-primary.is-pending {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

body.dark-mode .course-modal {
  background: rgba(0, 0, 0, .76);
}

body.dark-mode .modal-card {
  box-shadow: 0 28px 90px rgba(0, 0, 0, .56);
}

.app-toast {
  border: 1px solid var(--strong-line);
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
}

footer {
  padding: 38px 20px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.social-icons .social-link {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}

@media (max-width: 1120px) {
  main.container {
    padding-inline: 20px;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 64px;
  }

  .navbar {
    min-height: 64px;
  }

  .navbar .container-fluid {
    min-height: 63px;
  }

  .navbar-collapse {
    position: absolute;
    top: 100%;
    right: 20px;
    width: 200px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
  }

  .navbar-nav {
    align-items: stretch !important;
  }

  .hero-section {
    width: calc(100% - 32px);
    margin-top: 12px;
    padding: 46px 20px;
    border-radius: 20px;
  }

  .hero-title {
    font-size: 2.45rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn-primary-action,
  .btn-secondary-action {
    width: 100%;
  }

  .services-section {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
    padding: 28px 18px 20px;
    border-radius: 20px;
  }

  .services-heading,
  .library-heading {
    display: block;
  }

  .services-heading p,
  .library-heading p {
    margin-top: 8px;
  }

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

  .services-launcher {
    right: 14px;
    bottom: 14px;
    min-width: 0;
    width: min(310px, calc(100% - 28px));
  }

  .motivation-widget {
    left: 14px;
    bottom: 98px;
    width: calc(100% - 28px);
    padding: 11px;
  }

  .service-entry,
  .service-entry:first-child {
    border-left: 0;
  }

  .service-card-front > p {
    min-height: 0;
    margin-bottom: 22px;
  }

  .service-contact {
    width: 100%;
    justify-content: center;
  }

  #back-to-top {
    right: 18px;
    bottom: 102px;
  }

  main.container {
    padding: 50px 16px 60px;
  }

  .course-list {
    grid-template-columns: 1fr;
  }

  .course-item,
  .course-item:nth-child(odd) {
    border-left: 1px solid transparent;
  }

  .course-tools {
    display: none;
  }

  footer {
    padding-bottom: 36px;
  }

  .course-modal {
    padding: 12px;
  }

  .modal-card {
    margin-top: 2vh;
    border-radius: 20px;
  }

  .modal-course-hero {
    padding: 22px 60px 18px 18px;
  }

  .modal-course-hero .course-icon {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    border-radius: 14px;
  }

  .course-modal-content {
    padding: 16px 18px 20px;
  }

  .modal-meta-strip {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    padding: 13px 18px;
  }

  .modal-action-secondary {
    width: 38px;
    padding: 0 !important;
  }

  .modal-action-secondary {
    font-size: 0 !important;
  }

  .modal-action-secondary i {
    font-size: .75rem;
  }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: 2.15rem;
  }

  .course-item {
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    gap: 11px;
    padding: 16px 13px;
  }

  .course-icon,
  .bg-gradient-1,
  .bg-gradient-2,
  .bg-gradient-3,
  .bg-gradient-4,
  .bg-gradient-5,
  .bg-gradient-6 {
    width: 42px;
    height: 42px;
  }

  .motivation-content small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-card-inner {
    transition-duration: .01ms;
  }

  .motivation-widget {
    animation: none;
  }
}
