body {
    font-family: var(--font-sans);
    background: var(--gradient-secondary);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: var(--color-lab-pr);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
}

.mobile-bottom-nav {
    display: none;
}

.container {
    background-color: var(--color-bg-pr);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    width: 300px;
    max-width: calc(100vw - 32px);
    text-align: center;
}

.logo {
    margin-bottom: 10px;
}

h1 {
    color: #333;
}

form {
    display: flex;
    flex-direction: column;
}

label {
    margin-top: 10px;
    text-align: left;
}

input {
    padding: 8px 12px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--color-brand-900);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

button {
    margin-top: 15px;
    padding: 10px;
    background-color: var(--color-brand-900);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

button:hover {
    background-color: #333;
    transform: translateY(-1px);
}

button:focus-visible {
    outline: 2px solid var(--color-brand-900);
    outline-offset: 2px;
}

a {
    display: block;
    margin-top: 10px;
    color: var(--color-brand-900);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.4;
}

/* Шрифты из Syncro Test */
@font-face {
    font-family: 'Outfit';
    src: url('/assets/outfit-latin-400-normal-BGsTXAXT.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Outfit';
    src: url('/assets/outfit-latin-ext-400-normal-5tcqmc2S.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Переменные цветов: черно-белый дизайн с градиентами */
:root {
    --font-sans: 'Outfit', ui-sans-serif, system-ui, sans-serif;
    --color-brand-900: #000000;
    --color-bg-pr: #ffffff;
    --color-bg-sc: #f8f9fa;
    --color-lab-pr: #000000;
    --color-lab-sc: #666666;
    --color-bord-pr: #e0e0e0;
    --color-fill-pr: #f8f9fa;
    --color-fill-sc: #e9ecef;
    --color-status-green: #22c55e;
    --color-status-yellow: #f59e0b;
    --color-status-red: #ef4444;
    --color-status-blue: #3b82f6;
    --gradient-primary: linear-gradient(135deg, #000000 0%, #333333 100%);
    --gradient-secondary: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.15);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --mobile-nav-h: 64px;
}

/* Общий контейнер */
.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    font-family: var(--font-sans);
    overflow: hidden;
    background: var(--gradient-secondary);
    backdrop-filter: blur(10px);
}

/* Левая панель */
.sidebar {
    width: 320px;
    background: var(--color-bg-pr);
    border-right: 1px solid var(--color-bord-pr);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    border-radius: 0;
}

.sidebar-header {
    padding: 20px;
    background: white;
    color: black;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    height: 70px;
    box-sizing: border-box;
    border-radius: 0;
    border-bottom: 1px solid #cccccc;
    position: relative;
}

.sidebar-left-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.sidebar-left-actions .user-avatar {
    margin-right: 0;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.sidebar-header .logo img {
    vertical-align: middle;
}

.sidebar-header .logo {
    margin-right: 10px;
}

.search-container {
    display: flex;
    align-items: center;
    background: #f0f0f0;
    border-radius: 20px;
    padding: 3px 8px;
    margin: 0;
    height: 40px;
    box-sizing: border-box;
    flex: 1 1 auto;
    min-width: 0;
}

.search-container svg {
    margin-right: 5px;
}

.search-container input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    width: 100%;
    min-width: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    margin-right: 10px;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dropdown-menu {
    position: absolute;
    top: 50px;
    left: -5px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    text-decoration: none;
    color: black;
}

.dropdown-menu a:hover {
    background: #f0f0f0;
}

.notif-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: black;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 0;
    font-size: 0;
    align-self: center;
    position: relative;
}

.notif-btn svg {
    display: block;
    transform: translateY(-2px);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: white;
    border: 2px solid #ff3b30;
    color: #ff3b30;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
}

.notif-btn:hover {
    background: #f0f0f0;
}

.notif-menu {
    position: absolute;
    top: 50px;
    left: 12px;
    right: auto;
    background: white;
    border: 1px solid #ccc;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 12000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    width: calc(100% - 24px);
    max-width: 600px;
    max-height: calc(100vh - 90px);
    overflow: hidden;
    box-sizing: border-box;
}

.notif-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.notif-menu__title {
    padding: 10px 14px;
    font-weight: 600;
    border-bottom: 1px solid #ccc;
}

.notif-menu__empty {
    padding: 10px 14px;
    opacity: 0.8;
}

.notif-menu__list {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.notif-item {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item__msg {
    font-size: 13px;
}

.notif-item__title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
}

.notif-item__time {
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.7;
}

.notif-item__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-item__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.notif-item__avatar-fallback {
    font-size: 12px;
    font-weight: 700;
    color: black;
}

.notif-item__body {
    min-width: 0;
    flex: 1 1 auto;
}

.notif-item__del {
    border: none;
    background: transparent;
    color: black;
    opacity: 0.6;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 2px;
    flex: 0 0 auto;
}

.notif-item__del:hover {
    opacity: 1;
}

.user-list {
    flex: 1;
    overflow-y: auto;
}

.user-list-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px;
    color: var(--color-lab-pr);
    opacity: 0.8;
}

.user-list-empty__icon {
    margin-bottom: 10px;
    color: var(--color-lab-pr);
    opacity: 0.9;
}

.user-list-empty__text {
    font-size: 14px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-bord-pr);
    transition: var(--transition);
    height: auto;
    min-height: 64px;
    box-sizing: border-box;
    border-radius: var(--radius-md);
    margin: 4px 8px;
    position: relative;
    padding-right: 56px;
}

.user-item:hover {
    background: var(--color-fill-pr);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.user-item.selected {
    background: transparent;
    color: inherit;
    box-shadow: none;
}

.user-item.selected .chat-name,
.user-item.selected .last-message,
.user-item.selected .last-time {
    color: inherit;
}

.user-item .avatar {
    margin-right: 15px;
    flex-shrink: 0;
}

.user-item .chat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-item .chat-name {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    min-width: 0;
}

.user-item .chat-name__text {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.user-item .last-message.last-message--unread {
    font-weight: 700;
    opacity: 1;
}

.user-item .last-message {
    font-size: 14px;
    color: var(--color-lab-pr);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.verified-icon {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    margin-left: 6px;
}

.verified-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    outline: none;
}

.verified-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    margin-top: 8px;
    display: block;
    width: max-content;
    padding: 6px 10px;
    background: var(--color-bg-pr);
    color: var(--color-lab-pr);
    border: 1px solid var(--color-bord-pr);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    font-size: 12px;
    line-height: 1.25;
    max-width: 240px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.verified-tooltip:hover::after,
.verified-tooltip:focus::after,
.verified-tooltip:focus-visible::after {
    opacity: 1;
    visibility: visible;
}
.user-item .last-time {
    font-size: 12px;
    color: var(--color-lab-pr);
    opacity: 0.5;
    position: absolute;
    right: 12px;
    bottom: 10px;
    align-self: auto;
    margin-top: 0;
}

.user-item .chat-del-btn {
    flex: 0 0 auto;
    margin-left: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-lab-pr);
    opacity: 0;
    cursor: pointer;
    line-height: 1;
    pointer-events: none;
    position: absolute;
    top: 6px;
    right: 6px;
    bottom: auto;
    left: auto;
    transform: none;
}

.user-item:hover .chat-del-btn {
    opacity: 1;
    pointer-events: auto;
}

.user-item:focus-within .chat-del-btn {
    opacity: 1;
    pointer-events: auto;
}

.user-item.selected .chat-del-btn {
    color: rgba(255, 255, 255, 0.9);
    opacity: 0.9;
}

/* Стили для чата */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-pr);
    backdrop-filter: blur(10px);
    border-radius: 0;
}

.chat-header {
    padding: 20px;
    background: white;
    color: black;
    height: 70px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0;
    border-bottom: 1px solid #cccccc;
}

.chat-partner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    cursor: pointer;
}

.chat-partner-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-partner h1 {
    margin: 0;
    min-width: 0;
    display: flex;
    align-items: center;
    overflow: visible;
}

.chat-title__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    margin-right: 10px;
}

.chat-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--color-bg-sc);
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-bord-pr) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--color-bord-pr);
    border-radius: 3px;
}

.chat-antiphish {
    margin: 12px 24px 0;
    padding: 10px 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--color-fill-sc);
    border: 1px solid var(--color-bord-pr);
    border-radius: var(--radius-lg);
    color: var(--color-lab-pr);
}

.chat-antiphish[hidden] {
    display: none !important;
}

.chat-antiphish__body {
    min-width: 0;
}

.chat-antiphish__title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.chat-antiphish__text {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
    white-space: pre-line;
    opacity: 0.9;
}

.chat-antiphish__close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-lab-pr);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    flex-shrink: 0;
}

.chat-antiphish__close:hover {
    opacity: 1;
}

.date-separator {
    align-self: center;
    margin: 8px 0;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--color-lab-sc);
    background: var(--color-fill-sc);
    border: 1px solid var(--color-bord-pr);
    border-radius: var(--radius-sm);
    line-height: 1.2;
}

.message {
    display: flex;
    align-items: flex-end;
    animation: fadeIn 0.4s ease-out;
    margin-bottom: 4px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.my-message {
    justify-content: flex-end;
}

.other-message {
    justify-content: flex-start;
}

.system-message {
    justify-content: center;
}

.system-message .message-content {
    max-width: 80%;
    background: var(--color-fill-sc);
    color: var(--color-lab-pr);
    border: 1px solid var(--color-bord-pr);
    box-shadow: none;
    text-align: center;
}

.message-content {
    max-width: 75%;
    padding: 10px 12px;
    border-radius: var(--radius-lg);
    background-color: var(--color-bg-pr);
    box-shadow: var(--shadow-soft);
    word-wrap: break-word;
    position: relative;
    line-height: 1.5;
    font-size: 14px;
    transition: var(--transition);
}

.message-content.has-delete {
    padding-right: 34px;
}

.message-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    opacity: 0;
    cursor: pointer;
    pointer-events: none;
}

.message-content:hover .message-delete,
.message-content:focus-within .message-delete {
    opacity: 0.85;
    pointer-events: auto;
}

.message-delete:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.message-text {
    white-space: pre-wrap;
}

.message-attachment {
    margin-top: 6px;
}

.message-attachment-img {
    display: block;
    max-width: 320px;
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.chat-image-viewer {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    padding: 16px;
    box-sizing: border-box;
}

.chat-image-viewer[hidden] {
    display: none !important;
}

.chat-image-viewer__panel {
    position: relative;
    width: 100%;
    max-width: 960px;
    max-height: 92vh;
}

.chat-image-viewer__img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 92vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    background: var(--color-bg-pr);
}

.chat-image-viewer__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.chat-image-viewer__close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.message-attachment-file {
    display: inline-block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: underline;
    color: inherit;
    opacity: 0.95;
}

.message-attachment-deleted {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: var(--radius-md);
    background: var(--color-fill-sc);
    border: 1px solid var(--color-bord-pr);
    font-size: 12px;
    color: var(--color-lab-sc);
}

.my-message .message-content {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-md) var(--radius-md) var(--radius-sm) var(--radius-md);
}

.other-message .message-content {
    background-color: var(--color-bg-pr);
    color: var(--color-lab-pr);
    border-radius: var(--radius-md) var(--radius-md) var(--radius-md) var(--radius-sm);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 16px;
    box-shadow: var(--shadow-soft);
}

.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: var(--shadow-soft);
}

.message small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.7;
    text-align: right;
}

.chat-input {
    padding: 10px 24px 10px 24px;
    background-color: var(--color-bg-pr);
    border-top: 1px solid var(--color-bord-pr);
    display: flex;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.chat-input form {
    display: flex;
    width: 100%;
    gap: 8px;
    align-items: center;
    flex-direction: row;
}

.chat-input textarea {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--color-bord-pr);
    border-radius: var(--radius-lg);
    outline: none;
    font-size: 16px;
    transition: var(--transition);
    background: var(--color-bg-pr);
    resize: none;
    height: 44px;
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    max-height: 140px;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.4;
}

.chat-input textarea:focus {
    border-color: var(--color-brand-900);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.chat-input .send-btn,
.chat-input .attach-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    margin-top: 0;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.chat-input .send-btn:hover,
.chat-input .attach-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
}

.chat-input .attach-btn {
    background: var(--color-fill-sc);
    color: var(--color-lab-pr);
}

.chat-input__field {
    position: relative;
    flex: 1;
    width: 100%;
}

.chat-input__field textarea {
    padding-right: 52px;
}

.chat-input .emoji-btn {
    position: absolute;
    right: 10px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    transform: none;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-lab-sc);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input .emoji-btn svg {
    display: block;
    pointer-events: none;
}

.chat-input .emoji-btn:hover {
    background: var(--color-fill-pr);
}

.chat-input .emoji-btn:disabled {
    cursor: default;
}

.chat-input .emoji-picker {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: 280px;
    max-width: calc(100vw - 32px);
    max-height: 240px;
    overflow: auto;
    background: var(--color-bg-pr);
    border: 1px solid var(--color-bord-pr);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    z-index: 3500;
}

.chat-input .emoji-picker[hidden] {
    display: none;
}

.chat-input .emoji-picker__item {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input .emoji-picker__item:hover {
    background: var(--color-fill-pr);
}

.chat-input .attach-btn svg path {
    stroke: var(--color-lab-pr);
}

/* Медиа запросы для мобильных устройств */
@media (max-width: 768px) {
    body.has-mobile-nav {
        display: block;
        height: auto;
        min-height: 100vh;
        padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    }

    body.has-mobile-nav.app-shell {
        padding-bottom: 0;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    body.has-mobile-nav .container {
        margin: 12px auto;
    }

    body.has-mobile-nav .app-container {
        padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    }

    body.has-mobile-nav .chat-input {
        margin-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    }

    body.has-mobile-nav .chat-messages {
        padding-bottom: calc(12px + var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
        background: var(--color-bg-pr);
        border-top: 1px solid var(--color-bord-pr);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
        z-index: 3000;
    }

    .mobile-bottom-nav__item {
        flex: 1 1 0;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--color-lab-pr);
        border: none;
        background: transparent;
        padding: 10px;
        margin: 0;
        border-radius: var(--radius-md);
        cursor: pointer;
        min-height: 44px;
    }

    .mobile-bottom-nav__item:active {
        background: var(--color-fill-pr);
    }

    .mobile-bottom-nav__home {
        flex: 0 0 auto;
        width: 54px;
        height: 54px;
        border-radius: var(--radius-lg);
        background: var(--gradient-primary);
        box-shadow: var(--shadow-soft);
    }

    .mobile-bottom-nav__home:active {
        background: var(--gradient-primary);
    }

    .mobile-bottom-nav__icon {
        width: 24px;
        height: 24px;
        display: block;
    }

    .mobile-bottom-nav__home .mobile-bottom-nav__icon {
        width: 24px;
        height: 24px;
    }

    .mobile-bottom-nav__home .mobile-bottom-nav__icon path {
        stroke: #fff;
    }

    .mobile-bottom-nav__avatar {
        width: 30px;
        height: 30px;
        border-radius: 999px;
        overflow: hidden;
        background: var(--gradient-primary);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        line-height: 1;
        flex: 0 0 auto;
    }

    .mobile-bottom-nav__avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Чат: мобильный режим "список" ↔ "чат" (без split-screen) */
    .app-container {
        flex-direction: row;
        height: 100vh;
        height: 100dvh;
    }

    .sidebar,
    .chat-container {
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 0;
    }

    .chat-container {
        display: none;
    }

    body.mobile-chat-open .sidebar {
        display: none;
    }

    body.mobile-chat-open .chat-container {
        display: flex;
    }

    .sidebar-header,
    .chat-header {
        padding: 12px;
        height: auto;
    }

    .chat-container {
        min-height: 0;
    }

    .chat-messages {
        padding: 12px;
        min-height: 0;
    }

    .chat-input {
        padding: 10px;
    }

    /* iOS: не зумит поля ввода */
    .search-container input,
    .chat-input textarea,
    input,
    textarea,
    select {
        font-size: 16px;
    }

    .message-content {
        max-width: 88%;
    }

    .message-attachment-img {
        max-width: min(320px, 70vw);
    }

    /* Админка */
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        padding: 10px;
        border-right: 0;
        border-bottom: 1px solid var(--color-bord-pr);
    }

    .admin-nav {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 6px;
    }

    .admin-nav-item {
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .admin-topbar {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .admin-search {
        width: 100%;
    }

    .admin-search input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sidebar {
        height: 100%;
    }

    .user-item {
        padding: 10px 14px;
        margin: 4px 6px;
        padding-right: 56px;
    }
}

/* =========================
   Админка (современный UI)
   ========================= */

.admin-body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    background: var(--gradient-secondary);
    color: var(--color-lab-pr);
}

.admin-layout a {
    margin-top: 0;
}

.admin-layout a:hover {
    text-decoration: none;
}

.admin-layout {
    width: 100vw;
    height: 100vh;
    display: flex;
    background: var(--gradient-secondary);
    overflow: hidden;
}

.admin-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--color-bg-pr);
    border-right: 1px solid var(--color-bord-pr);
    display: flex;
    flex-direction: column;
    padding: 14px;
    box-sizing: border-box;
}

.admin-sidebar-header {
    padding: 6px 6px 14px 6px;
}

.admin-admin {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-admin-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-soft);
}

.admin-admin-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-admin-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
}

.admin-admin-meta {
    min-width: 0;
}

.admin-brand {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-lab-pr);
}

.admin-subtitle {
    font-size: 12px;
    color: var(--color-lab-sc);
    margin-top: 2px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    color: var(--color-lab-pr);
    text-decoration: none;
    transition: var(--transition);
    line-height: 1.2;
}

.admin-nav-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin-right: 8px;
}

.admin-nav-item:hover {
    background: var(--color-fill-pr);
    transform: none;
}

.admin-nav-item.is-active {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-soft);
}

.admin-nav-item.is-active .admin-nav-icon {
    filter: invert(1);
}

.admin-nav-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--color-status-red);
    color: var(--color-bg-pr);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.admin-sidebar-footer {
    margin-top: auto;
    padding: 12px 6px 6px 6px;
}

.admin-hint {
    font-size: 12px;
    color: var(--color-lab-sc);
}

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 16px;
    box-sizing: border-box;
    overflow: auto;
}

.admin-topbar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 12px;
}

.admin-topbar-title h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-lab-pr);
}

.admin-topbar-meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-lab-sc);
}

.admin-search {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-search input {
    width: min(340px, 52vw);
    padding: 8px 10px;
    border: 1px solid var(--color-bord-pr);
    border-radius: var(--radius-md);
    background: var(--color-bg-pr);
    box-sizing: border-box;
    height: 36px;
}

.admin-card {
    background: var(--color-bg-pr);
    border: 1px solid var(--color-bord-pr);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--color-lab-sc);
    background: var(--color-fill-pr);
    border-bottom: 1px solid var(--color-bord-pr);
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-bord-pr);
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: var(--transition);
}

.admin-table tbody tr:hover {
    background: var(--color-fill-pr);
}

.admin-th-actions,
.admin-td-actions {
    text-align: right;
    white-space: nowrap;
}

.admin-td-actions form {
    margin: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.admin-user {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.admin-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-soft);
    display: block;
    text-decoration: none;
}

.admin-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-user-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.admin-user-meta {
    min-width: 0;
}

.admin-user-name {
    font-weight: 700;
    color: var(--color-lab-pr);
    line-height: 1.2;
    font-size: 13px;
}

.admin-user-login {
    margin-top: 2px;
    font-size: 12px;
    color: var(--color-lab-sc);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(44vw, 520px);
}

.admin-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin: 0;
}

.admin-btn {
    margin-top: 0;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-size: 12px;
    line-height: 1;
}

.admin-btn:hover {
    transform: none;
    box-shadow: none;
}

.admin-btn-secondary {
    background: var(--color-fill-sc);
    color: var(--color-lab-pr);
    border: 1px solid var(--color-bord-pr);
}

.admin-btn-danger {
    background: var(--gradient-primary);
    border: 1px solid transparent;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--color-bord-pr);
    background: var(--color-bg-pr);
    color: var(--color-lab-pr);
}

.admin-badge.is-admin {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
}

.admin-badge.is-user {
    background: var(--color-bg-pr);
}

.admin-badge.is-active {
    background: var(--color-fill-pr);
}

.admin-badge.is-blocked {
    background: var(--color-fill-sc);
}

.admin-muted {
    color: var(--color-lab-sc);
}

/* Bug tracker priority dot */
.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 10px;
    margin-right: 8px;
    vertical-align: middle;
}

.priority-dot.is-green {
    background: var(--color-status-green);
}

.priority-dot.is-yellow {
    background: var(--color-status-yellow);
}

.priority-dot.is-red {
    background: var(--color-status-red);
}

/* =========================
   Bug tracker (pages/*)
   ========================= */

.bt-topbar-title {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bt-logo-link {
    display: inline-flex;
    margin: 0;
}

.bt-logo-img {
    display: block;
}

.bt-topbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bt-topbar-link {
    display: inline-flex;
    width: auto;
}

.bt-avatar-link {
    display: inline-flex;
    margin: 0;
}

.bt-form-error {
    color: var(--color-status-red);
}

.bt-card {
    overflow: hidden;
}

.bt-card--padded {
    padding: 14px;
}

.bt-card-head {
    padding: 14px 14px 0 14px;
}

.bt-card-title {
    font-weight: 700;
    color: var(--color-lab-pr);
    line-height: 1.2;
    font-size: 14px;
}

.bt-card-subtitle {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-lab-sc);
}

.bt-table-wrap {
    margin-top: 10px;
}

.bt-empty-row {
    padding-top: 18px;
    padding-bottom: 18px;
}

.bt-bug-link {
    display: inline;
    margin: 0;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.bt-bug-link:hover {
    text-decoration: underline;
}

.bt-mini-avatar {
    width: 24px;
    height: 24px;
    box-shadow: none;
}

.bt-mini-avatar__fallback {
    font-size: 12px;
}

.bt-user-login {
    max-width: none;
}

.bt-user-login--no-ellipsis {
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
}

.bt-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.bt-section-title {
    margin-top: 10px;
    font-weight: 700;
    color: var(--color-lab-pr);
    font-size: 13px;
}

.bt-pretext {
    margin-top: 10px;
    color: var(--color-lab-pr);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.bt-muted-spacer {
    margin-top: 8px;
}

.bt-danger-text {
    max-width: none;
    color: var(--color-status-red);
}

.bt-comment-list {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

.bt-comment {
    border: 1px solid var(--color-bord-pr);
    border-radius: var(--radius-md);
    padding: 10px;
    background: var(--color-bg-pr);
}

.bt-comment-head {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bt-comment-meta {
    min-width: 0;
    flex: 1;
}

.bt-comment-meta__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.bt-comment-time {
    font-size: 12px;
    white-space: nowrap;
}

.bt-comment-body {
    margin-top: 8px;
    color: var(--color-lab-pr);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.bt-comment-body--system {
    color: var(--color-lab-sc);
    font-size: 12px;
}

.bt-system-note {
    text-align: center;
    color: var(--color-lab-sc);
    font-size: 12px;
    padding: 8px 10px;
}

.bt-comment-form {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.bt-form-field {
    display: grid;
    gap: 6px;
}

.bt-textarea {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-bord-pr);
    background: var(--color-bg-pr);
    box-sizing: border-box;
    resize: vertical;
}

/* Row actions (hamburger popover) */
.admin-row-menu {
    position: relative;
    display: inline-block;
}

.admin-row-menu > summary {
    list-style: none;
}

.admin-row-menu > summary::-webkit-details-marker {
    display: none;
}

.admin-row-menu-trigger {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--color-bord-pr);
    background: var(--color-bg-pr);
    color: var(--color-lab-pr);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.admin-row-menu-trigger:hover {
    background: var(--color-fill-pr);
}

.admin-row-menu-trigger:focus {
    outline: none;
}

.admin-row-menu-trigger:focus-visible {
    outline: 2px solid var(--color-bord-pr);
    outline-offset: 2px;
}

.admin-row-menu-icon {
    width: 16px;
    height: 16px;
    display: block;
    font-size: 16px;
    line-height: 1;
}

.admin-row-menu-popover {
    position: fixed;
    width: 220px;
    background: var(--color-bg-pr);
    border: 1px solid var(--color-bord-pr);
    border-radius: 12px;
    box-shadow: var(--shadow-strong);
    padding: 6px;
    z-index: 50;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    overflow: auto;
    box-sizing: border-box;
}

.admin-row-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--color-lab-pr);
    font: inherit;
    font-size: 13px;
    line-height: 1.25;
    padding: 10px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    margin: 0;
    text-decoration: none;
}

.admin-row-menu-item:hover {
    background: var(--color-fill-pr);
}

.admin-row-menu[open] .admin-row-menu-trigger {
    background: var(--color-fill-pr);
}

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.admin-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.admin-modal__panel {
    position: absolute;
    left: 50%;
    top: 12vh;
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 24px));
    background: var(--color-bg-pr);
    border: 1px solid var(--color-bord-pr);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-strong);
    padding: 12px;
    box-sizing: border-box;
}

/* Блокировка: строго по центру экрана */
#blockedModal .admin-modal__panel {
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Восстановление пароля: строго по центру экрана */
#forgotPasswordModal .admin-modal__panel {
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Настройки: чтобы длинные списки (сессии/и т.п.) не вылезали за экран */
#settingsModal .admin-modal__panel {
    max-height: calc(100vh - 24px);
    overflow: auto;
}

/* Поддержка: большие окна и удобная прокрутка */
#supportModal .admin-modal__panel,
#supportThreadModal .admin-modal__panel {
    top: 10vh;
    width: min(720px, calc(100vw - 24px));
    max-height: calc(100vh - 120px);
    overflow: auto;
}

#supportThreadMessages {
    max-height: 40vh;
    overflow: auto;
}

/* Лендинг (только главная) */
body.landing-page {
    display: flex;
    min-height: 100vh;
    height: auto;
    padding: 32px 16px;
    justify-content: center;
    align-items: center;
}

.landing {
    width: 100%;
}

.landing__shell {
    width: min(720px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    align-items: stretch;
}

.landing__left {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--color-bord-pr);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    text-align: center;
}

.landing__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 16px;
}

.landing__logo {
    display: block;
    border-radius: 14px;
    margin-bottom: 10px;
}

.landing__brand-title {
    font-weight: 900;
    color: var(--color-lab-pr);
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-size: 24px;
}

.landing__brand-desc {
    margin-top: 6px;
    color: var(--color-lab-sc);
    font-size: 13px;
}

.landing__title {
    margin: 0 0 8px 0;
    font-size: 34px;
    letter-spacing: -0.04em;
    color: var(--color-lab-pr);
}

.landing__subtitle {
    margin: 0 0 16px 0;
    color: var(--color-lab-sc);
    font-size: 15px;
}

.landing__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    justify-content: center;
}

.landing__form-title {
    margin: 8px 0 10px 0;
    text-align: center;
    color: var(--color-lab-pr);
    letter-spacing: -0.02em;
}

.landing__form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.landing__form label {
    margin-top: 8px;
}

body.landing-page .landing__form-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

body.landing-page .landing__form-actions .landing__btn {
    flex: 1 1 160px;
}

body.landing-page .landing__form input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 14px;
    border-color: var(--color-bord-pr);
}

body.landing-page .landing__left .error {
    text-align: center;
}

.landing__btn--full {
    width: 100%;
    box-sizing: border-box;
}

body.landing-page button.landing__btn {
    margin-top: 0;
}

.landing__divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 12px 0;
    color: var(--color-lab-sc);
    font-size: 13px;
}

.landing__divider::before,
.landing__divider::after {
    content: "";
    height: 1px;
    background: var(--color-bord-pr);
    flex: 1 1 auto;
}

.landing__note {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--color-bord-pr);
    color: var(--color-lab-sc);
    font-size: 12px;
    text-align: center;
}

.landing__note--outside {
    margin-top: 12px;
    padding-top: 0;
    border-top: 0;
}

.landing__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--color-bord-pr);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    user-select: none;
}

.landing__btn--primary {
    background: var(--color-brand-900);
    color: #fff;
    border-color: var(--color-brand-900);
}

.landing__btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
}

.landing__btn--ghost {
    background: transparent;
    color: var(--color-lab-pr);
}

.landing__btn--ghost:hover {
    background: var(--color-fill-pr);
    text-decoration: none;
}

.landing__meta {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--color-bord-pr);
    color: var(--color-lab-sc);
    font-size: 13px;
}

.landing__card {
    background: var(--color-bg-pr);
    border: 1px solid var(--color-bord-pr);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 18px;
    box-sizing: border-box;
}

.landing__card-title {
    font-weight: 900;
    color: var(--color-lab-pr);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.landing__list {
    margin: 0;
    padding-left: 18px;
    color: var(--color-lab-sc);
}

.landing__list li {
    margin: 8px 0;
}

@media (max-width: 860px) {
    .landing__title {
        font-size: 30px;
    }
}

/* Auth-страницы: бренд-блок по центру */
body.auth-page .container {
    width: min(360px, 100%);
    padding: 22px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

body.auth-page .auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 14px;
}

body.auth-page .auth-brand__logo {
    display: block;
    border-radius: 14px;
    margin-bottom: 10px;
}

body.auth-page .auth-brand__title {
    font-weight: 900;
    color: var(--color-lab-pr);
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-size: 22px;
}

body.auth-page .auth-brand__desc {
    margin-top: 6px;
    color: var(--color-lab-sc);
    font-size: 13px;
}

body.auth-page .auth-title {
    margin-top: 6px;
    margin-bottom: 10px;
    text-align: center;
    color: var(--color-lab-pr);
}

body.auth-page input {
    border-radius: 14px;
    border-color: var(--color-bord-pr);
}

body.auth-page--register button[type="submit"] {
    border-radius: 12px;
}

body.auth-page--login .auth-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

body.auth-page--login .auth-form-actions button {
    flex: 1 1 160px;
    margin-top: 0;
}

body.auth-page--login .auth-forgot {
    background: transparent;
    color: var(--color-lab-pr);
    border: 1px solid var(--color-bord-pr);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
}

body.auth-page--login .auth-forgot:hover {
    background: var(--color-fill-pr);
}

.support-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.support-dot.is-green {
    background: var(--color-status-green);
}

.support-dot.is-yellow {
    background: var(--color-status-yellow);
}

.support-dot.is-red {
    background: var(--color-status-red);
}

.admin-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 4px 10px 4px;
}

.admin-modal__title {
    font-weight: 800;
    color: var(--color-lab-pr);
    font-size: 14px;
}

.admin-modal__close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--color-bord-pr);
    background: var(--color-bg-pr);
    color: var(--color-lab-pr);
    cursor: pointer;
}

.admin-modal__form {
    display: grid;
    gap: 10px;
    padding: 0 4px 4px 4px;
}

.admin-modal__label {
    font-size: 12px;
    color: var(--color-lab-sc);
}

.admin-modal__hint {
    font-size: 12px;
    color: var(--color-lab-pr);
    background: var(--color-fill-pr);
    border: 1px solid var(--color-bord-pr);
    border-radius: 12px;
    padding: 8px 10px;
}

.admin-modal__hint--warning {
    border-color: var(--color-status-yellow);
}

.admin-modal__input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--color-bord-pr);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--color-bg-pr);
    color: var(--color-lab-pr);
}

.settings-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-block__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-lab-pr);
}

/* Табы для поддержки */
.support-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.support-tab {
    border: 1px solid var(--color-bord-pr);
    background: var(--color-bg-pr);
    color: var(--color-lab-pr);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    margin: 0;
}

.support-tab:hover {
    background: var(--color-fill-pr);
}

.support-tab.is-active {
    background: var(--color-lab-pr);
    color: var(--color-bg-pr);
    border-color: var(--color-lab-pr);
}

.settings-sessions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-session {
    display: flex;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--color-bord-pr);
    border-radius: 12px;
    background: var(--color-bg-pr);
    min-width: 0;
}

.settings-session__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-session__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.settings-session__ua {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.settings-session__meta {
    font-size: 12px;
    color: var(--color-lab-sc);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.support-thread-time {
    font-size: 11px;
    color: var(--color-lab-sc);
    opacity: 0.85;
    white-space: nowrap;
}

.support-system-message {
    text-align: center;
    color: var(--color-lab-sc);
    font-size: 12px;
    padding: 6px 0;
}

.settings-table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--color-bord-pr);
    border-radius: 12px;
    background: var(--color-bg-pr);
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.settings-table th,
.settings-table td {
    text-align: left;
    vertical-align: top;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-bord-pr);
    font-size: 12px;
    color: var(--color-lab-pr);
}

.settings-table thead th {
    font-weight: 800;
    background: var(--color-fill-pr);
}

.settings-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-modal__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

.admin-modal__btn {
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--gradient-primary);
    color: #fff;
    cursor: pointer;
}

.admin-modal__btn--ghost {
    background: var(--color-fill-pr);
    color: var(--color-lab-pr);
    border: 1px solid var(--color-bord-pr);
}

.admin-modal__btn--danger {
    background: var(--color-status-red);
    color: #fff;
    border: 1px solid var(--color-status-red);
}

.admin-support-actions {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
}

.admin-support-actions__group {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}

.admin-support-actions > .admin-modal__btn {
    flex: 0 0 auto;
}

.admin-support-actions .admin-modal__btn {
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-support-actions .admin-modal__input {
    height: 40px;
}

.profile-modal__top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.profile-modal__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    border: 1px solid var(--color-bord-pr);
    background: var(--color-fill-pr);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.presence-dot {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--color-bg-pr);
}

.profile-modal__avatar:hover {
    background: var(--color-fill-sc);
}

.profile-modal__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-modal__avatar-fallback {
    font-weight: 800;
    color: var(--color-lab-pr);
}

.profile-modal__meta {
    min-width: 0;
    flex: 1 1 auto;
}

.cropper {
    display: grid;
    gap: 10px;
}

.cropper__viewport {
    width: 260px;
    height: 260px;
    border-radius: 16px;
    border: 1px solid var(--color-bord-pr);
    background: var(--color-fill-pr);
    overflow: hidden;
    position: relative;
    touch-action: none;
    margin: 0 auto;
}

.cropper__viewport img {
    position: absolute;
    left: 0;
    top: 0;
    user-select: none;
    -webkit-user-drag: none;
}

.admin-msg-btn {
    margin-left: 10px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--color-bord-pr);
    background: var(--color-fill-pr);
    color: var(--color-lab-pr);
    cursor: pointer;
    font-size: 12px;
}

.admin-msg-btn:hover {
    background: var(--color-bg-pr);
}

.admin-fade-in {
    animation: adminFadeIn 220ms ease-out;
}

@keyframes adminFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-bord-pr);
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    .admin-nav {
        flex-direction: row;
        flex-wrap: wrap;
        margin-top: 0;
    }
    .admin-sidebar-footer {
        display: none;
    }
    .admin-search input {
        width: 55vw;
    }
}