html.csa-lock, body.csa-lock { overflow: hidden !important; touch-action: none; }

.csa-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.csa-overlay.csa-visible {
  opacity: 1;
  pointer-events: auto;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.csa-box {
  position: fixed;
  left: 50%;
  bottom: -420px;
  transform: translateX(-50%);
  z-index: 99999;
  width: min(420px, 94vw);
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 30px rgba(0,0,0,.25);
  transition: bottom .35s ease;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  visibility: hidden;
}
.csa-box.csa-visible {
  bottom: 0;
  visibility: visible;
}

.csa-close {
  position: absolute;
  top: 6px; right: 10px;
  border: 0; background: transparent;
  color: #888; font-size: 22px; line-height: 1; cursor: pointer;
  display: none;
}

.csa-content { margin-top: 16px; }

/* Base mobile styles */
.csa-box.csa-mobile-anchor {
  left: 0;
  bottom: 0;
  transform: translateY(100%);
  width: 100%;
  border-radius: 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,.15);
  padding: 0;
  transition: transform .4s ease-in-out;
}
.csa-box.csa-mobile-anchor.csa-visible {
  transform: translateY(0);
}
.csa-mobile-anchor .csa-content {
  margin-top: 38px;
  display: flex;
  justify-content: center;
  padding: 0 8px;
  font-size: 20px;
  line-height: 1.4;
}
.csa-mobile-anchor .csa-close {
  top: 4px; right: 4px;
  background: rgba(255,255,255,.8);
  border-radius: 50%;
  width: 24px; height: 24px;
  line-height: 23px; text-align: center;
  font-size: 18px;
}
/* Mobile hide handle */
.csa-hide-handle {
  position: absolute;
  left: 10px;
  top: -24px;
  transform: none;
  width: 50px;
  height: 24px;
  border: 1px solid #ddd;
  border-bottom: 0;
  background: #f0f0f0;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
.csa-scroll-note {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 37px;
  line-height: 37px;
  font-size: 19px;
  font-style: normal;
  color: #3581bb;
  background: #f8f9fa;
  text-align: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  pointer-events: none;
  border-bottom: 1px solid #dadce0;
}
.csa-hide-handle::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  border-left: 2px solid #888;
  border-bottom: 2px solid #888;
  transform: translate(-50%, -75%) rotate(-45deg);
  transition: transform .2s ease;
}
.csa-mobile-anchor.csa-collapsed .csa-hide-handle::after {
  transform: translate(-50%, -25%) rotate(135deg);
}
.csa-mobile-anchor.csa-collapsed {
  transform: translateY(100%) !important;
}
@media(min-width: 782px){
  .csa-box {
    top: 50%; left: 50%;
    right: auto; bottom: auto;
    width: 336px;
    height: 280px;
    max-width: 90vw;
    padding: 0;
    background: transparent;
    box-shadow: 0 5px 25px rgba(0,0,0,.3);
    border-radius: 8px;
    max-height: 90vh;
    overflow: hidden;
    transform: translate(-50%, -45%);
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
  }
  .csa-box .csa-content { margin: 0; }
  .csa-box.csa-visible {
    transform: translate(-50%, -50%);
    opacity: 1;
    visibility: visible;
  }
  .csa-box .csa-close {
    display: none;
    transform: translate(30%, -30%);
    background: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    line-height: 26px;
    font-size: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,.2);
    color: #555;
  }
  .csa-desktop-note {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    background: rgba(255,255,255,.85);
    color: #333;
    font-size: 14px;
    padding: 12px;
    text-align: center;
    font-style: italic;
    transform: translateY(100%);
    transition: transform .3s ease-in-out .25s;
    pointer-events: none;
    border-top: 1px solid #ccc;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }
  .csa-desktop-note.csa-visible {
    transform: translateY(0);
  }
}