:root {
  color-scheme: light;
  --paper: var(--kx-paper);
  --white: var(--kx-paper);
  --ink: var(--kx-ink);
  --subtle: var(--kx-muted);
  --line: var(--kx-line);
  --accent: var(--kx-accent-hover);
  --accent-soft: var(--kx-accent-tint);
  --green: var(--kx-ink);
  --green-soft: var(--kx-surface);
  --orange: var(--kx-bright);
  --header-height: var(--kx-header-h);
  --result-hover: #f5f7ef;
  --directory-link-color: #0260ea;
  --viewer-stage: #eae7dd;
  font-family: var(--kx-sans);
  font-synthesis: none;
}

:root[data-kx-home-dark] {
  --result-hover: var(--kx-surface);
  --directory-link-color: #478cf5;
  --viewer-stage: #0f1310;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul { list-style: none; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--kx-accent); outline-offset: 4px; }
.sr-only, .skip:not(:focus) { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.skip:focus { position: fixed; inset: 8px auto auto 8px; z-index: 40; padding: 8px 16px; border-radius: 5px; background: var(--paper); }
[data-kx-home-dark] :is(.small-icon, .portal-icon img) { filter: invert(1); }
.shell { max-width: 1280px; margin-inline: auto; display: grid; grid-template-columns: 218px minmax(0, 1fr); }
.shell :is(h1, h2, h3, h4) { color: var(--ink); }
.shell a { color: inherit; text-decoration: none; }
.sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100dvh - var(--header-height));
  overflow-y: auto;
  align-self: start;
  background: var(--white);
  border-inline-end: 1px solid var(--line);
  padding: 30px 18px;
}
.nav-home { display: block; padding: 11px 10px; border-radius: 7px; font-weight: 750; }
.nav-home[aria-current], .nav-list a[aria-current] { background: var(--accent-soft); color: var(--accent); }
.nav-label { margin: 24px 10px 8px; color: var(--subtle); font-size: 13px; font-weight: 700; }
.nav-list a {
  display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 5px 10px;
  border-radius: 7px; font-size: 14px; font-weight: 600;
}
.nav-list a:hover, .nav-home:hover { background: var(--green-soft); }
.small-icon { display: block; width: 18px; height: 18px; }
.sidebar-contact { display: block; margin: 17px 10px 0; border-top: 1px solid var(--line); padding: 14px 0; color: var(--accent); font-size: 13px; font-weight: 700; }
.workspace { min-width: 0; }
main { max-width: 1250px; margin: 0 auto; padding: 38px 32px 58px; background: var(--paper); }
main:focus-visible { outline-offset: -4px; }
.mobile-navigation, .mobile-toc { display: none; }
.help-portal .shell { display: block; max-width: none; }
.help-portal :is(.sidebar, .mobile-navigation) { display: none; }
.help-portal main { max-width: none; padding: 0; }
.hero {
  padding: clamp(42px, 6.2vw, 92px) clamp(15px, 4vw, 32px);
  background: var(--kx-surface);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
h1 { font-size: clamp(33px, 4.05vw, 60px); line-height: 1.13; letter-spacing: -0.045em; font-weight: 800; overflow-wrap: anywhere; }
.hero h1 { font-size: clamp(30px, 4vw, 50px); text-wrap: balance; }
.hero > p { color: var(--subtle); margin: 14px auto 22px; max-width: 45em; text-wrap: pretty; }
.search-tools { max-width: 620px; margin-inline: auto; }
.search {
  display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 58px;
  padding: 5px 6px 5px 13px; background: var(--white); border: 1px solid var(--line);
  border-radius: 9px; box-shadow: 0 2px 8px #3b2f1a0a;
}
.search-icon { display: flex; color: var(--green); }
.search-icon svg { width: 23px; height: 23px; }
.search input[type=search] {
  width: 100%; min-width: 0; background: transparent; outline: 0; border: 0;
  color: var(--ink); padding: 9px 0; border-radius: 4px; font-size: 16px;
}
.search input:focus-visible { outline-offset: 0; }
.search input::placeholder { color: var(--subtle); opacity: 1; }
.search button { flex: none; min-height: 44px; border-radius: 6px; border: 0; background: var(--orange); padding-inline: 15px; color: #251604; font-weight: 750; }
.search button:hover { background: #fa9631; }
.quick-search { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 8px; margin-block-start: 12px; }
.quick-search a {
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  color: var(--subtle); font-size: 13px; padding: 5px 12px; min-height: 36px;
  display: inline-flex; align-items: center; font-weight: 650;
}
.quick-search a:hover { background: var(--accent-soft); color: var(--accent); }
.plain-link:hover, .breadcrumbs a:hover { text-decoration: underline; text-underline-offset: 4px; }
.arrow { font-family: sans-serif; flex: none; font-weight: 500; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 13px; }
.section-heading h2 { font-size: 22px; letter-spacing: -.02em; }
.portal-content { max-width: 1232px; margin-inline: auto; padding: 39px clamp(15px, 4vw, 32px) 64px; }
.portal-content section + section { margin-block-start: 46px; }
.portal-content h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; font-size: 23px; line-height: 1.25; }
.portal-icon {
  display: inline-grid; flex: none; place-items: center; width: 36px; height: 36px;
  border-radius: 8px; background: var(--accent-soft);
}
.task-grid, .category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.task-grid a, .category {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 2px 4px #3b2f1a0a;
}
.task-grid a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 54px; height: 100%; padding: 10px 14px; font-weight: 700;
}
.task-grid a span { flex: none; color: var(--accent); font-size: 22px; line-height: 1; }
.task-grid a:hover { border-color: var(--accent); background: var(--accent-soft); }
.category { display: flex; flex-direction: column; min-width: 0; padding: 18px; }
.category h3 a { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; line-height: 1.35; }
.category ul { flex: 1; padding-block: 12px; }
.category li + li { border-top: 1px solid var(--line); }
.category li a, .category-more { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.category-more { border-top: 1px solid var(--line); color: var(--accent); font-weight: 700; }
.category a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.category-icon { display: inline-grid; place-items: center; width: 39px; height: 39px; border-radius: 8px; background: var(--green-soft); }
.help-faq details { border-bottom: 1px solid var(--line); }
.help-faq summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 54px; padding: 8px 0; font-weight: 700; cursor: pointer; }
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary span[aria-hidden] { color: var(--accent); }
.help-faq details[open] summary span[aria-hidden] { transform: rotate(45deg); }
.help-faq details p { margin-bottom: 10px; max-width: 76ch; }
.faq-contact { display: flex; flex-wrap: wrap; column-gap: 20px; margin-top: 12px; }
.faq-contact a { align-content: center; min-height: 44px; color: var(--accent); text-decoration: underline; overflow-wrap: anywhere; }
.article-row:hover { border-color: var(--kx-line-strong); background: var(--result-hover); }
.plain-link { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 8px; }
#result-status { color: var(--subtle); margin-bottom: 12px; }
.article-list { display: grid; gap: 9px; }
.article-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 60px;
  padding: 12px 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--white);
}
.article-row strong, .article-row small, .row-summary { display: block; }
.row-summary { color: var(--subtle); font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }
.row-category { color: var(--accent); font-weight: 650; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; color: var(--subtle); font-size: 13px; }
.breadcrumbs a { color: var(--accent); }
.subheader { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 5px 13px; margin-bottom: 24px; }
.subheader h1, .lesson h1 { font-size: clamp(30px, 3.35vw, 46px); }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 36px; }
.lesson { max-width: 760px; overflow-wrap: anywhere; }
.lesson h1 { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.lesson h2 { font-size: 22px; margin-top: 27px; scroll-margin-top: calc(var(--header-height) + 22px); }
.lesson h3 { font-size: 16px; margin-top: 19px; }
.lesson p { line-height: 1.75; margin-top: 10px; }
.lesson > ul, .related > ul { list-style: disc; padding-inline-start: 26px; margin-top: 10px; line-height: 1.75; }
.lesson ol { padding-inline-start: 26px; margin-top: 10px; }
.lesson :is(ol, ul) :is(ol, ul) { padding-inline-start: 23px; }
.lesson table { width: 100%; border-collapse: collapse; table-layout: auto; margin-block: 15px; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.lesson :is(th, td) { border: 1px solid var(--line); text-align: left; vertical-align: top; padding: 8px 12px; }
.lesson th { background: var(--kx-surface); }
.lesson video { display: block; width: 100%; border-radius: 8px; }
.lesson li + li { margin-top: 4px; }
.lesson p a, .lesson > ul a, .related > ul a { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.lesson figure { margin: 15px 0; }
.lesson img { display: block; max-width: 100%; max-height: 490px; border: 1px solid var(--line); border-radius: 7px; }
.image-zoom { position: relative; display: block; width: fit-content; max-width: 100%; cursor: zoom-in; }
.image-zoom, .lesson img, .image-viewer img { -webkit-touch-callout: none; user-select: none; }
.zoom-icon {
  position: absolute; inset: auto 10px 10px auto; display: grid; place-items: center;
  width: 40px; height: 40px; color: #fffdf8; background: #202720; opacity: 0;
  border: 1px solid #fffdf8; border-radius: 50%; pointer-events: none;
}
.zoom-icon svg { width: 22px; height: 22px; }
.image-zoom:hover .zoom-icon, .image-zoom:focus-visible .zoom-icon { opacity: 1; }
@media (hover: none) { .zoom-icon { opacity: 1; } }
.image-viewer {
  position: fixed; inset: 0; margin: auto; padding: 0; box-sizing: border-box;
  width: min(1200px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 24px);
  border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--paper);
  overflow: hidden;
}
.image-viewer[open] { display: flex; flex-direction: column; }
.image-viewer::backdrop { background: rgb(20 24 20 / 78%); }
html:has(.image-viewer[open]) { overflow: hidden; }
.image-viewer-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.image-viewer-caption {
  flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: .875rem; font-weight: 600;
}
.image-viewer-toolbar button {
  min-height: 44px; min-width: 44px; padding: 0 10px; color: inherit; background: var(--paper);
  border: 1px solid var(--line); border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.image-viewer-toolbar button[aria-pressed="true"] { color: #202720; background: #ffb464; }
.image-viewer-toolbar form button { font-size: 1.5rem; }
.image-viewer-stage {
  min-height: 0; padding: 10px; background: var(--viewer-stage); overflow: auto; overscroll-behavior: contain;
}
.image-viewer-stage img { display: block; max-width: 100%; max-height: calc(100dvh - 124px); margin: auto; }
.image-viewer.original-size img { max-width: none; max-height: none; }
.lesson figcaption { color: var(--subtle); font-size: 13px; margin-top: 5px; }
.module-catalog { max-width: 760px; margin-block-start: 24px; }
.module-catalog h2 { margin-block-end: 10px; }
.module-catalog :is(h2, h3, .directory-link)[id] { scroll-margin-top: calc(var(--header-height) + 22px); }
.directory-list > li { border-block-start: 1px solid var(--line); }
.directory-topic { padding-block: 6px 12px; }
.directory-topic h3 { padding: 9px 10px; border-radius: 6px; font-size: 16px; }
.module-catalog :is(.directory-topic h3, .directory-link):target { background: var(--green-soft); }
.directory-branch { margin-inline-start: 16px; }
.directory-branch > li { position: relative; padding-inline-start: 20px; }
.directory-branch > li::before {
  content: ''; position: absolute; inset-block: 0; inset-inline-start: 0;
  border-inline-start: 1px solid var(--kx-line-strong);
}
.directory-branch > li:last-child::before { inset-block-end: auto; height: 22px; }
.directory-branch > li::after {
  content: ''; position: absolute; inset-block-start: 22px; inset-inline-start: 0;
  width: 14px; border-block-start: 1px solid var(--kx-line-strong);
}
.module-catalog .directory-link {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 11px 10px; border-radius: 6px; line-height: 22px;
  color: var(--directory-link-color); overflow-wrap: anywhere;
}
.module-catalog .directory-link:hover {
  background: var(--result-hover); text-decoration: underline; text-underline-offset: 3px;
}
.directory-link span { color: var(--accent); }
.module-extra { margin-block-start: 24px; }
.lesson a.module-reference {
  display: inline-flex; align-items: center; gap: 8px;
}
.related h2 { margin: 24px 0 8px; }
.lesson-navigation { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 14px; }
.lesson-navigation .lesson-module-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--subtle); font-size: 14px;
}
.lesson :is(.lesson-module-link, .module-reference) .small-icon { flex: none; border: 0; border-radius: 0; }
.lesson-module-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.lesson-pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lesson-pagination > a {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  min-width: 0; min-height: 68px; padding: 12px 15px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--paper);
}
.lesson-pagination > a:hover { color: var(--ink); background: var(--accent-soft); border-color: var(--accent); text-decoration: none; }
.lesson-pagination > a:only-child { grid-column: 1 / -1; }
.lesson-step-label { color: var(--accent); font-size: 13px; font-weight: 750; }
@media (max-width: 620px) {
  .lesson-pagination { grid-template-columns: minmax(0, 1fr); }
}
.toc { position: sticky; align-self: start; top: calc(var(--header-height) + 28px); border-inline-start: 1px solid var(--line); padding-inline-start: 13px; }
.toc h2 { font-size: 14px; margin-block-end: 6px; }
.toc a, .mobile-toc a { display: block; padding-block: 6px; color: var(--subtle); font-size: 13px; }
.toc a:hover, .mobile-toc a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 1150px) {
  .shell { grid-template-columns: 204px minmax(0, 1fr); }
  main { padding-inline: 26px; }
}
@media (max-width: 920px) {
  .sidebar, .toc { display: none; }
  .shell, .article-grid { display: block; }
  .mobile-navigation { display: block; margin: 16px 26px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
  .mobile-navigation summary, .mobile-toc summary { padding: 10px 13px; color: var(--green); font-weight: 750; cursor: pointer; min-height: 44px; }
  .mobile-navigation nav { padding: 0 10px 9px; }
  .mobile-navigation .nav-label { margin-top: 10px; }
  main { padding-top: 20px; }
  .mobile-toc { display: block; padding: 0 10px; margin-top: 14px; border: 1px solid var(--line); border-radius: 7px; }
  .mobile-toc ul { padding-inline: 12px; padding-bottom: 8px; }
  .task-grid, .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .mobile-navigation { margin-inline: 15px; }
  main { padding: 15px 15px 38px; }
  .hero > p { margin-block: 12px 16px; font-size: 14px; }
  .portal-content { padding-block: 28px 42px; }
  .portal-content section + section { margin-block-start: 32px; }
  .task-grid, .category-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .quick-search a, .nav-list a { min-height: 44px; }
}
