.unit-popup-overlay[hidden] { display: none !important; }
.unit-popup-overlay { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .65); box-sizing: border-box; }
.unit-popup-dialog { width: 960px; max-width: 100%; max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column; background: #fff; color: #222; border-radius: 10px; box-shadow: 0 16px 60px rgba(0, 0, 0, .3); overflow: hidden; font-family: Arial, sans-serif; box-sizing: border-box; }
.unit-popup-toolbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; flex: 0 0 auto; gap: 12px; padding: 8px 12px; }
.unit-popup-toolbar h2 { grid-column: 2; grid-row: 1; margin: 0; padding: 8px 0; font-size: 1.65rem; font-weight: 700; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.unit-popup-close { grid-column: 3; grid-row: 1; width: 44px; height: 44px; margin-left: auto; border: 0; border-radius: 50%; background: #f0f1f3; color: #222; font-size: 30px; line-height: 1; cursor: pointer; }
.unit-popup-close:hover { background: #e0e2e5; }
.unit-popup-dialog :focus-visible { outline: 3px solid #1769aa; outline-offset: 2px; }
.unit-popup-body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.unit-popup-image { display: block; width: auto; height: auto; max-width: 100%; max-height: 72vh; max-height: 72dvh; object-fit: contain; margin: 0 auto; }
.unit-popup-text { padding: 12px 24px 24px; line-height: 1.65; overflow-wrap: anywhere; overflow-x: auto; }
.unit-popup-text p:last-child { margin-bottom: 0; }
.unit-popup-text a, .unit-popup-text a:visited, .unit-popup-text a:hover, .unit-popup-text a:focus, .unit-popup-text a * { color: #0000ff !important; text-decoration: underline; }
.unit-popup-text ul { list-style: disc; padding-left: 24px; }
.unit-popup-text ol { list-style: decimal; padding-left: 24px; }
.unit-popup-text table { max-width: 100%; border-collapse: collapse; }
.unit-popup-text th, .unit-popup-text td { border: 1px solid #d7d7d7; padding: 6px; }
@media (max-width: 576px) {
    .unit-popup-overlay { padding: 10px; }
    .unit-popup-toolbar { gap: 8px; }
    .unit-popup-toolbar h2 { font-size: 1.3rem; }
    .unit-popup-text { padding: 10px 16px 20px; }
}
