:root {
    --bs-font-sans-serif: JetBrains Mono, monospace;
    --bs-font-sans-mono:  JetBrains Mono, monospace;

    --bs-info-bg-subtle:  #e7f1ff;   /* переопределение: active item в списке чатов (стандарт #cff4fc — слишком холодный) */

    --kmc-accent:         #d2f4ea;   /* мятный: hover/active в sidebar nav и .btn-toggle */
    --kmc-divider:        #f0f0f0;   /* серый тоньше --bs-border-color, для тонких линий в списке чатов и аватарок */
}

body {
    margin: 0;
}

main {
    display: flex;
    flex-wrap: nowrap;
}

.b-example-divider {
    flex-shrink: 0;
    width: 1.5rem;
    height: 100vh;
    background-color: rgba(var(--bs-emphasis-color-rgb), .1);
    border: solid rgba(var(--bs-emphasis-color-rgb), .15);
    border-width: 1px 0;
    box-shadow:
        inset 0 .5em 1.5em rgba(var(--bs-emphasis-color-rgb), .1),
        inset 0 .125em .5em rgba(var(--bs-emphasis-color-rgb), .15);
}

.bi {
    vertical-align: -.125em;
    pointer-events: none;
    fill: currentColor;
}

.dropdown-toggle { outline: 0; }

.nav-flush .nav-link {
    border-radius: 0;
}

.btn-toggle {
    display: inline-flex;
    align-items: center;
    padding: .25rem .5rem;
    font-weight: 600;
    color: rgba(var(--bs-emphasis-color-rgb), .65);
    background-color: transparent;
    border: 0;
}
.btn-toggle:hover,
.btn-toggle:focus {
    color: rgba(var(--bs-emphasis-color-rgb), .85);
    background-color: var(--kmc-accent);
}

.btn-toggle::before {
    width: 1.25em;
    line-height: 0;
    content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%280,0,0,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
    transition: transform .35s ease;
    transform-origin: .5em 50%;
}

.btn-toggle[aria-expanded="true"] {
    color: rgba(var(--bs-emphasis-color-rgb), .85);
}
.btn-toggle[aria-expanded="true"]::before {
    transform: rotate(90deg);
}

.btn-toggle-nav a {
    display: inline-flex;
    padding: .1875rem .5rem;
    margin-top: .125rem;
    margin-left: 1.25rem;
    text-decoration: none;
}
.btn-toggle-nav a:hover,
.btn-toggle-nav a:focus {
    background-color: var(--kmc-accent);
}

.scrollarea {
    overflow-y: auto;
}

.fw-semibold { font-weight: 600; }
.lh-tight { line-height: 1.25; }

.sticky-top-shadow {
    box-shadow: 0 0.5rem 1rem -0.5rem var(--bs-body-bg) !important;
}

.sticky-bottom-shadow {
    box-shadow: 0 -0.5rem 1rem -0.5rem var(--bs-body-bg) !important;
}

/* === Chat /messages === */

/* #chat-app использует утилиты ms-n5 mt-n3 в chat.phtml */

.chat-shell {
    display: flex;
    height: 100vh;
    height: 100dvh;
    border-left:  1px solid var(--bs-border-color);
    border-right: 1px solid var(--bs-border-color);
    overflow: hidden;
    background: var(--bs-body-bg);
}

.chat-list-col,
.chat-thread-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.chat-list-col {
    width: 320px;
    flex-shrink: 0;
    border-right: 1px solid var(--bs-border-color);
}

.chat-thread-col {
    flex: 1;
    min-width: 0;
}

.chat-list-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-secondary-bg);
    flex-shrink: 0;
    min-height: 56px;
    display: flex;
    align-items: center;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-list-section-label {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bs-tertiary-bg);
    border-top: 1px solid var(--kmc-divider);
}

.chat-list-section-label:first-child {
    border-top: none;
}

.chat-list-empty {
    margin-top: 1rem;
}

.chat-list-item {
    display: flex;
    padding: 0.65rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--kmc-divider);
    align-items: center;
}

.chat-list-item:hover {
    background: var(--bs-secondary-bg);
}

.chat-list-item.active {
    background: var(--bs-info-bg-subtle);
}

.chat-list-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--kmc-divider);
    flex-shrink: 0;
}

.chat-list-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.kmc-unread-badge {
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.4rem;
    font-size: 0.7rem;
    line-height: 1.1rem;
    font-weight: 600;
    box-sizing: content-box;
}

.chat-list-unread {
    position: absolute;
    right: -0.3rem;
    bottom: -0.3rem;
    border: 2px solid var(--bs-body-bg);
}

.chat-list-item.active .chat-list-unread {
    border-color: var(--bs-info-bg-subtle);
}

.chat-presence-dot {
    position: absolute;
    right: -0.1rem;
    top: -0.1rem;
    width: 0.7rem;
    height: 0.7rem;
    background-color: var(--bs-success);
    border: 2px solid var(--bs-body-bg);
    border-radius: 50%;
    box-sizing: content-box;
}

.chat-list-item.active .chat-presence-dot {
    border-color: var(--bs-info-bg-subtle);
}

.chat-list-body {
    flex: 1;
    min-width: 0;
    margin-left: 0.75rem;
}

.chat-list-time {
    flex-shrink: 0;
    white-space: nowrap;
}

.chat-list-status {
    font-size: 0.75rem;
    line-height: 1;
    flex-shrink: 0;
}

.chat-list-preview {
    line-height: 1.3;
}

.chat-thread-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-secondary-bg);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-height: 56px;
}

.chat-thread-header .chat-list-avatar {
    margin-top: -4px;
    margin-bottom: -4px;
}

.chat-back-btn {
    font-size: 1.1rem;
    color: var(--bs-secondary-color);
    text-decoration: none;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.chat-message {
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    max-width: 75%;
    min-width: 0;
}

.chat-message-mine {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message-bubble {
    background: var(--kmc-divider);
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.3;
}

.chat-message-mine .chat-message-bubble {
    background: var(--bs-primary);
    color: var(--bs-body-bg);
}

.chat-message-time {
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
    margin-top: 0.15rem;
    padding: 0 0.5rem;
}

.chat-message-status {
    color: var(--bs-secondary-color);
}

.chat-message-status-read {
    color: var(--bs-primary);
}

.chat-input {
    position: relative;
    padding: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
    flex-shrink: 0;
    background: var(--bs-body-bg);
}

.chat-input textarea {
    width: 100%;
    resize: none;
    min-height: calc(2.25rem + 2px);
    max-height: 10rem;
    padding-right: 3.5rem;
    overflow-y: auto;
}

.chat-input-actions {
    position: absolute;
    right: 1.25rem;
    bottom: 1rem;
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.chat-input-send {
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--bs-primary);
    width: auto;
    height: 2rem;
    padding: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-input-send:hover:not(:disabled) {
    color: var(--bs-primary-text-emphasis);
}

.chat-input-send:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.chat-input-send:disabled {
    color: var(--bs-secondary-color);
    opacity: 0.5;
}

.chat-input-emoji {
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--bs-secondary-color);
    width: auto;
    height: 2rem;
    padding: 0;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-input-emoji:hover,
.chat-input-emoji.active {
    color: var(--bs-primary);
}

.chat-input-emoji:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.chat-emoji-picker {
    position: absolute;
    right: 0.5rem;
    bottom: calc(100% + 0.5rem);
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    z-index: 10;
    max-width: calc(100% - 1rem);
}

.chat-emoji-grid {
    display: grid;
    grid-template-columns: repeat(10, 2rem);
    gap: 0.25rem;
    max-height: 10rem;
    overflow-y: auto;
}

.chat-emoji-item {
    background: transparent;
    border: none;
    width: 2rem;
    height: 2rem;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 0.25rem;
    cursor: pointer;
}

.chat-emoji-item:hover {
    background: var(--bs-secondary-bg);
}

.chat-empty {
    flex: 1;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767.98px) {
    .chat-list-col {
        width: 100%;
        border-right: none;
    }
    .chat-list-col.d-none {
        display: none !important;
    }
}

/* === Sticky message notifications (bottom-right) === */

.kmc-notifications-container {
    z-index: 1090;
    max-width: 360px;
    pointer-events: none;
}

.kmc-notification {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    cursor: pointer;
    pointer-events: auto;
    min-width: 280px;
    max-width: 360px;
}

.kmc-notification:hover {
    background: var(--bs-secondary-bg);
}

.kmc-notification-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.kmc-notification-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--kmc-divider);
    flex-shrink: 0;
}

.kmc-notification-presence-dot {
    border-color: var(--bs-body-bg);
}

.kmc-notification:hover .kmc-notification-presence-dot {
    border-color: var(--bs-secondary-bg);
}

.kmc-notification-body {
    flex: 1;
    min-width: 0;
}

.kmc-notification-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.kmc-notification-sender {
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
}

.kmc-notification-time {
    flex-shrink: 0;
    color: var(--bs-secondary-color);
    font-size: 0.7rem;
}

.kmc-notification-text {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.kmc-notification-close {
    flex-shrink: 0;
    background: transparent;
    border: 0;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--bs-secondary-color);
    padding: 0;
    cursor: pointer;
    margin-left: 0.25rem;
}

.kmc-notification-close:hover {
    color: var(--bs-emphasis-color);
}

.kmc-notif-enter-from {
    opacity: 0;
    transform: translateX(100%);
}
.kmc-notif-leave-to {
    opacity: 0;
    transform: translateX(100%);
}
.kmc-notif-enter-active,
.kmc-notif-leave-active {
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.kmc-notif-move {
    transition: transform 0.2s ease;
}

/* === Partners /partners (swipe cards) === */

.partners-shell {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 2rem);
}

.partners-filters {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.partners-looking-toggle .btn {
    font-size: 0.85rem;
}

.partners-tag-input {
    position: relative;
}

.partners-tag-input-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-height: calc(2.25rem + 2px);
    padding: 0.25rem 0.5rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    cursor: text;
}

.partners-tag-input-field:focus-within {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.partners-tag-chip {
    font-weight: 500;
    padding: 0.3rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    color: var(--bs-body-color);
}

.partners-tag-chip-icon {
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
    margin-right: 0.2rem;
}

.partners-tag-chip .btn-close {
    font-size: 0.7rem;
}

.partners-tag-input-input {
    flex: 1 1 6rem;
    min-width: 6rem;
    border: 0;
    outline: none;
    background: transparent;
    padding: 0.15rem 0.25rem;
    font-size: 0.875rem;
    color: var(--bs-body-color);
}

.partners-tag-input-input::placeholder {
    color: var(--bs-secondary-color);
}

.partners-tag-input-clear {
    background: transparent;
    border: 0;
    color: var(--bs-secondary-color);
    font-size: 1.4rem;
    line-height: 1;
    padding: 0 0.35rem;
    cursor: pointer;
    align-self: stretch;
}

.partners-tag-input-clear:hover {
    color: var(--bs-body-color);
}

.partners-typeahead {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    margin-top: 0.25rem;
    padding: 0.25rem 0;
    max-height: 16rem;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

.partners-typeahead-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.partners-typeahead-item:hover {
    background: var(--bs-secondary-bg);
}

.partners-stage {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    position: relative;
    padding: 1rem 0;
    min-height: 0;
}

.partners-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.swipe-card {
    width: 100%;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease;
    align-self: center;
}

.swipe-card-photo-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--kmc-divider);
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .swipe-card {
        flex-direction: row;
    }
    .swipe-card-photo-wrap {
        flex: 0 0 auto;
        width: 420px;
        aspect-ratio: 3 / 4;
        align-self: stretch;
    }
    .swipe-card-body {
        flex: 1 1 0;
        min-width: 0;
    }
}

.swipe-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.swipe-card-online {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 0.9rem;
    height: 0.9rem;
    background-color: var(--bs-success);
    border: 3px solid var(--bs-body-bg);
    border-radius: 50%;
    box-sizing: content-box;
}

.swipe-card-body {
    padding: 1rem 1.25rem 1.25rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.swipe-card-bio {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--bs-body-color);
    margin: 0.5rem 0 0.75rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.swipe-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.kmc-int-chip {
    font-weight: 500;
    padding: 0.35rem 0.6rem;
    cursor: default;
}

.kmc-int-chip-with-sub {
    cursor: help;
}

.kmc-int-chip-sup {
    font-size: 0.65em;
    margin-left: 0.15rem;
    vertical-align: super;
    opacity: 0.6;
}

.swipe-card-meta {
    line-height: 1.4;
    margin-top: 0.5rem;
}

.swipe-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 0 0.5rem;
    flex-shrink: 0;
}

.swipe-btn {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.08);
}

.swipe-btn-message {
    width: auto;
    min-width: 12rem;
    border-radius: 1.75rem;
    padding: 0 1.5rem;
}

.swipe-card-fly-left {
    transform: translateX(-150%) rotate(-25deg) !important;
    opacity: 0;
}

.swipe-card-fly-right {
    transform: translateX(150%) rotate(25deg) !important;
    opacity: 0;
}

@media (max-width: 575.98px) {
    .swipe-btn-message {
        min-width: auto;
        padding: 0 1rem;
    }
}

/* === Публичная страница (/u/{token}) === */

.public-card {
    width: 100%;
    max-width: 760px;
}

.public-brand {
    font-family: JetBrains Mono, monospace;
}

.public-qr {
    width: 132px;
    height: 132px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.public-qr img {
    display: block;
}

