:root {
  --kl-blue: #439bce;
  --kl-blue-dark: #236f9c;
  --kl-blue-focus: #2a7ca9;
  --kl-blue-cta: #2a7ca9;
  --kl-blue-soft: #eef8fd;
  --kl-ink: #231f20;
  --kl-text: #3d4348;
  --kl-muted: #6b737a;
  --kl-line: #dfe7ec;
  --kl-surface: #ffffff;
  --kl-page: #fbfcfd;
  --kl-radius: 16px;
  --kl-max: 1180px;
  --kl-reading: 760px;
  --kl-shadow: 0 10px 30px rgb(35 31 32 / 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--kl-page);
  color: var(--kl-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans JP", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--kl-blue-dark); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--kl-blue-dark); }

.kl-skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  padding: .7rem 1rem;
  border-radius: 8px;
  background: var(--kl-ink);
  color: #fff;
}
.kl-skip-link:focus { top: 1rem; }

.kl-site-header {
  position: relative;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--kl-line);
}
.kl-header-inner {
  width: min(calc(100% - 40px), var(--kl-max));
  min-height: 92px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.kl-brand { display: inline-flex; align-items: center; justify-self: start; text-decoration: none; }
.kl-brand img { width: 74px; height: 74px; display: block; }
.kl-header-center { display: flex; align-items: center; justify-self: center; gap: 24px; }
.kl-main-nav { display: flex; align-items: center; justify-content: center; gap: 26px; }
.kl-main-nav a,
.kl-language-switcher a,
.kl-language-current,
.kl-sister-link {
  color: var(--kl-ink);
  font-size: .94rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.kl-main-nav a {
  position: relative;
  padding: 33px 0 31px;
}
.kl-main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--kl-blue);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .18s ease;
}
.kl-main-nav a:hover::after,
.kl-main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.kl-main-nav a[aria-current="page"] { color: var(--kl-blue-dark); }
.kl-language-switcher {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: .42rem;
  color: var(--kl-ink);
  font-size: .94rem;
}
.kl-language-switcher a, .kl-language-current {
  position: relative;
  min-width: 28px;
  text-align: center;
  padding: .42rem .08rem .36rem;
  text-decoration: none;
}
.kl-language-switcher a { color: var(--kl-ink); transition: color .18s ease; }
.kl-language-switcher a:hover { color: var(--kl-blue-dark); }
.kl-language-current { color: var(--kl-blue-dark); }
.kl-language-current::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--kl-blue);
}
.kl-language-separator { color: var(--kl-muted); font-weight: 400; }
.kl-sister-link {
  padding: .64rem .86rem;
  border: 1px solid var(--kl-blue-cta);
  border-radius: 5px;
  background: var(--kl-blue-cta);
  color: #fff;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.kl-sister-link:hover { background: #185f88; color: #fff; border-color: #185f88; }
.kl-mobile-menu { display: none; }

.kl-main { width: min(calc(100% - 40px), var(--kl-max)); margin: 0 auto; }
.kl-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  padding: 36px 0;
}
.kl-eyebrow {
  margin: 0 0 .6rem;
  color: var(--kl-blue-dark);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.kl-hero h1,
.kl-utility-hero h1 {
  margin: 0;
  color: var(--kl-ink);
  font-size: clamp(2.55rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.045em;
}
.kl-lede {
  max-width: 720px;
  margin: 1.15rem 0 0;
  color: var(--kl-text);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  line-height: 1.62;
}
.kl-hero-art {
  width: auto;
  height: 150px;
  justify-self: center;
  align-self: end;
}
.kl-hero-art--scene {
  width: min(100%, 360px);
  height: auto;
  justify-self: end;
}

.kl-section-nav-wrap {
  margin: 0 0 54px;
  padding: 18px 20px;
  border: 1px solid var(--kl-line);
  border-radius: var(--kl-radius);
  background: var(--kl-surface);
  box-shadow: var(--kl-shadow);
}
.kl-section-nav-label {
  display: block;
  margin: 0 0 10px;
  color: var(--kl-blue-dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.kl-level-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.kl-level-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: .68rem 1.05rem;
  border-radius: 5px;
  background: var(--kl-blue-soft);
  color: var(--kl-blue-dark);
  font-weight: 750;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease;
}
.kl-level-nav a:hover { transform: translateY(-1px); background: #e1f3fc; }

.kl-content-section { padding: 0 0 80px; }
.kl-content-card {
  padding: clamp(26px, 5vw, 46px);
  border: 1px solid var(--kl-line);
  border-radius: var(--kl-radius);
  background: var(--kl-surface);
}
.kl-content-card h2 { margin: 0 0 .7rem; color: var(--kl-ink); font-size: clamp(1.45rem, 3vw, 2rem); }
.kl-content-card p { max-width: var(--kl-reading); margin: .55rem 0 0; }


.kl-site-footer { border-top: 1px solid #171717; background: #101010; color: #fff; }
.kl-footer-inner {
  width: min(calc(100% - 40px), var(--kl-max));
  margin: 0 auto;
  padding: 12px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 36px;
}
.kl-copyright {
  justify-self: start;
  margin: 0;
  color: #d8d8d8;
  font-size: .88rem;
}
.kl-footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
}
.kl-footer-brand img { width: 82px; height: 82px; }
.kl-footer-brand p {
  max-width: 220px;
  margin: 0;
  color: #d8d8d8;
  font-size: .88rem;
  line-height: 1.45;
}
.kl-footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-self: end;
  gap: 8px;
}
.kl-footer-links a {
  color: #fff;
  font-size: .88rem;
  text-decoration: none;
}
.kl-footer-links a:not(.kl-footer-sister-link):hover { color: #a9ddf7; }
.kl-footer-sister-link {
  margin-top: 6px;
  padding: .58rem .78rem;
  border: 1px solid var(--kl-blue-cta);
  border-radius: 5px;
  background: var(--kl-blue-cta);
  color: #fff !important;
  font-weight: 700;
  transition: background .18s ease, border-color .18s ease;
}
.kl-footer-sister-link:hover {
  background: #185f88;
  border-color: #185f88;
  color: #fff !important;
}

/* Intermediate layout: like NIHONGO Montréal, identity/language stay on the
   first row while the full navigation moves below before we switch to a
   hamburger menu. On the current test setup, ~780 CSS px corresponds roughly
   to the user's desired ~200% browser zoom threshold. */
@media (max-width: 780px) {
  .kl-header-inner {
    min-height: 0;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 24px;
    padding-top: 14px;
  }
  .kl-brand {
    grid-column: 1;
    grid-row: 1;
    padding-bottom: 14px;
  }
  .kl-brand img { width: 68px; height: 68px; }
  .kl-language-switcher {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    align-self: center;
    justify-self: end;
    padding-bottom: 14px;
  }
  .kl-header-center {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    width: 100%;
    justify-self: stretch;
    justify-content: center;
    gap: 20px;
    padding: 17px 0 18px;
    border-top: 1px solid var(--kl-line);
  }
  .kl-main-nav { gap: 23px; }
  .kl-main-nav a { padding: .55rem 0 .62rem; }
  .kl-main-nav a::after { bottom: .18rem; }
  .kl-mobile-menu { display: none; }
}

@media (max-width: 820px) {
  .kl-header-center { gap: 14px; }
  .kl-main-nav { gap: 17px; }
  .kl-main-nav a,
  .kl-sister-link { font-size: .9rem; }
  .kl-sister-link { padding: .58rem .7rem; }
}

@media (max-width: 590px) {
  .kl-header-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 14px;
    padding-top: 10px;
  }
  .kl-brand { grid-column: 1; grid-row: 1; padding-bottom: 10px; }
  .kl-brand img { width: 60px; height: 60px; }
  .kl-language-switcher {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    padding-bottom: 10px;
  }
  .kl-header-center { display: none; }
  .kl-mobile-menu {
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    justify-self: stretch;
    position: relative;
    padding: 8px 0 9px;
    border-top: 1px solid var(--kl-line);
  }
  .kl-mobile-menu summary {
    width: fit-content;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: .52rem .66rem;
    border-radius: 5px;
    color: var(--kl-ink);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }
  .kl-mobile-menu summary::-webkit-details-marker { display: none; }
  .kl-menu-icon { width: 21px; display: grid; gap: 4px; }
  .kl-menu-icon i { display: block; height: 2px; border-radius: 2px; background: currentColor; }
  .kl-mobile-menu nav {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    width: min(320px, calc(100vw - 28px));
    padding: 10px;
    border: 1px solid var(--kl-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 50px rgb(35 31 32 / .13);
  }
  .kl-mobile-menu nav > a {
    display: block;
    padding: .72rem .78rem;
    border-radius: 5px;
    color: var(--kl-ink);
    font-weight: 650;
    text-decoration: none;
  }
  .kl-mobile-menu nav > a:hover,
  .kl-mobile-menu nav > a[aria-current="page"] {
    background: var(--kl-blue-soft);
    color: var(--kl-blue-dark);
  }
  .kl-mobile-sister { margin-top: 6px; border-top: 1px solid var(--kl-line); }
  /* The language switcher remains in the identity row, so it is intentionally
     hidden inside the hamburger panel to avoid presenting it twice. */
  .kl-mobile-language { display: none; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .kl-header-inner, .kl-main, .kl-footer-inner { width: min(calc(100% - 28px), var(--kl-max)); }
  .kl-hero { grid-template-columns: 1fr; padding: 36px 0; gap: 14px; }
  .kl-hero-art { width: auto; height: 120px; justify-self: end; margin-top: -14px; opacity: .94; }
  .kl-hero-art--scene { width: min(100%, 290px); height: auto; margin-top: 0; opacity: 1; }
  .kl-section-nav-wrap { margin-bottom: 36px; padding: 15px; }
  .kl-level-nav a { flex: 1 1 88px; }
  .kl-footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  .kl-copyright { justify-self: center; order: 3; }
  .kl-footer-brand { justify-self: center; order: 1; }
  .kl-footer-links { align-items: center; justify-self: center; order: 2; }
  .kl-footer-brand p { text-align: center; }
}

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

/* ========================================================================== 
   JLPT lesson pages
   ========================================================================== */
.kl-lesson-page { padding-bottom: 80px; }

.kl-lesson-hero {
  padding: 36px 0;
}
.kl-lesson-hero h1 {
  max-width: 900px;
  margin: 0;
  color: var(--kl-ink);
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -.04em;
}
.kl-lesson-hero .kl-lede { max-width: 820px; }

.kl-level-nav a[aria-current="page"] {
  background: var(--kl-blue-dark);
  color: #fff;
}
.kl-level-nav a[aria-current="page"]:hover {
  background: #185f88;
  color: #fff;
}

.kl-page-toc {
  margin: 0 0 clamp(52px, 7vw, 78px);
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--kl-line);
  border-radius: var(--kl-radius);
  background: var(--kl-surface);
  box-shadow: var(--kl-shadow);
}
.kl-page-toc-heading { margin-bottom: 24px; }
.kl-page-toc-heading .kl-section-nav-label { margin-bottom: 4px; }
.kl-page-toc h2 {
  margin: 0;
  color: var(--kl-ink);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
}
.kl-toc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 22px;
}
.kl-toc-grid section {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--kl-line);
  border-radius: 10px;
  background: var(--kl-page);
}
.kl-toc-grid h3 { margin: 0 0 10px; font-size: 1.02rem; }
.kl-toc-grid h3 a { color: var(--kl-ink); text-decoration: none; }
.kl-toc-grid h3 a:hover { color: var(--kl-blue-dark); }
.kl-toc-grid ol {
  margin: 0;
  padding-left: 1.35rem;
  color: var(--kl-muted);
}
.kl-toc-grid li + li { margin-top: .28rem; }
.kl-toc-grid li::marker { color: var(--kl-blue); font-weight: 700; }
.kl-toc-grid li a { color: var(--kl-text); text-decoration: none; }
.kl-toc-grid li a:hover { color: var(--kl-blue-dark); text-decoration: underline; }

.kl-lesson-content {
  width: 100%;
  margin: 0 auto;
}
.kl-lesson-content > h2,
.kl-lesson-content > h3,
.kl-lesson-content > h4,
.kl-lesson-content > h5 {
  color: var(--kl-ink);
  scroll-margin-top: 24px;
}
.kl-lesson-content > h2 {
  margin: 0 0 1.3rem;
  padding-top: clamp(28px, 5vw, 52px);
  border-top: 1px solid var(--kl-line);
  font-size: clamp(1.8rem, 4vw, 2.55rem);
  line-height: 1.15;
  letter-spacing: -.025em;
}
.kl-lesson-content > h2:first-child {
  padding-top: 0;
  border-top: 0;
}
.kl-lesson-content > h3 {
  margin: clamp(42px, 6vw, 64px) 0 1rem;
  font-size: clamp(1.35rem, 3vw, 1.78rem);
  line-height: 1.3;
}
.kl-lesson-content > h4 {
  margin: 2.5rem 0 .9rem;
  font-size: clamp(1.17rem, 2.5vw, 1.42rem);
  line-height: 1.35;
}
.kl-lesson-content > h5 {
  margin: 2rem 0 .8rem;
  font-size: 1.05rem;
}
.kl-lesson-content > p,
.kl-lesson-content > ul,
.kl-lesson-content > ol {
  max-width: 860px;
}
.kl-lesson-content p { margin: .8rem 0 1rem; }
.kl-lesson-content strong { color: var(--kl-ink); }
.kl-lesson-content :is(.JP, .JP2, .JP3) strong,
.kl-lesson-content strong:is(.JP, .JP2, .JP3) { color: var(--kl-blue-dark); }

/* Japanese learner text inherited from the original KANJI-Link content. */
.JP {
  color: var(--kl-blue-dark);
  font-weight: 700;
}
.JP2,
.JP3 {
  color: var(--kl-blue-dark);
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}
.JP2 { font-size: 1.22em; }
.JP3 { font-size: 1.5em; }


.kl-table-scroll {
  width: 100%;
  margin: 1.25rem 0 1.8rem;
  overflow-x: auto;
  border: 1px solid var(--kl-line);
  border-radius: 10px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.kl-table-scroll table {
  width: 100%;
  min-width: 620px;
  margin: 0;
  border-collapse: collapse;
  background: #fff;
}
.kl-table-scroll th,
.kl-table-scroll td {
  padding: .72rem .8rem;
  border-right: 1px solid var(--kl-line);
  border-bottom: 1px solid var(--kl-line);
  text-align: center;
  vertical-align: middle;
}
.kl-table-scroll tr:last-child td { border-bottom: 0; }
.kl-table-scroll th:last-child,
.kl-table-scroll td:last-child { border-right: 0; }
.kl-table-scroll th {
  background: var(--kl-blue-soft);
  color: var(--kl-ink);
  font-size: .95rem;
  font-weight: 750;
}
.kl-table-scroll .vocabtable td { text-align: left; }
.kl-table-scroll td.advantage { background: #eff9f2; text-align: left; }
.kl-table-scroll td.drawback { background: #fff1f2; text-align: left; }

.kl-lesson-content figure {
  width: min(100%, 880px);
  margin: 1.6rem auto 2rem;
  text-align: center;
}
.kl-lesson-content figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 700px;
  margin: 0 auto;
}
.kl-lesson-content figcaption {
  margin-top: .5rem;
  color: var(--kl-muted);
  font-size: .9rem;
  font-style: italic;
}

.youtube {
  width: min(100%, 880px);
  aspect-ratio: 16 / 9;
  margin: 1.6rem auto 2rem;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
  box-shadow: var(--kl-shadow);
}
.youtube iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.kl-disclosure {
  width: min(100%, 880px);
  margin: 1rem 0 1.45rem;
  border: 1px solid var(--kl-line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.kl-disclosure summary {
  position: relative;
  padding: .78rem 2.8rem .78rem 1rem;
  color: var(--kl-blue-dark);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.kl-disclosure summary::-webkit-details-marker { display: none; }
.kl-disclosure summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  translate: 0 -50%;
  color: var(--kl-blue);
  font-size: 1.35rem;
  font-weight: 500;
}
.kl-disclosure[open] summary::after { content: "−"; }
.kl-disclosure summary:hover { background: var(--kl-blue-soft); }
.kl-disclosure-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--kl-line);
}
.kl-disclosure-body > .kl-table-scroll { margin-bottom: 0; }
.kl-disclosure-body > p:last-child { margin-bottom: 0; }

.kl-page-end-nav {
  width: 100%;
  margin: 68px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--kl-line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
}
.kl-page-end-nav a {
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 820px) {
  .kl-toc-grid { grid-template-columns: 1fr 1fr; }
  .kl-toc-grid section:first-child { grid-row: span 2; }
}

@media (max-width: 680px) {
  .kl-lesson-page { padding-bottom: 58px; }
  .kl-lesson-hero { padding: 36px 0; }
  .kl-toc-grid { grid-template-columns: 1fr; }
  .kl-toc-grid section:first-child { grid-row: auto; }
  .kl-lesson-content > h3 { margin-top: 38px; }
  .kl-table-scroll table { min-width: 560px; }
  .youtube { border-radius: 8px; }
  .kl-page-end-nav { flex-direction: column; }
}


/* Expandable lesson panels used by JLPT lessons and nested content. */
.kl-nested-panel {
  margin: 0 0 12px;
  border: 1px solid var(--kl-line);
  border-radius: 6px;
  background: #fff;
  overflow: clip;
}
.kl-nested-panel summary {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  cursor: pointer;
  color: var(--kl-ink);
  font-weight: 750;
}
.kl-nested-panel summary::-webkit-details-marker { display: none; }
.kl-nested-panel summary:hover { color: var(--kl-blue-dark); background: var(--kl-blue-soft); }
.kl-nested-panel summary::after {
  content: "+";
  color: var(--kl-blue);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1;
}
.kl-nested-panel[open] summary::after { content: "−"; }
.kl-nested-panel[open] summary {
  color: var(--kl-blue-dark);
  border-bottom: 1px solid var(--kl-line);
}
.kl-nested-summary-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.kl-nested-summary-subtitle { color: var(--kl-muted); font-size: .88rem; font-weight: 500; }
.kl-nested-panel-body { padding: 20px; }
.kl-nested-panel-body > :first-child { margin-top: 0; }
.kl-nested-panel-body > :last-child { margin-bottom: 0; }
@media (max-width: 620px) {
  .kl-nested-panel summary { padding: 16px; gap: 12px; }
  .kl-nested-summary-text { display: grid; gap: 2px; }
  .kl-nested-panel-body { padding: 16px; }
}


/* Live N5 nested lesson refinements. */
.kl-lesson-content > .kl-lesson-panel {
  width: 100%;
  scroll-margin-top: 24px;
}
.kl-lesson-content > h2 + .kl-lesson-panel { margin-top: .25rem; }
.kl-lesson-content > .kl-lesson-panel + h2 { margin-top: clamp(52px, 7vw, 78px); }
.kl-lesson-panel .kl-nested-panel-body { padding: clamp(18px, 3vw, 28px); }
.kl-lesson-panel .kl-nested-panel-body > h4:first-child,
.kl-lesson-panel .kl-nested-panel-body > h5:first-child { margin-top: 0; }
.kl-lesson-panel .kl-nested-panel-body > p,
.kl-lesson-panel .kl-nested-panel-body > ul,
.kl-lesson-panel .kl-nested-panel-body > ol { max-width: 860px; }
.kl-lesson-panel:target {
  border-color: rgb(67 155 206 / .7);
  box-shadow: 0 0 0 3px rgb(67 155 206 / .10);
}

@media print {
  .kl-lesson-panel > .kl-nested-panel-body { display: block !important; }
  .kl-lesson-panel summary::after { display: none !important; }
}

/* ========================================================================== 
   Shared accessibility hardening — stabilized shell v1.2
   ========================================================================== */
:where(a, summary):focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 3px;
}

.kl-mobile-menu summary:focus-visible,
.kl-nested-panel summary:focus-visible,
.kl-disclosure summary:focus-visible {
  outline-offset: -3px;
}

/* Single-section contents grid (N4/N3) */
.kl-toc-grid.kl-toc-grid--single { grid-template-columns: 1fr; }
.kl-toc-grid.kl-toc-grid--single section:first-child { grid-row: auto; }


/* ========================================================================== 
   Homepage
   ========================================================================== */
.kl-home-main { padding-bottom: clamp(68px, 8vw, 104px); }

.kl-home-hero {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 38vw);
  gap: clamp(24px, 4vw, 54px);
  padding-top: 36px;
  padding-bottom: 36px;
}
.kl-home-hero h1 { max-width: 920px; }
.kl-home-hero-art {
  width: min(100%, 520px);
  height: auto;
  justify-self: end;
  align-self: end;
}
.kl-home-hero-art--scene {
  width: min(100%, 520px);
  height: auto;
}

.kl-home-resources {
  padding-top: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--kl-line);
}
.kl-home-section-heading {
  margin-bottom: clamp(24px, 4vw, 34px);
}
.kl-home-section-heading .kl-section-nav-label { margin-bottom: 5px; }
.kl-home-section-heading h2 {
  margin: 0;
  color: var(--kl-ink);
  font-size: clamp(1.75rem, 3.5vw, 2.55rem);
  line-height: 1.14;
  letter-spacing: -.025em;
}

.kl-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.kl-home-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  min-height: 245px;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--kl-line);
  border-radius: var(--kl-radius);
  background: var(--kl-surface);
  color: var(--kl-text);
  text-decoration: none;
  box-shadow: var(--kl-shadow);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.kl-home-card:hover {
  transform: translateY(-2px);
  border-color: #b9dbea;
  background: #fff;
  color: var(--kl-text);
  box-shadow: 0 14px 34px rgb(35 31 32 / .085);
}
.kl-home-card:focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 3px;
}
.kl-home-card img {
  width: 155px;
  height: auto;
  justify-self: center;
}
.kl-home-card h3 {
  margin: 0 0 .5rem;
  color: var(--kl-ink);
  font-size: clamp(1.35rem, 2.4vw, 1.72rem);
  line-height: 1.18;
}
.kl-home-card p {
  margin: 0 0 1rem;
  color: var(--kl-text);
  line-height: 1.58;
}
.kl-home-card-cta {
  color: var(--kl-blue-dark);
  font-weight: 750;
}
.kl-home-card:hover .kl-home-card-cta { color: var(--kl-blue-dark); }

@media (max-width: 900px) {
  .kl-home-card {
    grid-template-columns: 1fr;
    align-content: start;
  }
  .kl-home-card img { justify-self: start; }
}

@media (max-width: 680px) {
  .kl-home-hero {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 36px;
  }
  .kl-home-hero-art {
    width: min(100%, 340px);
    height: auto;
    justify-self: end;
    margin-top: -6px;
  }
  .kl-home-grid { grid-template-columns: 1fr; }
  .kl-home-card {
    grid-template-columns: 118px minmax(0, 1fr);
    min-height: 0;
    padding: 22px;
    gap: 18px;
  }
  .kl-home-card img { width: 118px; }
}

@media (max-width: 450px) {
  .kl-home-card { grid-template-columns: 1fr; }
  .kl-home-card img { width: 135px; }
}

/* ==========================================================================
   Grammar furigana — contextual readings, visible by default
   ========================================================================== */
.kl-furigana {
  ruby-position: under;
  ruby-align: center;
  text-decoration: none;
}
.kl-furigana rt {
  position: relative;
  top: 1px;
  color: var(--kl-blue-dark);
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: .56em;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}
.kl-lesson-content .JP2 { line-height: 1.9; }
body.kl-furigana-off .kl-furigana rt { display: none; }

.kl-furigana-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  padding: .66rem .82rem;
  border: 1px solid var(--kl-blue-dark);
  border-radius: 5px;
  background: var(--kl-blue-dark);
  color: #fff;
  box-shadow: 0 8px 24px rgb(35 31 32 / .18);
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.kl-furigana-toggle:hover {
  background: #185f88;
  border-color: #185f88;
}
.kl-furigana-toggle:focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 3px;
}
.kl-furigana-toggle:active { transform: translateY(1px); }
.kl-furigana-toggle-state {
  min-width: 2.25rem;
  padding-left: .48rem;
  border-left: 1px solid rgb(255 255 255 / .55);
  color: #fff;
  font-size: .78rem;
  letter-spacing: .04em;
}

@media (max-width: 680px) {
  .kl-furigana-toggle {
    right: 12px;
    bottom: 12px;
    padding: .58rem .7rem;
    font-size: .8rem;
  }
}

@media print {
  .kl-furigana-toggle { display: none !important; }
  body.kl-furigana-off .kl-furigana rt { display: revert !important; }
}



#TE-form .kl-nested-panel-body > h3 {
  margin: 1.33em 0;
  color: var(--kl-ink);
  font-size: 1em;
  line-height: normal;
}
#TE-form .kl-nested-panel-body > h4 {
  margin: 1.67em 0;
  color: var(--kl-ink);
  font-size: .83em;
  line-height: normal;
}

/* N4 split contents: verb conjugation + particles. */
.kl-toc-grid.kl-toc-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.kl-toc-grid.kl-toc-grid--two section:first-child {
  grid-row: auto;
}
.kl-particles-panel .kl-nested-panel-body > h3 {
  margin: 2.25rem 0 .9rem;
  color: var(--kl-ink);
  font-size: clamp(1.3rem, 2.7vw, 1.65rem);
  line-height: 1.28;
}
.kl-particles-panel .kl-nested-panel-body > h3:first-child {
  margin-top: 0;
}
.kl-particles-panel .kl-nested-panel-body > h4 {
  margin: 1.9rem 0 .75rem;
  color: var(--kl-ink);
  font-size: clamp(1.08rem, 2.2vw, 1.28rem);
  line-height: 1.35;
}
@media (max-width: 680px) {
  .kl-toc-grid.kl-toc-grid--two {
    grid-template-columns: 1fr;
  }
}


/* Inline exercise answers — replaces the historical hover-on-"?" interaction. */
.kl-answer-reveal {
  display: inline-flex;
  align-items: baseline;
  gap: .42rem;
  vertical-align: baseline;
}
.kl-answer-button[hidden],
.kl-answer-text[hidden] {
  display: none !important;
}

.kl-answer-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 .08rem;
  padding: .28rem .58rem;
  border: 1px solid var(--kl-blue);
  border-radius: 5px;
  background: var(--kl-blue-soft);
  color: var(--kl-blue-dark);
  font: inherit;
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.kl-answer-button:hover {
  border-color: var(--kl-blue-dark);
  background: var(--kl-blue-dark);
  color: #fff;
}
.kl-answer-button:focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 2px;
}
.kl-answer-text,
.kl-answer-noscript {
  color: var(--kl-blue-dark);
  font-weight: 750;
}
.kl-answer-text:focus {
  outline: 2px solid var(--kl-blue-focus);
  outline-offset: 2px;
  border-radius: 3px;
}
.kl-answer-blank {
  display: inline-block;
  min-width: 2.1em;
  color: var(--kl-blue-dark);
  font-weight: 750;
  text-align: center;
}
@media (max-width: 450px) {
  .kl-answer-button {
    font-size: .75rem;
    padding: .3rem .52rem;
  }
}


/* ==========================================================================
   Kanji section landing page — v2.6
   ========================================================================== */
.kl-kanji-section-nav a {
  min-width: 150px;
}
.kl-kanji-overview {
  display: grid;
  gap: 22px;
  padding-bottom: clamp(70px, 8vw, 96px);
}
.kl-kanji-card {
  min-width: 0;
  box-shadow: var(--kl-shadow);
}
.kl-kanji-card > :last-child {
  margin-bottom: 0;
}
.kl-kanji-card p {
  max-width: 900px;
}
.kl-kanji-card .kl-section-nav-label {
  margin-bottom: 6px;
}
.kl-kanji-comparison {
  max-width: 920px;
}
.kl-kanji-comparison table {
  min-width: 650px;
  text-align: center;
}
.kl-kanji-comparison th {
  min-width: 128px;
  text-align: left;
}
.kl-kanji-comparison td {
  min-width: 105px;
  text-align: center;
}
.kl-kanji-benefits {
  max-width: 840px;
  margin: 1.2rem 0 1.1rem;
  padding-left: 1.35rem;
}
.kl-kanji-benefits li {
  margin: .48rem 0;
  line-height: 1.55;
}
.kl-kanji-start {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
}
.kl-inline-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  padding: .72rem 1rem;
  border: 1px solid var(--kl-blue-cta);
  border-radius: 5px;
  background: var(--kl-blue-cta);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, transform .15s ease;
}
.kl-inline-cta:hover {
  background: #185f88;
  border-color: #185f88;
  color: #fff;
  transform: translateY(-1px);
}
.kl-inline-cta:focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 3px;
}
@media (max-width: 680px) {
  .kl-kanji-section-nav a {
    min-width: 0;
  }
  .kl-kanji-start {
    grid-template-columns: 1fr;
  }
  .kl-inline-cta {
    justify-self: start;
  }
}


/* ==========================================================================
   Kanji readings interaction
   ========================================================================== */
.kl-reading-trigger {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #fff;
  color: var(--kl-blue-dark);
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 0 rgb(35 31 32 / .04);
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.kl-reading-trigger:hover,
.kl-reading-trigger:focus-visible {
  border-color: var(--kl-blue);
  background: #fff;
  color: var(--kl-blue);
  box-shadow: 0 5px 16px rgb(35 31 32 / .10);
  transform: translateY(-1px);
}
.kl-reading-trigger:focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 2px;
}
.kl-reading-popover {
  position: absolute;
  z-index: 40;
  left: 50%;
  top: calc(100% + 10px);
  width: min(340px, calc(100vw - 32px));
  padding: 15px 16px 16px;
  border: 1px solid #b9dbea;
  border-radius: 8px;
  background: #fff;
  color: var(--kl-text);
  box-shadow: 0 16px 42px rgb(35 31 32 / .16);
  transform: translateX(-50%);
}
.kl-reading-popover[hidden] {
  display: none !important;
}
.kl-reading-popover::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7px;
  width: 12px;
  height: 12px;
  border-left: 1px solid #b9dbea;
  border-top: 1px solid #b9dbea;
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
}
.kl-reading-popover.is-above {
  top: auto;
  bottom: calc(100% + 10px);
}
.kl-reading-popover.is-above::before {
  top: auto;
  bottom: -7px;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid #b9dbea;
  border-bottom: 1px solid #b9dbea;
}
.kl-reading-popover-kanji {
  display: block;
  margin-bottom: .55rem;
  color: var(--kl-blue);
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 2.3rem;
  font-weight: 650;
  line-height: 1;
}
.kl-reading-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: .34rem 0;
}
.kl-reading-label {
  color: var(--kl-muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
}
.kl-reading-values {
  color: var(--kl-ink);
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: .96rem;
  font-weight: 600;
  line-height: 1.55;
}
.kl-reading-legend {
  margin-bottom: 0;
  color: var(--kl-muted);
  font-size: .9rem;
}
.kl-reading-legend span {
  color: var(--kl-blue-dark);
  font-weight: 800;
}
@media (max-width: 680px) {
  .kl-reading-trigger {
    width: 50px;
    height: 50px;
    font-size: 1.85rem;
  }
  .kl-reading-popover {
    width: min(320px, calc(100vw - 28px));
  }
}


/* ==========================================================================
   Kanji by school grade — v2.8
   ========================================================================== */
.kl-grade-intro {
  padding-bottom: 28px;
}
.kl-grade-intro .kl-content-card p {
  max-width: 930px;
}
.kl-grade-intro .kl-japanese-term {
  color: var(--kl-blue-dark);
  font-weight: 400;
  line-height: 2.15;
}
.kl-grade-intro .kl-japanese-term ruby,
.kl-grade-intro .kl-japanese-term rt {
  color: inherit;
}
.kl-grade-intro .kl-romaji-term {
  color: var(--kl-blue-dark);
  font-weight: 700;
  font-style: normal;
}
.kl-grade-toc {
  padding-bottom: 54px;
}
.kl-grade-toc .kl-content-card {
  box-shadow: var(--kl-shadow);
}
.kl-grade-toc-grid {
  grid-template-columns: 1.3fr 1fr 1fr;
}
.kl-grade-toc-grid section {
  height: 100%;
}
.kl-grade-content {
  padding-bottom: clamp(70px, 8vw, 96px);
}
.kl-grade-content > h2 {
  margin-top: clamp(52px, 7vw, 78px);
}
.kl-grade-content > h2:first-child {
  margin-top: 0;
}
.kl-kanji-grade-panel {
  scroll-margin-top: 24px;
}
.kl-kanji-grade-panel:target {
  border-color: rgb(67 155 206 / .7);
  box-shadow: 0 0 0 3px rgb(67 155 206 / .10);
}
.kl-kanji-grade-panel .kl-nested-panel-body {
  padding: clamp(16px, 2.5vw, 24px);
}
.kl-kanji-reading-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}
.kl-kanji-reading-grid .kl-reading-trigger {
  flex: 0 0 auto;
}

/* Production list uses one viewport-positioned popover for all 2,136 kanji. */
.kl-reading-popover--shared {
  position: fixed;
  z-index: 120;
  width: min(340px, calc(100vw - 24px));
  height: auto;
  right: auto;
  bottom: auto;
  transform: none;
  pointer-events: none;
}

/* The shared popover is positioned entirely by JavaScript, so reset the
   base bottom value when it appears above a kanji. */
.kl-reading-popover--shared.is-above {
  bottom: auto;
}
.kl-reading-popover--shared::before {
  left: var(--kl-reading-arrow-x, 50%);
  transform: translateX(-50%) rotate(45deg);
}
.kl-reading-popover--shared.is-above::before {
  left: var(--kl-reading-arrow-x, 50%);
  transform: translateX(-50%) rotate(45deg);
}
.kl-reading-trigger.is-reading-active,
.kl-reading-trigger.is-reading-locked {
  border-color: var(--kl-blue);
  background: #fff;
  color: var(--kl-blue);
  box-shadow: 0 5px 16px rgb(35 31 32 / .10);
  transform: translateY(-1px);
}
@media (max-width: 820px) {
  .kl-grade-toc-grid {
    grid-template-columns: 1fr 1fr;
  }
  .kl-grade-toc-grid section:first-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 560px) {
  .kl-grade-toc-grid {
    grid-template-columns: 1fr;
  }
  .kl-grade-toc-grid section:first-child {
    grid-column: auto;
  }
  .kl-kanji-reading-grid {
    gap: 7px;
  }
  .kl-kanji-reading-grid .kl-reading-trigger {
    width: 48px;
    height: 48px;
    font-size: 1.78rem;
  }
}
@media print {
  .kl-kanji-grade-panel > .kl-nested-panel-body {
    display: block !important;
  }
  .kl-reading-popover--shared {
    display: none !important;
  }
}


/* ========================================================================== 
   Kanji by radical — v3.4
   ========================================================================== */
.kl-radical-intro {
  padding-bottom: 28px;
}
.kl-radical-intro .kl-content-card p {
  max-width: 930px;
}
.kl-radical-intro .kl-japanese-term {
  color: var(--kl-blue-dark);
  font-weight: 400;
  line-height: 2.15;
}
.kl-radical-intro .kl-japanese-term ruby,
.kl-radical-intro .kl-japanese-term rt {
  color: inherit;
}
.kl-radical-intro .kl-romaji-term {
  color: var(--kl-blue-dark);
  font-weight: 700;
  font-style: normal;
}
.kl-radical-toc {
  padding-bottom: 54px;
}
.kl-radical-toc .kl-content-card {
  box-shadow: var(--kl-shadow);
}
.kl-radical-toc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.kl-radical-toc-link {
  display: grid;
  grid-template-columns: minmax(52px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--kl-line);
  border-radius: 6px;
  background: #fff;
  color: var(--kl-ink);
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.kl-radical-toc-link:hover {
  border-color: var(--kl-blue);
  background: var(--kl-blue-soft);
  color: var(--kl-blue-dark);
  box-shadow: 0 5px 16px rgb(35 31 32 / .08);
  transform: translateY(-1px);
}
.kl-radical-toc-link:focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 2px;
}
.kl-radical-toc-form,
.kl-radical-summary-form {
  color: var(--kl-blue-dark);
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-weight: 650;
}
.kl-radical-toc-form {
  font-size: 1.45rem;
  line-height: 1.1;
  white-space: nowrap;
}
.kl-radical-toc-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.kl-radical-toc-name {
  font-size: .92rem;
  font-weight: 750;
  line-height: 1.2;
}
.kl-radical-toc-count {
  color: var(--kl-muted);
  font-size: .76rem;
  line-height: 1.2;
}
.kl-radical-content {
  padding-bottom: clamp(70px, 8vw, 96px);
}
.kl-kanji-radical-panel {
  scroll-margin-top: 24px;
}
.kl-kanji-radical-panel:target {
  border-color: rgb(67 155 206 / .7);
  box-shadow: 0 0 0 3px rgb(67 155 206 / .10);
}
.kl-kanji-radical-panel .kl-nested-panel-body {
  padding: clamp(16px, 2.5vw, 24px);
}
.kl-radical-summary-text {
  align-items: center;
}
.kl-radical-summary-name {
  min-width: 112px;
}
.kl-radical-summary-form {
  font-size: 1.22rem;
}
@media (max-width: 980px) {
  .kl-radical-toc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 740px) {
  .kl-radical-toc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .kl-radical-toc-grid {
    gap: 8px;
  }
  .kl-radical-toc-link {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 0;
    padding: 10px;
  }
  .kl-radical-toc-form {
    font-size: 1.35rem;
  }
  .kl-radical-summary-name {
    min-width: 0;
  }
  .kl-radical-summary-form {
    font-size: 1.12rem;
  }
}
@media print {
  .kl-kanji-radical-panel > .kl-nested-panel-body {
    display: block !important;
  }
}

/* ========================================================================== 
   Kanji introduction — v3.5
   ========================================================================== */
.kl-kanji-intro-page {
  --kl-intro-reading: 900px;
}
.kl-intro-toc {
  margin: 0 0 72px;
  padding: 18px 20px;
  border: 1px solid var(--kl-line);
  border-radius: var(--kl-radius);
  background: var(--kl-surface);
  box-shadow: var(--kl-shadow);
}
.kl-intro-toc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.kl-intro-toc-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: .62rem .9rem;
  border: 1px solid var(--kl-line);
  border-radius: 5px;
  background: #fff;
  color: var(--kl-blue-dark);
  font-size: .91rem;
  font-weight: 750;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.kl-intro-toc-links a:hover {
  border-color: var(--kl-blue);
  background: var(--kl-blue-soft);
  transform: translateY(-1px);
}
.kl-intro-toc-links a:focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 2px;
}
.kl-intro-note {
  max-width: var(--kl-intro-reading);
  margin: 18px 0 0;
  color: var(--kl-muted);
  font-size: .93rem;
}

.kl-mnemonic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.kl-mnemonic-card {
  padding: 22px;
  border: 1px solid var(--kl-line);
  border-radius: 12px;
  background: #fff;
}
.kl-mnemonic-card > p:last-child {
  margin-bottom: 0;
}
.kl-mnemonic-equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 102px;
  margin: 12px 0 18px;
  padding: 16px;
  border-radius: 10px;
  background: var(--kl-blue-soft);
  color: var(--kl-blue-dark);
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}
.kl-mnemonic-equation strong {
  font-size: 2.8rem;
  line-height: 1;
}
.kl-mnemonic-equation span {
  font-size: 2rem;
  font-weight: 650;
  line-height: 1;
}
.kl-mnemonic-equation b {
  color: var(--kl-muted);
  font-size: 1.3rem;
}

.kl-radical-download-card {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--kl-line);
  border-radius: var(--kl-radius);
  background: #fff;
  box-shadow: var(--kl-shadow);
}
.kl-radical-download-card {
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
}
.kl-radical-download-card h2 {
  margin: 0;
  color: var(--kl-ink);
  font-size: 1.3rem;
}
.kl-radical-download-card p:not(.kl-section-nav-label) {
  margin: .45rem 0 .8rem;
}
.kl-radical-coverage {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.kl-radical-tier {
  overflow: hidden;
  border: 1px solid var(--kl-line);
  border-radius: 14px;
  background: #fff;
}
.kl-radical-tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  background: var(--kl-blue-soft);
  color: var(--kl-blue-dark);
  font-size: .9rem;
  font-weight: 800;
}
.kl-radical-tier-header strong {
  font-size: 1.06rem;
}
.kl-radical-reference-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.kl-radical-reference-item {
  display: grid;
  align-content: center;
  min-height: 92px;
  padding: 11px 10px;
  border-right: 1px solid var(--kl-line);
  border-top: 1px solid var(--kl-line);
  text-align: center;
}
.kl-radical-reference-item:nth-child(6n) {
  border-right: 0;
}
.kl-radical-reference-label {
  color: var(--kl-muted);
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.2;
}
.kl-radical-reference-form {
  margin-top: 7px;
  color: var(--kl-blue-dark);
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 650;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.kl-intro-list {
  padding-left: 1.25rem;
}
.kl-intro-list li + li {
  margin-top: .35rem;
}
.kl-reading-family-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  max-width: 780px;
  margin: 26px 0;
  padding: 18px;
  border-radius: 12px;
  background: var(--kl-blue-soft);
}
.kl-reading-family-demo span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid #b9dbea;
  border-radius: 9px;
  background: #fff;
  color: var(--kl-blue-dark);
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 2rem;
  font-weight: 650;
}
.kl-reading-family-demo strong {
  margin-left: 6px;
  padding: .45rem .7rem;
  border-radius: 999px;
  background: var(--kl-blue-dark);
  color: #fff;
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: .94rem;
}
.kl-intro-next-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.kl-intro-next-links a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .72rem .9rem;
  border-radius: 5px;
  background: var(--kl-blue-soft);
  color: var(--kl-blue-dark);
  font-weight: 800;
  text-decoration: none;
}
.kl-intro-next-links a:hover {
  background: #e1f3fc;
}

@media (max-width: 900px) {
  .kl-radical-reference-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .kl-radical-reference-item:nth-child(6n) {
    border-right: 1px solid var(--kl-line);
  }
  .kl-radical-reference-item:nth-child(4n) {
    border-right: 0;
  }
}
@media (max-width: 760px) {
  .kl-intro-toc {
    margin-bottom: 58px;
  }
  .kl-mnemonic-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .kl-intro-toc-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .kl-intro-toc-links a {
    justify-content: center;
    text-align: center;
  }
  .kl-radical-reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kl-radical-reference-item:nth-child(4n) {
    border-right: 1px solid var(--kl-line);
  }
  .kl-radical-reference-item:nth-child(2n) {
    border-right: 0;
  }
  .kl-radical-reference-form {
    font-size: 1.35rem;
  }
}
@media (max-width: 390px) {
  .kl-intro-toc-links {
    grid-template-columns: 1fr;
  }
}
@media print {
  .kl-intro-toc,
  .kl-radical-download-card,
  .kl-intro-next-links {
    break-inside: avoid;
  }
}

/* ========================================================================== 
   Kanji introduction — v3.5.1 nested / historical-content pass
   ========================================================================== */
.kl-kanji-intro-page--nested .kl-intro-toc { margin-bottom: 32px; }
.kl-intro-accordion-stack {
  width: 100%;
  margin: 0 auto clamp(80px, 10vw, 118px);
}
.kl-intro-panel {
  scroll-margin-top: 24px;
  margin-bottom: 14px;
  border-radius: var(--kl-radius);
  box-shadow: var(--kl-shadow);
}
.kl-intro-panel > summary {
  padding: 20px 22px;
  font-size: 1.03rem;
}
.kl-intro-panel > .kl-nested-panel-body {
  padding: clamp(22px, 4vw, 34px);
}
.kl-intro-panel > .kl-nested-panel-body > p,
.kl-intro-panel > .kl-nested-panel-body > ul {
  max-width: var(--kl-intro-reading);
}
.kl-intro-panel:target {
  border-color: rgb(67 155 206 / .7);
  box-shadow: 0 0 0 3px rgb(67 155 206 / .10), var(--kl-shadow);
}

/* History: an original comic-like sequence restoring the explanatory rhythm
   of the historical page without depending on a third-party manga image. */
.kl-history-comic {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 30px;
}
.kl-history-comic-step {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 280px;
  padding: 20px 18px 18px;
  border: 1px solid var(--kl-line);
  border-radius: 12px;
  background: #fff;
}
.kl-history-comic-step p { margin: 16px 0 0; font-size: .94rem; line-height: 1.55; }
.kl-history-step-number {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--kl-blue-dark);
  color: #fff;
  font-size: .78rem;
  font-weight: 850;
  z-index: 1;
}
.kl-history-mountain,
.kl-history-kanji-card,
.kl-history-dialogue,
.kl-history-dual-reading {
  display: grid;
  place-items: center;
  min-height: 136px;
  margin-top: 14px;
  border-radius: 10px;
  background: var(--kl-blue-soft);
  color: var(--kl-blue-dark);
}
.kl-history-mountain svg { width: min(150px, 78%); }
.kl-history-kanji-card {
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: clamp(4rem, 7vw, 5.4rem);
  font-weight: 650;
}
.kl-history-dialogue {
  grid-template-columns: auto auto;
  gap: 14px;
  padding: 16px;
}
.kl-history-dialogue span {
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 4.1rem;
  line-height: 1;
}
.kl-history-dialogue b {
  position: relative;
  padding: 12px 14px;
  border: 2px solid var(--kl-blue-dark);
  border-radius: 18px;
  background: #fff;
  font-size: 1rem;
}
.kl-history-dual-reading {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  padding: 14px;
  gap: 6px 10px;
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}
.kl-history-dual-reading strong {
  grid-row: 1 / 3;
  font-size: 4rem;
  line-height: 1;
}
.kl-history-dual-reading span { font-size: 1.35rem; font-weight: 750; }
.kl-history-reading-tag {
  display: inline-flex;
  align-self: flex-start;
  margin-top: auto;
  padding: .32rem .52rem;
  border-radius: 999px;
  background: var(--kl-blue-soft);
  color: var(--kl-blue-dark);
  font-size: .74rem;
  font-weight: 850;
}

/* Nested type accordions. */
.kl-intro-type-stack { display: grid; gap: 10px; margin: 24px 0 0; }
.kl-intro-type-disclosure {
  width: 100%;
  margin: 0;
  border-radius: 9px;
}
.kl-intro-type-disclosure > summary {
  padding-right: 4.25rem;
  font-size: .96rem;
}
.kl-intro-type-heading {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .2rem .55rem;
  min-width: 0;
  line-height: 1.6;
}
.kl-intro-type-kanji {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}
.kl-intro-type-disclosure > summary span[lang="ja-Latn"] { color: var(--kl-muted); font-weight: 600; }
.kl-intro-type-label {
  color: var(--kl-muted);
  font-weight: 600;
}
.kl-intro-type-label::before { content: "– "; }
.kl-intro-type-disclosure .kl-disclosure-body { padding: 20px; }
.kl-intro-type-disclosure .kl-disclosure-body > p:first-child { margin-top: 0; }

/* Larger diagrams intentionally echo the historical teaching images. */
.kl-historic-diagram {
  width: min(100%, 720px);
  min-height: 180px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid #c8c8c8;
  border-radius: 6px;
  background: #fff;
}
.kl-historic-diagram--pictograph,
.kl-historic-diagram--ideograph {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(100px, .8fr);
  align-items: center;
  gap: 22px;
  text-align: center;
}
.kl-historic-diagram > b { color: #111; font-size: 2rem; font-weight: 600; }
.kl-historic-diagram > strong,
.kl-historic-diagram--equation strong {
  color: #0098c8;
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: clamp(3.3rem, 8vw, 5.1rem);
  line-height: 1;
}
.kl-diagram-mountain { display: grid; place-items: center; color: #4d345f; }
.kl-diagram-mountain svg { width: min(180px, 100%); }
.kl-diagram-mountain span,
.kl-above-symbol span { margin-top: 4px; color: var(--kl-ink); font-weight: 750; }
.kl-above-symbol {
  display: grid;
  grid-template-rows: 54px 10px auto;
  place-items: center;
  min-width: 130px;
}
.kl-above-symbol i {
  align-self: end;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #6b4c78;
  box-shadow: inset -8px -8px 14px rgb(0 0 0 / .14);
}
.kl-above-symbol b { width: 120px; height: 7px; border-radius: 99px; background: #111; }
.kl-historic-diagram--equation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 4vw, 34px);
  text-align: center;
}
.kl-historic-diagram--equation span { display: grid; gap: 8px; }
.kl-historic-diagram--equation small { color: var(--kl-ink); font-size: .9rem; font-weight: 750; }

/* Full phono-semantic board: preserve the historical 日 + 青 = 晴 logic. */
.kl-keisei-board {
  width: min(100%, 780px);
  margin: 24px auto 4px;
  padding: 20px;
  border: 1px solid #c8c8c8;
  border-radius: 6px;
  background: #fff;
  overflow-x: auto;
}
.kl-keisei-board-head,
.kl-keisei-board-row {
  display: grid;
  grid-template-columns: 86px 32px 78px 32px 86px 110px minmax(110px, 1fr);
  align-items: center;
  min-width: 650px;
  column-gap: 6px;
}
.kl-keisei-board-head {
  margin-bottom: 8px;
  color: var(--kl-ink);
  font-size: .85rem;
  text-align: center;
}
.kl-keisei-board-head strong:first-of-type { grid-column: 6; }
.kl-keisei-board-head strong:last-of-type { grid-column: 7; }
.kl-keisei-board-row { min-height: 66px; text-align: center; }
.kl-keisei-board-row--source .kl-keisei-result { grid-column: 5; }
.kl-keisei-board-row--source b { grid-column: 6; }
.kl-keisei-board-row--source em { grid-column: 7; }
.kl-keisei-component,
.kl-keisei-result {
  display: grid;
  place-items: center;
  color: #0098c8;
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 2.65rem;
  font-style: normal;
  line-height: 1;
}
.kl-keisei-component small {
  margin-top: 4px;
  color: var(--kl-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: .72rem;
  font-weight: 500;
}
.kl-keisei-board-row i { color: #111; font-size: 1.5rem; font-style: normal; }
.kl-keisei-board-row b { color: #0098c8; font-size: 1rem; }
.kl-keisei-board-row em { color: var(--kl-ink); font-style: normal; font-weight: 750; }

.kl-intro-radical-download { margin: 24px auto 18px; box-shadow: none; }
.kl-intro-panel .youtube { margin-top: 24px; }

@media (max-width: 920px) {
  .kl-history-comic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kl-history-comic-step { min-height: 260px; }
}
@media (max-width: 620px) {
  .kl-intro-panel > summary { padding: 17px 16px; }
  .kl-intro-panel > .kl-nested-panel-body { padding: 18px 16px; }
  .kl-history-comic { grid-template-columns: 1fr; }
  .kl-history-comic-step { min-height: 0; }
  .kl-historic-diagram--pictograph,
  .kl-historic-diagram--ideograph {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .kl-historic-diagram--pictograph > b,
  .kl-historic-diagram--ideograph > b { transform: rotate(90deg); }
  .kl-historic-diagram--equation { gap: 10px; }
  .kl-historic-diagram--equation strong { font-size: 2.6rem; }
  .kl-historic-diagram--equation small { font-size: .75rem; }
}
@media print {
  .kl-intro-panel > .kl-nested-panel-body { display: block !important; }
  .kl-intro-panel > summary::after { display: none !important; }
}

/* ========================================================================== 
   Vocabulary — v3.6
   ========================================================================== */
.kl-vocab-page {
  --kl-vocab-reading: 900px;
}
.kl-vocab-toc {
  margin: 0 0 32px;
  padding: 18px 20px;
  border: 1px solid var(--kl-line);
  border-radius: var(--kl-radius);
  background: var(--kl-surface);
  box-shadow: var(--kl-shadow);
}
.kl-vocab-toc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.kl-vocab-toc-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: .62rem .9rem;
  border: 1px solid var(--kl-line);
  border-radius: 5px;
  background: #fff;
  color: var(--kl-blue-dark);
  font-size: .91rem;
  font-weight: 750;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.kl-vocab-toc-links a:hover {
  border-color: var(--kl-blue);
  background: var(--kl-blue-soft);
  transform: translateY(-1px);
}
.kl-vocab-toc-links a:focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 2px;
}
.kl-vocab-accordion-stack {
  width: 100%;
  margin: 0 auto clamp(80px, 10vw, 118px);
}
.kl-vocab-panel {
  scroll-margin-top: 24px;
  margin-bottom: 14px;
  border-radius: var(--kl-radius);
  box-shadow: var(--kl-shadow);
}
.kl-vocab-panel > summary {
  padding: 20px 22px;
  font-size: 1.03rem;
}
.kl-vocab-panel > .kl-nested-panel-body {
  padding: clamp(22px, 4vw, 34px);
}
.kl-vocab-panel > .kl-nested-panel-body > p {
  max-width: var(--kl-vocab-reading);
}
.kl-vocab-panel:target {
  border-color: rgb(67 155 206 / .7);
  box-shadow: 0 0 0 3px rgb(67 155 206 / .10), var(--kl-shadow);
}
.kl-vocab-download-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin: 28px 0 30px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--kl-line);
  border-radius: 12px;
  background: linear-gradient(135deg, #f9fdff 0%, #fff 68%);
}
.kl-vocab-file-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 78px;
  border: 2px solid var(--kl-blue);
  border-radius: 9px;
  background: #fff;
  color: var(--kl-blue-dark);
  font-weight: 850;
  letter-spacing: .04em;
  box-shadow: 0 8px 22px rgb(17 70 97 / .08);
}
.kl-vocab-file-icon span { font-size: .76rem; }
.kl-vocab-download-copy .kl-section-nav-label { margin-bottom: 5px; }
.kl-vocab-download-copy h2 {
  margin: 0;
  color: var(--kl-ink);
  font-size: clamp(1.28rem, 2.5vw, 1.65rem);
  line-height: 1.2;
}
.kl-vocab-download-copy p:last-child {
  margin: .5rem 0 0;
  color: var(--kl-muted);
}
.kl-vocab-subheading {
  margin: 30px 0 14px;
  color: var(--kl-ink);
  font-size: 1.25rem;
}
.kl-vocab-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.kl-vocab-steps li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--kl-line);
  border-radius: 10px;
  background: #fff;
}
.kl-vocab-steps li > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--kl-blue-soft);
  color: var(--kl-blue-dark);
  font-weight: 850;
}
.kl-vocab-steps p { margin: 0; line-height: 1.55; }
.kl-vocab-before-note {
  margin-top: 24px !important;
  padding: 14px 16px;
  border-left: 4px solid var(--kl-blue);
  border-radius: 0 8px 8px 0;
  background: var(--kl-blue-soft);
}
.kl-vocab-notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}
.kl-vocab-note-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--kl-line);
  border-radius: 10px;
  background: #fff;
}
.kl-vocab-note-card h3 {
  margin: 0 0 9px;
  color: var(--kl-ink);
  font-size: 1.08rem;
  line-height: 1.3;
}
.kl-vocab-note-card p {
  margin: .55rem 0 0;
  line-height: 1.6;
}
.kl-vocab-note-card p:first-of-type { margin-top: 0; }
.kl-vocab-note {
  padding: 11px 12px;
  border-radius: 7px;
  background: #f7f9fa;
  color: var(--kl-text);
  font-size: .94rem;
}

@media (max-width: 820px) {
  .kl-vocab-download-card {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .kl-vocab-download-card .kl-inline-cta {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .kl-vocab-steps { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .kl-vocab-toc { padding: 16px; }
  .kl-vocab-toc-links { display: grid; }
  .kl-vocab-toc-links a { width: 100%; }
  .kl-vocab-panel > summary { padding: 16px; }
  .kl-vocab-panel > .kl-nested-panel-body { padding: 18px 16px; }
  .kl-vocab-download-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .kl-vocab-file-icon { width: 60px; height: 68px; }
  .kl-vocab-download-card .kl-inline-cta { grid-column: auto; }
  .kl-vocab-notes-grid { grid-template-columns: 1fr; }
}

@media print {
  .kl-vocab-toc { box-shadow: none; }
  .kl-vocab-panel > .kl-nested-panel-body { display: block !important; }
}

/* ========================================================================== 
   Guide — v3.7
   ========================================================================== */
.kl-guide-page {
  --kl-guide-reading: 900px;
}
.kl-guide-toc {
  margin: 0 0 32px;
  padding: 18px 20px;
  border: 1px solid var(--kl-line);
  border-radius: var(--kl-radius);
  background: var(--kl-surface);
  box-shadow: var(--kl-shadow);
}
.kl-guide-toc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.kl-guide-toc-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: .62rem .9rem;
  border: 1px solid var(--kl-line);
  border-radius: 5px;
  background: #fff;
  color: var(--kl-blue-dark);
  font-size: .91rem;
  font-weight: 750;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.kl-guide-toc-links a:hover {
  border-color: var(--kl-blue);
  background: var(--kl-blue-soft);
  transform: translateY(-1px);
}
.kl-guide-toc-links a:focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 2px;
}
.kl-guide-intro {
  margin: 0 0 18px;
}
.kl-guide-intro .kl-section-nav-label { margin-bottom: 4px; }
.kl-guide-intro h2 {
  margin: 0;
  color: var(--kl-ink);
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  line-height: 1.2;
}
.kl-guide-accordion-stack {
  width: 100%;
  margin: 0 auto 34px;
}
.kl-guide-panel {
  scroll-margin-top: 24px;
  margin-bottom: 14px;
  border-radius: var(--kl-radius);
  box-shadow: var(--kl-shadow);
}
.kl-guide-panel > summary {
  padding: 20px 22px;
  font-size: 1.03rem;
}
.kl-guide-panel > .kl-nested-panel-body {
  padding: clamp(22px, 4vw, 34px);
}
.kl-guide-panel > .kl-nested-panel-body > p,
.kl-guide-panel .kl-guide-reasons {
  max-width: var(--kl-guide-reading);
}
.kl-guide-panel:target {
  border-color: rgb(67 155 206 / .7);
  box-shadow: 0 0 0 3px rgb(67 155 206 / .10), var(--kl-shadow);
}
.kl-guide-reasons {
  display: grid;
  gap: 10px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}
.kl-guide-reasons li {
  position: relative;
  padding: 15px 16px 15px 42px;
  border: 1px solid var(--kl-line);
  border-radius: 9px;
  background: #fff;
  line-height: 1.62;
}
.kl-guide-reasons li::before {
  content: "✓";
  position: absolute;
  left: 16px;
  top: 15px;
  color: var(--kl-blue-dark);
  font-weight: 850;
}
.kl-guide-tip {
  margin: 22px 0 16px !important;
  padding: 14px 16px;
  border-left: 4px solid var(--kl-blue);
  border-radius: 0 8px 8px 0;
  background: var(--kl-blue-soft);
}
.kl-guide-course-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 5vw, 48px);
  align-items: center;
  margin: 0 0 clamp(80px, 10vw, 118px);
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--kl-line);
  border-radius: var(--kl-radius);
  background: linear-gradient(135deg, #f9fdff 0%, #fff 72%);
  box-shadow: var(--kl-shadow);
}
.kl-guide-course-card .kl-section-nav-label { margin-bottom: 5px; }
.kl-guide-course-card h2 {
  margin: 0;
  color: var(--kl-ink);
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  line-height: 1.2;
}
.kl-guide-course-card p:last-child {
  max-width: 760px;
  margin: .65rem 0 0;
  color: var(--kl-text);
  line-height: 1.62;
}

@media (max-width: 720px) {
  .kl-guide-course-card { grid-template-columns: 1fr; }
  .kl-guide-course-card .kl-inline-cta { justify-self: start; }
}

@media (max-width: 640px) {
  .kl-guide-toc { padding: 16px; }
  .kl-guide-toc-links { display: grid; }
  .kl-guide-toc-links a { width: 100%; }
  .kl-guide-panel > summary { padding: 16px; }
  .kl-guide-panel > .kl-nested-panel-body { padding: 18px 16px; }
  .kl-guide-reasons li { padding-left: 40px; }
}

@media print {
  .kl-guide-toc { box-shadow: none; }
  .kl-guide-panel > .kl-nested-panel-body { display: block !important; }
}

/* ========================================================================== 
   Utility pages — v3.7.4
   ========================================================================== */
.kl-utility-page { padding-bottom: clamp(72px, 10vw, 110px); }
.kl-utility-hero {
  max-width: 860px;
  padding: 36px 0;
}
.kl-sitemap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.kl-sitemap-card,
.kl-utility-card {
  padding: clamp(22px, 4vw, 30px);
  border: 1px solid var(--kl-line);
  border-radius: var(--kl-radius);
  background: var(--kl-surface);
  box-shadow: var(--kl-shadow);
}
.kl-sitemap-card h2,
.kl-utility-card h2 {
  margin: 0 0 .75rem;
  color: var(--kl-ink);
  font-size: clamp(1.28rem, 2.5vw, 1.65rem);
  line-height: 1.25;
}
.kl-sitemap-card h2 a { color: inherit; text-decoration-color: rgb(67 155 206 / .45); }
.kl-sitemap-card ul { margin: .75rem 0 0; padding-left: 1.15rem; }
.kl-sitemap-card li + li { margin-top: .42rem; }
.kl-sitemap-card p,
.kl-utility-card p { margin: .55rem 0 0; }
.kl-sitemap-card--external { background: linear-gradient(135deg, #f9fdff 0%, #fff 72%); }
.kl-privacy-stack { display: grid; gap: 16px; max-width: 960px; }
.kl-privacy-updated { margin: 26px 0 0; color: var(--kl-muted); font-size: .92rem; }
.kl-privacy-page code {
  padding: .08rem .32rem;
  border-radius: 5px;
  background: var(--kl-blue-soft);
  color: var(--kl-blue-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
}

/* Static bilingual error pages: intentionally independent of PHP. */
.kl-error-body { min-height: 100vh; background: #fbfcfd; }
.kl-error-header {
  background: #fff;
  border-bottom: 1px solid var(--kl-line);
}
.kl-error-header-inner {
  width: min(calc(100% - 40px), var(--kl-max));
  min-height: 118px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.kl-error-brand { display: inline-flex; justify-self: start; text-decoration: none; }
.kl-error-brand img { display: block; width: 82px; height: 82px; }
.kl-error-site-name {
  justify-self: center;
  color: var(--kl-ink);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: .01em;
}
.kl-error-language {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .94rem;
  font-weight: 750;
}
.kl-error-language a { color: var(--kl-ink); text-decoration: none; }
.kl-error-language a:hover { color: var(--kl-blue-dark); }
.kl-error-language span { color: var(--kl-muted); font-weight: 400; }
.kl-error-main {
  width: min(calc(100% - 40px), 1120px);
  margin: 0 auto;
  padding: clamp(62px, 9vw, 108px) 0 clamp(70px, 10vw, 120px);
}
.kl-error-code {
  margin: 0 0 24px;
  color: var(--kl-blue);
  font-size: clamp(6rem, 15vw, 10rem);
  font-weight: 900;
  line-height: .85;
  letter-spacing: -.065em;
  text-align: center;
}
.kl-error-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.kl-error-card {
  display: flex;
  min-height: 310px;
  padding: clamp(30px, 4vw, 46px);
  border: 1px solid #d5dde2;
  border-radius: 18px;
  background: #fff;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.kl-error-card h1 {
  margin: 0;
  color: #17354b;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.025em;
}
.kl-error-card p {
  max-width: 460px;
  margin: 1.05rem 0 0;
  color: var(--kl-ink);
  font-size: 1.08rem;
  line-height: 1.55;
}
.kl-error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}
.kl-error-btn {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  padding: .8rem 1.35rem;
  border: 2px solid #17354b;
  border-radius: 7px;
  background: #fff;
  color: #17354b;
  font-weight: 800;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.kl-error-btn:hover { transform: translateY(-1px); background: var(--kl-blue-soft); color: #17354b; }
.kl-error-btn--primary {
  border-color: var(--kl-blue-cta);
  background: var(--kl-blue-cta);
  color: #fff;
}
.kl-error-btn--primary:hover { border-color: #185f88; background: #185f88; color: #fff; }
.kl-error-btn:focus-visible,
.kl-error-language a:focus-visible,
.kl-error-brand:focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .kl-sitemap-grid { grid-template-columns: 1fr; }
  .kl-error-grid { grid-template-columns: 1fr; }
  .kl-error-header-inner { min-height: 96px; }
  .kl-error-brand img { width: 66px; height: 66px; }
  .kl-error-site-name { font-size: 1.05rem; }
}
@media (max-width: 480px) {
  .kl-error-header-inner { width: min(calc(100% - 28px), var(--kl-max)); gap: 10px; }
  .kl-error-site-name { display: none; }
  .kl-error-header-inner { grid-template-columns: 1fr auto; }
  .kl-error-language { grid-column: 2; }
  .kl-error-main { width: min(calc(100% - 28px), 1120px); padding-top: 48px; }
  .kl-error-card { min-height: 0; padding: 28px 18px; }
  .kl-error-actions { width: 100%; display: grid; }
  .kl-error-btn { width: 100%; }
}

/* ========================================================================== 
   Pre-RC footer support + contextual YouTube consent (v3.8.9)
   ========================================================================== */
.kl-footer-support {
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 280px;
}
.kl-footer-donate-message {
  margin: 0;
  color: #d8d8d8;
  font-size: .82rem;
  line-height: 1.45;
}
.kl-footer-donate-form { margin: 1px 0 0; }
.kl-footer-donate-button {
  min-height: 38px;
  padding: .54rem .78rem;
  font: inherit;
  font-size: .86rem;
  cursor: pointer;
}
.kl-footer-logo-link {
  display: inline-flex;
  border-radius: 50%;
}
.kl-footer-logo-link:focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 4px;
}

.youtube {
  aspect-ratio: auto;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.kl-youtube-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
  box-shadow: var(--kl-shadow);
}
.youtube iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.kl-youtube-placeholder {
  display: flex;
  height: 100%;
  padding: clamp(22px, 5vw, 44px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(145deg, #102b3a, #111);
  color: #fff;
  text-align: center;
}
.kl-youtube-placeholder[hidden] { display: none; }
.kl-youtube-label {
  margin: 0;
  color: #a9ddf7;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.kl-youtube-title {
  max-width: 680px;
  margin: 0;
  color: #fff;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 750;
  line-height: 1.35;
}
.kl-youtube-message {
  max-width: 650px;
  margin: .2rem 0 .4rem;
  color: #e2e7ea;
  font-size: clamp(.82rem, 2vw, .92rem);
  line-height: 1.5;
}
.kl-youtube-consent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
}
.kl-youtube-consent-actions a {
  color: #c9eafb;
  font-size: .82rem;
  text-underline-offset: 3px;
}
.kl-youtube-consent-actions a:hover { color: #fff; }
.kl-youtube-load {
  font: inherit;
  cursor: pointer;
}
.kl-youtube-tools {
  display: flex;
  justify-content: flex-end;
  margin-top: .55rem;
}
.kl-youtube-unload {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--kl-blue-dark);
  font: inherit;
  font-size: .8rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.kl-youtube-unload:hover { color: var(--kl-blue-cta); }
.kl-youtube-unload:focus-visible {
  outline: 3px solid var(--kl-blue-focus);
  outline-offset: 3px;
}

@media (max-width: 680px) {
  .kl-footer-support {
    justify-self: center;
    align-items: center;
    order: 3;
    max-width: 320px;
  }
  .kl-footer-donate-message { text-align: center; }
  .kl-footer-support .kl-copyright { order: 0; }
  .kl-youtube-placeholder { padding: 20px 16px; }
}
