.nph-fv[hidden],
.nph-fv [hidden] { display: none !important; }

.nph-fv {
    --nph-fv-blue: #1e5fbe;
    --nph-fv-blue-dark: #174b96;
    --nph-fv-ink: #173650;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2147483000;
    color: var(--nph-fv-ink);
    font-family: Prompt, "Noto Sans Thai", Tahoma, sans-serif;
}
.nph-fv * { box-sizing: border-box; }

.nph-fv__preview {
    position: relative;
    width: 188px;
    overflow: visible;
    border: 1px solid rgba(23, 75, 150, .2);
    border-radius: 13px;
    background: #050709;
    box-shadow: 0 12px 34px rgba(7, 30, 55, .28);
}
.nph-fv__preview-media {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: #030506;
    cursor: pointer;
}
.nph-fv__preview-media:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -4px;
}
.nph-fv__preview-media img,
.nph-fv__preview-media iframe {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}
.nph-fv__preview-media iframe {
    z-index: 2;
    background: #000;
    pointer-events: none;
}
.nph-fv__preview-shade {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .08) 35%, rgba(0, 0, 0, .78) 100%);
    transition: opacity .2s ease;
}
.nph-fv__play {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    padding-left: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    color: var(--nph-fv-blue);
    font-size: 18px;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
    transition: opacity .2s ease;
}
.nph-fv__preview-title {
    position: absolute;
    z-index: 1;
    right: 10px;
    bottom: 12px;
    left: 10px;
    display: -webkit-box;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    transition: opacity .2s ease;
}
.nph-fv__preview-media.is-playing .nph-fv__preview-shade,
.nph-fv__preview-media.is-playing .nph-fv__play,
.nph-fv__preview-media.is-playing .nph-fv__preview-title {
    opacity: 0;
    pointer-events: none;
}
.nph-fv__preview-more {
    display: block;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 0 0 11px 11px;
    background: var(--nph-fv-blue);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.nph-fv__preview-more:hover,
.nph-fv__preview-more:focus-visible { background: var(--nph-fv-blue-dark); }
.nph-fv__preview-nav {
    position: absolute;
    z-index: 5;
    top: calc(50% - 17px);
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}
.nph-fv__preview-nav--prev { left: 8px; }
.nph-fv__preview-nav--next { right: 8px; }
.nph-fv__dismiss {
    position: absolute;
    z-index: 7;
    top: -34px;
    right: -2px;
    width: 29px;
    height: 29px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #8d969c;
    color: #fff;
    font-size: 22px;
    line-height: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .22);
}

.nph-fv__modal {
    position: fixed;
    z-index: 2147483100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
}
.nph-fv__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 13, 21, .87);
    backdrop-filter: blur(3px);
}
.nph-fv__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(360px, 680px) minmax(320px, 390px);
    width: min(1120px, 100%);
    height: min(850px, calc(100vh - 44px));
    overflow: hidden;
    border-radius: 18px;
    background: #030508;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}
.nph-fv__close {
    position: absolute;
    z-index: 8;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .68);
    color: #fff;
    font-size: 30px;
    line-height: 34px;
    cursor: pointer;
}
.nph-fv__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    background: #000;
}
.nph-fv__player {
    height: 100%;
    max-width: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
}
.nph-fv__player iframe { display: block; width: 100%; height: 100%; border: 0; }
.nph-fv__nav {
    position: absolute;
    top: 50%;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 50%;
    background: rgba(0, 0, 0, .48);
    color: #fff;
    font-size: 36px;
    line-height: 38px;
    cursor: pointer;
    transform: translateY(-50%);
}
.nph-fv__nav--prev { left: 14px; }
.nph-fv__nav--next { right: 14px; }
.nph-fv__counter {
    position: absolute;
    right: 14px;
    bottom: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .62);
    color: #fff;
    font-size: 12px;
}

.nph-fv__panel { padding: 32px 26px 26px; overflow: auto; background: #fff; }
.nph-fv__inquiry-toggle,
.nph-fv__panel-collapse { display: none; }
.nph-fv__panel h2 { margin: 0 0 10px; color: var(--nph-fv-ink); font-size: 24px; line-height: 1.35; }
.nph-fv__panel > p { margin: 0 0 12px; color: #586d7c; font-size: 14px; line-height: 1.65; }
.nph-fv__video-context {
    display: grid;
    gap: 5px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f0f5fb;
}
.nph-fv__video-context strong { color: var(--nph-fv-ink); font-size: 14px; line-height: 1.45; }
.nph-fv__video-context span { color: #657b8c; font-size: 12px; line-height: 1.5; }
.nph-fv__detail {
    display: inline-flex;
    margin-top: 2px;
    color: var(--nph-fv-blue-dark);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.nph-fv__detail:hover { text-decoration: underline; }
.nph-fv__form { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid #dbe4ed; }
.nph-fv__form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nph-fv__form label { display: grid; gap: 5px; color: #405b70; font-size: 12px; font-weight: 600; }
.nph-fv__form input,
.nph-fv__form select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #c8d5e1;
    border-radius: 9px;
    outline: 0;
    background: #f7f9fc;
    color: var(--nph-fv-ink);
    font: inherit;
    font-size: 14px;
}
.nph-fv__form select { cursor: pointer; }
.nph-fv__form input:focus,
.nph-fv__form select:focus { border-color: var(--nph-fv-blue); box-shadow: 0 0 0 3px rgba(30, 95, 190, .14); }
.nph-fv__form button {
    height: 46px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(90deg, var(--nph-fv-blue-dark), #2e7add);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.nph-fv__form button:disabled { opacity: .65; cursor: wait; }
.nph-fv__status { min-height: 20px; color: var(--nph-fv-blue-dark); font-size: 13px; font-weight: 600; text-align: center; }
.nph-fv-open { overflow: hidden !important; }

@media (max-width: 767px) {
    .nph-fv { right: 12px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
    .nph-fv__preview { width: 126px; border-radius: 11px; }
    .nph-fv__preview-media { border-radius: 10px 10px 0 0; }
    .nph-fv__preview-more { height: 31px; border-radius: 0 0 9px 9px; font-size: 11px; }
    .nph-fv__preview-nav { width: 26px; height: 26px; font-size: 22px; }
    .nph-fv__preview-nav--prev { left: 5px; }
    .nph-fv__preview-nav--next { right: 5px; }
    .nph-fv__dismiss { top: -31px; right: -2px; width: 27px; height: 27px; font-size: 20px; }
    .nph-fv__modal { padding: 0; }
    .nph-fv__dialog {
        display: block;
        width: 100%;
        max-width: 480px;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        border-radius: 0;
        background: #020407;
    }
    .nph-fv__media { width: 100%; height: 100vh; height: 100dvh; min-height: 0; }
    .nph-fv__player { height: 100%; }
    .nph-fv__inquiry-toggle {
        position: absolute;
        z-index: 7;
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        left: 14px;
        display: block;
        height: 52px;
        border: 1px solid rgba(255, 255, 255, .7);
        border-radius: 12px;
        background: linear-gradient(90deg, var(--nph-fv-blue-dark), #2e7add);
        box-shadow: 0 10px 26px rgba(0, 0, 0, .38);
        color: #fff;
        font: inherit;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        transition: opacity .24s ease, transform .24s ease;
    }
    .nph-fv__panel {
        position: absolute;
        z-index: 8;
        right: 12px;
        bottom: 0;
        left: 12px;
        max-height: min(72vh, 620px);
        max-height: min(72dvh, 620px);
        padding: 48px 16px calc(16px + env(safe-area-inset-bottom, 0px));
        overflow: auto;
        border: 2px solid var(--nph-fv-blue);
        border-radius: 18px 18px 0 0;
        background: #fff;
        box-shadow: 0 14px 38px rgba(0, 0, 0, .4);
        scrollbar-color: #9eb3c9 transparent;
        scrollbar-width: thin;
        transform: translateY(calc(100% + 24px));
        visibility: hidden;
        pointer-events: none;
        transition: transform .32s ease, visibility 0s linear .32s;
    }
    .nph-fv__dialog.is-inquiry-open .nph-fv__panel {
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
        transition: transform .32s ease;
    }
    .nph-fv__dialog.is-inquiry-open .nph-fv__inquiry-toggle {
        opacity: 0;
        pointer-events: none;
        transform: translateY(18px);
    }
    .nph-fv__panel-collapse {
        position: absolute;
        top: 10px;
        right: 12px;
        display: inline-flex;
        align-items: center;
        min-height: 30px;
        padding: 4px 10px;
        border: 0;
        border-radius: 999px;
        background: #e9f1fb;
        color: var(--nph-fv-blue-dark);
        font: inherit;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
    }
    .nph-fv__panel h2 { font-size: 19px; }
    .nph-fv__panel > p { font-size: 13px; line-height: 1.55; }
    .nph-fv__video-context { margin-bottom: 10px; padding: 10px 12px; }
    .nph-fv__form { gap: 10px; padding-top: 14px; }
    .nph-fv__form input,
    .nph-fv__form select { height: 42px; }
    .nph-fv__form button { position: sticky; bottom: 0; box-shadow: 0 -8px 16px rgba(255, 255, 255, .9); }
    .nph-fv__nav { z-index: 5; top: 50%; width: 38px; height: 38px; font-size: 30px; }
    .nph-fv__nav--prev { left: 8px; }
    .nph-fv__nav--next { right: 8px; }
    .nph-fv__counter { z-index: 5; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); top: auto; }
    .nph-fv__close { top: 8px; right: 8px; }
}

@media (max-width: 380px) {
    .nph-fv__preview { width: 118px; }
    .nph-fv__panel { right: 8px; left: 8px; }
    .nph-fv__form-row { grid-template-columns: 1fr 1fr; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .nph-fv * { scroll-behavior: auto !important; transition: none !important; }
}
