@media screen {
  :root {
    --kk-pin-top: max(22px, env(safe-area-inset-top, 0px));
    --kk-header-height: 67px;
    --kk-clearance: calc(var(--kk-pin-top) + var(--kk-header-height) + 12px);
    scroll-padding-top: var(--kk-clearance);
  }
  .kk-island-space { height: calc(var(--kk-pin-top) + var(--kk-header-height)); }
  .kk-island-space::before {
    content: ""; position: fixed; inset: 0 0 auto;
    height: calc(var(--kk-pin-top) + 18px); z-index: 39; pointer-events: none;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    mask-image: linear-gradient(#000 var(--kk-pin-top), transparent);
  }
  .kk-island {
    position: fixed; top: var(--kk-pin-top); inset-inline: 0; margin: 0 auto; z-index: 40;
  }
  .kk-island .kk-category ul, .kk-island .kk-search {
    max-height: calc(100vh - var(--kk-clearance));
    max-height: calc(100dvh - var(--kk-clearance));
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
  .guide-toc, .guide-sidebar, .toc, .sidebar { top: var(--kk-clearance); }
}
@media screen and (min-width: 801px) {
  .guide-toc, .guide-sidebar, .toc, .sidebar {
    max-height: calc(100dvh - var(--kk-clearance) - 12px);
    overflow-y: auto;
  }
}
@media screen and (max-width: 1160px) { :root { --kk-header-height: 97px; } }
@media screen and (max-width: 920px) {
  :root { --kk-pin-top: max(9px, env(safe-area-inset-top, 0px)); --kk-header-height: 99px; }
}
@media screen and (max-width: 510px) { :root { --kk-header-height: 143px; } }
