/* HP-Collection – compact, content-sized calculator / organizer dialog.
   The historical datasheets and the rest of the site remain unchanged. */
.hp-model-popup {
    box-sizing: border-box;
    width: min(790px, calc(100vw - 24px));
    height: fit-content;
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 0;
    margin: auto;
    border: 1px solid #b9bec5;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 16px 50px rgba(0, 0, 0, .45);
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
    color: #24282d;
}
.hp-model-popup::backdrop {
    background: rgba(12, 18, 24, .70);
}
.hp-model-popup, .hp-model-popup * { box-sizing: border-box; }
.hp-model-popup[open] {
    display: flex;
    flex-direction: column;
}
.hp-model-popup-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    padding: 3px 8px 3px 13px;
    background: #e8eaed;
    border-bottom: 1px solid #c7cbd1;
}
.hp-model-popup-title {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 600;
    color: #252a31;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hp-model-popup-close {
    appearance: none;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    font: 600 12px Arial, Helvetica, sans-serif;
    color: #252a31;
    background: #fff;
    border: 1px solid #adb4bd;
    border-radius: 4px;
    min-width: 83px;
    min-height: 25px;
    padding: 3px 7px;
    cursor: pointer;
}
.hp-model-popup-close:hover { background: #d7dce2; }
.hp-model-popup-close:focus-visible {
    outline: 2px solid #357db4;
    outline-offset: 2px;
}
.hp-model-popup-close-cross { font-size: 16px; line-height: 1; font-weight: 400; }
.hp-model-popup-frame {
    display: block;
    flex: 0 1 auto;
    min-height: 0;
    width: 100%;
    height: 400px; /* Temporary height until the datasheet has loaded. */
    max-height: calc(100vh - 74px);
    max-height: calc(100dvh - 74px);
    border: 0;
    background: #fff;
}
/* Hide the old banners inside the embedded datasheet only. */
html.hp-popup-frame body {
    background: white !important;
    background-image: none !important;
    margin: 0 !important;
    padding: 8px 0 12px !important;
    min-width: 755px;
}
html.hp-popup-frame body > div[align="center"] > table:nth-of-type(1),
html.hp-popup-frame body > div[align="center"] > table:nth-of-type(2) {
    display: none !important;
}
@media (max-width: 600px) {
    .hp-model-popup {
        width: calc(100vw - 12px);
        max-height: calc(100vh - 12px);
        max-height: calc(100dvh - 12px);
        border-radius: 5px;
    }
    .hp-model-popup-header { padding: 3px 6px 3px 10px; }
    .hp-model-popup-title { font-size: 14px; }
    .hp-model-popup-close { min-width: 30px; min-height: 26px; padding: 3px 6px; }
    .hp-model-popup-close-label { display: none; }
    .hp-model-popup-frame {
        max-height: calc(100vh - 58px);
        max-height: calc(100dvh - 58px);
    }
}
