/*
 * Shared phone layout for every subject after the Geography pilot.
 * Desktop remains untouched; Chemistry keeps its approved colour treatment.
 */

@media (max-width: 760px) {
  html:has(body[data-subject]:not([data-subject="geography"])) {
    overflow-x: clip;
  }

  body[data-subject]:not([data-subject="geography"]) {
    --control-height: 44px;
    --mobile-ink: color-mix(in srgb, var(--accent) 12%, #10204e 88%);
    --mobile-copy: color-mix(in srgb, var(--accent) 22%, #284e73 78%);
    --mobile-accent-deep: color-mix(in srgb, var(--accent) 68%, #173b63 32%);
    --mobile-card-shadow: color-mix(in srgb, var(--accent) 17%, rgba(22, 60, 91, 0.14) 83%);
    overflow-x: clip;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]):not([data-subject="chemistry"]):not([data-subject="kazakhstan-history"]),
  body.page--classes[data-subject]:not([data-subject="geography"]):not([data-subject="chemistry"]):not([data-subject="kazakhstan-history"]),
  body.page--scientists[data-subject]:not([data-subject="geography"]):not([data-subject="chemistry"]):not([data-subject="kazakhstan-history"]) {
    background-color: color-mix(in srgb, var(--accent) 14%, #c9e2ed 86%);
    background-image:
      radial-gradient(circle at 95% 4%, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent 25rem),
      radial-gradient(circle at -8% 42%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 24rem),
      linear-gradient(
        155deg,
        color-mix(in srgb, var(--accent) 18%, #c7e2ef 82%) 0%,
        color-mix(in srgb, var(--accent-2) 15%, #cee6e7 85%) 53%,
        color-mix(in srgb, var(--accent-2) 22%, #bfdce9 78%) 100%
      );
    background-attachment: scroll;
    background-blend-mode: normal;
    background-position: 0 0;
    background-repeat: no-repeat;
    background-size: auto;
  }

  /* Keep the approved Chemistry backdrop, but avoid fixed-background jank on iOS. */
  body.page--subject[data-subject="chemistry"],
  body.page--classes[data-subject="chemistry"],
  body.page--scientists[data-subject="chemistry"] {
    background-attachment: scroll;
  }

  /* Classes now shares the established gold-to-teal Kazakhstan History field. */
  body.page--classes[data-subject="kazakhstan-history"] {
    background-color: #dde2d7;
    background-image:
      radial-gradient(ellipse 28rem 19rem at -12% 4%, rgba(209, 154, 52, 0.22), transparent 76%),
      radial-gradient(ellipse 30rem 22rem at 112% 20%, rgba(73, 163, 164, 0.24), transparent 76%),
      linear-gradient(165deg, #e8dec7 0%, #dde2d7 48%, #c8e0de 100%);
    background-attachment: scroll;
  }

  body[data-subject]:not([data-subject="geography"]) .app-shell,
  body[data-subject]:not([data-subject="geography"]) .app-shell--classes {
    width: calc(100% - 28px);
    padding-top: max(10px, env(safe-area-inset-top));
  }

  body[data-subject]:not([data-subject="geography"]) .topbar {
    min-height: 44px;
  }

  body[data-subject]:not([data-subject="geography"]) .language-switch {
    width: 126px;
  }

  body[data-subject]:not([data-subject="geography"]) :is(.icon-button, .action-button, .language-switch) {
    min-height: 44px;
    touch-action: manipulation;
  }

  /* Subject landing: stable copy rows, decorative hero art, compact learning map. */
  body.page--subject[data-subject]:not([data-subject="geography"]) .subject-main {
    padding-top: 0;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .subject-hero {
    display: grid;
    height: auto;
    min-height: 0;
    grid-template-rows: auto 190px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .subject-hero__copy {
    position: relative;
    z-index: 2;
    top: auto;
    right: auto;
    left: auto;
    order: 1;
    width: auto;
    padding: 32px 6px 0;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .subject-hero__copy h1 {
    min-height: 0.96em;
    margin: 0;
    color: var(--mobile-ink);
    font-size: clamp(45px, 13.5vw, 52px);
    letter-spacing: -0.064em;
    line-height: 0.96;
    text-wrap: balance;
  }

  body.page--subject[data-subject]:is(
    [data-subject="world-history"],
    [data-subject="kazakhstan-history"],
    [data-subject="kazakh-language"],
    [data-subject="russian-language"]
  ) .subject-hero__copy h1 {
    min-height: 1.92em;
    font-size: clamp(40px, 12vw, 48px);
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .subject-hero__copy > p:last-child {
    display: -webkit-box;
    min-height: 86px;
    max-width: 35rem;
    margin: 14px 0 0;
    color: var(--mobile-copy);
    font-size: 15px;
    font-weight: 520;
    line-height: 1.44;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .subject-hero__scene {
    position: relative;
    z-index: 1;
    inset: auto;
    display: block;
    order: 2;
    width: calc(100% + 8px);
    height: 190px;
    margin-inline: -4px;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 18px 17px rgba(24, 66, 91, 0.17));
    pointer-events: none;
    -webkit-mask-image: none;
    mask-image: none;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card {
    height: 176px;
    border-color: rgba(255, 255, 255, 0.82);
    border-radius: 24px;
    background:
      radial-gradient(circle at 92% 8%, rgba(var(--accent-rgb), 0.15), transparent 43%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.79), rgba(237, 248, 249, 0.5));
    box-shadow: 0 15px 34px var(--mobile-card-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.94);
    touch-action: manipulation;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card--active {
    border-color: color-mix(in srgb, var(--accent) 48%, transparent);
    background:
      radial-gradient(circle at 91% 9%, color-mix(in srgb, var(--accent-2) 25%, transparent), transparent 45%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.87), color-mix(in srgb, var(--accent) 8%, rgba(236, 249, 246, 0.64)));
    box-shadow:
      0 0 0 3px rgba(var(--accent-rgb), 0.07),
      0 18px 38px var(--mobile-card-shadow),
      inset 0 1px 0 #fff;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card__art-wrap {
    right: -2px;
    bottom: 4px;
    width: 44%;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card:disabled .section-card__art {
    filter: saturate(0.82) drop-shadow(0 12px 12px rgba(32, 74, 86, 0.15));
    opacity: 0.82;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card__content {
    display: flex;
    width: 56%;
    height: 100%;
    padding: 19px 0 17px 19px;
    flex-direction: column;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card h2 {
    display: -webkit-box;
    margin: 0;
    font-size: clamp(18px, 5vw, 21px);
    font-weight: 720;
    letter-spacing: -0.038em;
    line-height: 1.08;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card p {
    margin-top: 9px;
    color: var(--mobile-copy);
    font-size: 13px;
    font-weight: 510;
    line-height: 1.4;
    -webkit-line-clamp: 2;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card:disabled p {
    -webkit-line-clamp: 3;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card__state {
    display: inline-flex;
    min-height: 26px;
    margin-top: auto;
    padding: 0 10px;
    align-items: center;
    align-self: flex-start;
    border: 1px solid rgba(var(--accent-rgb), 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
    color: var(--mobile-copy);
    font-family: var(--font-head);
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card:disabled .section-card__arrow {
    display: none;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card__arrow {
    left: 19px;
    bottom: 17px;
    width: 44px;
    height: 44px;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 22px rgba(var(--accent-rgb), 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.46);
    color: #fff;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .topics-block {
    margin-top: 27px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .topics-block > h2 {
    margin: 0 2px 13px;
    font-size: 23px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .topic-card {
    height: 74px;
    padding: 10px;
    gap: 9px;
    border-radius: 18px;
    background: rgba(245, 252, 252, 0.56);
    box-shadow: 0 10px 25px rgba(30, 81, 100, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .topic-card__number {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--mobile-accent-deep);
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .topic-card strong {
    font-size: 12px;
    line-height: 1.24;
  }

  /* Scientists: horizontal filters and people rail, with a face-led hero. */
  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientists-main {
    padding-top: 12px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientists-intro {
    display: grid;
    min-height: 0;
    padding: 22px 3px 0;
    align-items: start;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientists-intro__copy h1 {
    min-height: 0;
    font-size: clamp(47px, 14vw, 52px);
    letter-spacing: -0.058em;
    line-height: 0.96;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientists-intro__copy > p:last-child {
    min-height: 66px;
    margin: 14px 0 0;
    color: var(--mobile-copy);
    font-size: 15px;
    font-weight: 510;
    line-height: 1.46;
    -webkit-line-clamp: 3;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientists-tools {
    width: 100%;
    gap: 9px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .search {
    width: 100%;
    height: 52px;
    padding-inline: 16px;
    border-radius: 17px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .search input {
    min-width: 0;
    font-size: 16px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .filter-list {
    display: flex;
    width: 100%;
    padding: 1px 2px 7px;
    align-items: center;
    gap: 8px;
    grid-template-columns: none;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) :is(.filter-list, .scientist-grid)::-webkit-scrollbar {
    display: none;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .filter-pill {
    width: auto;
    min-width: max-content;
    min-height: 44px;
    padding: 0 16px;
    flex: 0 0 auto;
    border-radius: 15px;
    color: var(--mobile-copy);
    font-size: 12px;
    scroll-snap-align: start;
    text-overflow: clip;
    touch-action: manipulation;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .filter-pill.is-active {
    background: linear-gradient(125deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 22px rgba(var(--accent-rgb), 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-hero {
    display: block;
    min-height: 624px;
    margin-top: 28px;
    grid-template-columns: none;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-hero__clip {
    border-radius: 26px;
    box-shadow: 0 22px 48px rgba(16, 58, 83, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-hero__surface {
    background:
      radial-gradient(circle at 20% 5%, color-mix(in srgb, var(--accent-2) 24%, transparent), transparent 38%),
      linear-gradient(180deg, rgba(8, 21, 38, 0.04) 0%, rgba(8, 23, 40, 0.13) 39%, rgba(9, 26, 44, 0.79) 59%, rgba(8, 24, 41, 0.94) 100%);
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .hero-grid {
    border-radius: 26px;
    opacity: 0.6;
    mask-image: linear-gradient(to bottom, #000, transparent 78%);
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .hero-orbit {
    opacity: 0.52;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .hero-portrait-slot {
    position: absolute;
    top: -24px;
    right: 0;
    left: 0;
    width: 100%;
    height: 330px;
    margin-top: 0;
    border-radius: 26px 26px 0 0;
    overflow: hidden;
    transform: none;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]):not([data-subject="chemistry"]) .hero-portrait--image {
    top: var(--portrait-lift, 0px);
    right: 50%;
    bottom: auto;
    width: auto;
    height: 820px;
    max-width: none;
    object-position: center top;
    transform: translateX(50%);
  }

  body.page--scientists[data-subject="chemistry"] .hero-portrait--image {
    top: -12px;
    right: 50%;
    bottom: auto;
    left: auto;
    width: auto;
    height: 440px;
    max-width: none;
    object-position: center top;
    transform: translateX(50%);
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .portrait-halo {
    right: 50%;
    bottom: -20px;
    left: auto;
    width: 250px;
    height: 250px;
    transform: translateX(50%);
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .hero-illustration {
    display: none;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .hero-content {
    position: absolute;
    right: 19px;
    bottom: 83px;
    left: 19px;
    width: auto;
    margin: 0;
    padding: 0;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .hero-content__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .hero-content__heading h2 {
    max-width: 100%;
    font-size: clamp(27px, 8.2vw, 32px);
    line-height: 1.02;
    text-wrap: pretty;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .hero-content__heading span {
    font-size: 12px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .hero-content__role {
    margin: 10px 0 14px;
    font-size: 13px;
    line-height: 1.42;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .hero-content__label {
    margin-bottom: 8px;
    font-size: 12px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .discovery-list {
    font-size: 12px;
    gap: 7px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .discovery-list li {
    align-items: flex-start;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .discovery-list li span {
    margin-top: 1px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .details-button {
    right: 17px;
    bottom: 16px;
    left: 17px;
    width: auto;
    height: 52px;
    padding: 0 7px 0 18px;
    justify-content: space-between;
    border-radius: 17px;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    box-shadow: 0 14px 30px rgba(var(--accent-rgb), 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.52);
    color: #fff;
  }

  body.page--scientists[data-subject="chemistry"] .details-button {
    background: linear-gradient(120deg, #fe4caf, #ff765f);
    box-shadow: 0 14px 30px rgba(247, 71, 151, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.52);
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .details-button__arrow {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: var(--mobile-accent-deep);
  }

  body.page--scientists[data-subject="chemistry"] .details-button__arrow {
    color: #ec4c9f;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-list-heading {
    display: flex;
    margin: 24px 2px 10px;
    align-items: flex-end;
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-list-heading h2 {
    font-size: 22px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-list-heading > p {
    flex: 0 0 auto;
    margin-bottom: 2px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-grid {
    display: grid;
    margin-right: -14px;
    padding: 3px 14px 18px 2px;
    grid-template-columns: none;
    grid-auto-columns: min(82vw, 318px);
    grid-auto-flow: column;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-padding-inline: 2px;
    scroll-snap-type: x mandatory;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-card {
    min-height: 162px;
    padding: 8px;
    border-radius: 22px;
    grid-template-columns: 98px minmax(0, 1fr);
    scroll-snap-align: start;
    touch-action: manipulation;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .card-portrait {
    width: auto;
    height: auto;
    min-height: 146px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]):not([data-subject="chemistry"]) .card-portrait img {
    top: -2px;
    right: 50%;
    bottom: auto;
    width: auto;
    height: 252px;
    max-width: none;
    object-position: center top;
    transform: translateX(50%);
  }

  body.page--scientists[data-subject="chemistry"] .card-portrait img {
    top: auto;
    right: 50%;
    bottom: -3px;
    width: auto;
    height: 165px;
    max-width: none;
    object-position: center bottom;
    transform: translateX(50%);
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-card__content {
    padding: 7px 12px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-card__topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-card__topline strong {
    display: -webkit-box;
    max-width: 100%;
    font-size: 15px;
    line-height: 1.12;
    text-overflow: clip;
    white-space: normal;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-card__description {
    margin-top: 7px;
    color: #536d87;
    font-size: 11px;
    line-height: 1.38;
    -webkit-line-clamp: 2;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .tag-row {
    gap: 4px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .tag {
    max-width: 52%;
    padding: 4px 6px;
    font-size: 10px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-card__arrow {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 700px) {
  body.page--classes[data-subject]:not([data-subject="geography"]) .classes-main {
    padding-top: 4px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .classes-hero {
    display: grid;
    height: 405px;
    min-height: 0;
    grid-template-rows: 195px 210px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .classes-hero__copy {
    width: auto;
    padding: 30px 4px 0;
    overflow: hidden;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .classes-hero__copy h1 {
    min-height: 50px;
    font-size: clamp(47px, 14vw, 52px);
    letter-spacing: -0.06em;
    line-height: 0.96;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .classes-hero__copy p {
    min-height: 0;
    margin-top: 13px;
    color: var(--mobile-copy);
    font-size: 14px;
    line-height: 1.5;
    -webkit-line-clamp: 5;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .classes-hero__visual {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    height: 210px;
    margin-top: 0;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .classes-hero__halo {
    top: 38px;
    right: 12%;
    width: 76%;
    height: 145px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .classes-hero__cell-ring {
    display: none;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .grade-switch {
    position: sticky;
    z-index: 30;
    top: max(8px, env(safe-area-inset-top));
    height: 60px;
    border-radius: 19px;
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .grade-tab {
    min-height: 48px;
    font-size: 13px;
    touch-action: manipulation;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-heading {
    min-height: 62px;
    padding: 20px 2px 11px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-grid {
    gap: 10px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-card {
    --mobile-lesson-art: clamp(124px, 38vw, 166px);
    height: 202px;
    border-radius: 23px;
    box-shadow: 0 14px 32px rgba(25, 70, 86, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.96);
    touch-action: manipulation;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-card__content {
    width: calc(100% - var(--mobile-lesson-art));
    padding: 18px 0 15px 18px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-card__kicker {
    margin-bottom: 7px;
    font-size: 9.5px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-card h3 {
    font-size: 19px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-card--long-title h3 {
    font-size: 17px;
    line-height: 1.08;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-card--very-long-title h3 {
    font-size: 16px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-card__description {
    margin-top: 7px;
    font-size: 12.5px;
    line-height: 1.38;
    -webkit-line-clamp: 3;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-card__formats {
    max-height: 48px;
    flex-wrap: wrap;
    row-gap: 4px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-card__art {
    top: 8px;
    right: 2px;
    width: var(--mobile-lesson-art);
    height: calc(100% - 16px);
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-card__arrow {
    right: 10px;
    bottom: 10px;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 380px) {
  body[data-subject]:not([data-subject="geography"]) .topbar__left {
    gap: 8px;
  }

  body[data-subject]:not([data-subject="geography"]) .brand img {
    width: 94px;
  }

  body[data-subject]:not([data-subject="geography"]) .language-switch {
    width: 108px;
  }
}

@media (max-width: 350px) {
  body[data-subject]:not([data-subject="geography"]) .app-shell,
  body[data-subject]:not([data-subject="geography"]) .app-shell--classes {
    width: calc(100% - 24px);
  }

  body[data-subject]:not([data-subject="geography"]) .topbar {
    display: grid;
    min-height: 96px;
    align-items: center;
    grid-template-areas:
      "left instruction"
      "language language";
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-rows: 44px 44px;
    column-gap: 8px;
    row-gap: 8px;
  }

  body[data-subject]:not([data-subject="geography"]) .topbar__left {
    grid-area: left;
    gap: 7px;
  }

  body[data-subject]:not([data-subject="geography"]) .topbar__actions {
    display: contents;
  }

  body[data-subject]:not([data-subject="geography"]) .topbar [data-instruction] {
    grid-area: instruction;
  }

  body[data-subject]:not([data-subject="geography"]) .language-switch {
    width: 100%;
    grid-area: language;
  }

  body[data-subject]:not([data-subject="geography"]) .brand img {
    width: 94px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .subject-hero {
    grid-template-rows: auto 180px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .subject-hero__copy {
    padding-top: 27px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .subject-hero__scene {
    height: 180px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card {
    height: 182px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card__content {
    width: 58%;
    padding-left: 17px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card__art-wrap {
    width: 42%;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card h2 {
    font-size: 18px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .section-card__arrow {
    left: 17px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .topic-card {
    padding: 8px;
    gap: 7px;
  }

  body.page--subject[data-subject]:not([data-subject="geography"]) .topic-card strong {
    font-size: 11px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .classes-hero {
    height: 410px;
    grid-template-rows: 220px 190px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .classes-hero__copy {
    padding-top: 25px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .classes-hero__visual {
    height: 190px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-card {
    --mobile-lesson-art: 118px;
    height: 214px;
  }

  body.page--classes[data-subject]:not([data-subject="geography"]) .lesson-card__content {
    padding-left: 16px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientists-intro {
    padding-top: 19px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-hero {
    min-height: 640px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .hero-portrait-slot {
    height: 318px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]):not([data-subject="chemistry"]) .hero-portrait--image {
    height: 760px;
  }

  body.page--scientists[data-subject="chemistry"] .hero-portrait--image {
    height: 410px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .hero-content {
    right: 17px;
    left: 17px;
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-grid {
    margin-right: -12px;
    padding-right: 12px;
    grid-auto-columns: calc(100vw - 42px);
  }

  body.page--scientists[data-subject]:not([data-subject="geography"]) .scientist-card {
    grid-template-columns: 90px minmax(0, 1fr);
  }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  body[data-subject]:not([data-subject="geography"]) :is(.filter-list, .scientist-grid) {
    scroll-behavior: auto;
  }

  body[data-subject]:not([data-subject="geography"]) .lesson-card__art::before,
  body[data-subject]:not([data-subject="geography"]) .section-card__art {
    transition-duration: 0.01ms;
  }
}
