.bpw-research-panel,
.bpw-research-owner-editor {
    margin-top: 12px;
}

.bpw-research-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bpw-research-directory-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 10px;
}

.bpw-research-directory-overview > div {
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
}

.bpw-research-directory-overview strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
}

.bpw-research-directory-overview span {
    color: #646970;
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.bpw-research-intro,
.bpw-research-privacy-note,
.bpw-research-empty,
.bpw-research-results-summary,
.bpw-research-muted {
    color: #50575e;
    margin: 0;
}

.bpw-research-muted {
    font-style: italic;
}

.bpw-research-privacy-note {
    border: 1px solid #dcdcde;
    border-radius: 6px;
    background: #f6f7f7;
    padding: 8px 10px;
    font-size: 12px;
}

.bpw-research-form,
.bpw-research-filter-strip,
.bpw-research-city-selector,
.bpw-research-admin-search {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 10px;
}

.bpw-research-form label,
.bpw-research-filter-strip label,
.bpw-research-city-selector label,
.bpw-research-admin-search label,
.bpw-research-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}

.bpw-research-form label span,
.bpw-research-filter-strip label span,
.bpw-research-city-selector label span,
.bpw-research-admin-search label span,
.bpw-research-field span {
    font-weight: 600;
}

.bpw-research-search-label,
.bpw-research-field-wide {
    flex: 1 1 260px;
}

.bpw-research-form input[type="search"],
.bpw-research-form select,
.bpw-research-filter-strip select,
.bpw-research-city-selector select,
.bpw-research-admin-search input[type="search"],
.bpw-research-field input,
.bpw-research-field textarea {
    max-width: 100%;
    width: 100%;
}

.bpw-research-filter-strip {
    flex: 999 1 100%;
}

.bpw-research-filter-strip label[hidden] {
    display: none;
}

.bpw-research-results.is-loading {
    opacity: 0.68;
}

.bpw-research-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.bpw-research-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.bpw-research-table th,
.bpw-research-table td {
    border: 1px solid #dcdcde;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.bpw-research-table th {
    background: #f6f7f7;
}

.bpw-research-link {
    border: 0;
    background: none;
    color: #2271b1;
    cursor: pointer;
    padding: 0;
    text-align: left;
    text-decoration: underline;
}

.bpw-research-link:hover,
.bpw-research-link:focus {
    color: #135e96;
}

.bpw-research-subsection,
.bpw-research-admin-item {
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #fff;
    padding: 0;
    overflow: hidden;
}

.bpw-research-subsection > summary,
.bpw-research-admin-item > summary {
    cursor: pointer;
    font-weight: 700;
    padding: 10px 12px;
    background: #f6f7f7;
}

.bpw-research-admin-item > summary span {
    display: block;
    color: #646970;
    font-size: 12px;
    font-weight: 400;
    margin-top: 2px;
}

.bpw-research-public-form,
.bpw-research-clear-form,
.bpw-research-admin-search {
    padding: 12px;
}

.bpw-research-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.bpw-research-form-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.bpw-research-form-message {
    color: #50575e;
    font-size: 12px;
}

.bpw-research-form-message-success {
    color: #008a20;
}

.bpw-research-form-message-error {
    color: #b32d2e;
}

.bpw-research-admin-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bpw-research-admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
}

.bpw-research-profile-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bpw-research-profile-hero {
    align-items: center;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    padding: 12px;
}

.bpw-research-profile-badge {
    background: #1d2327;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    text-transform: uppercase;
}

.bpw-research-profile-hero h4 {
    margin: 0;
    font-size: 18px;
}

.bpw-research-profile-hero p {
    color: #646970;
    margin: 2px 0 0 0;
}

.bpw-research-mini-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bpw-research-mini-list li {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bpw-research-mini-list span {
    color: #646970;
    font-size: 12px;
}

.bpw-research-detail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 12px 0;
}

.bpw-research-detail-list div {
    border-bottom: 1px solid #f0f0f1;
    padding-bottom: 8px;
}

.bpw-research-detail-list dt {
    color: #646970;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.bpw-research-detail-list dd {
    margin: 0;
}

.bpw-research-modal[hidden] {
    display: none;
}

.bpw-research-modal {
    bottom: 0;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 100000;
}

.bpw-research-modal-backdrop {
    background: rgba(0, 0, 0, 0.55);
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.bpw-research-modal-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
    left: 50%;
    max-height: min(82vh, 760px);
    max-width: 720px;
    overflow: auto;
    padding: 18px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 720px);
}

.bpw-research-modal-close {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    padding: 2px 6px;
    position: absolute;
    right: 10px;
    top: 8px;
}

.bpw-research-modal-card h3 {
    margin: 0 38px 14px 0;
}

.bpw-research-modal-body {
    font-size: 14px;
}

@media (max-width: 700px) {
    .bpw-research-directory-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bpw-research-form,
    .bpw-research-filter-strip,
    .bpw-research-filter-strip label,
    .bpw-research-form label,
    .bpw-research-form .button,
    .bpw-research-city-selector,
    .bpw-research-city-selector label,
    .bpw-research-city-selector .button,
    .bpw-research-admin-search,
    .bpw-research-admin-search label,
    .bpw-research-admin-search .button {
        width: 100%;
    }

    .bpw-research-profile-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .bpw-research-form-grid {
        grid-template-columns: 1fr;
    }

    .bpw-research-table,
    .bpw-research-table thead,
    .bpw-research-table tbody,
    .bpw-research-table th,
    .bpw-research-table td,
    .bpw-research-table tr {
        display: block;
    }

    .bpw-research-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .bpw-research-table tr {
        border: 1px solid #dcdcde;
        border-radius: 8px;
        margin: 0 0 10px 0;
        overflow: hidden;
        background: #fff;
    }

    .bpw-research-table td {
        border: 0;
        border-bottom: 1px solid #eee;
        padding: 8px 10px;
    }

    .bpw-research-table td:last-child {
        border-bottom: 0;
    }

    .bpw-research-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        color: #646970;
        margin-bottom: 2px;
    }

    .bpw-research-modal-card {
        border-radius: 0;
        bottom: 0;
        left: 0;
        max-height: none;
        max-width: none;
        right: 0;
        top: auto;
        transform: none;
        width: auto;
    }
}
