.kss-siteplan-wrapper {
    position: relative;
    max-width: 100%;
    margin: 20px auto;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    overflow: visible; /* Changed from hidden to visible */
}

.kss-image-container {
    position: relative;
    width: 100%;
    line-height: 0;
    overflow: visible; /* Changed from hidden to visible */
}

.kss-siteplan-image {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.kss-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    overflow: visible;
}

.kss-svg-polygon {
    fill: rgba(0, 130, 255, 0.3);
    stroke: #005cbf;
    stroke-width: 1px;
    cursor: pointer;
    transition: fill 0.15s ease-in-out, opacity 0.15s ease-in-out;
}
.kss-svg-polygon:hover {
    fill: rgba(255, 150, 0, 0.5);
}

.kss-popup {
    position: fixed; /* Changed from absolute to fixed */
    z-index: 1001;
    min-width: 260px;
    max-width: 320px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    display: none;
    pointer-events: auto;
    background-color: #fff;
    border: 1px solid #ccc;
    color: #333;
    /* Added positioning properties */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.kss-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.kss-popup-title {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    line-height: 1.2;
    color: #000;
}

.kss-popup-close {
    background: none;
    border: none;
    font-size: 26px;
    font-weight: normal;
    line-height: 1;
    padding: 0 5px;
    cursor: pointer;
    opacity: 0.7;
    color: #333;
}
.kss-popup-close:hover {
    opacity: 1;
    color: #d00;
}

.kss-popup-body {
    padding: 12px 15px;
    max-height: none; /* Changed from 400px to none */
    overflow-y: visible; /* Changed from auto to visible */
}

.kss-popup-content-simple img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
    display: block;
}
.kss-popup-content-simple p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.kss-popup-content-detailed ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}
.kss-popup-content-detailed ul li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.kss-popup-content-detailed ul li:last-child {
    border-bottom: none;
}
.kss-popup-content-detailed ul li strong {
    margin-right: 10px;
    flex-shrink: 0;
}
.kss-popup-content-detailed ul li span {
    text-align: right;
}
.kss-popup-content-detailed img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 15px;
    display: block;
}
.kss-popup-link {
    display: block;
    background-color: #0073aa;
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.kss-popup-link:hover {
    background-color: #005a87;
    color: #fff;
}

.kss-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    pointer-events: none;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    opacity: 1;
    visibility: visible;
}
.kss-loading-overlay.kss-hidden {
    opacity: 0;
    visibility: hidden;
}
.kss-loading-overlay span {
    font-size: 14px;
    padding: 10px 15px;
    background: #f0f0f0;
    border-radius: 4px;
    color: #555;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

@media (max-width: 480px) {
  .kss-popup {
    min-width: 240px;
    max-width: calc(100vw - 30px);
    font-size: 13px;
    /* Ensure proper positioning on mobile */
    left: 50%;
    transform: translateX(-50%);
    top: 20px;
  }
  .kss-popup-body {
     padding: 10px 12px;
     max-height: none; /* Changed from 60vh to none */
     overflow-y: visible; /* Ensure no scrolling */
  }
  .kss-popup-header {
     padding: 8px 12px;
  }
  .kss-popup-title {
     font-size: 15px;
  }
   .kss-popup-content-detailed ul li {
      padding: 6px 0;
      flex-direction: column;
      align-items: flex-start;
   }
   .kss-popup-content-detailed ul li strong {
      margin-right: 0;
      margin-bottom: 2px;
   }
    .kss-popup-content-detailed ul li span {
       text-align: left;
       font-weight: 500;
   }
}

/* Additional responsive breakpoint for very small screens */
@media (max-width: 360px) {
  .kss-popup {
    min-width: 200px;
    max-width: calc(100vw - 20px);
  }
}