/* Panel native-select: hidden source + button trigger + modal (generic, not admin-prefixed). */

select.pns-source {
    position: absolute !important;
    left: -99999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.pns-trigger {
    width: 100%;
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 14px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    text-align: left;
}

.pns-trigger:hover,
.pns-trigger.is-open {
    background: rgba(255, 255, 255, 0.12);
}

.pns-trigger:focus-visible {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.pns-trigger.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.pns-trigger-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Частичный multi-select: N + connector (tw) + M; пробелы только из gap */
.pns-trigger-text.pns-trigger-text--split {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0.35em;
    white-space: normal;
}

.pns-trigger-seg--n,
.pns-trigger-seg--m {
    font-weight: 700;
    flex-shrink: 0;
}

.pns-trigger-seg--mid {
    flex-shrink: 0;
    min-width: 0;
}

.pns-trigger-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 8px;
    color: currentColor;
    opacity: 0.8;
    flex-shrink: 0;
}

.pns-trigger-caret svg {
    display: block;
    width: 100%;
    height: 100%;
}

.pns-overlay {
    position: fixed;
    inset: 0;
    z-index: 180;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pns-modal {
    width: min(560px, 100%);
    max-height: 78vh;
    background: rgba(10, 10, 12, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.pns-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #111;
    font-size: 16px;
    cursor: pointer;
}

.pns-title {
    margin: 2px 40px 0 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
}

.pns-search {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 14px;
    padding: 9px 12px;
}

.pns-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: calc(78vh - 120px);
    padding-right: 2px;
}

.pns-modal--multi .pns-list {
    max-height: calc(78vh - 200px);
}

.pns-modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.pns-btn {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    padding: 9px 12px;
    cursor: pointer;
}

.pns-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
}

.pns-btn--apply {
    font-weight: 600;
    background: rgba(255, 255, 255, 0.92);
    color: #111;
    border-color: #fff;
}

.pns-btn--apply:hover:not(:disabled) {
    background: #fff;
}

.pns-btn.is-disabled,
.pns-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pns-option--multi {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.pns-option-label {
    flex: 1;
    min-width: 0;
}

.pns-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(0, 0, 0, 0.2);
    position: relative;
}

.pns-option.is-selected .pns-checkbox {
    background: #fff;
    border-color: #fff;
}

.pns-option.is-selected .pns-checkbox::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #111;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pns-option {
    width: 100%;
    text-align: left;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    padding: 9px 10px;
    cursor: pointer;
}

.pns-option:hover {
    background: rgba(255, 255, 255, 0.12);
}

.pns-option.is-selected {
    background: #ffffff;
    color: #111111;
    border-color: #ffffff;
    font-weight: 600;
}

.pns-option.is-disabled,
.pns-option:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pns-option.is-inactive {
    color: rgba(255, 255, 255, 0.55);
    border-style: dashed;
}

.pns-empty {
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.75);
    padding: 10px;
    font-size: 13px;
}
