.courses-page {
  padding: 28px 0 12px;
}

html.in-frame,
html.in-frame body {
  scrollbar-width: none;
}

html.in-frame::-webkit-scrollbar,
html.in-frame body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.entry-switch[hidden] {
  display: none !important;
}

.entry-switch {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  background: #2a2220;
  color: #fff;
  font-size: 13px;
}

.entry-switch a,
.entry-switch__current {
  padding: 4px 12px;
  border-radius: 999px;
}

.entry-switch__current {
  background: #d51741;
  font-weight: 700;
}

.entry-switch a {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.entry-switch--portal {
  position: relative;
  z-index: 2;
  width: fit-content;
  margin-bottom: 16px;
  border-radius: 999px;
  background: rgba(42, 34, 32, 0.92);
}

.ios-portal__frame {
  display: block;
  width: 100%;
  height: 798px;
  border: 0;
  background: #fff1dd;
}

body.app-body {
  height: auto;
  min-height: 100vh;
  overflow: auto;
}

body.app-body .ios-device__screen {
  background: #fff1dd;
}

body.app-body .ios-status-bar {
  background: #fff7ea;
}

.courses-page__title {
  margin: 18px 0 28px;
  text-align: center;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #2b2b2b;
}

.courses-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px 12px;
}

.courses-side h2 {
  margin: 22px 0 12px;
  font-size: 16px;
}

.courses-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #f0c7a8;
  border-radius: 8px;
  background: #fff;
  color: #c9a48a;
}

.courses-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 14px;
  background: transparent;
}

.courses-filter {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #555;
}

.courses-filter input {
  margin-top: 3px;
  accent-color: #d51741;
}

.courses-clear {
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid #f3c2c8;
  border-radius: 8px;
  background: #fff;
  color: #d51741;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.courses-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.courses-overview {
  font-size: 14px;
  color: #666;
}

.courses-overview:hover {
  color: #d51741;
}

.courses-sort select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #f0c7a8;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: #555;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.course-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0 0 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #f3ebe3;
  box-shadow: 0 8px 20px rgba(80, 40, 20, 0.05);
  overflow: hidden;
}

.course-card[hidden] {
  display: none;
}

.course-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #fff4ea;
}

.course-card h3 {
  margin: 14px 16px 8px;
  font-size: 18px;
  color: #222;
}

.course-card p {
  margin: 0 16px 14px;
  flex: 1;
  font-size: 13px;
  line-height: 1.65;
  color: #666;
}

.course-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 16px;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid #f0b8c4;
  color: #d51741;
  font-size: 14px;
  font-weight: 700;
}

.course-card__btn:hover {
  background: #fff5f7;
}

.courses-page .home-lead {
  margin-top: 36px;
}

.courses-mobile-bar,
.nav-toggle {
  display: none;
}

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 8px;
    border: 0;
    border-radius: 10px;
    background: #fff5f0;
    cursor: pointer;
  }

  .nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #333;
  }

  .site-header {
    flex-wrap: wrap;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-top: 8px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
    padding: 10px 4px;
    border-bottom: 1px solid #f6eee8;
  }

  .courses-page {
    padding-top: 8px;
  }

  .courses-page__title {
    margin: 8px 0 12px;
    font-size: 32px;
    text-align: left;
    padding: 0 20px;
  }

  .courses-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 16px 8px;
  }

  .courses-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .courses-mobile-label {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
  }

  .courses-filter-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #ffe4ea;
    color: #d51741;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .courses-side {
    display: none;
    padding: 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #f3ebe3;
  }

  .courses-side.is-open {
    display: block;
  }

  .courses-search {
    display: none;
  }

  .courses-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .courses-overview {
    font-size: 13px;
  }

  .courses-sort,
  .courses-sort select {
    width: 100%;
  }

  .course-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .course-card {
    border-radius: 14px;
  }

  .courses-page .home-lead {
    margin-top: 28px;
    padding: 0 16px;
  }

  .home-lead__head,
  .home-lead__body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .home-lead__title {
    font-size: 22px;
  }

  .home-lead__grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
