/* Kids Learners Platform — page shells & feature CSS (shared components in kl-components.css) */

.kl-platform-active {
  font-family: var(--kl-font);
  font-size: 16px;
  color: var(--kl-ink);
  background: var(--kl-surface-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header height breakpoint lives in kl-design-tokens.css */

.kl-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.kl-container {
  width: var(--kl-container);
  margin-inline: auto;
}

/* Header — reference StickyHeader (App.tsx) */
.kl-site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.kl-site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom-color: #eaeaea;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05), 0 1px 2px -1px rgb(0 0 0 / 0.05);
}

.kl-site-header__shell {
  width: 100%;
  max-width: 90rem;
  margin-inline: auto;
  padding-inline: 1rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .kl-site-header__shell {
    padding-inline: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .kl-site-header__shell {
    padding-inline: 2rem;
  }
}

.kl-site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--kl-header-h);
}

.kl-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  text-decoration: none;
  color: #111827;
  transition: transform 0.2s ease;
}

.kl-brand:hover {
  transform: scale(1.01);
}

.kl-brand__mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #4f8cff 0%, #a78bfa 100%);
  flex-shrink: 0;
}

.kl-brand__logo {
  display: block;
  width: auto;
  height: 2.5rem;
  max-width: 12rem;
  object-fit: contain;
}

.kl-brand__logo[src$=".svg"],
.kl-brand__logo[src*=".svg?"] {
  width: auto;
  height: 2.5rem;
}

.kl-brand__text {
  display: none;
  font-family: var(--kl-font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #111827;
}

@media (min-width: 640px) {
  .kl-brand__text {
    display: block;
  }
}

.kl-primary-nav {
  display: none;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.kl-primary-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.kl-primary-nav__list > li {
  margin: 0;
}

.kl-primary-nav__list > li > a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-family: var(--kl-font);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  color: #4b5563;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.kl-primary-nav__list > li > a:hover,
.kl-primary-nav__list > li > a:focus-visible,
.kl-primary-nav__list > li.current-menu-item > a {
  background: #f3f4f6;
  color: #4b5563;
  outline: none;
}

.kl-primary-nav__list > li.menu-item-has-children {
  position: relative;
}

.kl-primary-nav__list > li.menu-item-has-children > a {
  padding-right: 1.75rem;
}

.kl-nav-submenu-toggle {
  display: none;
}

.kl-primary-nav__list .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kl-primary-nav__list .sub-menu a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-family: var(--kl-font);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  color: #4b5563;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.kl-primary-nav__list .sub-menu a:hover,
.kl-primary-nav__list .sub-menu a:focus-visible,
.kl-primary-nav__list .sub-menu .current-menu-item > a {
  background: #f3f4f6;
  color: #111827;
  outline: none;
}

@media (min-width: 768px) {
  .kl-primary-nav__list > li.menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    margin-left: 0.35rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0.55;
    vertical-align: middle;
  }

  .kl-primary-nav__list .sub-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 13.5rem;
    padding: 0.35rem;
    border: 1px solid #eaeaea;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 10px 25px -12px rgb(0 0 0 / 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.35rem);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 45;
  }

  .kl-primary-nav__list > li.menu-item-has-children:hover > .sub-menu,
  .kl-primary-nav__list > li.menu-item-has-children:focus-within > .sub-menu,
  .kl-primary-nav__list > li.menu-item-has-children.is-submenu-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.kl-site-header__actions {
  display: none;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .kl-site-header__actions {
    display: flex;
  }
}

.kl-header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.kl-header-action:hover,
.kl-header-action:focus-visible {
  background: #f3f4f6;
  color: #4b5563;
  outline: none;
}

.kl-header-action--ghost {
  flex-shrink: 0;
}

.kl-header-action__dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f8cff;
  border: 2px solid #fff;
  box-sizing: content-box;
  pointer-events: none;
}

.kl-header-action__dot[hidden] {
  display: none !important;
}

.kl-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.kl-nav-toggle:hover,
.kl-nav-toggle:focus-visible {
  background: #f3f4f6;
  outline: none;
}

@media (min-width: 768px) {
  .kl-nav-toggle {
    display: none;
  }

  .kl-primary-nav {
    display: flex;
  }
}

.kl-primary-nav__quick {
  display: none;
}

.kl-primary-nav__backdrop {
  display: none;
  position: fixed;
  inset: var(--kl-header-h) 0 0;
  z-index: 38;
  background: rgb(0 0 0 / 0.2);
  border: none;
  margin: 0;
  padding: 0;
}

.kl-primary-nav__backdrop:not([hidden]) {
  display: block;
}

@media (max-width: 767px) {
  .kl-primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 39;
    display: none;
    flex: none;
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid #eaeaea;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    padding: 1rem;
  }

  .kl-primary-nav.is-open {
    display: block;
  }

  .kl-primary-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .kl-primary-nav__list > li > a {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }

  .kl-primary-nav__list > li.menu-item-has-children {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "link toggle"
      "sub sub";
    align-items: center;
    gap: 0;
  }

  .kl-primary-nav__list > li.menu-item-has-children > a {
    grid-area: link;
    padding-right: 1rem;
  }

  .kl-nav-submenu-toggle {
    display: inline-flex;
    grid-area: toggle;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-right: 0.25rem;
    padding: 0;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
  }

  .kl-nav-submenu-toggle__icon {
    display: block;
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
  }

  .kl-primary-nav__list > li.menu-item-has-children.is-submenu-open .kl-nav-submenu-toggle__icon {
    transform: rotate(-135deg);
  }

  .kl-primary-nav__list .sub-menu {
    grid-area: sub;
    display: none;
    padding: 0.25rem 0 0.5rem 0.75rem;
  }

  .kl-primary-nav__list > li.menu-item-has-children.is-submenu-open > .sub-menu {
    display: block;
  }

  .kl-primary-nav__list .sub-menu a {
    padding: 0.65rem 0.85rem;
    font-size: 0.9375rem;
  }

  .kl-primary-nav.is-open .kl-primary-nav__quick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eaeaea;
  }
}

.kl-primary-nav__quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  border: none;
  border-radius: 0.75rem;
  background: #f3f4f6;
  color: #4b5563;
  font-family: var(--kl-font);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-decoration: none;
}

.kl-primary-nav__quick-btn:hover {
  background: #e5e7eb;
}

.kl-primary-nav__quick-btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

body.kl-nav-open {
  overflow: hidden;
}

@media (min-width: 768px) {
  .kl-primary-nav__quick {
    display: none !important;
  }
}

/* Hero */
.kl-hero {
  padding: 3rem 0 2.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(37, 99, 235, 0.12), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 10%, rgba(249, 115, 22, 0.1), transparent 55%),
    var(--kl-surface-soft);
}

.kl-hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.kl-hero__eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kl-primary);
  margin: 0 0 0.75rem;
}

.kl-hero__title {
  font-family: var(--kl-font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.kl-hero__lead {
  font-size: 1.05rem;
  color: var(--kl-ink-muted);
  max-width: 36rem;
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

.kl-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.kl-hero__visual {
  position: relative;
  min-height: 260px;
}

.kl-hero__card {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: var(--kl-radius);
  background: var(--kl-surface);
  box-shadow: var(--kl-shadow);
  font-weight: 800;
  font-family: var(--kl-font-display);
}

.kl-hero__card--a {
  width: 120px;
  height: 120px;
  font-size: 3rem;
  color: var(--kl-violet);
  top: 10%;
  left: 15%;
}

.kl-hero__card--trace {
  width: 100px;
  height: 100px;
  font-size: 1rem;
  color: var(--kl-primary);
  top: 45%;
  right: 10%;
}

.kl-hero__card--write {
  width: 110px;
  height: 110px;
  font-size: 1rem;
  color: var(--kl-accent);
  bottom: 5%;
  left: 40%;
}

@media (max-width: 800px) {
  .kl-hero__grid { grid-template-columns: 1fr; }
  .kl-hero__visual { min-height: 200px; }
}

/* Buttons, sections, resource cards, page headers → kl-components.css + kl-consistency.css */

.kl-text-link {
  color: var(--kl-primary);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

/* Authority strip */
.kl-authority-strip {
  padding: 1rem 0 2rem;
  border-block: 1px solid var(--kl-border);
  background: var(--kl-surface);
}

.kl-authority-strip__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.kl-authority-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: var(--kl-radius-sm);
  background: var(--kl-surface-soft);
  text-decoration: none;
  color: var(--kl-ink);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.kl-authority-card:hover {
  background: color-mix(in srgb, var(--kl-primary) 8%, var(--kl-surface-soft));
}

.kl-authority-card__icon {
  font-size: 1.25rem;
  color: var(--kl-primary);
}

.kl-authority-card__label {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Hub cards → kl-components.css + kl-consistency.css (§49 locked grids) */

.kl-hub-card,
.kl-pathway-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border-radius: var(--kl-radius);
  background: var(--kl-surface);
  border: 1px solid var(--kl-border);
  text-decoration: none;
  color: var(--kl-ink);
  box-shadow: var(--kl-shadow);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.kl-hub-card:hover,
.kl-pathway-card:hover {
  box-shadow: var(--kl-shadow-hover);
  border-color: var(--kl-primary);
}

.kl-hub-card__badge,
.kl-pathway-card__meta {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--kl-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kl-hub-card__title,
.kl-pathway-card__title {
  font-family: var(--kl-font-display);
  font-size: 1.2rem;
  margin: 0;
}

.kl-hub-card__desc,
.kl-pathway-card__desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--kl-ink-muted);
  line-height: 1.5;
  flex: 1;
}

.kl-hub-card__cta {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--kl-primary);
}

.kl-pathway-card {
  border-top: 4px solid var(--kl-pathway-accent, var(--kl-violet));
}

/* Letter grid */
.kl-letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 0.5rem;
}

.kl-letter-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: var(--kl-radius-sm);
  background: var(--kl-surface);
  border: 1px solid var(--kl-border);
  text-decoration: none;
  color: var(--kl-ink);
  transition: all 0.15s ease;
}

.kl-letter-tile:hover {
  background: var(--kl-primary);
  color: #fff;
  border-color: var(--kl-primary);
  transform: scale(1.04);
}

.kl-letter-tile__glyph {
  font-family: var(--kl-font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.kl-letter-tile__count {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-top: 0.15rem;
}

/* Chips */
.kl-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: var(--kl-surface);
  border: 1px solid var(--kl-border);
  text-decoration: none;
  color: var(--kl-ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.kl-chip:hover {
  border-color: var(--kl-primary);
  color: var(--kl-primary);
}

.kl-chip__count {
  font-size: 0.75rem;
  color: var(--kl-ink-muted);
}

/* Resource cards & grids → kl-components.css + kl-consistency.css */

/* Authority hub pillars */
.kl-authority-hub__quick {
  margin-bottom: 2rem;
}

.kl-authority-hub__label {
  font-family: var(--kl-font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--kl-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kl-authority-hub__featured {
  margin-bottom: 2.5rem;
}

.kl-authority-hub__group + .kl-authority-hub__group {
  margin-top: 2rem;
}

.kl-authority-hub__guidance {
  margin-top: 2.5rem;
}

.kl-authority-hub__prose {
  max-width: 48rem;
  line-height: 1.7;
  color: var(--kl-ink);
}

.kl-authority-hub__prose p {
  margin: 0 0 1rem;
}

.kl-authority-hub__related {
  margin-top: 2.5rem;
}

.kl-hub-grid--compact {
  /* locked in kl-consistency.css */
}

.kl-authority-hub__internal {
  margin-top: 2rem;
}

.kl-internal-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.kl-internal-links a {
  color: var(--kl-primary);
  text-decoration: none;
  font-weight: 500;
}

.kl-internal-links a:hover {
  text-decoration: underline;
}

.kl-section__title--sub {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.kl-archive-library__title {
  margin: 2rem 0 1rem;
}

.kl-archive-layout {
  padding-bottom: 2rem;
}

.kl-authority-hub--footer {
  padding-top: 1rem;
  border-top: 1px solid var(--kl-border);
}

.kl-taxonomy-letter-glyph {
  font-family: var(--kl-font-display);
  font-size: 4rem;
  color: var(--kl-violet);
  margin: 0 0 1rem;
  line-height: 1;
}

/* Worksheet single */
.kl-worksheet-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.kl-worksheet-figure {
  margin: 0;
  border-radius: var(--kl-radius);
  overflow: hidden;
  box-shadow: var(--kl-shadow);
}

.kl-worksheet-figure__img {
  display: block;
  width: 100%;
  height: auto;
}

.kl-worksheet-layout__panel {
  background: var(--kl-surface);
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius);
  padding: 1.5rem;
  box-shadow: var(--kl-shadow);
}

.kl-worksheet-title {
  font-family: var(--kl-font-display);
  font-size: 1.75rem;
  margin: 0.5rem 0 0;
}

.kl-worksheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.kl-worksheet-progression {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.kl-progression-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--kl-primary);
  text-decoration: none;
}

/* Breadcrumb — reference Breadcrumb.tsx */
.kl-breadcrumb {
  margin: 0 0 1.5rem;
  padding: 0;
}

.kl-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--kl-font);
  font-size: 0.875rem;
  line-height: 1.25;
}

.kl-breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.kl-breadcrumb__sep {
  display: inline-flex;
  align-items: center;
  color: #d1d5db;
  flex-shrink: 0;
}

.kl-breadcrumb__sep .kl-icon {
  display: block;
}

.kl-breadcrumb a {
  color: #6b7280;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s ease;
}

.kl-breadcrumb a:hover {
  color: #4f8cff;
}

.kl-breadcrumb__current {
  color: #111827;
  font-weight: 600;
}

.kl-archive--worksheets .kl-breadcrumb {
  margin-bottom: 1rem;
}

@media (max-width: 800px) {
  .kl-worksheet-layout { grid-template-columns: 1fr; }
}

/* Pathways */
.kl-pathway-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.kl-pathway-step__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.kl-pathway-step__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--kl-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.kl-pathway-step__title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--kl-ink);
  text-decoration: none;
}

.kl-skill-browser {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kl-skill-row {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--kl-surface);
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius-sm);
  text-decoration: none;
  color: var(--kl-ink);
  font-weight: 600;
}

.kl-skill-row:hover {
  border-color: var(--kl-primary);
}

.kl-skill-row__count {
  color: var(--kl-ink-muted);
}

.kl-back-link {
  margin-top: 2rem;
}

.kl-back-link a {
  color: var(--kl-primary);
  font-weight: 700;
  text-decoration: none;
}

.kl-empty {
  color: var(--kl-ink-muted);
  padding: 2rem;
  text-align: center;
}

.kl-pagination {
  margin-top: 2rem;
}

.kl-pagination .page-numbers {
  display: inline-flex;
  padding: 0.5rem 0.75rem;
  margin: 0.15rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--kl-ink);
  border: 1px solid var(--kl-border);
}

.kl-pagination .current {
  background: var(--kl-primary);
  color: #fff;
  border-color: var(--kl-primary);
}

/* Facets use .kl-facets styles below */

/* Footer */
.kl-site-footer {
  margin-top: 3rem;
  padding: 2rem 0 1.5rem;
  background: var(--kl-ink);
  color: #94a3b8;
}

.kl-site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.kl-site-footer__brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgb(148 163 184 / 0.18);
}

.kl-site-footer__brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  text-decoration: none;
  color: #e2e8f0;
  transition: color 0.18s ease;
}

.kl-site-footer__brand-link:hover,
.kl-site-footer__brand-link:focus-visible {
  color: #fff;
  outline: none;
}

.kl-site-footer__brand-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.45rem;
  background: linear-gradient(135deg, #4f8cff 0%, #a78bfa 100%);
  overflow: hidden;
}

.kl-site-footer__brand-icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.kl-site-footer__brand-logo {
  display: block;
  width: auto;
  height: 1.35rem;
  max-width: 5.5rem;
  object-fit: contain;
}

.kl-site-footer__brand-name {
  font-family: var(--kl-font-display);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: inherit;
}

.kl-site-footer__brand-tagline {
  margin: 0;
  max-width: 28rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #94a3b8;
}

.kl-site-footer__sitemap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1.25rem;
}

@media (min-width: 768px) {
  .kl-site-footer__inner {
    gap: 1.75rem;
  }

  .kl-site-footer__brand-block {
    padding-bottom: 1.5rem;
  }

  .kl-site-footer__sitemap {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem 1.5rem;
  }
}

.kl-site-footer__col-title {
  margin: 0 0 0.85rem;
  font-family: var(--kl-font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.kl-site-footer__col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.kl-site-footer__col-list a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.35;
  transition: color 0.18s ease;
}

.kl-site-footer__col-list a:hover,
.kl-site-footer__col-list a:focus-visible {
  color: #fff;
  outline: none;
}

.kl-site-footer__meta {
  padding-top: 1.15rem;
  border-top: 1px solid rgb(148 163 184 / 0.12);
}

.kl-site-footer__copyright {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #64748b;
}

.kl-site-footer__nav {
  display: flex;
  gap: 1.25rem;
}

.kl-site-footer__nav a {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
}

.kl-site-footer__nav a:hover {
  color: #fff;
}

.kl-404-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.kl-platform-active .wp-block-template-part[data-area="footer"] {
  display: none !important;
}

/* Hide legacy blog chrome on platform pages */
.kl-platform-active .wp-block-post-date,
.kl-platform-active .wp-block-post-author-name {
  display: none !important;
}

/* —— Overlays: search modal + saved drawer —— */
body.kl-overlay-open {
  overflow: hidden;
}

.kl-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top, 0px));
  pointer-events: none;
}

.kl-overlay[hidden] {
  display: none !important;
}

.kl-overlay.is-open {
  pointer-events: auto;
}

.kl-overlay__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(17, 24, 39, 0.4);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.kl-overlay--search {
  align-items: flex-start;
  justify-content: center;
  padding-top: max(4rem, env(safe-area-inset-top, 0px));
}

@media (min-width: 768px) {
  .kl-overlay--search {
    padding-top: max(6rem, env(safe-area-inset-top, 0px));
  }
}

.kl-search-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 42rem;
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.kl-overlay--search.is-open .kl-search-modal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .kl-search-modal,
  .kl-saved-drawer,
  .kl-saved-list__item--extra,
  .kl-saved-section__items-inner {
    transition: none;
  }

  .kl-saved-section--collapsible.is-expanded .kl-saved-list__item--extra {
    grid-template-rows: 1fr;
    opacity: 1;
  }
}

.kl-search-modal__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #eaeaea;
}

.kl-search-modal__form {
  flex: 1;
  min-width: 0;
}

.kl-search-modal__input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 1.125rem;
  font-weight: 500;
  color: #111827;
}

.kl-search-modal__input::placeholder {
  color: #9ca3af;
}

.kl-search-modal__body {
  overflow: auto;
  max-height: min(60vh, 520px);
}

.kl-search-modal__label {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
}

.kl-search-modal__empty {
  padding: 1.5rem;
}

.kl-search-modal__results {
  padding: 0.5rem 0;
}

.kl-search-quick {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .kl-search-quick {
    grid-template-columns: 1fr 1fr;
  }
}

.kl-search-quick__card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  background: #f3f4f6;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.kl-search-quick__card:hover {
  background: #e5e7eb;
}

.kl-search-quick__accent {
  flex-shrink: 0;
  width: 0.5rem;
  height: 2.5rem;
  border-radius: 0.25rem;
}

.kl-search-quick__title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
}

.kl-search-quick__meta {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
}

.kl-search-hit-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kl-search-hit__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.kl-search-hit__link:hover {
  background: #f9fafb;
}

.kl-search-hit__thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f3f4f6;
}

.kl-search-hit__thumb--placeholder {
  display: block;
  background: linear-gradient(145deg, #eef2ff, #e5e7eb);
}

.kl-search-hit__body {
  flex: 1;
  min-width: 0;
}

.kl-search-hit__title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kl-search-hit__meta {
  display: block;
  font-size: 0.8125rem;
  color: #6b7280;
}

/* —— Share modal (reference) —— */
.kl-overlay--share {
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  .kl-overlay--share {
    align-items: center;
  }
}

.kl-share-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.kl-overlay--share.is-open .kl-share-modal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .kl-share-modal {
    transition: none;
  }
}

.kl-share-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #eaeaea;
}

.kl-share-modal__title {
  margin: 0;
  font-family: var(--kl-font);
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.kl-share-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
}

.kl-share-modal__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 3.25rem;
  padding: 0 1rem;
  border: none;
  border-radius: 0.75rem;
  font-family: var(--kl-font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.kl-share-modal__btn:hover {
  opacity: 0.92;
  color: #fff;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.12);
}

.kl-share-modal__btn:active {
  transform: scale(0.98);
}

.kl-share-modal__btn--facebook { background-color: #4267b2; }
.kl-share-modal__btn--x { background-color: #14171a; }
.kl-share-modal__btn--whatsapp { background-color: #25d366; }
.kl-share-modal__btn--pinterest { background-color: #bd081c; }
.kl-share-modal__btn--copy { background-color: #6b7280; }

.kl-share-modal__copy-default,
.kl-share-modal__copy-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.kl-share-modal__copy-done[hidden],
.kl-share-modal__copy-default[hidden] {
  display: none !important;
}

.kl-share-modal__btn--copy.is-copied {
  background-color: #059669;
}

.kl-overlay--drawer {
  justify-content: flex-end;
  padding: 0;
}

.kl-saved-drawer {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 30rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -12px 0 40px rgb(0 0 0 / 0.12);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.kl-overlay--drawer.is-open .kl-saved-drawer {
  transform: none;
}

.kl-saved-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
  border-bottom: 1px solid #eaeaea;
}

.kl-saved-drawer__title {
  margin: 0;
  font-family: var(--kl-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}

.kl-saved-drawer__sub {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.kl-saved-drawer__body {
  flex: 1;
  overflow: auto;
  padding: 1.5rem;
}

.kl-saved-drawer__body[hidden] {
  display: none !important;
}

.kl-saved-groups {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.kl-saved-drawer__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.kl-saved-drawer__empty[hidden] {
  display: none !important;
}

.kl-saved-drawer__empty-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.75rem;
  border-radius: 0.75rem;
  background: #f3f4f6;
  color: #d1d5db;
}

.kl-saved-drawer__empty-title {
  margin: 0 0 0.5rem;
  font-family: var(--kl-font);
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.kl-saved-drawer__empty-body {
  margin: 0;
  max-width: 18rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #6b7280;
}

.kl-saved-drawer__foot {
  flex-shrink: 0;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid #eaeaea;
}

.kl-saved-drawer__foot[hidden] {
  display: none !important;
}

.kl-saved-drawer__view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--kl-primary, #4f8cff);
  text-decoration: none;
}

.kl-saved-drawer__view-all:hover {
  text-decoration: underline;
}

.kl-saved-section__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.kl-saved-section__icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--kl-saved-accent, #4f8cff) 12%, transparent);
  color: var(--kl-saved-accent, #4f8cff);
  flex-shrink: 0;
}

.kl-saved-section__title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: var(--kl-font);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
}

.kl-saved-section__middot {
  color: #9ca3af;
  font-weight: 400;
}

.kl-saved-section__count {
  font-weight: 700;
  color: #6b7280;
}

.kl-saved-section__items {
  overflow: hidden;
}

.kl-saved-section__items-inner {
  transition: opacity 0.2s ease;
}

.kl-saved-section__toggle {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0.25rem 0;
  border: none;
  background: transparent;
  font-family: var(--kl-font);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  color: #4f8cff;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.kl-saved-section__toggle:hover {
  color: #3b7dd8;
  opacity: 0.9;
}

.kl-saved-section__toggle:focus-visible {
  outline: 2px solid #4f8cff;
  outline-offset: 2px;
  border-radius: 4px;
}

.kl-saved-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.375rem;
}

.kl-saved-list__item--extra {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.28s ease, opacity 0.22s ease, margin 0.22s ease;
  margin-top: 0;
}

.kl-saved-list__item--extra > .kl-saved-list__link {
  overflow: hidden;
  min-height: 0;
}

.kl-saved-section--collapsible.is-expanded .kl-saved-list__item--extra {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 0;
}

.kl-saved-list__item-inner {
  --kl-saved-thumb-col: 2.75rem;
  --kl-saved-action-col: 2.5rem;
  display: grid;
  grid-template-columns: var(--kl-saved-thumb-col) minmax(0, 1fr) var(--kl-saved-action-col);
  align-items: center;
  column-gap: 0.65rem;
  padding: 0.625rem 0.5rem;
  border-radius: 0.75rem;
  transition: background-color 0.2s ease;
}

.kl-saved-list__item-inner:hover,
.kl-saved-list__item-inner:focus-within {
  background: #f3f4f6;
}

.kl-saved-list__link {
  display: contents;
  text-decoration: none;
  color: inherit;
}

.kl-saved-list__thumb {
  grid-column: 1;
  display: grid;
  place-items: center;
  width: var(--kl-saved-thumb-col, 2.75rem);
  height: 2.75rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--kl-saved-accent, #4f8cff) 12%, transparent);
  color: var(--kl-saved-accent, #4f8cff);
  flex-shrink: 0;
  overflow: hidden;
}

.kl-saved-list__thumb--has-img {
  background: #f3f4f6;
}

.kl-saved-list__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kl-saved-list__body {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
}

.kl-saved-list__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: #111827;
  overflow-wrap: anywhere;
}

.kl-saved-list__meta {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kl-saved-list__remove,
.kl-saved-account-item__remove {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: #fff;
  color: #6b7280;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.kl-saved-list__remove {
  grid-column: 3;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  flex-shrink: 0;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0.2s ease, color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Drawer: desktop hover/focus reveal; action column space always reserved. */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .kl-saved-list__remove {
    opacity: 0;
    visibility: hidden;
  }

  .kl-saved-list__item-inner:hover .kl-saved-list__remove,
  .kl-saved-list__item-inner:focus-within .kl-saved-list__remove,
  .kl-saved-list__remove:focus,
  .kl-saved-list__remove:focus-visible {
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 767px) {
  .kl-saved-list__remove {
    opacity: 1;
    visibility: visible;
    width: 2.75rem;
    height: 2.75rem;
  }
}

.kl-saved-list__remove:hover,
.kl-saved-list__remove:focus-visible,
.kl-saved-account-item__remove:hover,
.kl-saved-account-item__remove:focus-visible {
  color: #b91c1c;
  background: #fef2f2;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.14);
  outline: none;
}

.kl-worksheet-save[aria-pressed="true"] {
  border-color: var(--kl-primary);
  color: var(--kl-primary);
}

.kl-saved-account-grid {
  display: grid;
  gap: 1.25rem;
}

.kl-saved-account-item__card {
  position: relative;
}

.kl-saved-account-item__card .kl-resource-card__media {
  position: relative;
}

.kl-saved-account-item__remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  background: rgb(255 255 255 / 0.95);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.14);
  transition: opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.kl-saved-account-item .kl-resource-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* Desktop: hover-reveal. Below 768px and touch devices: × stays visible (no hover gate). */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  .kl-saved-account-item__remove {
    opacity: 0;
    pointer-events: none;
  }

  .kl-saved-account-item:hover .kl-saved-account-item__remove,
  .kl-saved-account-item:focus-within .kl-saved-account-item__remove {
    opacity: 1;
    pointer-events: auto;
  }
}

/* —— Worksheet archive (Figma WorksheetsArchive tokens) —— */
.kl-archive--worksheets {
  padding-bottom: 2rem;
}

@media (min-width: 1024px) {
  .kl-archive--worksheets {
    padding-bottom: 4rem;
  }
}

.kl-archive--worksheets .kl-container.kl-archive-layout {
  width: 100%;
  max-width: 90rem;
  margin-inline: auto;
  padding: 1rem 1rem 2rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .kl-archive--worksheets .kl-container.kl-archive-layout {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .kl-archive--worksheets .kl-container.kl-archive-layout {
    padding-top: 1.5rem;
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 4rem;
  }
}

.kl-archive-header {
  margin-bottom: 2rem;
}

@media (min-width: 1024px) {
  .kl-archive-header {
    margin-bottom: 3rem;
  }
}

.kl-archive-header__title {
  margin: 0 0 1rem;
  font-family: var(--kl-font-display);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #111827;
}

.kl-archive-header__lead {
  margin: 0;
  max-width: 48rem;
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.75;
  color: #6b7280;
}

.kl-archive-filters {
  margin-bottom: 2rem;
}

.kl-archive-filters__panel {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.kl-archive-filters__desktop {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .kl-archive-filters__desktop {
    display: flex;
  }

  .kl-archive-filters__mobile {
    display: none;
  }
}

.kl-archive-filter {
  min-width: 0;
  flex: 0 1 auto;
}

.kl-archive-filter--stacked {
  flex: 1 1 100%;
}

.kl-archive-filter--stacked .kl-custom-select,
.kl-archive-filter--stacked .kl-custom-select__trigger {
  width: 100%;
}

/* Custom filter dropdowns — match FilterDropdown in reference */
.kl-custom-select {
  position: relative;
  min-width: 0;
}

.kl-custom-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.kl-custom-select__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-sizing: border-box;
  min-width: 12rem;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: #f3f4f6;
  font-family: var(--kl-font);
  font-size: 0.875rem;
  line-height: 1.25;
  color: #111827;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.kl-custom-select__trigger:hover {
  background: #e5e7eb;
}

.kl-custom-select__trigger .kl-icon {
  flex-shrink: 0;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.kl-custom-select.is-open .kl-custom-select__trigger .kl-icon {
  transform: rotate(180deg);
}

.kl-custom-select__prefix {
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
}

.kl-custom-select__value {
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
}

.kl-custom-select__list {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 30;
  min-width: 12rem;
  width: max-content;
  max-width: min(20rem, 90vw);
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  max-height: 16rem;
  overflow: auto;
}

.kl-custom-select__list[hidden] {
  display: none !important;
}

.kl-custom-select__option {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  font-family: var(--kl-font);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  color: #4b5563;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.kl-custom-select__option:hover,
.kl-custom-select__option.is-selected {
  background: #eff6ff;
  color: #4f8cff;
  font-weight: 600;
}

.kl-archive-filters__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: #f3f4f6;
  font-family: var(--kl-font);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  color: #111827;
  cursor: pointer;
}

.kl-archive-filters__toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.kl-archive-filters__toggle .kl-icon:last-child {
  flex-shrink: 0;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.kl-archive-filters__toggle[aria-expanded="true"] .kl-icon:last-child {
  transform: rotate(180deg);
}

.kl-archive-filters__mobile-panel {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.kl-archive-filters__mobile-panel[hidden] {
  display: none !important;
}

.kl-archive-filters__mobile-panel .kl-custom-select,
.kl-archive-filters__mobile-panel .kl-custom-select__trigger {
  width: 100%;
  min-width: 0;
}

.kl-archive-filters__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.kl-archive-filters__count {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #6b7280;
}

.kl-archive-filters__count strong,
.kl-archive-filters__count b {
  font-weight: 600;
  color: #111827;
}

.kl-archive-filters__clear {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
  color: #4f8cff;
  text-decoration: none;
}

.kl-archive-filters__clear:hover {
  text-decoration: underline;
}

/* Archive resource cards — layout tweaks; base styles in kl-consistency.css */
.kl-archive--worksheets .kl-resource-grid--archive {
  gap: var(--kl-space-6);
}

.kl-archive-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.kl-archive-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  color: #4b5563;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.kl-archive-pagination__btn:hover:not(.is-disabled) {
  background: #f3f4f6;
}

.kl-archive-pagination__btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.kl-archive-pagination__pages {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .kl-archive-pagination__pages {
    display: flex;
  }

  .kl-archive-pagination__mobile {
    display: none !important;
  }
}

.kl-archive-pagination__page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.kl-archive-pagination__page:hover {
  background: #f3f4f6;
}

.kl-archive-pagination__page.is-current {
  background: var(--kl-primary);
  color: #fff;
  font-weight: 600;
}

.kl-archive-pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: #9ca3af;
  font-size: 0.875rem;
}

.kl-archive-pagination__mobile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: #f3f4f6;
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
}

/* —— P3: Facets —— */
.kl-facets {
  background: var(--kl-surface);
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--kl-shadow);
}
.kl-facets__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.kl-facets__group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--kl-ink-muted);
  margin-bottom: 0.35rem;
}
.kl-facets__group select {
  width: 100%;
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius-sm);
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
}
.kl-facets__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* —— P3: Letter hub —— */
.kl-letter-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem 0 1rem;
}
.kl-letter-hero__glyph {
  font-family: var(--kl-font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 1;
  color: var(--kl-violet);
  margin: 0;
}
.kl-letter-hero__title {
  font-family: var(--kl-font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin: 0 0 0.5rem;
}
.kl-letter-hero__lead { color: var(--kl-ink-muted); line-height: 1.6; margin: 0 0 1rem; }
.kl-letter-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.kl-letter-nav__link {
  font-weight: 700;
  color: var(--kl-primary);
  text-decoration: none;
}
.kl-curriculum-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.kl-curriculum-strip__step {
  background: var(--kl-surface);
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.kl-curriculum-strip__step span {
  font-size: 0.85rem;
  color: var(--kl-ink-muted);
}
.kl-companion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.kl-companion-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}
.kl-companion-list a {
  color: var(--kl-primary);
  text-decoration: none;
  font-weight: 600;
}

/* —— P3: FAQ & trust —— */
.kl-faq { display: flex; flex-direction: column; gap: 0.5rem; }
.kl-faq__item {
  background: var(--kl-surface);
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius-sm);
  padding: 0.75rem 1rem;
}
.kl-faq__q { cursor: pointer; font-weight: 700; }
.kl-faq__a { margin: 0.5rem 0 0; color: var(--kl-ink-muted); line-height: 1.55; }
.kl-teacher-note {
  background: #eff6ff;
  border-left: 4px solid var(--kl-primary);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--kl-radius-sm) var(--kl-radius-sm) 0;
  margin-bottom: 1.5rem;
}
.kl-trust-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--kl-surface-muted);
  color: var(--kl-ink-muted);
  margin-right: 0.35rem;
}
.kl-trust-badge--goal { background: #ede9fe; color: var(--kl-violet); }
.kl-worksheet-objective {
  color: var(--kl-ink-muted);
  line-height: 1.55;
  margin: 0.5rem 0 0;
}
.kl-discover-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius);
  padding: 1.5rem;
}
.kl-graph-section { padding-top: 0; }

/* —— P5: Bundles, trust, engagement —— */
.kl-guided-grid,
.kl-bundle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.kl-guided-card,
.kl-bundle-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem;
  background: var(--kl-surface);
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kl-guided-card:hover,
.kl-bundle-card:hover {
  border-color: var(--kl-primary);
  box-shadow: var(--kl-shadow-sm);
}
.kl-guided-card__eyebrow,
.kl-bundle-card__count {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--kl-primary);
}
.kl-guided-card__title,
.kl-bundle-card__title {
  font-family: var(--kl-font-display);
  font-size: 1.1rem;
  margin: 0;
}
.kl-bundle-card__desc {
  margin: 0;
  color: var(--kl-ink-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.kl-guided-card__cta,
.kl-bundle-card__cta {
  margin-top: auto;
  font-weight: 700;
  color: var(--kl-primary);
}
.kl-bundle-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
  margin: 1.5rem 0 2rem;
}
.kl-bundle-hero__glyph {
  font-family: var(--kl-font-display);
  font-size: 4rem;
  line-height: 1;
  margin: 0;
  color: var(--kl-primary);
}
.kl-bundle-hero__title {
  font-family: var(--kl-font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 0.5rem;
}
.kl-bundle-hero__lead {
  color: var(--kl-ink-muted);
  line-height: 1.6;
  margin: 0 0 1rem;
}
.kl-bundle-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.kl-bundle-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.kl-bundle-steps {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.65;
  color: var(--kl-ink-muted);
}
.kl-bundle-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}
.kl-bundle-quick-link {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--kl-border);
  background: var(--kl-surface);
  text-decoration: none;
  color: var(--kl-ink);
  font-size: 0.875rem;
  font-weight: 600;
}
.kl-bundle-quick-link:hover {
  border-color: var(--kl-primary);
  color: var(--kl-primary);
}
.kl-bundle-guidance .kl-authority-hub__prose {
  max-width: 42rem;
  color: var(--kl-ink-muted);
  line-height: 1.65;
}
.kl-bundle-guide-callout {
  padding: 1.25rem;
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius);
  background: color-mix(in srgb, var(--kl-primary, #2563eb) 5%, var(--kl-surface));
}
.kl-bundle-order__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
  max-width: 40rem;
}
.kl-bundle-order__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--kl-border);
}
.kl-bundle-order__item:last-child {
  border-bottom: none;
}
.kl-bundle-order__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--kl-primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.kl-bundle-order__link {
  display: block;
  font-weight: 700;
  color: var(--kl-ink);
  text-decoration: none;
  line-height: 1.35;
}
.kl-bundle-order__link:hover {
  color: var(--kl-primary);
}
.kl-bundle-order__type {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--kl-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}
.kl-bundle-group + .kl-bundle-group {
  border-top: 1px solid var(--kl-border);
}
.kl-trust-panel {
  background: #f8fafc;
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius);
  padding: 1rem 1.15rem;
  margin: 1rem 0;
}
.kl-trust-panel__badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}
.kl-trust-panel__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 0.7rem;
}
.kl-trust-panel__date {
  font-weight: 500;
  color: var(--kl-ink-muted);
  font-size: 0.85rem;
}
.kl-trust-panel__heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.35rem;
  color: var(--kl-ink-muted);
}
.kl-trust-panel__list {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.55;
}
.kl-trust-panel__block {
  margin-top: 0.75rem;
}
.kl-trust-panel__block p {
  margin: 0;
  line-height: 1.55;
  color: var(--kl-ink-muted);
}
.kl-continue-learning {
  border-top: 1px solid var(--kl-border);
  padding-top: 2rem;
}
.kl-pathway-cta__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.kl-pathway-cta__card {
  display: block;
  padding: 1rem 1.15rem;
  background: var(--kl-surface);
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius-sm);
  text-decoration: none;
  font-weight: 700;
  color: var(--kl-primary);
}
.kl-saved-collections {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
}
.kl-saved-collections__toggle {
  background: var(--kl-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--kl-shadow-md);
}
.kl-saved-collections__panel {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius);
  padding: 0.75rem;
  box-shadow: var(--kl-shadow-md);
}
.kl-saved-collections__panel a {
  display: block;
  padding: 0.35rem 0;
  color: var(--kl-primary);
  text-decoration: none;
  font-weight: 600;
}

/* Stabilization: calm UX — section rhythm owned by kl-consistency.css */
.kl-quick-topics { padding-block: var(--kl-space-5) 0; }
.kl-quick-topics__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.kl-quick-topic {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--kl-surface);
  border: 1px solid var(--kl-border);
  text-decoration: none;
  color: var(--kl-ink);
  font-weight: 600;
  font-size: 0.9rem;
}
.kl-quick-topic:hover {
  border-color: var(--kl-primary);
  color: var(--kl-primary);
}
.kl-trust-panel--compact {
  padding: 0.85rem 1rem;
  background: var(--kl-surface);
}
.kl-trust-panel__skills-line,
.kl-trust-panel__tip {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--kl-ink-muted);
  line-height: 1.5;
}
.kl-related-strip { border-top: 1px solid var(--kl-border); padding-top: 2rem; }
.kl-home .kl-section--filter { padding-top: 1rem; }
.kl-letter-section + .kl-letter-section {
  border-top: 1px solid var(--kl-border);
}
.kl-letter-bundle-callout {
  padding: 1.25rem;
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius);
  background: color-mix(in srgb, var(--kl-primary, #2563eb) 4%, var(--kl-surface));
}
.kl-letter-hub .kl-section { padding-block: var(--kl-section-gap-sm); }
.kl-saved-collections { display: none; }

@media (max-width: 700px) {
  .kl-letter-hero { grid-template-columns: 1fr; text-align: center; }
  .kl-site-header__inner { flex-wrap: wrap; }
  .kl-bundle-hero { grid-template-columns: 1fr; }
  .kl-bundle-hero__glyph { font-size: 3rem; }
  .kl-bundle-quick-links { justify-content: flex-start; }
}

/* —— Homepage redesign: pathway-led discovery —— */
.kl-home-redesign {
  background:
    linear-gradient(180deg, #fbf8f1 0%, #ffffff 28rem),
    #fff;
  color: var(--kl-ink);
}

/* Homepage layout — containers/grids locked in kl-consistency.css (§49) */

.kl-home-hero {
  padding: clamp(2rem, 6vw, 4.5rem) 0 2rem;
}

.kl-home-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.75fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.kl-home-kicker,
.kl-home-section__eyebrow,
.kl-home-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
  color: #6f3f16;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kl-home-hero h1,
.kl-home-hero__title {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.95;
}

.kl-home-hero__lead {
  max-width: 42rem;
  margin: 1rem 0 0;
  color: var(--kl-ink-muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.65;
}

.kl-home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.kl-home-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.7rem;
  max-width: 34rem;
}

.kl-home-stat {
  border-left: 3px solid #f2b84b;
  padding-left: 0.8rem;
}

.kl-home-stat strong {
  display: block;
  color: var(--kl-ink);
  font-size: 1.45rem;
  line-height: 1;
}

.kl-home-stat span {
  display: block;
  margin-top: 0.25rem;
  color: var(--kl-ink-muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.kl-home-hero__visual {
  display: grid;
  gap: 0.85rem;
}

.kl-home-feature-stack {
  display: grid;
  gap: 0.85rem;
}

.kl-home-feature-tile,
.kl-home-hero-tile {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  min-height: 118px;
  padding: 0.85rem;
  background: #fff;
  border: 1px solid rgba(39, 53, 67, 0.12);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(31, 41, 55, 0.08);
  text-decoration: none;
  color: inherit;
}

.kl-home-feature-tile:nth-child(2),
.kl-home-hero-tile:nth-child(2) {
  transform: translateX(1rem);
}

.kl-home-feature-tile:nth-child(3),
.kl-home-hero-tile:nth-child(3) {
  transform: translateX(-0.7rem);
}

.kl-home-feature-tile img,
.kl-home-feature-tile__placeholder,
.kl-home-hero-tile img,
.kl-home-hero-tile__placeholder {
  width: 96px;
  height: 96px;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  background: #f4e8d5;
}

.kl-home-feature-tile__placeholder,
.kl-home-hero-tile__placeholder {
  display: grid;
  place-items: center;
  color: #8b5a2b;
  font-size: 1.6rem;
  font-weight: 800;
}

.kl-home-feature-tile__label,
.kl-home-hero-tile__label {
  display: block;
  color: #6f3f16;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kl-home-feature-tile strong,
.kl-home-hero-tile strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1rem;
  line-height: 1.25;
}

.kl-home-section {
  padding: clamp(2rem, 5vw, 4rem) 0;
}

.kl-home-section--pathways {
  padding-top: 1rem;
}

.kl-home-section__head {
  display: block;
  margin-bottom: 1.15rem;
}

.kl-home-section__head--row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.kl-home-section__head h2,
.kl-home-search-cta h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.kl-home-section__head p,
.kl-home-search-cta p {
  max-width: 40rem;
  margin: 0.45rem 0 0;
  color: var(--kl-ink-muted);
  line-height: 1.6;
}

.kl-home-view-all {
  flex: 0 0 auto;
  color: var(--kl-primary);
  font-weight: 800;
  text-decoration: none;
}

.kl-home-pathways {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
}

.kl-home-pathway {
  min-height: 12rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  color: #fff;
  background: var(--kl-pathway-color, var(--kl-primary));
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(31, 41, 55, 0.14);
}

.kl-home-pathway--blue { --kl-pathway-color: #2861b8; }
.kl-home-pathway--violet { --kl-pathway-color: #6f48ba; }
.kl-home-pathway--green { --kl-pathway-color: #24765b; }
.kl-home-pathway--amber { --kl-pathway-color: #9b5b10; }
.kl-home-pathway--pink { --kl-pathway-color: #ad3e68; }

.kl-home-pathway:hover {
  box-shadow: var(--kl-shadow-hover);
}

.kl-home-pathway__icon,
.kl-home-pathway__mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 1.45rem;
}

.kl-home-pathway h3,
.kl-home-pathway__title {
  display: block;
  margin: 1.1rem 0 0.35rem;
  font-size: 1.18rem;
  line-height: 1.15;
  font-weight: 800;
}

.kl-home-pathway p,
.kl-home-pathway__body {
  display: block;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9rem;
  line-height: 1.45;
}

.kl-home-pathway__kicker {
  display: block;
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kl-home-pathway__cue,
.kl-home-pathway__stat {
  display: block;
  margin-top: 1rem;
  font-weight: 800;
}

.kl-home-section--grades {
  padding-block: var(--kl-section-gap-sm);
  background: #233142;
  color: #fff;
}

.kl-home-grade-band,
.kl-home-grades {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.kl-home-grade-band h2,
.kl-home-grades h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.kl-home-grade-band p,
.kl-home-grades p {
  margin: 0.45rem 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.kl-home-grade-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.kl-home-grade-list a {
  padding: 0.68rem 0.95rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.kl-home-redesign .kl-letter-ecosystem {
  padding-block: clamp(2rem, 5vw, 4rem);
}

.kl-home-collections {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.kl-home-collection {
  min-height: 12.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem;
  background: var(--kl-collection-bg, #f6f7fb);
  border: 1px solid rgba(39, 53, 67, 0.1);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.kl-home-collection__label,
.kl-home-collection__title {
  display: block;
  color: #6f3f16;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.2;
}

.kl-home-collection h3 {
  margin: 0.9rem 0 0.4rem;
  font-size: 1.2rem;
}

.kl-home-collection p,
.kl-home-collection__body {
  display: block;
  margin: 0.75rem 0 0;
  color: var(--kl-ink-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

/* Auth pages */
.kl-auth-page {
  display: grid;
  gap: 1rem;
  max-width: 36rem;
  margin-inline: auto;
  padding-bottom: 2rem;
}

.kl-auth-card {
  border-radius: 1rem;
}

.kl-auth-form {
  display: grid;
  gap: 0.75rem;
}

.kl-auth-form--inline {
  margin-top: 0.5rem;
}

.kl-auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.kl-auth-divider::before,
.kl-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.kl-auth-links {
  margin: 0.5rem 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.kl-auth-links a {
  color: #2563eb;
  text-decoration: none;
}

.kl-auth-links a:hover,
.kl-auth-links a:focus-visible {
  text-decoration: underline;
}

.kl-auth-google-placeholder {
  margin: 0;
  padding: 0.8rem 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  color: #4b5563;
  font-size: 0.9rem;
}

.kl-auth-verify-panel {
  margin: 0 0 0.5rem;
  padding: 0.9rem 1rem;
  background: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 0.75rem;
}

/* Admin auth */
.kl-admin-auth-shell .kl-page-hero {
  display: none;
}

.kl-admin-auth-page {
  display: grid;
  gap: 1rem;
  max-width: 28rem;
  margin-inline: auto;
  padding: 2rem 0 2.5rem;
}

.kl-admin-auth-card {
  border-radius: 0.85rem;
  border: 1px solid #d1d5db;
  box-shadow: 0 8px 24px -18px rgb(15 23 42 / 0.45);
}

.kl-admin-auth-header {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e5e7eb;
}

.kl-admin-auth-header__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
}

.kl-admin-auth-header__lead {
  margin: 0.35rem 0 0;
  color: #6b7280;
  font-size: 0.92rem;
}

.kl-admin-auth-form {
  margin-top: 0.25rem;
}

.kl-admin-auth-links {
  margin-top: 0.75rem;
  text-align: center;
}

.kl-human-check {
  margin: 0.4rem 0 0.2rem;
}

.kl-account-menu {
  position: relative;
}

.kl-header-account {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  padding: 0.25rem 0.6rem 0.25rem 0.25rem;
  font: inherit;
  cursor: pointer;
}

.kl-header-account__avatar {
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.78rem;
  font-weight: 700;
}

.kl-header-account__name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.kl-account-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: min(15rem, 70vw);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 28px -14px rgb(0 0 0 / 0.35);
  padding: 0.35rem;
  z-index: 60;
}

.kl-account-menu__item {
  display: block;
  padding: 0.65rem 0.75rem;
  color: #374151;
  text-decoration: none;
  border-radius: 0.55rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.kl-account-menu__item:hover,
.kl-account-menu__item:focus-visible {
  background: #f3f4f6;
  outline: none;
}

.kl-account-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.kl-account-nav__link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4b5563;
  background: #f3f4f6;
}

.kl-account-nav__link.is-active {
  color: #1e40af;
  background: #dbeafe;
}

.kl-account-identity {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.kl-account-identity__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  color: #1e40af;
  font-weight: 700;
}

.kl-account-identity__name {
  margin: 0;
  font-weight: 700;
}

.kl-account-settings__block + .kl-account-settings__block {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid #e5e7eb;
}

.kl-account-settings__heading {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.kl-account-settings__subheading {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.kl-account-settings__sessions {
  margin-top: 1rem;
}

.kl-auth-logout-notice {
  max-width: 40rem;
  margin: 1rem auto 0;
  padding: 0 1rem;
}

.kl-account-identity__email,
.kl-account-identity__provider {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .kl-header-account__name {
    display: none;
  }
}

.kl-home-collection__cue,
.kl-home-text-link {
  display: inline-flex;
  align-items: center;
  margin-top: 1.4rem;
  color: var(--kl-primary);
  font-weight: 800;
  text-decoration: none;
}

.kl-home-section--featured {
  background: var(--kl-surface-soft);
}

/* kl-home-featured-grid → use kl-resource-grid--archive */

.kl-home-search-cta {
  padding: clamp(2.4rem, 6vw, 4.5rem) 0;
  background: #fff;
}

.kl-home-search-cta__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.3rem, 4vw, 2rem);
  background: #fff7e6;
  border: 1px solid rgba(188, 122, 26, 0.18);
  border-radius: 8px;
}

@media (max-width: 980px) {
  .kl-home-hero__grid,
  .kl-home-grade-band,
  .kl-home-grades,
  .kl-home-search-cta__inner {
    grid-template-columns: 1fr;
  }

  .kl-home-pathways,
  .kl-home-collections,
  .kl-home-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kl-home-grade-list {
    justify-content: flex-start;
  }

  .kl-home-feature-tile:nth-child(2),
  .kl-home-feature-tile:nth-child(3),
  .kl-home-hero-tile:nth-child(2),
  .kl-home-hero-tile:nth-child(3) {
    transform: none;
  }
}

@media (max-width: 640px) {
  .kl-home-redesign .kl-container {
    width: var(--kl-container);
  }

  .kl-home-hero__stats,
  .kl-home-pathways,
  .kl-home-collections,
  .kl-home-featured-grid {
    grid-template-columns: 1fr;
  }

  .kl-home-section__head {
    display: block;
  }

  .kl-home-view-all {
    display: inline-block;
    margin-top: 0.75rem;
  }

  .kl-home-pathway,
  .kl-home-collection {
    min-height: auto;
  }

  .kl-home-feature-tile,
  .kl-home-hero-tile {
    grid-template-columns: 76px minmax(0, 1fr);
    min-height: 96px;
  }

  .kl-home-feature-tile img,
  .kl-home-feature-tile__placeholder,
  .kl-home-hero-tile img,
  .kl-home-hero-tile__placeholder {
    width: 76px;
    height: 76px;
  }
}

/* —— Ecosystem relationship blocks —— */
.kl-ecosystem-blocks {
  margin-top: var(--kl-section-gap);
  border-top: 1px solid var(--kl-border);
}
.kl-ecosystem-block + .kl-ecosystem-block {
  border-top: 1px solid var(--kl-border);
}
.kl-ecosystem-block__text {
  margin: 0;
  max-width: 42rem;
  color: var(--kl-ink-muted, #4a5568);
  line-height: 1.6;
}
.kl-ecosystem-block--tip {
  padding-block: 1.5rem;
  background: color-mix(in srgb, var(--kl-primary, #2563eb) 6%, transparent);
  border-radius: var(--kl-radius, 12px);
  padding-inline: 1.25rem;
  margin-block: 1rem;
  border: none;
}
.kl-bundle-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  max-width: 36rem;
}
.kl-bundle-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--kl-border);
  border-radius: var(--kl-radius, 12px);
  background: var(--kl-surface);
  text-decoration: none;
  color: inherit;
}
.kl-bundle-link:hover {
  border-color: var(--kl-primary);
}
.kl-bundle-link span {
  color: var(--kl-primary);
  font-weight: 600;
  white-space: nowrap;
}
