* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 7, 58, 0.4) rgba(255, 255, 255, 0.05);
}

/* Стилизованные ползунки под стиль сайта */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 7, 58, 0.4);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 7, 58, 0.6);
}

::-webkit-scrollbar-corner {
    background: rgba(255, 255, 255, 0.05);
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
     background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Боковые декоративные элементы */
.side-decoration {
    position: fixed;
    top: 0;
    height: 100%;
    width: 150px;
    z-index: -1;
    opacity: 0.1;
}

.corner-decoration {
    position: fixed;
    width: 300px;
    height: 300px;
    z-index: -1;
    opacity: 0.05;
}

    .corner-decoration.top-left {
        top: -150px;
        left: -150px;
        background: radial-gradient(circle, #ff073a, transparent 70%);
    }

    .corner-decoration.bottom-right {
        bottom: -150px;
        right: -150px;
        background: radial-gradient(circle, #ff073a, transparent 70%);
    }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.team-name {
    font-family: 'Impact', sans-serif;
    font-size: 4rem;
    margin-bottom: 30px;
    color: #ff073a;
    text-shadow: 0 0 10px rgba(255, 7, 58, 0.7);
    letter-spacing: 3px;
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px rgba(255, 7, 58, 0.7);
    }

    to {
        text-shadow: 0 0 20px rgba(255, 7, 58, 0.9), 0 0 30px rgba(255, 7, 58, 0.6);
    }
}

h1 {
    color: #e6e6e6;
    margin-bottom: 30px;
    font-size: 2.5rem;
}

.status {
    padding: 20px;
    margin: 30px auto;
    border-radius: 8px;
    font-weight: bold;
    max-width: 600px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.online {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid #28a745;
    color: #b5f5c4;
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(40, 167, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #b8c2cc;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.buttons {
    margin: 50px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.btn {
    position: relative;
    padding: 15px 40px;
    background: linear-gradient(45deg, #ff073a 0%, #ff3860 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 7, 58, 0.4);
    min-width: 200px;
}

    .btn:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(255, 7, 58, 0.6);
    }

    .btn:active {
        transform: translateY(0);
    }

    .btn:disabled {
        background: linear-gradient(45deg, #6c757d 0%, #495057 100%);
        cursor: not-allowed;
        box-shadow: none;
    }

        .btn:disabled:hover {
            transform: none;
        }

    .btn::after {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: rgba(255, 255, 255, 0.1);
        transform: rotate(45deg);
        transition: all 0.3s;
    }

    .btn:hover::after {
        left: 100%;
    }

.services {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 800px;
    margin: 40px auto;
}

.service-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 15px;
    transition: all 0.3s;
    border-left: 4px solid #ff073a;
    text-align: center;
}

    .service-item:hover {
        transform: translateY(-5px);
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    }

    .service-item h3 {
        margin-bottom: 20px;
        color: #ff073a;
        font-size: 1.8rem;
    }

.port-list {
    list-style-type: none;
    margin-top: 20px;
}

    .port-list li {
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.1rem;
    }

.port-status {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 12px;
}

    .port-status.open {
        background-color: #28a745;
        box-shadow: 0 0 8px #28a745;
    }

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 25px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-top: 5px;
}

.port-form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.port-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 15px;
    color: white;
    font-size: 1rem;
    text-align: center;
}

.port-input::placeholder {
    text-align: center;
}

/* --- SyharikChat additions (forms + chat UI) --- */
:root {
    --accent: #ff073a;
    --bg1: #1a1a2e;
    --bg2: #16213e;
    --card: rgba(255, 255, 255, 0.06);
    --card-2: rgba(0, 0, 0, 0.25);
    --border: rgba(255, 255, 255, 0.12);
    --text: #e6e6e6;
    --muted: #b8c2cc;
}

.btn-secondary {
    background: linear-gradient(45deg, #3a3f55 0%, #2a2f45 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.btn-secondary::after {
    display: none !important;
}

.btn-secondary:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.btn-small {
    padding: 10px 18px;
    min-width: unset;
    font-size: 14px;
    border-radius: 999px;
}

.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    backdrop-filter: blur(10px);
}

.form-grid {
    display: grid;
    gap: 14px;
    text-align: left;
}

.form-centered,
.form-centered .form-card,
.form-centered .form-grid {
    text-align: center;
}

.form-grid-centered .field {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-grid-centered .field span {
    text-align: center;
}

.form-grid-centered .port-input {
    width: 100%;
    max-width: 320px;
}

.form-grid-centered textarea.port-input {
    min-height: 60px;
    resize: vertical;
}

.form-centered .buttons {
    justify-content: center;
}

.profile-avatar-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-initials span {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--muted);
}

.field span {
    display: block;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Центрирование страниц логина/регистрации и профиля */
.page-center {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-center .container-profile .form-card .form-grid,
.page-center .form-card .form-grid {
    text-align: center;
}

.page-center .container-profile .form-card .form-grid .field,
.page-center .form-card .form-grid .field {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-center .container-profile .form-card .form-grid .field span,
.page-center .form-card .form-grid .field span {
    text-align: center;
}

.page-center .container-profile .form-card .form-grid .port-input,
.page-center .form-card .form-grid .port-input {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

/* Профиль: сворачиваемые блоки Почта / Пароль */
.profile-collapse {
    margin: 12px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
}

.profile-collapse summary {
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: var(--text);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.profile-collapse summary::-webkit-details-marker {
    display: none;
}

.profile-collapse summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 10px;
    font-size: 0.75em;
    transition: transform 0.2s;
}

.profile-collapse[open] summary::before {
    transform: rotate(90deg);
}

.profile-collapse-inner {
    padding: 0 18px 16px;
    border-top: 1px solid var(--border);
}

.profile-collapse .profile-collapse-inner .field {
    margin-top: 12px;
}

.profile-form .form-grid {
    margin-bottom: 0;
}

/* Капча reCAPTCHA по центру на странице регистрации */
.page-center .form-card > .field {
    display: flex;
    justify-content: center;
}

.page-center .form-card > .field .g-recaptcha {
    margin: 0 auto;
}

.admin-table tbody tr td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.app-shell {
    max-width: 1200px;
    margin: 0 auto;
    height: calc(100vh - 40px);
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
}

.sidebar, .chat {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 18px;
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
    overflow: hidden;
}

.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.12);
}

.brand-title {
    font-family: 'Impact', sans-serif;
    letter-spacing: 1px;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(255, 7, 58, 0.35);
}

.brand-subtitle {
    margin-top: 4px;
    font-size: 0.9rem;
    color: var(--muted);
}

.sidebar-search {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.sidebar-search .port-input {
    padding: 8px 12px;
    font-size: 0.95rem;
}

.search-results {
    margin-top: 10px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item strong {
    color: var(--text);
}

.search-item small {
    display: block;
    color: var(--muted);
    margin-top: 2px;
}

.search-item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.group-bar {
    padding: 10px 14px;
    background: rgba(255, 7, 58, 0.12);
    border: 1px solid rgba(255, 7, 58, 0.35);
    border-radius: 12px;
    margin-bottom: 10px;
}

.group-bar-title {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 8px;
}

.group-bar-actions {
    display: flex;
    gap: 8px;
}

/* Кнопки в панели подбора группы — компактнее */
.group-bar-actions .btn {
    padding: 6px 10px;
    min-width: 0;
    font-size: 12px;
}

.sidebar-section {
    padding: 14px 18px 18px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.section-title {
    color: var(--muted);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
}

.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    padding-right: 6px;
    flex: 1;
    min-height: 0;
}

.conversation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.conversation-item:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.06);
    border-color: rgba(255, 7, 58, 0.35);
}

.conversation-item.active {
    border-color: rgba(255, 7, 58, 0.6);
    box-shadow: 0 0 0 1px rgba(255, 7, 58, 0.25), 0 10px 30px rgba(255, 7, 58, 0.08);
}

.conv-content {
    min-width: 0;
    flex: 1;
}

.conv-title {
    font-weight: bold;
    color: var(--text);
}

.conv-last {
    color: var(--muted);
    font-size: 0.92rem;
}

.conv-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #ff073a;
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

.chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.12);
}

.chat-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-header-avatar .avatar,
.chat-header-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.chat-header-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-title {
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--text);
}

.chat-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.9rem;
}

.chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.messages {
    padding: 18px;
    overflow: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* Системные сообщения (назначение админа, кик, добавление в группу и т.д.) — по центру */
.msg.msg-system-row {
    justify-content: center;
    align-items: center;
    width: 100%;
}

.msg-system {
    display: inline-block;
    max-width: 85%;
    text-align: center;
    padding: 8px 14px;
    color: var(--muted);
    font-size: 0.9rem;
    font-style: italic;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.msg.me {
    justify-content: flex-end;
}

.msg.me .msg-content {
    justify-content: flex-end;
}

.msg-actions {
    flex-basis: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 2px;
}

.msg-action-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 6px;
}

.msg-action-btn:hover {
    color: #ff073a;
}

.msg-attachment-wrap {
    position: relative;
    display: inline-block;
}

.msg-attachment-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 7, 58, 0.9);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.msg-attachment-remove:hover {
    background: #ff073a;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-weight: bold;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-small {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.8rem;
    flex-shrink: 0;
    overflow: hidden;
}

.msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Важно: атрибут hidden должен всегда скрывать модалку */
.modal-overlay[hidden] {
    display: none !important;
}

.modal-window {
    background: rgba(15, 23, 42, 0.96);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    max-width: 420px;
    width: 100%;
    padding: 20px 22px;
}

.modal-header {
    margin-bottom: 10px;
    position: relative;
    padding-right: 30px;
}

.modal-title {
    font-size: 1.1rem;
    color: var(--text);
    margin: 0;
    padding-right: 10px;
}

.modal-body {
    margin-top: 6px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.95rem;
}

.modal-body .port-input {
    width: 100%;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.bubble {
    max-width: 78%;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    white-space: pre-wrap;
    word-break: break-word;
}

.msg.me .bubble {
    border-color: rgba(255, 7, 58, 0.35);
    background: linear-gradient(135deg, rgba(255, 7, 58, 0.18), rgba(255, 56, 96, 0.10));
}

.meta {
    font-size: 0.78rem;
    color: rgba(184, 194, 204, 0.85);
    margin-top: 6px;
}

.reply-preview {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--muted);
}

.reply-preview .msg-action-btn {
    float: right;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.2rem;
}

.msg-reply-quote {
    border-left: 3px solid var(--accent);
    padding-left: 8px;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--muted);
}

.msg-attachment-video {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
}

.edit-attachment-preview {
    margin-bottom: 8px;
}

.modal-body img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.modal-body video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

.msg-reply-name {
    font-weight: 600;
}

/* Блок поиска — только по высоте контента, не растягивать (список чатов получает оставшееся место) */
.sidebar > .sidebar-search {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.sidebar-toolbar-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-toolbar .sidebar-search {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

.sidebar-toolbar .sidebar-search input {
    width: 100%;
}

.sidebar-toolbar .search-results {
    margin-top: 8px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    min-height: 0;
}

.modal-header {
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text);
}

.composer {
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.12);
    padding: 12px 14px;
}

.composer-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.composer-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 12px 14px;
    color: white;
    outline: none;
}

.composer-input:focus {
    border-color: rgba(255, 7, 58, 0.55);
    box-shadow: 0 0 0 4px rgba(255, 7, 58, 0.12);
}

.composer-hint {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--muted);
}

/* Блок эмодзи: когда закрыт — не занимает места вообще */
.emoji-picker-wrap {
    display: none !important;
    height: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.emoji-picker-wrap.is-open {
    display: block !important;
    height: auto;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    max-height: 160px;
    overflow-y: auto;
}

.emoji-picker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.emoji-picker-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
}

.emoji-picker-btn:hover {
    background: rgba(255,255,255,0.15);
}

.composer-file-label {
    cursor: pointer;
    transition: none !important;
    animation: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.composer-file-label::after {
    display: none !important;
}

.composer-file-label:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: none !important;
    box-shadow: none !important;
}

.composer-file-label:active {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: none !important;
    box-shadow: none !important;
}

.composer-file-label .btn {
    transition: none !important;
    animation: none !important;
}

.composer-file-label .btn::after {
    display: none !important;
}

.composer-file-label .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none !important;
    box-shadow: none !important;
}

.composer-file-label .btn:active {
    background: rgba(255, 255, 255, 0.15);
    transform: none !important;
    box-shadow: none !important;
}

.conversation-item.pinned {
    border-color: rgba(255, 7, 58, 0.5);
    background: rgba(255, 7, 58, 0.08);
}

.conversation-item[draggable="true"] {
    user-select: none;
}

.conversation-item.dragging {
    opacity: 0.5;
}

.conv-pin-btn {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.conversation-item:hover .conv-pin-btn {
    opacity: 1;
}

/* Убираем большую анимацию «прямоугольника» у кнопки «Файл» в композере */
.composer .btn::after {
    display: none !important;
}

.composer .btn:hover {
    transform: none !important;
    box-shadow: none !important;
}

.composer .btn-secondary:hover {
    transform: none !important;
    box-shadow: none !important;
}

.composer .btn-secondary::after {
    display: none !important;
}

/* Убираем анимации в редакторе сообщений */
.modal-body .btn::after,
.edit-attachment-section .btn::after {
    display: none !important;
}

.modal-body .btn:hover,
.edit-attachment-section .btn:hover {
    transform: none !important;
    box-shadow: none !important;
}

.modal-body .btn-secondary::after,
.edit-attachment-section .btn-secondary::after {
    display: none !important;
}

.modal-body .btn-secondary:hover,
.edit-attachment-section .btn-secondary:hover {
    transform: none !important;
    box-shadow: none !important;
}

.edit-attachment-section label.btn::after {
    display: none !important;
}

.edit-attachment-section label.btn:hover {
    transform: none !important;
    box-shadow: none !important;
}

.msg-attachment-img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 8px;
    display: block;
    margin-top: 6px;
}

footer {
    margin-top: 0px;
    font-size: 14px;
    color: #6c757d;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

@media (max-width: 992px) {
    .side-decoration {
        width: 100px;
    }
}

@media (max-width: 768px) {
    html, body {
        height: 100%;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    body {
        padding: 8px;
    }

    .container {
        padding: 20px 16px;
    }

    .team-name {
        font-size: 2.2rem;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .btn {
        padding: 12px 20px;
        min-width: 0;
        min-height: 44px;
        font-size: 15px;
    }

    .btn.btn-small {
        padding: 8px 12px;
        font-size: 14px;
    }

    .service-item {
        padding: 20px;
    }

    .side-decoration, .corner-decoration {
        display: none;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    /* App shell: заполняем viewport, 100dvh учёт мобильной панели браузера */
    .app-shell {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 16px);
        min-height: 0;
        max-height: calc(100vh - 16px);
        gap: 8px;
    }

    @supports (height: 100dvh) {
        .app-shell {
            height: calc(100dvh - 16px);
            max-height: calc(100dvh - 16px);
        }
    }

    .sidebar {
        flex: 0 0 45%;
        min-height: 180px;
        max-height: 55vh;
    }

    .chat {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .chat-header {
        flex-shrink: 0;
        padding: 12px 14px;
    }

    .messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 12px 12px 4px;
        -webkit-overflow-scrolling: touch;
    }

    .composer {
        flex-shrink: 0;
        padding: 8px 12px 10px;
    }

    .composer-hint {
        margin-top: 4px;
        font-size: 0.8rem;
        line-height: 1.3;
    }

    /* Скрываем подсказку на мобильных — сайдбар виден, блок только мешает */
    #composerHint.composer-hint {
        display: none !important;
    }

    .reply-preview {
        padding: 6px 10px;
    }

    .emoji-picker-wrap.is-open {
        max-height: 120px;
        margin-bottom: 6px;
    }

    .composer-form {
        gap: 8px;
    }

    .composer-input {
        padding: 10px 12px;
        font-size: 16px;
    }

    .composer .btn, .composer .composer-file-label {
        padding: 8px 12px;
        min-width: 0;
    }

    .sidebar-toolbar {
        min-height: 0;
        overflow: hidden;
    }

    .sidebar-toolbar .sidebar-search {
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .sidebar-toolbar .search-results {
        max-height: 200px;
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        overflow-x: hidden;
        touch-action: pan-y;
        flex-shrink: 0;
    }

    .sidebar-header {
        padding: 12px 14px;
    }

    /* Профиль на мобильных */
    .container-profile {
        padding: 16px 12px !important;
    }

    .profile-avatar-wrap {
        width: 64px;
        height: 64px;
        margin-bottom: 16px;
    }

    .profile-collapse summary {
        padding: 14px 16px;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .page-center .form-card .port-input {
        min-height: 44px;
        font-size: 16px;
    }

    .page-center .form-card .buttons {
        flex-wrap: wrap;
        gap: 10px;
    }

    .page-center .form-card .buttons .btn {
        flex: 1;
        min-width: 120px;
    }

    .sidebar-header .btn {
        padding: 8px 12px;
    }

    .conversation-item {
        padding: 14px 12px;
        min-height: 48px;
    }

    .chat-title {
        font-size: 1rem;
    }

    .chat-subtitle {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 6px;
    }

    .container {
        padding: 12px 10px;
    }

    .team-name {
        font-size: 1.8rem;
        margin-bottom: 16px;
    }

    .form-card {
        padding: 20px 16px;
    }

    .page-center .container {
        max-width: 100%;
    }

    .app-shell {
        height: calc(100vh - 12px);
        max-height: calc(100vh - 12px);
    }

    @supports (height: 100dvh) {
        .app-shell {
            height: calc(100dvh - 12px);
            max-height: calc(100dvh - 12px);
        }
    }

    .sidebar {
        flex: 0 0 50%;
    }
}