:root {
  --round4-blue: #2b6bff;
  --round4-ink: #151515;
  --round4-muted: #68707a;
  --round4-line: #d8dadd;
  --round4-soft: #f4f6f8;
  --round4-paper: #ffffff;
}

.knowledge-round4-page,
.knowledge-module-page,
.knowledge-tools-open-page {
  background: var(--round4-paper);
  color: var(--round4-ink);
}

.round4-hero {
  border-bottom: 1px solid var(--round4-line);
}

.round4-hero__row {
  display: grid;
  min-height: 190px;
  grid-template-columns: minmax(280px, 0.75fr) minmax(480px, 1.25fr);
  align-items: center;
  gap: 64px;
  padding-block: 34px;
}

.round4-hero__copy h1 {
  margin: 4px 0 10px;
  font-size: 38px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.round4-hero__copy > p:last-child {
  max-width: 560px;
  margin: 0;
  color: var(--round4-muted);
  font-size: 14px;
  line-height: 1.7;
}

.round4-search label {
  display: block;
  margin-bottom: 8px;
  color: var(--round4-muted);
  font-size: 12px;
}

.round4-search__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 10px;
}

.round4-search input,
.round4-filter-toggle {
  min-height: 48px;
  border: 1px solid var(--round4-ink);
  border-radius: 0;
  background: var(--round4-paper);
  color: var(--round4-ink);
}

.round4-search input {
  min-width: 0;
  padding: 0 15px;
  font: inherit;
}

.round4-filter-toggle {
  cursor: pointer;
  font-weight: 700;
}

.round4-search input:focus,
.round4-filter-toggle:focus-visible {
  border-color: var(--round4-blue);
  outline: 2px solid color-mix(in srgb, var(--round4-blue) 20%, transparent);
  outline-offset: 1px;
}

.round4-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.round4-active-filters a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid #b9c8ed;
  border-radius: 3px;
  color: inherit;
  text-decoration: none;
  background: #f5f8ff;
  color: #244b9d;
  cursor: pointer;
  font-size: 12px;
}

.round4-map-section {
  padding: 54px 0 62px;
}

.round4-map-heading,
.module-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 22px;
}

.round4-map-heading p,
.module-section-heading p {
  margin: 0 0 6px;
  color: var(--round4-muted);
  font-size: 12px;
}

.round4-map-heading h2,
.module-section-heading h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
}

.round4-map-heading > span {
  max-width: 430px;
  color: var(--round4-muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
}

.knowledge-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  min-height: 0;
  padding: 28px 0 10px;
  border: 0;
}

.knowledge-map__track {
  position: absolute;
  top: 38px;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--round4-line);
}

.knowledge-map__stage,
.knowledge-map__stage:last-of-type {
  padding: 0;
  border: 0;
}

.knowledge-map__stage-toggle {
  min-height: 98px;
  padding: 0 0 18px;
  border: 0;
  background: transparent;
  text-align: left;
}

.knowledge-map__stage-toggle > span {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px solid var(--round4-blue);
  border-radius: 50%;
  background: var(--round4-paper);
}

.knowledge-map__nodes {
  gap: 0;
}

.knowledge-map__node {
  min-height: 84px;
  padding: 15px 0;
  border: 0;
  border-top: 1px solid var(--round4-line);
  background: transparent;
}

.knowledge-map__node:hover,
.knowledge-map__node:focus-visible {
  border-color: var(--round4-blue);
  background: transparent;
}

.knowledge-map__node {
  grid-template-columns: 17px minmax(0, 1fr) 18px;
}

.knowledge-map__node-arrow {
  align-self: center;
  color: var(--round4-blue);
  font-size: 14px;
}

.knowledge-map__node:hover .knowledge-map__node-mark,
.knowledge-map__node:focus-visible .knowledge-map__node-mark {
  background: var(--round4-blue);
  box-shadow: 0 0 0 1px var(--round4-blue);
}

.round4-aux {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 20px;
  border-bottom: 1px solid var(--round4-line);
}

.round4-aux a {
  padding: 0 0 14px;
  color: var(--round4-ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.round4-aux a:hover {
  color: var(--round4-blue);
}

.round4-results {
  padding: 56px 0 92px;
  border-top: 1px solid var(--round4-line);
}

.has-active-catalog .round4-map-section {
  display: none;
}

.has-active-catalog .round4-results {
  padding-top: 34px;
  border-top: 0;
}

.resource-catalog-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  align-items: stretch;
  border-top: 1px solid var(--round4-line);
}

.resource-card {
  min-height: 0;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  border: 0;
  border-bottom: 1px solid var(--round4-line);
  transition: border-color 150ms ease, color 150ms ease;
}

.resource-card:hover {
  border-color: #9da4ad;
}

.resource-card__body,
.resource-card--course .resource-card__body,
.resource-card--open_resource .resource-card__body,
.resource-card--tool .resource-card__body,
.resource-card--repository .resource-card__body,
.resource-card--formula .resource-card__body {
  min-height: 0;
  padding: 18px 0 18px 16px;
}

.resource-card__media {
  min-height: 0;
  height: 92px;
  margin: 18px 0;
}

.resource-card__media img {
  height: 100%;
  object-fit: cover;
}

.resource-card h3 {
  margin: 12px 0 8px;
  font-size: 19px;
}

.resource-card__summary {
  -webkit-line-clamp: 2;
  line-height: 1.65;
}

.resource-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 12px;
}

.resource-card__cta {
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}

.resource-card__cta::after {
  display: none;
}

.round4-filter-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgb(15 18 22 / 22%);
}

.round4-filter-panel {
  position: fixed;
  z-index: 100;
  top: 92px;
  right: 32px;
  display: none;
  width: min(390px, calc(100% - 64px));
  max-height: calc(100vh - 124px);
  padding: 22px;
  overflow-y: auto;
  border: 1px solid var(--round4-line);
  background: var(--round4-paper);
  box-shadow: 0 22px 55px rgb(26 32 44 / 16%);
}

.round4-filter-panel.is-open {
  display: block;
}

.round4-filter-panel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.round4-filter-panel__heading strong {
  font-size: 22px;
}

.round4-filter-panel__heading button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--round4-line);
  background: var(--round4-paper);
  cursor: pointer;
  font-size: 22px;
}

.round4-filter-group {
  padding: 16px 0;
  border-top: 1px solid var(--round4-line);
}

.round4-filter-group > p,
.round4-filter-group label {
  display: grid;
  gap: 9px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.round4-filter-group select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--round4-line);
  border-radius: 0;
  background: var(--round4-paper);
  color: var(--round4-ink);
}

.catalog-sort {
  display: grid;
  gap: 7px;
  min-width: 140px;
  color: var(--round4-muted);
  font-size: 12px;
}

.catalog-sort select {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--round4-line);
  border-radius: 0;
  background: var(--round4-paper);
  color: var(--round4-ink);
}

.round4-filter-panel .catalog-type-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.round4-filter-panel .catalog-type-tabs button {
  min-height: 40px;
  padding: 6px 10px;
}

.round4-filter-panel__actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--round4-line);
}

.round4-filter-panel__actions button {
  min-height: 44px;
  border: 1px solid var(--round4-ink);
  background: var(--round4-paper);
  cursor: pointer;
  font-weight: 700;
}

.round4-filter-panel__actions [data-filter-apply] {
  background: var(--round4-ink);
  color: var(--round4-paper);
}

.filter-panel-open {
  overflow: hidden;
}

.module-main {
  padding: 0 0 96px;
}

.module-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 72px;
  padding: 34px 0 46px;
  border-bottom: 1px solid var(--round4-ink);
}

.module-hero h1 {
  margin: 8px 0 14px;
  font-size: 48px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0;
}

.module-hero > div > p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--round4-muted);
  font-size: 16px;
  line-height: 1.75;
}

.module-hero dl {
  display: grid;
  align-content: end;
  gap: 18px;
  margin: 0;
}

.module-hero dl div {
  padding-top: 12px;
  border-top: 1px solid var(--round4-line);
}

.module-hero dt {
  color: var(--round4-muted);
  font-size: 12px;
}

.module-hero dd {
  margin: 6px 0 0;
  line-height: 1.6;
}

.module-start {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin-top: 36px;
  padding: 24px 26px;
  border-left: 3px solid var(--round4-blue);
  background: var(--round4-soft);
}

.module-start p,
.module-start h2,
.module-start span {
  margin: 0;
}

.module-start p {
  color: var(--round4-blue);
  font-size: 12px;
  font-weight: 700;
}

.module-start h2 {
  margin-top: 5px;
  font-size: 23px;
}

.module-start span {
  display: block;
  margin-top: 7px;
  color: var(--round4-muted);
  font-size: 13px;
}

.module-start > a {
  min-width: 132px;
  padding: 13px 16px;
  background: var(--round4-ink);
  color: var(--round4-paper);
  text-align: center;
  text-decoration: none;
}

.module-sequence,
.module-library,
.open-source-section {
  padding-top: 64px;
}

.module-sequence ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--round4-ink);
  list-style: none;
}

.module-sequence li {
  display: grid;
  min-width: 0;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 22px 18px 24px;
  border-right: 1px solid var(--round4-line);
  border-bottom: 1px solid var(--round4-line);
}

.module-sequence li:nth-child(4n) {
  border-right: 0;
}

.module-sequence li > span {
  color: var(--round4-blue);
  font-size: 11px;
  font-weight: 700;
}

.module-sequence small {
  color: var(--round4-muted);
  font-size: 11px;
}

.module-sequence strong {
  display: block;
  margin-top: 5px;
  line-height: 1.45;
}

.module-sequence strong a {
  color: var(--round4-ink);
  text-decoration: none;
}

.module-sequence strong a:hover {
  color: var(--round4-blue);
}

.module-sequence p {
  margin: 8px 0 0;
  color: var(--round4-muted);
  font-size: 12px;
  line-height: 1.6;
}

.module-type-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.module-type-filter button {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--round4-line);
  background: var(--round4-paper);
  cursor: pointer;
}

.module-type-filter button[aria-pressed="true"] {
  border-color: var(--round4-ink);
  background: var(--round4-ink);
  color: var(--round4-paper);
}

.module-resource-grid,
.open-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.module-resource,
.open-source-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--round4-line);
}

.module-resource__meta,
.open-source-card > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--round4-blue);
  font-size: 11px;
}

.module-resource h3,
.open-source-card h2 {
  margin: 13px 0 8px;
  font-size: 19px;
  line-height: 1.45;
}

.module-resource p,
.open-source-card p {
  margin: 0;
  color: var(--round4-muted);
  font-size: 13px;
  line-height: 1.7;
}

.module-resource small,
.open-source-card small {
  display: block;
  margin-top: 14px;
  color: var(--round4-muted);
  line-height: 1.6;
}

.module-resource > a,
.open-source-card > a {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 18px;
  color: var(--round4-ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.module-resource > a:hover,
.open-source-card > a:hover {
  color: var(--round4-blue);
}

.module-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--round4-ink);
}

.module-pagination a {
  display: grid;
  padding: 18px;
  border: 1px solid var(--round4-line);
  color: var(--round4-ink);
  text-decoration: none;
}

.module-pagination a:last-child {
  text-align: right;
}

.module-pagination small {
  color: var(--round4-muted);
}

.module-pagination strong {
  margin-top: 5px;
}

.article-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
  color: var(--round4-muted);
  font-size: 12px;
}

.article-breadcrumb a {
  color: inherit;
}

.article-year {
  margin: 14px 0 0;
  color: var(--round4-muted);
  font-size: 13px;
}

@media (max-width: 1023px) {
  .round4-hero__row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .round4-map-heading {
    align-items: start;
  }

  .knowledge-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-map__stage:nth-of-type(2) {
    border-right: 0;
  }

  .module-sequence ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-sequence li:nth-child(2n) {
    border-right: 0;
  }

  .module-resource-grid,
  .open-source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .round4-hero__row {
    min-height: 0;
    gap: 18px;
    padding-block: 24px;
  }

  .round4-hero__copy h1 {
    font-size: 30px;
  }

  .round4-search__row {
    grid-template-columns: minmax(0, 1fr) 88px;
  }

  .round4-map-section {
    padding: 36px 0 44px;
  }

  .round4-map-heading,
  .module-section-heading {
    display: block;
  }

  .round4-map-heading h2,
  .module-section-heading h2 {
    font-size: 25px;
  }

  .round4-map-heading > span {
    display: block;
    margin-top: 10px;
    text-align: left;
  }

  .knowledge-map {
    display: block;
    min-height: 0;
  }

  .knowledge-map__stage {
    padding: 0;
    border-right: 0;
  }

  .knowledge-map__node {
    min-height: 72px;
    grid-template-columns: 17px minmax(0, 1fr) 18px;
  }

  .round4-aux {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .round4-results {
    padding: 38px 0 64px;
  }

  .round4-filter-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(78vh, 680px);
    padding: 18px 16px max(18px, env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    box-shadow: 0 -18px 48px rgb(26 32 44 / 20%);
  }

  .round4-filter-panel .catalog-type-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-main {
    padding-bottom: 64px;
  }

  .module-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 24px 0 34px;
  }

  .module-hero h1 {
    font-size: 37px;
  }

  .module-start {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .module-start > a {
    width: 100%;
  }

  .module-sequence,
  .module-library,
  .open-source-section {
    padding-top: 48px;
  }

  .module-sequence ol,
  .module-resource-grid,
  .open-source-grid {
    grid-template-columns: 1fr;
  }

  .module-sequence li,
  .module-sequence li:nth-child(2n),
  .module-sequence li:nth-child(4n) {
    border-right: 0;
  }

  .module-pagination {
    grid-template-columns: 1fr;
  }

  .module-pagination a:last-child {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .resource-card,
  .resource-card__media img {
    transition: none;
  }
}
