/* Specialties badges + edit modal (cabinet + public profile) */
.cb-profile-hero__specialties {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.lg-pf-hero__specialties {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 1px solid rgba(15, 45, 82, .06);
}

.lg-pf-specialties-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.lg-pf-specialties-toggle {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    min-height: 40px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid rgba(15, 45, 82, .1);
    border-radius: 12px;
    background: rgba(15, 45, 82, .03);
    color: var(--lg-blue, #0f2d52);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s ease, border-color .15s ease;
}

.lg-pf-specialties-toggle:hover {
    background: rgba(5, 150, 105, .06);
    border-color: rgba(5, 150, 105, .28);
}

.lg-pf-specialties-toggle:focus-visible {
    outline: 2px solid var(--lg-emerald, #059669);
    outline-offset: 2px;
}

.lg-pf-specialties-toggle__main {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.lg-pf-specialties-toggle__main > i {
    color: var(--lg-emerald, #059669);
    flex-shrink: 0;
}

.lg-pf-specialties-toggle__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lg-pf-specialties-toggle__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    min-width: 1.4em;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(5, 150, 105, .12);
    color: var(--lg-emerald, #059669);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.5;
    vertical-align: middle;
}

.lg-pf-specialties-toggle__chevron {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--lg-muted, #64748b);
    transition: transform .2s ease;
}

#profileSpecialtiesWrap:not(.is-collapsed) .lg-pf-specialties-toggle__chevron {
    transform: rotate(180deg);
}

#profileSpecialtiesWrap.is-collapsed .lg-pf-hero__specialty-badges {
    display: none;
}

#profileSpecialtiesWrap:not(.is-collapsed) .lg-pf-hero__specialty-badges[hidden] {
    display: flex !important;
}


.cb-profile-hero__specialty-badges,
.lg-pf-hero__specialty-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    gap: 8px;
    min-width: 0;
}

.cb-profile-hero__specialty-badges,
.lg-pf-hero__specialty-badges {
    flex: 1 1 auto;
    width: 100%;
}

.lg-pf-hero__specialty-badges .lg-pf-hero__role-badge,
.lg-pf-hero__specialty-badges .cb-profile-hero__role-badge {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
}

.lg-pf-hero__specialty-badges[data-lg-chip-pack] .lg-pf-hero__role-badge,
.lg-pf-hero__specialty-badges[data-lg-chip-pack] .cb-profile-hero__role-badge,
.cb-profile-hero__specialty-badges[data-lg-chip-pack] .lg-pf-hero__role-badge,
.cb-profile-hero__specialty-badges[data-lg-chip-pack] .cb-profile-hero__role-badge {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    white-space: nowrap;
    text-wrap: nowrap;
}

.cb-specialties-edit,
.lg-pf-specialties-edit {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--lg-border);
    border-radius: 8px;
    background: var(--lg-surface);
    color: var(--lg-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    flex-shrink: 0;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.cb-specialties-edit:hover,
.lg-pf-specialties-edit:hover {
    color: var(--lg-blue);
    border-color: #b8c5d4;
    background: #fff;
}

.cb-profile-hero__role-badge--empty {
    opacity: .85;
}

.lg-spec-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    overflow: hidden;
    overscroll-behavior: contain;
}

.lg-spec-modal[hidden] {
    display: none;
}

.lg-spec-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 45, 82, .45);
}

.lg-spec-modal__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(520px, 100%);
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    max-height: min(90dvh, 720px);
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--lg-border);
    box-shadow: 0 18px 48px rgba(15, 45, 82, .16);
}

.lg-spec-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--lg-border);
    flex-shrink: 0;
    background: #fff;
}

.lg-spec-modal__head h3 {
    margin: 0;
    font-size: 17px;
    color: var(--lg-blue);
}

.lg-spec-modal__close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--lg-muted);
    cursor: pointer;
    font-family: inherit;
}

.lg-spec-modal__body {
    flex: 1;
    min-height: 0;
    min-width: 0;
    padding: 14px 16px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.lg-spec-modal__intro {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.45;
}

.lg-spec-modal__count {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--lg-emerald);
}

.lg-spec-modal__section + .lg-spec-modal__section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--lg-border);
}

.lg-spec-modal__section-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 800;
    color: var(--lg-blue);
}

.lg-spec-modal__checks {
    display: grid;
    gap: 8px;
}

.lg-spec-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 -6px;
    padding: 8px 6px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--lg-text);
    cursor: pointer;
    transition: background-color .2s ease, box-shadow .2s ease;
}

.lg-spec-check__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin-top: 0;
    border-radius: 50%;
    background: var(--lg-emerald, #059669);
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

.lg-spec-check__icon i {
    display: block;
    line-height: 1;
}

.lg-spec-check__label {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 4px;
}

.lg-spec-check.is-just-added {
    background: rgba(5, 150, 105, .12);
    box-shadow: inset 0 0 0 1px rgba(5, 150, 105, .35);
}

@media (prefers-reduced-motion: reduce) {
    .lg-spec-check {
        transition: none;
    }
}

.lg-spec-check input {
    margin-top: 6px;
    flex-shrink: 0;
}

.lg-spec-modal__custom-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lg-spec-modal__custom-field {
    flex: 1;
    min-width: 0;
}

.lg-spec-modal__section--custom {
    padding-top: 16px;
    overflow: visible;
}

.lg-spec-modal__section--custom .lg-spec-modal__section-title {
    margin-bottom: 8px;
}

.lg-spec-modal__custom-box {
    padding: 10px;
    border-radius: 12px;
    background: rgba(15, 45, 82, .03);
    border: 1px solid rgba(15, 45, 82, .08);
    overflow: visible;
}

.lg-spec-modal__custom-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid var(--lg-border);
    background: #fff;
    color: var(--lg-text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.35;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.lg-spec-modal__custom-input::placeholder {
    color: var(--lg-muted);
    opacity: .85;
}

.lg-spec-modal__custom-input:focus {
    outline: none;
    border-color: rgba(5, 150, 105, .45);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, .12);
}

.lg-spec-modal__suggest {
    position: fixed;
    z-index: 1300;
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: min(240px, 40dvh);
    overflow: auto;
    border-radius: 10px;
    border: 1px solid var(--lg-border);
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 45, 82, .18);
}

.lg-spec-modal__suggest[hidden] {
    display: none;
}

.lg-spec-modal__suggest-hint {
    padding: 4px 8px 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--lg-muted);
}

.lg-spec-modal__suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--lg-text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.lg-spec-modal__suggest-item .lg-spec-check__icon {
    width: 24px;
    height: 24px;
    font-size: 11px;
}

.lg-spec-modal__suggest-item:hover,
.lg-spec-modal__suggest-item.is-active {
    background: rgba(5, 150, 105, .08);
    color: var(--lg-emerald);
}

.lg-spec-modal__custom-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 0 14px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(5, 150, 105, .28);
    background: rgba(5, 150, 105, .08);
    color: var(--lg-emerald);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.lg-spec-modal__custom-add:hover {
    background: rgba(5, 150, 105, .14);
    border-color: rgba(5, 150, 105, .42);
}

.lg-spec-modal__custom-add:active {
    transform: translateY(1px);
}

.lg-spec-modal__custom-add i {
    font-size: 12px;
}

.lg-spec-modal__custom-box .lg-spec-modal__chips {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(15, 45, 82, .1);
}

.lg-spec-modal__custom-box .lg-spec-modal__chips[hidden] {
    display: none;
}

@media (max-width: 420px) {
    .lg-spec-modal__custom-add span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .lg-spec-modal__custom-add {
        width: 44px;
        padding: 0;
    }
}

.lg-spec-modal__chips {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lg-spec-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 10px;
    border-radius: 999px;
    background: rgba(5, 150, 105, .1);
    border: 1px solid rgba(5, 150, 105, .16);
    font-size: 13px;
    color: var(--lg-emerald);
}

.lg-spec-chip__remove {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 45, 82, .06);
    color: var(--lg-muted);
    cursor: pointer;
    font-family: inherit;
}

.lg-spec-modal__foot {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid var(--lg-border);
    flex-shrink: 0;
    background: #fff;
}

.lg-spec-modal__foot .lg-btn {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 16px;
    font-size: 14px;
}

@media (min-width: 520px) {
    .lg-spec-modal__foot {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
    }

    .lg-spec-modal__foot .lg-btn {
        width: auto;
        flex: 0 1 auto;
    }
}

.lg-spec-modal__foot .lg-btn--secondary,
.lg-spec-modal__foot .lg-btn[data-spec-close] {
    background: var(--lg-bg);
    border: 1px solid var(--lg-border);
    color: var(--lg-blue);
}

.lg-spec-modal__foot .lg-btn--secondary:hover,
.lg-spec-modal__foot .lg-btn[data-spec-close]:hover {
    background: #fff;
    border-color: #b8c5d4;
}
