.secret-chat-create-modal {
    position: fixed;
    inset: 0;
    z-index: 1000002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.58);
}

.secret-chat-create-modal.hidden {
    display: none;
}

.secret-chat-create-modal__sheet {
    width: min(440px, 100%);
    max-height: min(680px, 88vh);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(130, 169, 255, 0.22);
    background: rgb(25 36 52);
    color: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.secret-chat-create-modal__head,
.secret-chat-pin-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.secret-chat-create-modal__head h3,
.secret-chat-pin-modal__head h3 {
    margin: 0;
    font-size: 1.25rem;
}

#secret-chat-pin-title {
    margin-top: 0;
}

.secret-chat-create-modal__head button,
.secret-chat-pin-modal__head button {
    width: 38px;
    height: 38px;
    min-width: 38px;
    flex: 0 0 38px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #343c63;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
}

.secret-chat-create-modal__hint {
    color: #cbd5e8;
    font-size: 0.92rem;
    line-height: 1.35;
}

.secret-chat-create-modal__list {
    display: grid;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
}

.secret-chat-create-modal__list::-webkit-scrollbar {
    width: 8px;
}

.secret-chat-create-modal__list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(130, 169, 255, 0.35);
}

.secret-chat-peer {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(130, 169, 255, 0.16);
    border-radius: 14px;
    background: rgba(13, 22, 34, 0.62);
    color: white;
    text-align: left;
    cursor: pointer;
}

.secret-chat-peer:hover {
    background: rgba(52, 60, 99, 0.58);
}

.secret-chat-peer.is-disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.secret-chat-peer img {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    object-fit: cover;
}

.secret-chat-peer span {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.secret-chat-peer strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.secret-chat-peer small {
    color: #aebbd2;
    line-height: 1.25;
}

.secret-chat-create-modal__empty {
    padding: 20px 12px;
    border-radius: 14px;
    background: rgba(13, 22, 34, 0.48);
    color: #cbd5e8;
    text-align: center;
}

.chat-title-secret-mark {
    color: #9ee7c7;
    font-size: 0.9em;
}

.secret-chat-pin-modal,
.secret-chat-fingerprint-modal {
    position: fixed;
    inset: 0;
    z-index: 1000004;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.62);
}

.secret-chat-pin-modal.hidden,
.secret-chat-fingerprint-modal.hidden {
    display: none;
}

.secret-chat-pin-modal__sheet,
.secret-chat-fingerprint-modal__sheet {
    width: min(440px, 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(130, 169, 255, 0.22);
    background: rgb(25 36 52);
    color: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.secret-chat-pin-modal__text {
    margin: 0;
    color: #cbd5e8;
    font-size: 0.92rem;
    line-height: 1.45;
}

.secret-chat-pin-modal__input {
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid rgba(130, 169, 255, 0.28);
    border-radius: 12px;
    outline: none;
    background: rgba(13, 22, 34, 0.82);
    color: white;
    font-size: 1rem;
}

.secret-chat-pin-modal__input:focus {
    border-color: rgba(130, 169, 255, 0.78);
}

.secret-chat-pin-modal__error {
    min-height: 18px;
    color: #ff9d9d;
    font-size: 0.86rem;
}

.secret-chat-pin-modal__actions {
    display: flex;
    gap: 10px;
}

.secret-chat-pin-modal__actions button {
    flex: 1;
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    background: #343c63;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.secret-chat-pin-modal__actions button:last-child {
    background: #343c63;
}

.secret-chat-create-modal__own-fingerprint {
    display: grid;
    gap: 5px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(13, 22, 34, 0.48);
    color: #cbd5e8;
    font-size: 0.86rem;
}

.secret-chat-fingerprint,
.secret-chat-create-modal__own-fingerprint code,
.secret-chat-fingerprint-row code {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 5px 8px;
    border-radius: 10px;
    background: rgba(158, 231, 199, 0.12);
    color: #9ee7c7;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

.secret-chat-fingerprint-list {
    display: grid;
    gap: 10px;
}

.secret-chat-fingerprint-row {
    display: grid;
    gap: 7px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(13, 22, 34, 0.62);
}

.secret-chat-fingerprint-row span {
    color: white;
    font-weight: 800;
}

.secret-chat-fingerprint-link {
    color: #9ee7c7 !important;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(158, 231, 199, 0.42);
    text-underline-offset: 3px;
}

@media (max-width: 1000px) {
    .secret-chat-create-modal,
    .secret-chat-pin-modal,
    .secret-chat-fingerprint-modal {
        align-items: flex-end;
        padding: 12px;
    }

    .secret-chat-create-modal__sheet,
    .secret-chat-pin-modal__sheet,
    .secret-chat-fingerprint-modal__sheet {
        max-height: 82vh;
        border-radius: 20px 20px 14px 14px;
    }
}
