html:has(#tksd-site-popup[open]) {
 overflow: hidden;
}

html:has(#tksd-site-popup.tksd-popup-stable-gutter[open]) {
 scrollbar-gutter: stable;
}

#tksd-site-popup {
 box-sizing: border-box;
 width: min(92%, 560px);
 max-width: none;
 max-height: 88vh;
 max-height: 88dvh;
 margin: auto;
 padding: clamp(16px, 4vw, 28px);
 overflow: auto;
 overscroll-behavior: contain;
 overflow-wrap: anywhere;
 border: 0;
 border-top: 4px solid #009ee3;
 border-radius: 10px;
 background: #fff;
 color: #19354b;
 box-shadow: 0 12px 44px rgb(0 0 0 / 24%);
 font: inherit;
 line-height: 1.5;
}

#tksd-site-popup::backdrop {
 background: rgb(13 44 61 / 58%);
}

.tksd-popup-heading {
 display: flex;
 align-items: flex-start;
 justify-content: space-between;
 gap: 12px;
}

#tksd-popup-title {
 margin: 0;
 color: inherit;
 font: inherit;
 font-size: clamp(1.25rem, 2.6vw, 1.6rem);
 font-weight: 700;
 line-height: 1.25;
}

.tksd-popup-close {
 flex: none;
 width: 44px;
 height: 44px;
 margin: -8px -8px 0 0;
 padding: 0;
 border: 0;
 border-radius: 6px;
 background: #eef6fa;
 color: inherit;
 font: inherit;
 font-size: 1.5rem;
 cursor: pointer;
}

.tksd-popup-image {
 display: block;
 max-width: 100%;
 max-height: 32vh;
 width: auto;
 height: auto;
 margin: 16px auto 0;
 object-fit: contain;
}

.tksd-popup-text {
 margin: 16px 0 0;
 white-space: pre-wrap;
}

#tksd-site-popup .tksd-popup-button {
 display: inline-block;
 margin-top: 18px;
 padding: 10px 16px;
 border-radius: 6px;
 background: #087a9a;
 color: #fff;
 font-weight: 700;
 text-decoration: none;
}

#tksd-site-popup :is(button, a):focus-visible {
 outline: 2px solid #087a9a;
 outline-offset: 3px;
}
