/*
 * JobDropper author/match drawer
 * One final owner for drawer geometry, card reflow and scroll behavior.
 */

body .jd-author-panel[data-jd-author-panel="1"] {
    container-name: jd-author-drawer;
    container-type: inline-size;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    height: var(--jd-author-vv-height, 100dvh) !important;
    min-height: 0 !important;
    max-height: var(--jd-author-vv-height, 100dvh) !important;
    overflow: hidden !important;
    overscroll-behavior: auto !important;
    background: rgba(252, 252, 255, .985) !important;
}

body .jd-author-panel[data-jd-author-panel="1"] .jd-author-panel-head,
body .jd-author-panel[data-jd-author-panel="1"] .jd-author-tabs,
body .jd-author-panel[data-jd-author-panel="1"] .jd-author-search,
body .jd-author-panel[data-jd-author-panel="1"] .jd-author-found {
    flex: 0 0 auto !important;
    min-width: 0 !important;
}

body .jd-author-panel[data-jd-author-panel="1"] .jd-author-posts {
    position: relative !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-x: none !important;
    overscroll-behavior-y: auto !important;
    scroll-behavior: auto !important;
    scroll-snap-type: none !important;
    scrollbar-gutter: stable !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(89, 58, 205, .72) transparent !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
    contain: none !important;
}

body .jd-author-panel[data-jd-author-panel="1"] .jd-author-posts::-webkit-scrollbar {
    display: block !important;
    width: 8px !important;
    height: 8px !important;
    background: transparent !important;
}

body .jd-author-panel[data-jd-author-panel="1"] .jd-author-posts::-webkit-scrollbar-track,
body .jd-author-panel[data-jd-author-panel="1"] .jd-author-posts::-webkit-scrollbar-corner {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body .jd-author-panel[data-jd-author-panel="1"] .jd-author-posts::-webkit-scrollbar-thumb {
    min-height: 46px !important;
    border: 2px solid transparent !important;
    border-radius: 999px !important;
    background: rgba(89, 58, 205, .72) !important;
    background-clip: padding-box !important;
}

body .jd-author-panel[data-jd-author-panel="1"] .jd-author-posts::-webkit-scrollbar-thumb:hover {
    background: rgba(73, 43, 183, .9) !important;
    background-clip: padding-box !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-posts {
    gap: 14px !important;
}

body .jd-author-panel[data-jd-author-panel="1"] .jd-author-card {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-match-card {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 88px minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 12px !important;
    height: auto !important;
    min-height: 116px !important;
    max-height: none !important;
    padding: 13px !important;
    overflow: hidden !important;
    border: 1px solid rgba(34, 26, 104, .09) !important;
    border-radius: 20px !important;
    color: #171244 !important;
    background: rgba(255, 255, 255, .99) !important;
    box-shadow: 0 12px 30px rgba(28, 21, 88, .075) !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-card-media {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: block !important;
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    height: 88px !important;
    min-height: 88px !important;
    max-height: 88px !important;
    margin: 0 !important;
    border-radius: 16px !important;
    object-fit: cover !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-card-copy {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0 50px 0 0 !important;
    overflow: visible !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-type {
    width: fit-content !important;
    margin: 0 0 6px !important;
    padding: 4px 9px !important;
    border: 1px solid rgba(53, 40, 128, .12) !important;
    border-radius: 999px !important;
    color: #352476 !important;
    background: linear-gradient(135deg, rgba(25, 38, 91, .09), rgba(105, 59, 213, .14)) !important;
    font-size: .68rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-match-card strong {
    display: block !important;
    margin: 0 !important;
    overflow: visible !important;
    color: #151044 !important;
    font-size: 1rem !important;
    font-weight: 950 !important;
    line-height: 1.16 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-match-card small {
    display: block !important;
    margin: 4px 0 0 !important;
    overflow: hidden !important;
    color: #756d92 !important;
    font-size: .75rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-card-summary {
    display: -webkit-box !important;
    margin: 8px 0 0 !important;
    max-height: 2.6em !important;
    overflow: hidden !important;
    color: #504967 !important;
    font-size: .79rem !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-card-summary:empty {
    display: none !important;
}

body .jd-author-panel[data-jd-author-panel="1"] .jd-author-match-score {
    position: absolute !important;
    top: 13px !important;
    right: 13px !important;
    z-index: 2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 !important;
    border: 1px solid rgba(56, 42, 139, .19) !important;
    border-radius: 50% !important;
    color: #342273 !important;
    background: linear-gradient(145deg, rgba(25, 38, 91, .075), rgba(105, 58, 219, .15)) !important;
    box-shadow: 0 8px 18px rgba(34, 27, 99, .06) !important;
    font-size: .73rem !important;
    font-weight: 950 !important;
    line-height: 1 !important;
}

body .jd-author-panel[data-jd-author-panel="1"] .jd-author-match-reasons,
body .jd-author-panel[data-jd-author-panel="1"] .jd-author-card p.jd-author-match-reasons {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 9px 0 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    -webkit-box-orient: initial !important;
}

body .jd-author-panel[data-jd-author-panel="1"] .jd-author-match-reasons em {
    display: inline-flex !important;
    flex: 0 1 auto !important;
    align-items: center !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 6px 10px !important;
    overflow: visible !important;
    border: 1px solid rgba(53, 40, 128, .13) !important;
    border-radius: 13px !important;
    color: #342473 !important;
    background: linear-gradient(135deg, rgba(28, 40, 91, .09), rgba(107, 61, 214, .145)) !important;
    box-shadow: 0 5px 14px rgba(35, 27, 99, .045) !important;
    font-size: .68rem !important;
    font-style: normal !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    text-overflow: clip !important;
}

body .jd-author-panel[data-jd-author-panel="1"] .jd-author-sentinel {
    flex: 0 0 1px !important;
    width: 100% !important;
    height: 1px !important;
    min-height: 1px !important;
}

@media (min-width: 768px) {
    body .jd-author-panel[data-jd-author-panel="1"] {
        top: var(--jd-author-vv-top, 0px) !important;
        right: 0 !important;
        bottom: auto !important;
        left: auto !important;
        min-width: min(360px, calc(var(--jd-author-vv-width, 100vw) - 12px)) !important;
        max-width: calc(var(--jd-author-vv-width, 100vw) - 12px) !important;
        padding: 18px 0 0 18px !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"] .jd-author-panel-head {
        width: auto !important;
        margin: 0 18px 0 0 !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"] .jd-author-tabs {
        width: auto !important;
        margin: 16px 18px 14px 0 !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"] .jd-author-search {
        align-self: stretch !important;
        width: auto !important;
        margin: 0 18px 14px 0 !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"] .jd-author-found {
        width: auto !important;
        margin: 0 18px 10px 4px !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"] .jd-author-posts {
        padding: 0 10px 18px 0 !important;
    }
}

@container jd-author-drawer (max-width: 410px) {
    body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-match-card {
        grid-template-columns: 72px minmax(0, 1fr) !important;
        gap: 10px !important;
        min-height: 102px !important;
        padding: 11px !important;
        border-radius: 18px !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-card-media {
        width: 72px !important;
        min-width: 72px !important;
        max-width: 72px !important;
        height: 72px !important;
        min-height: 72px !important;
        max-height: 72px !important;
        border-radius: 14px !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-card-copy {
        padding-right: 43px !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"] .jd-author-match-score {
        top: 11px !important;
        right: 11px !important;
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        font-size: .67rem !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-match-card strong {
        font-size: .88rem !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"] .jd-author-match-reasons em {
        padding: 5px 8px !important;
        font-size: .64rem !important;
    }
}

@media (max-width: 767.98px), (hover: none) and (pointer: coarse) {
    body .jd-author-panel[data-jd-author-panel="1"] {
        top: var(--jd-author-vv-top, 0px) !important;
        right: auto !important;
        bottom: auto !important;
        left: var(--jd-author-vv-left, 0px) !important;
        width: var(--jd-author-vv-width, 100vw) !important;
        min-width: 0 !important;
        max-width: var(--jd-author-vv-width, 100vw) !important;
        height: var(--jd-author-vv-height, 100dvh) !important;
        padding:
            max(10px, env(safe-area-inset-top))
            0
            max(8px, env(safe-area-inset-bottom))
            max(10px, env(safe-area-inset-left)) !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"] .jd-author-panel-head {
        width: auto !important;
        margin-right: max(10px, env(safe-area-inset-right)) !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"] .jd-author-tabs {
        width: auto !important;
        margin-right: max(10px, env(safe-area-inset-right)) !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"] .jd-author-search {
        width: auto !important;
        margin-right: max(10px, env(safe-area-inset-right)) !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"] .jd-author-found {
        width: auto !important;
        margin-right: max(10px, env(safe-area-inset-right)) !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"] .jd-author-posts {
        padding: 0 max(6px, env(safe-area-inset-right)) 8px 0 !important;
        scrollbar-gutter: auto !important;
    }
}

/*
 * Final Match card contract.
 * The fast deterministic response and the AI refinement use this exact compact
 * geometry. Explanatory reason chips stay out of the drawer by design.
 */
body .jd-author-panel[data-jd-author-panel="1"] .jd-author-panel-head {
    position: relative !important;
    z-index: 30 !important;
    pointer-events: auto !important;
}

body .jd-author-panel[data-jd-author-panel="1"] .jd-author-panel-close {
    position: relative !important;
    z-index: 40 !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-posts {
    align-items: stretch !important;
    gap: 14px !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-match-card {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 88px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 132px !important;
    min-height: 132px !important;
    max-height: 132px !important;
    margin: 0 !important;
    padding: 12px !important;
    overflow: hidden !important;
    border-radius: 20px !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-card-media {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: center !important;
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    height: 88px !important;
    min-height: 88px !important;
    max-height: 88px !important;
    margin: 0 !important;
    border-radius: 16px !important;
    object-fit: cover !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-card-copy {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: center !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    max-height: 108px !important;
    padding: 0 50px 0 0 !important;
    overflow: hidden !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-type {
    flex: 0 0 auto !important;
    margin: 0 0 5px !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-match-card strong {
    display: -webkit-box !important;
    flex: 0 0 auto !important;
    max-height: 2.32em !important;
    margin: 0 !important;
    overflow: hidden !important;
    white-space: normal !important;
    text-overflow: ellipsis !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-match-card small {
    display: -webkit-box !important;
    flex: 0 0 auto !important;
    max-height: 2.5em !important;
    margin: 4px 0 0 !important;
    overflow: hidden !important;
    white-space: normal !important;
    text-overflow: ellipsis !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-card-summary {
    display: -webkit-box !important;
    flex: 0 0 auto !important;
    max-height: 1.3em !important;
    margin: 5px 0 0 !important;
    overflow: hidden !important;
    white-space: normal !important;
    text-overflow: ellipsis !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 1 !important;
    line-clamp: 1 !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-match-reasons,
body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-card p.jd-author-match-reasons {
    display: none !important;
}

body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-match-score {
    top: 14px !important;
    right: 14px !important;
}

@container jd-author-drawer (max-width: 410px) {
    body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-match-card {
        grid-template-columns: 72px minmax(0, 1fr) !important;
        gap: 10px !important;
        height: 124px !important;
        min-height: 124px !important;
        max-height: 124px !important;
        padding: 11px !important;
        border-radius: 18px !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-card-media {
        width: 72px !important;
        min-width: 72px !important;
        max-width: 72px !important;
        height: 72px !important;
        min-height: 72px !important;
        max-height: 72px !important;
        border-radius: 14px !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-card-copy {
        max-height: 102px !important;
        padding-right: 43px !important;
    }

    body .jd-author-panel[data-jd-author-panel="1"][data-jd-author-mode="match"] .jd-author-match-score {
        top: 11px !important;
        right: 11px !important;
    }
}

/* `hidden` is the final authority on desktop and mobile. */
body .jd-author-panel[data-jd-author-panel="1"][hidden] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
