.property-collaboration-panel {
    clear: both;
}

/* ── Chat shell ── */
.pc-chat {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* ── Header ── */
.pc-chat__header {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #f0f1f3;
}

.pc-chat__header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #e8f1fc;
    flex-shrink: 0;
}

.pc-chat__message-logo {
    display: block;
    width: 24px;
    height: 24px;
}

.pc-chat__message-logo--muted {
    width: 28px;
    height: 28px;
    opacity: 0.45;
}

.pc-chat__title {
    margin: 0 0 0.2rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.pc-chat__subtitle {
    margin: 0;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
    max-width: 40rem;
}

/* ── Thread ── */
.property-collaboration-thread {
    max-height: 420px;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f9fafb;
    min-height: 200px;
}

/* ── Empty state ── */
.pc-chat__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
    flex: 1;
}

.pc-chat__empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.pc-chat__empty-title {
    margin: 0 0 0.35rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
}

.pc-chat__empty-sub {
    margin: 0;
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* ── Bubbles ── */
.pc-bubble {
    max-width: 78%;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pc-bubble--mine {
    margin-left: auto;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.pc-bubble--theirs {
    margin-right: auto;
}

.pc-bubble__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.pc-bubble__meta strong {
    color: #0f172a;
    font-size: 0.8125rem;
    display: inline;
    font-weight: 700;
}

.pc-bubble__who {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.pc-bubble__who .pc-role {
    flex-shrink: 0;
}

.pc-bubble__body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9375rem;
    color: #374151;
    line-height: 1.5;
}

.pc-bubble__actions {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.pc-visibility-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.5rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #206bc4;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.pc-visibility-toggle:hover {
    background: rgba(32, 107, 196, 0.08);
}

.pc-visibility-toggle:disabled,
.pc-visibility-toggle.is-loading {
    opacity: 0.6;
    cursor: wait;
}

/* ── Attachment in bubble ── */
.pc-attachment {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e5e7eb;
}

.pc-attachment__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #206bc4;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.pc-attachment__content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.pc-attachment__name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #0f172a;
    word-break: break-word;
}

.pc-attachment__link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #206bc4;
    text-decoration: none;
}

.pc-attachment__link:hover {
    text-decoration: underline;
}

/* ── Badges ── */
.property-collaboration-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.property-collaboration-badge--public {
    background: #d1fae5;
    color: #065f46;
}

.property-collaboration-badge--private {
    background: #e5e7eb;
    color: #4b5563;
}

.property-collaboration-badge--pending {
    background: #fef3c7;
    color: #92400e;
}

.property-collaboration-badge--rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Admin public sharing page ── */
.pc-admin-page__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pc-admin-page__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.pc-admin-page__subtitle {
    color: #6b7280;
    margin: 0;
}

.pc-admin-pending-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.pc-admin-empty-card {
    text-align: center;
    padding: 3rem 1.5rem;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    background: #fafafa;
}

.pc-admin-empty-card__icon {
    font-size: 2rem;
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

.pc-admin-empty-card h2 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.pc-admin-empty-card p {
    color: #6b7280;
    margin: 0;
}

.pc-admin-requests-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pc-admin-request-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.pc-admin-request-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
}

.pc-admin-request-card__type {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.pc-admin-request-card__listing {
    font-size: 1.05rem;
    margin: 0;
}

.pc-admin-request-card__listing a {
    color: inherit;
    text-decoration: none;
}

.pc-admin-request-card__listing a:hover {
    color: var(--bb-primary, #206bc4);
}

.pc-admin-request-card__body {
    padding: 1rem 1.25rem;
}

.pc-admin-request-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.85rem;
}

.pc-admin-request-card__preview {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
}

.pc-admin-request-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem 1rem;
    border-top: 1px solid #f3f4f6;
}

/* ── Composer ── */
.pc-composer {
    padding: 1.25rem 1.5rem 1.5rem;
    background: #fff;
    border-top: 1px solid #f0f1f3;
}

.pc-composer__box {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pc-composer__box:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pc-composer__textarea {
    display: block;
    width: 100%;
    border: none;
    outline: none;
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
    font-size: 0.9375rem;
    padding: 0.875rem 1rem 0.5rem;
    color: #0f172a;
    background: transparent;
    line-height: 1.5;
}

.pc-composer__textarea::placeholder {
    color: #9ca3af;
}

.pc-composer__attach-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.pc-composer__attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s;
}

.pc-composer__attach-btn:hover {
    border-color: #206bc4;
    color: #206bc4;
}

.pc-composer__attach-btn i {
    font-size: 0.9rem;
}

.pc-composer__file-input {
    display: none;
}

.pc-composer__file-name {
    font-size: 0.8125rem;
    color: #6b7280;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pc-composer__file-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
    margin-left: auto;
}

.pc-composer__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.pc-composer__toggles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pc-toggle-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.pc-toggle {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
    margin: 0;
}

.pc-toggle__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pc-toggle__track {
    display: block;
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background 0.2s;
    position: relative;
}

.pc-toggle__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.pc-toggle__input:checked + .pc-toggle__track {
    background: #206bc4;
}

.pc-toggle__input:checked + .pc-toggle__track::after {
    transform: translateX(16px);
}

.pc-toggle__input:focus-visible + .pc-toggle__track {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.pc-toggle-card__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.pc-toggle-card__text strong {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.pc-toggle-card__hint {
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.3;
}

.pc-composer__send {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.35rem;
    border: none;
    border-radius: 8px;
    background: #206bc4;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
    margin-left: auto;
}

.pc-composer__send:hover {
    background: #1a5aa0;
}

.pc-composer__send:active {
    transform: scale(0.98);
}

.pc-composer__send i {
    font-size: 1rem;
}

/* ── Role badges (chat + public) ── */
.pc-role,
.pc-public-role {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

.pc-role--admin,
.pc-public-role--admin {
    background: #dbeafe;
    color: #1d4ed8;
}

.pc-role--broker,
.pc-public-role--broker {
    background: #ede9fe;
    color: #6d28d9;
}

.pc-public-role--inline {
    text-transform: uppercase;
}

.pc-bubble__meta .pc-role {
    flex-shrink: 0;
}

/* ── Public listing resources ── */
.pc-public-resources {
    margin-top: 1.5rem;
}

.pc-public-resources__card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.pc-public-resources__header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.25rem 1.35rem;
    border-bottom: 1px solid #f3f4f6;
    background: #fafbfc;
}

.pc-public-resources__header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #eff6ff;
    flex-shrink: 0;
}

.pc-public-resources__logo {
    display: block;
}

.pc-public-resources__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.2rem;
    line-height: 1.3;
}

.pc-public-resources__subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.45;
}

.pc-public-resources__divider {
    margin: 0;
    border: 0;
    border-top: 1px solid #f3f4f6;
}

.pc-public-section {
    padding: 1.15rem 1.35rem 1.25rem;
}

.pc-public-section__heading {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #374151;
}

.pc-public-section__heading i {
    font-size: 1rem;
    color: #6b7280;
}

.pc-public-section__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 0.6875rem;
    font-weight: 700;
    margin-left: 0.15rem;
}

.pc-public-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pc-public-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.pc-public-message__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.pc-public-message__avatar--admin {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.pc-public-message__avatar--broker {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.pc-public-message__content {
    flex: 1;
    min-width: 0;
}

.pc-public-message__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.4rem;
}

.pc-public-message__who {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.pc-public-message__who .pc-public-role {
    flex-shrink: 0;
}

.pc-public-message__author {
    display: inline;
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.pc-public-message__date {
    font-size: 0.8125rem;
    color: #9ca3af;
}

.pc-public-message__bubble {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    color: #374151;
    font-size: 0.9375rem;
    line-height: 1.55;
    word-break: break-word;
}

.pc-public-documents {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pc-public-document {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.pc-public-document__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #ecfdf5;
    color: #059669;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pc-public-document__info {
    flex: 1;
    min-width: 0;
}

.pc-public-document__name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.2rem;
    word-break: break-word;
}

.pc-public-document__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: #9ca3af;
}

.pc-public-document__meta-sep {
    color: #d1d5db;
}

.pc-public-document__caption {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.45;
}

.pc-public-document__download {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid #2563eb;
    border-radius: 8px;
    color: #2563eb;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.pc-public-document__download:hover {
    background: #2563eb;
    color: #fff;
}

@media (max-width: 576px) {
    .pc-public-resources__header,
    .pc-public-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .pc-public-document {
        flex-wrap: wrap;
    }

    .pc-public-document__download {
        width: 100%;
        justify-content: center;
    }
}

/* legacy alias kept for admin request cards */
.property-collaboration-attachment--public {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: #f9fafb;
}

@media (max-width: 576px) {
    .pc-composer__attach-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .pc-composer__file-hint {
        margin-left: 0;
    }

    .pc-composer__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .pc-composer__send {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
}

[data-bs-theme='dark'] .pc-chat {
    background: #1e293b;
    border-color: #334155;
}

[data-bs-theme='dark'] .pc-chat__header {
    background: #1e293b;
    border-color: #334155;
}

[data-bs-theme='dark'] .pc-chat__title {
    color: #f1f5f9;
}

[data-bs-theme='dark'] .pc-chat__subtitle {
    color: #94a3b8;
}

[data-bs-theme='dark'] .property-collaboration-thread {
    background: #0f172a;
}

[data-bs-theme='dark'] .pc-chat__empty-icon {
    background: #1e293b;
    color: #475569;
}

[data-bs-theme='dark'] .pc-chat__empty-title {
    color: #f1f5f9;
}

[data-bs-theme='dark'] .pc-bubble {
    background: #1e293b;
    border-color: #334155;
}

[data-bs-theme='dark'] .pc-bubble--mine {
    background: #134e4a;
    border-color: #0d9488;
}

[data-bs-theme='dark'] .pc-composer {
    background: #1e293b;
    border-color: #334155;
}

[data-bs-theme='dark'] .pc-composer__box {
    border-color: #334155;
    background: #0f172a;
}

[data-bs-theme='dark'] .pc-composer__textarea {
    color: #e2e8f0;
}

[data-bs-theme='dark'] .pc-composer__attach-bar {
    background: #1e293b;
    border-color: #334155;
}

[data-bs-theme='dark'] .pc-composer__attach-btn {
    background: #0f172a;
    border-color: #475569;
    color: #cbd5e1;
}

[data-bs-theme='dark'] .pc-toggle-card {
    background: #0f172a;
    border-color: #334155;
}

[data-bs-theme='dark'] .pc-toggle-card__text strong {
    color: #f1f5f9;
}
