/* ==================================================
   DESKTOP + TABLET
   ================================================== */

.library-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(62px, 7vw, 96px) 0 clamp(88px, 9vw, 124px);
  color: #fff;
  background:
    radial-gradient(circle at 82% 24%, rgba(243, 107, 19, 0.17), transparent 30%),
    linear-gradient(125deg, var(--fx-navy-950), #102e5c 72%, #173c70);
}

.library-hero::before,
.library-hero::after {
  position: absolute;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.library-hero::before {
  width: 360px;
  height: 360px;
  top: -210px;
  left: -150px;
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.library-hero::after {
  width: 240px;
  height: 240px;
  right: 4%;
  bottom: -175px;
  background: rgba(243, 107, 19, 0.08);
}

.library-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: clamp(40px, 6vw, 86px);
  align-items: center;
}

.library-hero__content {
  max-width: 700px;
}

.library-hero h1,
.library-hero h2 {
  color: #fff;
}

.library-hero h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(2.65rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.library-hero p:not(.eyebrow) {
  max-width: 650px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.72;
}

.library-hero .button-row {
  margin-top: 28px;
}

.library-hero__visual {
  position: relative;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 30px 70px rgba(3, 12, 30, 0.34);
}

.library-hero__visual::after {
  position: absolute;
  inset: auto 28px -14px;
  height: 28px;
  border-radius: 50%;
  background: rgba(3, 12, 30, 0.26);
  filter: blur(18px);
  content: "";
  pointer-events: none;
}

.library-hero__visual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  object-position: center 46%;
  border-radius: 16px;
  background: #fff;
}

.library-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.library-stats span {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  gap: 4px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.78rem;
}

.library-stats strong {
  color: #fff;
}

.library-search-panel {
  position: relative;
  z-index: 4;
  margin-top: -48px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid rgba(7, 20, 47, 0.1);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 253, 0.99));
  box-shadow: 0 24px 60px rgba(7, 20, 47, 0.14);
}

.library-search-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 30px;
  align-items: end;
  margin-bottom: 18px;
}

.library-search-intro h2 {
  margin: 3px 0 0;
  font-size: clamp(1.45rem, 2.3vw, 2rem);
}

.library-search-intro > p {
  margin: 0;
  color: var(--fx-muted);
  line-height: 1.65;
}

.library-search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 8px;
  border: 1px solid rgba(14, 35, 72, 0.13);
  border-radius: 16px;
  background: #eef2f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.library-search-box input {
  min-height: 54px;
  padding: 13px 16px;
  border: 1px solid rgba(14, 35, 72, 0.1);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(7, 20, 47, 0.04);
  font-size: 1rem;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.library-search-box input:focus {
  border-color: var(--fx-orange-500);
  outline: 3px solid rgba(243, 107, 19, 0.14);
}

.library-search-box span {
  align-self: center;
  min-height: 38px;
  padding: 10px 13px;
  border: 1px solid rgba(14, 35, 72, 0.1);
  border-radius: 999px;
  color: var(--fx-navy-700);
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.83rem;
  font-weight: 900;
  white-space: nowrap;
}

.library-toolbar {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(14, 35, 72, 0.1);
}

.library-category-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 16px;
  border: 1px solid rgba(243, 107, 19, 0.2);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff8f2, #fff);
}

.library-category-context[hidden],
.library-filters[hidden],
.library-category-continuation[hidden] {
  display: none;
}

.library-category-context > div {
  display: grid;
  gap: 2px;
}

.library-category-context span {
  color: #667085;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-category-context strong {
  color: var(--fx-navy-950);
  font-size: 1rem;
}

.library-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.library-filter {
  flex: none;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--fx-line);
  border-radius: 999px;
  color: var(--fx-navy-950);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 850;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.library-filter:hover,
.library-filter:focus-visible {
  border-color: rgba(243, 107, 19, 0.48);
  background: var(--fx-orange-100);
}

.library-filter.active {
  color: #fff;
  border-color: var(--fx-orange-600);
  background: var(--fx-orange-600);
  box-shadow: 0 8px 18px rgba(233, 87, 9, 0.2);
}

.library-selectors {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.library-selectors label {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 10px 11px 11px;
  border: 1px solid rgba(14, 35, 72, 0.11);
  border-radius: 14px;
  color: #536075;
  background: #fff;
  box-shadow: 0 7px 18px rgba(7, 20, 47, 0.045);
  font-size: 0.74rem;
  font-weight: 850;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.library-selectors label > span {
  padding-inline: 2px;
  letter-spacing: 0.035em;
}

.library-selectors select {
  width: 100%;
  min-height: 46px;
  padding: 10px 38px 10px 12px;
  border: 1px solid rgba(14, 35, 72, 0.16);
  border-radius: 11px;
  color: var(--fx-navy-950);
  background-color: #f9fbfd;
  background-image:
    linear-gradient(45deg, transparent 50%, #334a6f 50%),
    linear-gradient(135deg, #334a6f 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 20px,
    calc(100% - 12px) 20px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  font: inherit;
  font-size: 0.88rem;
  appearance: none;
  cursor: pointer;
}

.library-selectors label:hover,
.library-selectors label:focus-within {
  border-color: rgba(243, 107, 19, 0.34);
  box-shadow: 0 11px 24px rgba(7, 20, 47, 0.08);
  transform: translateY(-2px);
}

.library-selectors select:focus-visible {
  border-color: var(--fx-orange-500);
  outline: 3px solid rgba(243, 107, 19, 0.12);
}

.library-purpose {
  padding: clamp(68px, 8vw, 100px) 0 clamp(56px, 7vw, 84px);
}

.library-purpose__grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(34px, 6vw, 78px);
  align-items: center;
}

.library-purpose__intro h2 {
  max-width: 570px;
  margin-bottom: 14px;
}

.library-purpose__intro p:last-child {
  max-width: 590px;
  color: var(--fx-muted);
  line-height: 1.72;
}

.library-purpose__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.library-purpose__steps li {
  position: relative;
  min-height: 190px;
  padding: 24px 21px;
  border: 1px solid var(--fx-line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 12px 30px rgba(7, 20, 47, 0.065);
}

.library-purpose__steps li::after {
  position: absolute;
  right: -15px;
  top: 39px;
  width: 16px;
  height: 2px;
  background: var(--fx-orange-500);
  content: "";
}

.library-purpose__steps li:last-child::after {
  display: none;
}

.library-purpose__steps span {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  margin-bottom: 19px;
  border-radius: 50%;
  color: var(--fx-orange-600);
  background: var(--fx-orange-100);
  font-size: 0.78rem;
  font-weight: 900;
}

.library-purpose__steps strong,
.library-purpose__steps small {
  display: block;
}

.library-purpose__steps strong {
  color: var(--fx-navy-950);
  line-height: 1.3;
}

.library-purpose__steps small {
  margin-top: 9px;
  color: var(--fx-muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.library-categories {
  position: relative;
  padding-block: clamp(64px, 7vw, 88px);
  background: linear-gradient(180deg, #edf2f8, #f8fafc);
}

.library-categories::before {
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(7, 20, 47, 0.15), transparent);
  content: "";
}

.library-categories .section-heading {
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: 30px;
}

.library-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: clamp(18px, 1.7vw, 24px);
  align-items: stretch;
}

.library-category-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  padding: 0;
  border: 1px solid rgba(7, 20, 47, 0.11);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(7, 20, 47, 0.075);
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 280ms ease, box-shadow 280ms ease;
}

.library-category-card:nth-child(9) {
  grid-column: 2;
}

.library-category-card:nth-child(10) {
  grid-column: 3;
}

.library-category-card__image {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0;
  padding: 10px;
  border-bottom: 1px solid rgba(7, 20, 47, 0.08);
  background: linear-gradient(145deg, #eef2f7, #fffaf5);
}

.library-category-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  background: #fff;
  transition: transform 360ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.library-category-card__content {
  display: flex;
  min-width: 0;
  height: 100%;
  flex: 1;
  flex-direction: column;
  padding: 19px;
}

.library-category-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  color: #fff;
  background: var(--fx-navy-950);
  box-shadow: 0 8px 20px rgba(7, 20, 47, 0.18);
}

.library-category-icon svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.library-topic {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--fx-orange-600);
  background: var(--fx-orange-100);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.library-category-card h3 {
  min-height: 2.6em;
  margin: 13px 0 7px;
  font-size: 1.12rem;
  line-height: 1.3;
}

.library-category-card strong {
  color: var(--fx-navy-700);
  font-size: 0.82rem;
}

.library-category-card p {
  min-height: 4.75em;
  margin: 11px 0 13px;
  color: var(--fx-muted);
  font-size: 0.8rem;
  line-height: 1.58;
}

.library-category-card small {
  display: block;
  color: var(--fx-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.library-category-card__meta {
  display: grid;
  min-height: 3.2em;
  gap: 3px;
}

.library-category-card .text-link {
  margin-top: auto;
  padding-top: 17px;
}

.library-featured {
  padding-top: clamp(66px, 8vw, 96px);
  padding-bottom: clamp(54px, 6vw, 78px);
}

.library-featured .section-heading {
  max-width: 720px;
  margin-bottom: 28px;
}

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

.lesson-card {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(7, 20, 47, 0.1);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(7, 20, 47, 0.075);
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 280ms ease, box-shadow 280ms ease;
}

.lesson-card__body {
  display: flex;
  min-width: 0;
  height: 100%;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.lesson-card h3 {
  min-height: 2.76em;
  margin: 13px 0 9px;
  font-size: 1.02rem;
  line-height: 1.38;
}

.lesson-card p {
  min-height: 4.75em;
  color: #4b586d;
  font-size: 0.86rem;
  line-height: 1.58;
}

.lesson-card__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.lesson-card__visual {
  display: block;
  overflow: hidden;
  margin: 0;
  padding: 9px;
  border-bottom: 1px solid var(--fx-line);
  background: linear-gradient(145deg, #eef2f7, #fffaf5);
}

.lesson-card__visual img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  object-position: center;
  border-radius: 11px;
  background: #fff;
  transition: transform 360ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.lesson-card__outcomes {
  margin: 9px 0 5px;
  padding: 12px 13px;
  border-left: 3px solid var(--fx-orange-500);
  border-radius: 0 10px 10px 0;
  background: #fff8f2;
}

.lesson-card__outcomes strong {
  color: var(--fx-navy-950);
  font-size: 0.74rem;
}

.lesson-card__outcomes ul {
  display: grid;
  gap: 5px;
  margin: 7px 0 0;
  padding-left: 17px;
}

.lesson-card__outcomes li {
  color: var(--fx-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.lesson-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
  margin: 12px 0;
  color: #526078;
  font-size: 0.72rem;
}

.lesson-card-meta > span {
  padding: 5px 8px;
  border: 1px solid rgba(14, 35, 72, 0.07);
  border-radius: 999px;
  background: #f4f7fb;
}

.lesson-card .text-link,
.lesson-card .button,
.lesson-card .btn {
  margin-top: auto;
}

.library-freshness {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  color: #a63b08;
  background: #fff2e9;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.library-freshness--new {
  color: #087443;
  background: #ecfdf3;
}

.library-recommendations {
  padding: clamp(62px, 7vw, 88px) 0;
  color: #fff;
  background:
    radial-gradient(circle at 88% 18%, rgba(243, 107, 19, 0.18), transparent 25%),
    linear-gradient(125deg, var(--fx-navy-950), #102b56);
}

.library-recommendations .section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.library-recommendations .section-heading h2 {
  color: #fff;
}

.library-recommendations .section-heading p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.72);
}

.library-recommendation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.library-recommendation-card {
  display: flex;
  min-height: 215px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 14px 32px rgba(3, 12, 30, 0.18);
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 280ms ease, background 280ms ease;
}

.library-recommendation-card h3 {
  margin: 14px 0 8px;
  color: #fff;
  font-size: 1rem;
  line-height: 1.4;
}

.library-recommendation-card p,
.library-recommendation-card small {
  color: rgba(255, 255, 255, 0.7);
}

.library-recommendation-card p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.56;
}

.library-recommendation-card small {
  display: block;
  margin-top: 12px;
  font-size: 0.7rem;
}

.library-recommendation-card .text-link {
  margin-top: auto;
  padding-top: 17px;
  color: #fff;
}

.library-honest-state {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.library-honest-state strong {
  color: #fff;
}

.library-honest-state p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.68);
}

.library-browse-cta {
  padding: clamp(58px, 6vw, 78px) 0;
  background: linear-gradient(180deg, #f5f8fb, #fff);
}

.library-browse-cta__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: center;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid rgba(7, 20, 47, 0.1);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(7, 20, 47, 0.1);
}

.library-browse-cta__inner h2 {
  margin-bottom: 9px;
}

.library-browse-cta__inner p:last-child {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--fx-muted);
}

.library-results-section {
  padding-block: clamp(58px, 6vw, 78px);
  background: linear-gradient(180deg, #f3f6fa, #f8fafc);
}

.library-results-section[hidden] {
  display: none;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 18px;
  align-items: stretch;
}

.library-empty {
  grid-column: 1 / -1;
  padding: 26px;
  border: 1px dashed var(--fx-line);
  border-radius: 14px;
  color: var(--fx-muted);
  background: #fff;
  text-align: center;
}

.library-load-more {
  display: flex;
  justify-content: center;
  margin: 26px auto 0;
}

.library-load-more[hidden] {
  display: none;
}

.library-related {
  padding-block: clamp(64px, 7vw, 90px);
  background: linear-gradient(180deg, #fff, #fffaf5);
}

.library-category-continuation {
  padding: 0 0 clamp(54px, 7vw, 82px);
  background: var(--fx-soft);
}

.library-category-continuation__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: center;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 10%, rgba(243, 107, 19, 0.2), transparent 30%),
    var(--fx-navy-950);
  box-shadow: 0 18px 42px rgba(7, 20, 47, 0.16);
}

.library-category-continuation__inner h2 {
  margin-bottom: 8px;
  color: #fff;
}

.library-category-continuation__inner p:last-child {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.library-related .section-heading {
  max-width: 740px;
  margin-bottom: 28px;
}

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

.related-course-card {
  display: flex;
  min-height: 225px;
  flex-direction: column;
  padding: 23px;
  border: 1px solid rgba(7, 20, 47, 0.1);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(7, 20, 47, 0.07);
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 280ms ease, box-shadow 280ms ease;
}

.related-course-card::before {
  width: 46px;
  height: 3px;
  margin-bottom: 20px;
  border-radius: 999px;
  background: var(--fx-orange-500);
  content: "";
}

.related-course-card h3 {
  font-size: 1.06rem;
  line-height: 1.4;
}

.related-course-card p {
  color: var(--fx-muted);
  font-size: 0.83rem;
  line-height: 1.6;
}

.related-course-card .text-link {
  margin-top: auto;
}

.library-updates-section {
  padding-block: clamp(52px, 6vw, 72px);
  background: linear-gradient(180deg, var(--fx-cream), #fff5e9);
}

.library-updates {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: clamp(26px, 4vw, 40px);
  border: 1px solid rgba(243, 107, 19, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 38px rgba(7, 20, 47, 0.08);
}

.library-updates h2 {
  margin-bottom: 9px;
}

.library-updates p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--fx-muted);
}

.library-assessment-section {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding-block: clamp(48px, 5vw, 66px);
  border-bottom: 10px solid #f4f7fb;
  background:
    radial-gradient(circle at 90% 20%, rgba(243, 107, 19, 0.2), transparent 26%),
    linear-gradient(135deg, #102d58, var(--fx-navy-950));
}

.library-assessment-section::after {
  position: absolute;
  right: 7%;
  bottom: -160px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.library-assessment {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: center;
}

.library-assessment > div:first-child {
  max-width: 760px;
}

.library-assessment > div:last-child {
  display: grid;
  min-width: 250px;
  gap: 13px;
  justify-items: stretch;
}

.library-assessment strong {
  color: var(--fx-orange-500);
  font-size: 1.25rem;
  text-align: center;
}

.btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 11px 17px;
  border: 0;
  border-radius: 10px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background: var(--fx-orange-600);
}

.library-registration-modal {
  position: fixed;
  z-index: 1001;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 15, 35, 0.8);
}

.library-registration-modal[hidden] {
  display: none;
}

.library-registration-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.4);
}

.library-registration-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--fx-line);
  border-radius: 50%;
  color: var(--fx-navy-950);
  background: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.library-registration-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.library-registration-form label {
  display: grid;
  gap: 6px;
  color: var(--fx-navy-950);
  font-weight: 800;
}

.library-registration-form input,
.library-registration-form select {
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--fx-line);
  border-radius: 10px;
}

.library-registration-form .button,
.library-registration-form .btn,
.library-registration-status,
.library-registration-help {
  grid-column: 1 / -1;
}

.library-registration-help,
.library-registration-status {
  margin: 0;
  color: var(--fx-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.library-modal-open {
  overflow: hidden;
}

/* Dedicated category learning view. */
.library-category-intro {
  position: relative;
  overflow: hidden;
  padding: clamp(46px, 5.5vw, 70px) 0;
  border-bottom: 1px solid rgba(14, 35, 72, 0.08);
  background:
    radial-gradient(circle at 8% 10%, rgba(243, 107, 19, 0.1), transparent 24%),
    linear-gradient(135deg, #f4f7fb, #fff);
}

.library-category-intro::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--fx-orange-500), rgba(243, 107, 19, 0.12) 62%, transparent);
  content: "";
}

.library-category-intro[hidden] {
  display: none;
}

.library-category-intro__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: clamp(24px, 5vw, 60px);
  align-items: stretch;
}

.library-category-intro__overview {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(10px, 2vw, 22px) 0;
}

.library-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: #5f6d82;
  font-size: 0.78rem;
  font-weight: 800;
}

.library-breadcrumb a {
  color: var(--fx-navy-800);
}

.library-breadcrumb a:hover,
.library-breadcrumb a:focus-visible {
  color: var(--fx-orange-600);
}

.library-category-intro h1 {
  margin-bottom: 12px;
  color: var(--fx-navy-950);
}

.library-category-intro__latest {
  padding: 22px;
  border: 1px solid rgba(14, 35, 72, 0.12);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(7, 20, 47, 0.075);
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.library-learning-sequence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.library-learning-sequence span {
  padding: 8px 11px;
  border: 1px solid var(--fx-line);
  border-radius: 999px;
  color: var(--fx-navy-800);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(7, 20, 47, 0.045);
}

.library-category-view .library-hero,
.library-category-view .library-purpose,
.library-category-view #topics,
.library-category-view .library-featured,
.library-category-view .library-recommendations,
.library-category-view .library-browse-cta {
  display: none;
}

.library-category-view .library-search-panel {
  margin-top: 0;
  border-top: 3px solid rgba(243, 107, 19, 0.72);
  border-radius: 0 0 22px 22px;
  background: linear-gradient(180deg, #fff, #f7f9fc);
}

.library-category-view .library-filters {
  display: none;
}

.library-category-view .library-results-section {
  display: block;
}

.library-compact-lesson {
  padding: 13px 0;
  border-bottom: 1px solid var(--fx-line);
}

.library-compact-lesson:last-child {
  border: 0;
}

.library-compact-lesson__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.library-compact-lesson > span,
.library-compact-lesson small {
  color: var(--fx-muted);
  font-size: 0.7rem;
}

.library-compact-lesson h3 {
  margin: 7px 0;
  font-size: 0.9rem;
}

/* Subtle premium interaction and entrance behavior. */
.has-js [data-library-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.has-js [data-library-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .library-category-card:hover,
  .library-category-card:focus-within,
  .lesson-card:hover,
  .lesson-card:focus-within,
  .related-course-card:hover,
  .related-course-card:focus-within,
  .library-category-intro__latest:hover,
  .library-category-intro__latest:focus-within {
    border-color: rgba(243, 107, 19, 0.36);
    box-shadow: 0 20px 42px rgba(7, 20, 47, 0.13);
    transform: translateY(-5px);
  }

  .library-category-card:hover .library-category-card__image img,
  .library-category-card:focus-within .library-category-card__image img,
  .lesson-card:hover .lesson-card__visual img,
  .lesson-card:focus-within .lesson-card__visual img {
    transform: scale(1.018);
  }

  .library-recommendation-card:hover,
  .library-recommendation-card:focus-within {
    border-color: rgba(243, 107, 19, 0.56);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
  }
}

@media (min-width: 981px) {
  .library-search-box {
    padding-right: 190px;
  }
}

@media (max-width: 1180px) {
  .library-hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
    gap: 38px;
  }

  .library-purpose__grid {
    grid-template-columns: 1fr;
  }

  .library-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .library-category-card__image {
    aspect-ratio: 16 / 9;
  }

  .library-category-card:nth-child(9),
  .library-category-card:nth-child(10) {
    grid-column: auto;
  }

  .library-featured-grid,
  .library-recommendation-grid,
  .related-course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .library-hero {
    padding-top: 56px;
  }

  .library-hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
    gap: 30px;
  }

  .library-hero h1 {
    font-size: clamp(2.35rem, 6vw, 3.9rem);
  }

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

@media (max-width: 820px) {
  .library-hero__grid,
  .library-search-intro,
  .library-category-intro__grid {
    grid-template-columns: 1fr;
  }

  .library-hero__visual {
    max-width: 620px;
  }

  .library-hero__visual img {
    aspect-ratio: 16 / 10;
  }

  .library-search-intro {
    gap: 8px;
  }

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

  .library-purpose__steps {
    grid-template-columns: 1fr;
  }

  .library-purpose__steps li {
    min-height: auto;
    padding-left: 78px;
  }

  .library-purpose__steps span {
    position: absolute;
    top: 22px;
    left: 21px;
  }

  .library-purpose__steps li::after {
    width: 2px;
    height: 15px;
    top: auto;
    right: auto;
    bottom: -15px;
    left: 42px;
  }

  .library-browse-cta__inner,
  .library-updates,
  .library-assessment,
  .library-category-continuation__inner {
    display: grid;
    grid-template-columns: 1fr;
  }

  .library-assessment > div:last-child {
    min-width: 0;
    justify-items: start;
  }

  .library-assessment strong {
    text-align: left;
  }
}

/* ==================================================
   MOBILE
   ================================================== */

@media (max-width: 600px) {
  .library-hero {
    padding: 46px 0 78px;
  }

  .library-hero h1 {
    font-size: clamp(2.3rem, 12vw, 3.25rem);
    line-height: 1.02;
  }

  .library-hero .button-row,
  .library-hero .button-row .button {
    width: 100%;
  }

  .library-hero__grid {
    gap: 30px;
  }

  .library-hero__visual {
    width: 100%;
    padding: 9px;
    border-radius: 18px;
  }

  .library-hero__visual img {
    aspect-ratio: 4 / 3;
    object-position: center 44%;
    border-radius: 12px;
  }

  .library-stats {
    margin-top: 23px;
  }

  .library-stats span {
    min-height: 36px;
    font-size: 0.72rem;
  }

  .library-search-panel {
    width: calc(100% - 24px);
    margin-top: -30px;
    padding: 20px 16px;
    border-radius: 18px;
  }

  .library-search-intro h2 {
    font-size: 1.45rem;
  }

  .library-search-box,
  .library-selectors,
  .library-category-grid,
  .library-featured-grid,
  .library-recommendation-grid,
  .library-grid,
  .related-course-grid,
  .library-registration-form {
    grid-template-columns: 1fr;
  }

  .library-search-box span {
    padding: 3px 7px 5px;
    justify-self: start;
  }

  .library-selectors {
    gap: 9px;
  }

  .library-category-context {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-purpose {
    padding: 58px 0 50px;
  }

  .library-purpose__grid {
    gap: 26px;
  }

  .library-purpose__steps li {
    padding: 21px 18px 21px 70px;
  }

  .library-purpose__steps span {
    top: 19px;
    left: 17px;
  }

  .library-categories {
    padding-block: 58px;
  }

  .library-category-grid {
    gap: 15px;
  }

  .library-category-card,
  .lesson-card,
  .related-course-card,
  .library-recommendation-card {
    min-height: auto;
  }

  .library-category-card h3,
  .library-category-card p,
  .library-category-card__meta,
  .lesson-card h3,
  .lesson-card p {
    min-height: 0;
  }

  .library-category-card__image img,
  .lesson-card__visual img {
    aspect-ratio: 16 / 11;
    object-fit: contain;
    object-position: center;
  }

  .library-category-card__image {
    aspect-ratio: 16 / 11;
  }

  .library-category-card__content,
  .lesson-card__body {
    padding: 18px;
  }

  .library-featured {
    padding-top: 58px;
    padding-bottom: 50px;
  }

  .library-recommendations {
    padding-block: 58px;
  }

  .library-recommendation-card {
    min-height: 0;
  }

  .library-browse-cta {
    padding-block: 48px;
  }

  .library-browse-cta__inner,
  .library-updates,
  .library-category-continuation__inner {
    padding: 23px 19px;
    border-radius: 18px;
  }

  .library-browse-cta__inner .button,
  .library-updates .button,
  .library-assessment .button,
  .library-load-more,
  .library-load-more .button,
  .library-registration-form .button {
    width: 100%;
  }

  .library-related {
    padding-block: 56px;
  }

  .library-category-continuation {
    padding-bottom: 50px;
  }

  .library-updates-section,
  .library-assessment-section {
    padding-block: 50px;
  }

  .library-assessment > div:last-child {
    width: 100%;
  }

  .library-registration-panel {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .library-registration-form .button,
  .library-registration-status,
  .library-registration-help {
    grid-column: auto;
  }

  .library-category-view .library-search-panel {
    width: 100%;
  }

  .library-category-intro__overview {
    padding-block: 0;
  }
}

@media (max-width: 380px) {
  .library-hero h1 {
    font-size: 2.25rem;
  }

  .library-search-panel {
    width: calc(100% - 16px);
  }

  .library-filter {
    padding-inline: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .has-js [data-library-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .library-category-card,
  .lesson-card,
  .related-course-card,
  .library-recommendation-card,
  .library-category-card__image img,
  .lesson-card__visual img,
  .library-filter,
  .library-selectors label,
  .library-category-intro__latest {
    transition: none;
  }
}
