.tasks-main-wrapper {
  display: flex;
  min-height: 70vh;
  gap: 25px;
  justify-content: center;
  align-items: stretch;
  margin-bottom: 40px;
  box-sizing: border-box;
}

.subject-picker-title {
  margin-bottom: 24px;
}

.tasks-main-wrapper.subject-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 0;
  align-items: stretch;
  margin-bottom: 16px;
}

.tasks-main-wrapper.subject-picker.subject-picker-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tasks-main-wrapper.subject-picker .tasks-block-link {
  width: 100%;
  min-width: 0;
  min-height: 480px;
  height: calc(100dvh - 225px);
}

.tasks-main-wrapper.subject-picker .tasks-block-info {
  max-width: calc(100% - 64px);
  bottom: 112px;
}

/* Полный список предметов (ЕГЭ/ОГЭ и др.) — компактные плитки вместо трёх гигантских карточек */
.tasks-main-wrapper.subject-picker.subject-picker-many {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.tasks-main-wrapper.subject-picker.subject-picker-many .tasks-block-link {
  min-height: 230px;
  height: 230px;
  padding: 28px 24px 24px 24px;
  border-radius: 28px;
  border: 1px solid rgba(35, 38, 52, 0.06);
  box-shadow: 0 10px 30px rgba(41, 45, 72, 0.06);
}

.tasks-main-wrapper.subject-picker.subject-picker-many .tasks-block-info {
  max-width: calc(100% - 48px);
  bottom: 96px;
  left: 24px;
  margin: 0;
}

.tasks-main-wrapper.subject-picker.subject-picker-many .tasks-block-title {
  font-size: 26px;
  margin-bottom: 0;
}

.tasks-main-wrapper.subject-picker.subject-picker-many .tasks-block-arrow-btn {
  height: 48px;
  min-height: 48px;
  margin-top: 16px;
  font-size: 0.95rem;
}

.tasks-main-wrapper.subject-picker.subject-picker-many .corner-arrow {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
}

.tasks-main-wrapper.subject-picker.subject-picker-many .corner-arrow svg {
  width: 36px;
  height: 36px;
}

.subject-picker-favorites {
  margin-bottom: 44px;
}

/* Сердечко «в избранное» в левом верхнем углу карточки предмета — зеркально
   corner-arrow, который справа. */
.subject-fav-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.48);
  border: none;
  border-radius: 14px;
  padding: 0;
  cursor: pointer;
  z-index: 3;
  color: inherit;
  transition: background 0.2s, transform 0.15s;
}

.subject-fav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.06);
}

.subject-fav-btn .subject-fav-heart-ico path {
  transition: fill 0.15s, stroke 0.15s;
}

.subject-fav-btn.is-on {
  color: #f0525b;
}

.subject-fav-btn.is-on .subject-fav-heart-ico path {
  fill: #f0525b;
  stroke: #f0525b;
}

.subject-fav-btn.is-on:hover {
  color: #ff6670;
}

.subject-fav-btn.is-on:hover .subject-fav-heart-ico path {
  fill: #ff6670;
  stroke: #ff6670;
}

.subject-fav-btn--guest {
  cursor: default;
}

.subject-fav-btn--guest:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: none;
}

.subject-tile.tone-light .subject-fav-btn {
  background: rgba(255, 255, 255, 0.5);
}

.subject-tile.tone-light .subject-fav-btn:hover {
  background: rgba(255, 255, 255, 0.82);
}

.subject-tile.tone-light .subject-fav-btn--guest:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Свой фирменный цвет фона у каждой плитки предмета (задаётся инлайн-style
   в шаблоне), .tone-dark/.tone-light только подбирают контрастный текст. */
.subject-tile.tone-dark {
  color: #fff;
}

.subject-tile.tone-light {
  color: #292b35;
}

.subject-tile.tone-dark .corner-arrow svg {
  stroke: #fff;
}

.subject-tile.tone-light .corner-arrow svg {
  stroke: #3b3e4c;
}

.subject-tile.tone-dark .tasks-block-arrow-btn {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.subject-tile.tone-light .tasks-block-arrow-btn {
  background: rgba(255, 255, 255, 0.42);
  color: #292b35;
  border: 1.5px solid rgba(41, 43, 53, 0.2);
}

.subject-tile.tone-dark .tasks-block-arrow-btn:hover {
  filter: brightness(1.08);
}

.subject-tile.tone-light .tasks-block-arrow-btn:hover {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(112, 125, 255, 0.5);
}

.subject-bank-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}

.subject-bank-title {
  margin: 0;
}

.subject-bank-page .tasks-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  width: fit-content;
  height: 48px;
  box-sizing: border-box;
  padding: 12px 28px 12px 18px;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: #222;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font: 500 18px 'Manrope', sans-serif;
  text-decoration: none;
  transition: background .2s;
}

.subject-bank-page .tasks-back-btn:hover {
  background: #f6f7ff;
  color: #222;
}

.subject-bank-page .tasks-back-btn .hero-button-arrow {
  transform: scaleX(-1);
  transition: transform .2s ease;
}

.subject-bank-page .tasks-back-btn:hover .hero-button-arrow {
  transform: scaleX(-1) translateX(4px);
}

.subject-bank-page .tasks-main-wrapper {
  display: grid;
  min-height: 0;
  align-items: stretch;
  margin-bottom: 16px;
}

.subject-bank-page .subject-bank-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.subject-bank-page .subject-bank-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subject-bank-page .tasks-main-wrapper > .tasks-block-link {
  width: 100% !important;
  min-width: 0;
  min-height: 480px;
  height: calc(100dvh - 285px);
}

.subject-bank-page.subject-bank-page-without-header .tasks-main-wrapper > .tasks-block-link {
  height: calc(100dvh - 225px);
}

.subject-bank-page .tasks-block-info {
  max-width: calc(100% - 64px);
  bottom: 132px;
}

.subject-bank-page .tasks-block-arrow-btn {
  height: 60px;
  min-height: 60px;
  margin-top: 24px;
}

.subject-bank-page .tasks-block-arrow-btn .hero-button-arrow {
  width: 3em;
  height: 2.2em;
}

.tasks-block-link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  border-radius: 40px;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 4px 24px 0 rgba(112, 125, 255, 0.06);
  cursor: pointer;
  min-width: 180px;
  min-height: 220px;
  height: calc(85vh - 40px);
  position: relative;
  padding: 40px 32px 32px 32px;
  overflow: hidden;
  box-sizing: border-box;
}

.tasks-block-link.ege {
  width: 45%;
  background: #222222;
  color: #fff;
}

.tasks-block-link.oge {
  width: 27.5%;
  background: #707dff;
  color: #fff;
}

.tasks-block-link.programming {
  width: 27.5%;
  background: #fff;
  color: #222;
}

.tasks-block-link.subject-russian {
  background: #b3221b;
  color: #fff;
}

.tasks-block-link.subject-literature {
  flex: 1;
  background: #344a7d;
  color: #fff;
}

.tasks-block-link.subject-russian .tasks-block-arrow-btn,
.tasks-block-link.subject-literature .tasks-block-arrow-btn {
  background: #fff;
  border: 2px solid #fff;
}

.tasks-block-link.subject-russian .tasks-block-arrow-btn {
  color: #b3221b;
}

.tasks-block-link.subject-literature .tasks-block-arrow-btn {
  color: #344a7d;
}

.tasks-block-link.subject-russian .corner-arrow svg,
.tasks-block-link.subject-literature .corner-arrow svg {
  stroke: #fff !important;
}

.tasks-block-link:hover {
  box-shadow: 0 14px 36px rgba(63, 69, 112, 0.12);
  transform: translateY(-4px);
}

.tasks-block-title {
  font-size: 48px;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 15px;
  margin-top: 0;
  line-height: 1.1;
  display: block;
}

.tasks-block-desc {
  font-size: 1.08rem;
  font-family: 'Manrope', sans-serif;
  font-weight: 400;
  line-height: 1.25;
  opacity: 0.92;
  margin-bottom: 0;
  display: block;
}

.tasks-block-info {
  position: absolute;
  left: 32px;
  bottom: 100px;
  text-align: left;
  z-index: 1;
  max-width: 70%;
}

.tasks-block-arrow-btn {
  margin-top: 40px;
  margin-bottom: 0;
  width: 100%;
  height: 72px;
  min-height: 72px;
  background: #707dff;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  border-radius: 30px;
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  gap: 12px;
  transition: background 0.2s, color 0.2s;
}

.tasks-block-link.oge .tasks-block-arrow-btn {
  background: #fff;
  color: #707dff;
  border: 2px solid #fff;
}

.tasks-block-arrow-btn .hero-button-arrow {
  width: 4em;
  height: 3em;
  margin-left: 8px;
  vertical-align: middle;
}

.tasks-block-link .corner-arrow {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  z-index: 2;
  box-sizing: border-box;
}

.tasks-block-link .corner-arrow svg {
  width: 52px;
  height: 52px;
  stroke: #707dff;
  stroke-width: 4px;
  fill: none;
}

.tasks-block-link.oge .corner-arrow svg {
  stroke: #fff;
}

.tasks-block-link.ege .corner-arrow svg {
  stroke: #707dff;
}

.tasks-block-link.programming .corner-arrow svg {
  stroke: #707dff;
}

@media (max-width: 1200px) {
  .tasks-main-wrapper {
    flex-direction: column;
    gap: 24px;
  }

  .tasks-block-link {
    width: 100% !important;
    min-height: 120px;
    height: 320px;
    padding: 24px 16px 16px 16px;
  }

  .tasks-block-title {
    margin-top: 10px;
  }

  .tasks-block-arrow-btn {
    width: 100%;
    min-width: 0;
  }

  .tasks-main-wrapper.subject-picker {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tasks-main-wrapper.subject-picker.subject-picker-two {
    grid-template-columns: 1fr;
  }

  .tasks-main-wrapper.subject-picker .tasks-block-link {
    min-height: 320px;
    height: 320px;
  }

  .subject-bank-page .tasks-main-wrapper {
    grid-template-columns: 1fr;
  }

  .subject-bank-page .tasks-block-link {
    min-height: 320px;
    height: 320px;
  }


  .tasks-block-arrow-btn {
    height: 64px;
    min-height: 64px;
  }
}
