#kas-layer {
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: none;
  z-index: 9999;
}

#kas-body {
  display: block;
  font-family: 'Noto Sans', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  width: 1280px;
  background-color: #fff;
  padding: 25px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);

  /* hint to browser: this element will be animated via transform/opacity
     and should get its own compositing layer to avoid layout jank */
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Keep the body centered inside the full-screen layer and allow
   it to scroll when its content exceeds the viewport height. */
#kas-body {
  position: relative;
  text-align: left;
  box-sizing: border-box;
  max-height: none;
  overflow: visible;
  -webkit-overflow-scrolling: touch;
}

/* Use page-style scrolling for modal content (no inner #kas-body scrollbar) */
#kas-layer.kas-layer-window-scroll {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

#kas-layer.kas-layer-window-scroll #kas-body {
  margin: 24px auto 36px;
  max-height: none;
  overflow: visible;
}

#kas-header {
  display: flex;
  justify-content: flex-start;
  position: sticky;
  margin-top: -25px;
  top: -25px;
  z-index: 2;
  align-items: center;
  gap: 8px;
  padding-top: 25px;
  padding-bottom: 20px;
  background: rgba(255, 255, 255, 0.95);
}

#kas-header button {
  all: reset; 
  background: none; 
  border: none; 
  cursor: pointer;
}

#kas-header #kas-forward {
  margin-right: 5px;
}

#kas-header button:disabled {
  opacity: 0.3;
  cursor: default;
}

.kas-menu-toggle {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  width: 40px;
  max-width: 40px;
  height: 40px;
  max-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  position: relative;
  flex: 0 0 40px;
  transition: opacity 180ms ease;
}

.kas-menu-toggle:active {
  opacity: 0.5;
}

.kas-menu-toggle .bar {
  display: block;
  position: absolute;
  left: 11px;
  width: 18px;
  height: 3px;
  background: #111;
  margin: 0;
  border-radius: 999px;
  transform-origin: center;
  transition: transform 180ms ease, opacity 180ms ease, top 180ms ease;
}

.kas-menu-toggle .bar:nth-child(1) { top: 13px; }
.kas-menu-toggle .bar:nth-child(2) { top: 19px; }
.kas-menu-toggle .bar:nth-child(3) { top: 25px; }

.kas-menu-toggle[aria-expanded="true"] .bar:nth-child(1) { top: 19px; transform: rotate(45deg); }
.kas-menu-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.kas-menu-toggle[aria-expanded="true"] .bar:nth-child(3) { top: 19px; transform: rotate(-45deg); }

.kas-menu-toggle[aria-expanded="true"] .bar {
  height: 2px;
}

/* Dropdown menu */
#kas-header nav.kas-menu {
  display: none;
  position: absolute;
  left: 10px;
  top: 64px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(2,6,23,0.16);
  padding: 6px 0;
  min-width: 160px;
  z-index: 1200;
}

#kas-header nav.kas-menu.open { display: block; }
#kas-header nav.kas-menu li { list-style: none; }
#kas-header nav.kas-menu li a {
  display: block;
  padding: 8px 14px;
  color: #111827;
  text-decoration: none;
  font-size: 14px;
}

#kas-header nav.kas-menu li a:hover { background: rgba(0,0,0,0.04); }
#kas-header nav.kas-menu li a:active { background: rgba(0,0,0,0.08); }

#kas-header nav.kas-menu > ul,
#kas-header nav.kas-menu ul {
  margin: 0;
  padding: 0;
}

#kas-header nav.kas-menu li.has-submenu {
  position: relative;
}

#kas-header nav.kas-menu li.has-submenu > a::after {
  content: '›';
  float: right;
  margin-left: 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.6;
}

#kas-header nav.kas-menu .kas-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: -5px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(2,6,23,0.16);
  min-width: 180px;
  padding: 6px 0;
  z-index: 1300;
}

/* Hover support */
@media (hover: hover) and (pointer: fine) {
  #kas-header nav.kas-menu li.has-submenu:hover > .kas-submenu {
    display: block;
  }
}

/* Click/toggle support */
#kas-header nav.kas-menu li.has-submenu.open > .kas-submenu {
  display: block;
}

/* Mobile/touch behavior: click toggle only, no flyout hover dependency */
@media (hover: none), (pointer: coarse), (max-width: 900px) {
  #kas-header nav.kas-menu {
    min-width: 220px;
  }

  #kas-header nav.kas-menu .kas-submenu {
    position: static;
    left: auto;
    top: auto;
    margin: 4px 8px 8px 12px;
    border-left: 2px solid rgba(0,0,0,0.08);
    border-radius: 0;
    box-shadow: none;
    min-width: 0;
    padding: 2px 0;
  }

  #kas-header nav.kas-menu li.has-submenu > a::after {
    content: '▾';
    font-size: 16px;
    margin-left: 10px;
  }

  #kas-header nav.kas-menu li.has-submenu.open > a::after {
    content: '▴';
  }
}

#kas-body.scroll #kas-header {
  padding-top: 35px;
}

#kas-header h1 {
  display: flex;
  align-items: center;
  font-size: 23px;
  font-weight: bold;
  line-height: 1.5;
  color: inherit;
  margin: 0;
  margin-left: 0;
}

#kas-header h1 a,
#kas-header h1 button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  height: auto;
}

/* #kas-header h1 a,
#kas-header h1 button {
  all: unset;
  display: inline-block;
  margin-left: 25px;
  margin-bottom: -2px;
  color: inherit;
  font-size: 14px;
  line-height: 18px;
  font-weight: bold;
  text-decoration: none;
  background: none;
  border-bottom: 2px solid currentColor;
  border-radius: none;
  padding: 0;
  cursor: pointer;
} */

#kas-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

#kas-content {
  display: block;
}

#kas-footer {
  text-align: center;
}

#kas-footer a {
  font-size: 90%;
  color: #999;
  text-decoration: none;
}

#kas-footer a:hover {
  text-decoration: underline;
}


/* Loader shown while kas content is being fetched */
.kas-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 200px;
  box-sizing: border-box;
}

.kas-loader:before {
  content: "";
  width: 36px;
  height: 36px;
  margin-right: 12px;
  border-radius: 50%;
  border: 4px solid rgba(0,0,0,0.12);
  border-top-color: rgba(0,0,0,0.6);
  animation: kas-spin 1s linear infinite;
}

.kas-loader.kas-loader-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: rgba(255,255,255,0.25);
  z-index: 2147483647;
}

.kas-loader.kas-loader-overlay:before {
  margin-right: 0;
  margin-bottom: 12px;
}

.kas-loader .kas-loader-text {
  font-size: 14px;
  color: #333;
}

.kas-body-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.85);
  pointer-events: none;
  z-index: 10;
  border-radius: inherit;
  overflow: hidden;
}

.kas-screen-spinner {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2147483647;
}

.kas-screen-spinner__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.kas-screen-spinner__ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 6px solid rgba(0,0,0,0.15);
  border-top-color: #111;
  box-sizing: border-box;
  animation: kas-inline-spin 1s linear infinite;
  background: transparent;
  position: relative;
  z-index: 2147483648;
}

.kas-screen-spinner__label {
  font-size: 16px;
  color: #111;
  font-weight: 700;
  text-align: center;
  margin-top: 12px;
  z-index: 2147483648;
}

@keyframes kas-inline-spin {
  to { transform: rotate(360deg); }
}


/* Notification shown at top of kas layer */
#kas-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  pointer-events: none;
  width: 100%;
  max-width: 680px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.kas-notification {
  pointer-events: auto;
  min-width: 280px;
  max-width: 90%;
  box-sizing: border-box;
  padding: 8px 16px;
  border-radius: 6px;
  color: #fff;
  font-size: 75%;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  position: relative;
}

.kas-notification-success { background: #2e7d32; }
.kas-notification-error { background: #c62828; }

.kas-notification-message { text-align: center; }

.kas-notification-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: rgba(255,255,255,0.4);
  transform-origin: left;
}

@keyframes kas-notify-shrink {
  from { width: 100%; }
  to { width: 0%; }
}

/* exit animation: drop a bit then move up offscreen */
.kas-notification-leave {
  animation: kas-notify-exit 300ms ease-in-out forwards;
}

@keyframes kas-notify-exit {
  0% { transform: translateY(0); opacity: 1; }
  30% { transform: translateY(8px); opacity: 1; }
  100% { transform: translateY(-140%); opacity: 0; }
}

/* enter animation: come from top, drop slightly, settle */
.kas-notification-enter {
  animation: kas-notify-enter 300ms ease-out forwards;
}

@keyframes kas-notify-enter {
  0% { transform: translateY(-140%); opacity: 0; }
  70% { transform: translateY(8px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

/* kas-body enter/leave animations */
.kas-body-enter {
  animation: kas-body-in 320ms cubic-bezier(.2,.9,.2,1) forwards;
}
.kas-body-leave {
  animation: kas-body-out 360ms cubic-bezier(.2,.9,.2,1) forwards;
}

@keyframes kas-body-in {
  0% { transform: translateY(-12px); opacity: 0; }
  60% { transform: translateY(6px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes kas-body-out {
  0% { transform: translateY(0); opacity: 1; }
  30% { transform: translateY(8px); opacity: 1; }
  100% { transform: translateY(-140%); opacity: 0; }
}

