/* Support portal — support.perfecteam.ru */
body.support-portal {
    --support-bg-page: #050508;
    --support-bg-rail: #0a0a10;
    --support-bg-header: #050508;
    --support-bg-elevated: #12121a;
    --support-bg-card: rgba(12, 12, 18, 0.72);
    --support-bg-input: rgba(255, 255, 255, 0.06);
    --support-text: #e8ecf8;
    --support-text-heading: #f3f6ff;
    --support-text-muted: #8f9ab8;
    --support-text-secondary: #b8c0d8;
    --support-border: rgba(255, 255, 255, 0.06);
    --support-border-strong: rgba(255, 255, 255, 0.1);
    --support-online-dot-border: #050508;
    margin: 0;
    background: var(--support-bg-page);
    color: var(--support-text);
    overflow: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.38) var(--support-bg-page);
}

html:has(body.support-portal) {
    background: #050508;
}

html:has(body.support-portal.light-theme) {
    background: #eceef2;
}

body.support-portal.light-theme {
    --support-bg-page: #eceef2;
    --support-bg-rail: #e2e5ea;
    --support-bg-header: #eceef2;
    --support-bg-elevated: #ffffff;
    --support-bg-card: #ffffff;
    --support-bg-input: #ffffff;
    --support-text: #334155;
    --support-text-heading: #0f172a;
    --support-text-muted: #64748b;
    --support-text-secondary: #475569;
    --support-border: rgba(15, 23, 42, 0.08);
    --support-border-strong: rgba(15, 23, 42, 0.14);
    --support-online-dot-border: #eceef2;
    color: var(--support-text);
    background: var(--support-bg-page);
    color-scheme: light;
}

body.support-portal * {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.38) var(--support-bg-page);
}

body.support-portal::-webkit-scrollbar,
body.support-portal *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body.support-portal::-webkit-scrollbar-track,
body.support-portal *::-webkit-scrollbar-track {
    background: var(--support-bg-page);
}

body.support-portal::-webkit-scrollbar-thumb,
body.support-portal *::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.38);
    border-radius: 999px;
    border: 2px solid var(--support-bg-page);
}

body.support-portal.light-theme {
    scrollbar-color: rgba(100, 116, 139, 0.45) var(--support-bg-page);
}

body.support-portal.light-theme * {
    scrollbar-color: rgba(100, 116, 139, 0.45) var(--support-bg-page);
}

body.support-portal.light-theme::-webkit-scrollbar-thumb,
body.support-portal.light-theme *::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.45);
    border-color: var(--support-bg-page);
}
body.support-portal.support-portal-locked .support-rail,
body.support-portal.support-portal-locked .support-header,
body.support-portal.support-portal-locked .support-view,
body.support-portal.support-portal-locked #tickets-inbox-main {
    display: none !important;
}
body.support-portal.support-portal-locked #tickets-inbox-login {
    display: flex !important;
}
body.support-portal.support-login-screen .support-rail,
body.support-portal.support-login-screen .support-header {
    display: none !important;
}
body.support-portal.support-login-screen .support-view {
    display: none !important;
}
body.support-portal.support-login-screen #tickets-inbox-login {
    display: flex !important;
}
body.support-portal:not(.support-portal-locked):not(.support-login-screen) .support-rail,
body.support-portal:not(.support-portal-locked):not(.support-login-screen) .support-header {
    display: flex;
}
body.support-portal .app-container,
body.support-portal .site-left-rail {
    display: none !important;
}
.support-app {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    height: var(--support-vvh, 100dvh);
    max-height: var(--support-vvh, 100dvh);
    min-height: 0;
    overflow: hidden;
    background: var(--support-bg-page);
}
.support-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    background: var(--support-bg-rail);
    border-right: 1px solid var(--support-border);
    position: relative;
    z-index: 40;
    overflow: visible;
}
.support-rail-brand {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c6df0, #a855f7);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.support-rail-online {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    border: none;
    background: transparent;
    color: #9aa6c4;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
.support-rail-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a855f7;
    animation: support-online-pulse 1.4s ease-in-out infinite;
}
@keyframes support-online-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.5); }
    50% { opacity: 0.65; box-shadow: 0 0 0 6px rgba(168, 85, 247, 0); }
}
.support-rail-online-popover {
    position: absolute;
    left: calc(100% + 8px);
    top: 44px;
    width: min(260px, calc(100vw - 88px));
    max-height: min(420px, calc(100vh - 96px));
    padding: 12px;
    background: var(--support-bg-elevated);
    border: 1px solid var(--support-border-strong);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    z-index: 120;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.support-rail-online-popover[hidden] {
    display: none !important;
}
.support-rail-online-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.support-rail-online-title {
    margin: 0 0 10px;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #8f9ab8;
    text-transform: uppercase;
}
.support-rail-online-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 4px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
}
.support-rail-online-item:hover {
    background: rgba(255, 255, 255, 0.04);
}
.support-rail-online-item:last-child { border-bottom: none; }
.support-rail-online-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}
.support-rail-online-name { font-size: 13px; color: #f3f6ff; font-weight: 500; }
.support-rail-online-role { font-size: 11px; color: #8f9ab8; }
.support-rail-online-did { font-size: 10px; color: #6b7289; font-variant-numeric: tabular-nums; margin-top: 1px; }
.support-rail-nav {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #9aa6c4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.support-rail-nav.is-active,
.support-rail-nav:hover {
    background: rgba(124, 109, 240, 0.18);
    color: #e8e4ff;
}
.support-rail-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #5865f2;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}
.support-shell {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
}
.support-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--support-border);
    background: var(--support-bg-header);
    flex-shrink: 0;
}
.support-header-left {
    min-width: 0;
    flex-shrink: 1;
}
.support-header-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--support-text-heading);
}
.support-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    min-width: 0;
}
.support-header-end {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.support-header-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--support-text-secondary);
    font-size: 13px;
    cursor: pointer;
}
.support-header-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.support-header-link.is-active {
    color: var(--support-text-heading);
    background: rgba(109, 124, 242, 0.15);
}
body.support-portal #support-btn-staff-admin[hidden],
body.support-portal #support-btn-staff-banlist[hidden],
body.support-portal #tickets-inbox-filter-all-open-accepted[hidden],
body.support-portal #support-staff-ban-form[hidden] {
    display: none !important;
}
.support-header-user { position: relative; margin-left: 0; }
.support-header-user-block { cursor: pointer; }
body.support-portal .support-header-end .header-user-wrap {
    margin-left: 0;
}
body.support-portal .support-header-avatar-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}
.support-user-avatar { border-radius: 50%; display: block; }
body.support-portal .support-user-online-dot {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--support-online-dot-border);
    z-index: 2;
    pointer-events: none;
}
.support-user-dropdown { min-width: 220px; }
.support-header-discord-id {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.45);
    font-variant-numeric: tabular-nums;
}
body.light-theme .support-header-discord-id { color: rgba(15, 23, 42, 0.5); }
.support-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.support-view {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.support-view[hidden] { display: none !important; }
.support-inbox-grid.tickets-inbox {
    min-height: 0;
    max-height: 100%;
    height: 100%;
    flex: 1 1 0;
    overflow: hidden;
}
body.support-portal .tickets-inbox-messages-wrap {
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
body.support-portal .tickets-inbox-messages {
    overflow-anchor: none;
}
body.support-portal .support-inbox-grid.tickets-inbox {
    min-height: 0 !important;
    max-height: 100% !important;
}
body.support-portal .tickets-inbox-sidebar {
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}
body.support-portal .tickets-inbox-list {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}
body.support-portal .tickets-inbox-chat {
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
body.support-portal .tickets-inbox-compose-wrap {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: var(--support-bg-page, #0f1118);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.support-portal .tickets-inbox-chat-head-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}
body.support-portal .tickets-inbox-chat-head-toolbar[hidden] {
    display: none !important;
}
body.support-portal .tickets-inbox-head-action-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #e8ecf8;
    cursor: pointer;
    font-size: 13px;
}
body.support-portal .tickets-inbox-head-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}
body.support-portal .tickets-inbox-head-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
body.support-portal .tickets-inbox-head-action-btn--danger .tickets-inbox-head-action-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}
body.support-portal .tickets-inbox-head-action-btn--danger:hover {
    background: rgba(239, 68, 68, 0.1);
}
.support-tickets-delete-modal-content {
    max-width: 520px;
}
.tickets-delete-dialogue-user {
    margin: 0 0 8px;
    font-size: 14px;
    color: #c8d0e8;
}
.tickets-delete-dialogue-hint {
    margin: 0 0 14px;
    font-size: 12px;
    color: #8f9ab8;
}
.tickets-delete-dialogue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(360px, 50vh);
    overflow-y: auto;
    margin-bottom: 16px;
}
.tickets-delete-dialogue-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.tickets-delete-dialogue-row-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}
.tickets-delete-dialogue-row-id {
    font-weight: 700;
    color: #f3f6ff;
}
.tickets-delete-dialogue-row-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}
.tickets-delete-dialogue-row-status--open { background: rgba(52, 152, 219, 0.2); color: #7ec8ff; }
.tickets-delete-dialogue-row-status--accepted { background: rgba(109, 124, 242, 0.2); color: #c4b5fd; }
.tickets-delete-dialogue-row-status--closed { background: rgba(231, 76, 60, 0.15); color: #f5a8a0; }
.tickets-delete-dialogue-row-meta {
    flex: 1 1 160px;
    font-size: 12px;
    color: #8f9ab8;
    min-width: 0;
}
.tickets-delete-dialogue-row-btn {
    margin-left: auto;
}
.tickets-delete-dialogue-empty {
    margin: 0;
    color: #8f9ab8;
    font-size: 13px;
}
body.support-portal .tickets-inbox-notes-inline {
    flex-shrink: 0;
    padding: 10px 14px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    max-height: 180px;
    overflow-y: auto;
}
body.support-portal .tickets-inbox-notes-inline[hidden] {
    display: none !important;
}
body.support-portal .tickets-inbox-notes-inline .tickets-inbox-notes-block {
    margin: 0;
}
body.support-portal .tickets-inbox-notes-inline:empty {
    display: none !important;
}
@media (max-width: 1100px) {
    body.support-portal .tickets-inbox-profile-toggle {
        display: inline-flex !important;
    }
    body.support-portal .support-inbox-grid.tickets-inbox:not(.tickets-inbox-profile-hidden) .tickets-inbox-profile {
        display: flex !important;
    }
    body.support-portal .support-inbox-grid.tickets-inbox.tickets-inbox-profile-hidden .tickets-inbox-profile {
        display: none !important;
    }
    body.support-portal .support-inbox-grid.tickets-inbox:not(.tickets-inbox-profile-hidden) {
        grid-template-columns: minmax(200px, 260px) minmax(0, 1fr) minmax(200px, 240px);
    }
    body.support-portal .support-inbox-grid.tickets-inbox.tickets-inbox-profile-hidden {
        grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
    }
}
@media (max-width: 760px) {
    body.support-portal .support-inbox-grid.tickets-inbox:not(.tickets-inbox-profile-hidden) {
        grid-template-columns: 1fr;
    }
    body.support-portal .support-inbox-grid.tickets-inbox.tickets-inbox-profile-hidden {
        grid-template-columns: 1fr;
    }
    body.support-portal .support-inbox-grid.tickets-inbox.tickets-inbox-profile-hidden .tickets-inbox-profile {
        display: none !important;
    }
}
/* Stats page */
.support-stats {
    padding: 20px 24px 32px;
    overflow-y: auto;
    height: 100%;
}
.support-profile-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.support-profile-summary-meta {
    min-width: 0;
    flex: 1 1 auto;
}
.support-profile-summary-online {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #94a3b8;
}
.support-profile-summary-online strong {
    color: #e2e8f0;
    font-weight: 650;
}
.support-profile-back {
    margin-left: auto;
    flex-shrink: 0;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(148, 163, 184, 0.08);
    color: #cbd5e1;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
}
.support-profile-back:hover {
    background: rgba(148, 163, 184, 0.16);
}
.support-recent-closed {
    margin-top: 24px;
}
.support-recent-closed-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.support-recent-closed-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "num name time"
        "num did time";
    gap: 2px 12px;
    align-items: center;
    width: 100%;
    text-align: left;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.06);
    color: inherit;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.support-recent-closed-item:hover:not(:disabled) {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.32);
}
.support-recent-closed-item:disabled,
.support-recent-closed-item--locked {
    cursor: default;
    opacity: 0.9;
}
.support-recent-closed-item--locked:hover {
    background: rgba(148, 163, 184, 0.06);
    border-color: rgba(148, 163, 184, 0.18);
}
.support-recent-closed-num {
    grid-area: num;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #e2e8f0;
    min-width: 2.5rem;
}
.support-recent-closed-name {
    grid-area: name;
    font-weight: 600;
    color: #f1f5f9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.support-recent-closed-did {
    grid-area: did;
    font-size: 0.78rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.support-recent-closed-time {
    grid-area: time;
    font-size: 0.82rem;
    color: #94a3b8;
    white-space: nowrap;
    justify-self: end;
}
body.light-theme .support-recent-closed-item {
    border-color: rgba(15, 23, 42, 0.1);
    background: rgba(15, 23, 42, 0.03);
}
body.light-theme .support-recent-closed-num,
body.light-theme .support-recent-closed-name { color: #0f172a; }
body.light-theme .support-recent-closed-did,
body.light-theme .support-recent-closed-time { color: #64748b; }
.support-staff-devices-block {
    margin-top: 28px;
    padding-top: 8px;
}
.support-staff-devices-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.support-profile-summary-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
}
.support-profile-summary-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f3f6ff;
}
.support-profile-summary-did {
    margin-top: 4px;
    font-size: 0.85rem;
    color: #8f9ab8;
}
.support-profile-summary-steam {
    margin-top: 4px;
    font-size: 0.85rem;
    color: #8f9ab8;
}
.support-profile-summary-steam a {
    color: #93c5fd;
    text-decoration: none;
}
.support-profile-summary-steam a:hover {
    text-decoration: underline;
}
.support-profile-summary-steam code {
    font-size: 0.82rem;
    color: #c5d0ea;
}
.support-profile-summary-did code {
    font-size: 0.82rem;
    color: #c5d0ea;
}
.support-profile-discord-id {
    margin: 0;
    font-size: 0.95rem;
    color: #c5d0ea;
    font-variant-numeric: tabular-nums;
}
body.light-theme .support-profile-summary {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}
body.light-theme .support-profile-summary-name { color: #0f172a; }
body.light-theme .support-profile-summary-did,
body.light-theme .support-profile-discord-id { color: #64748b; }
body.light-theme .support-profile-summary-steam { color: #64748b; }
body.light-theme .support-profile-summary-steam a { color: #2563eb; }
body.light-theme .support-profile-summary-steam code { color: #334155; }
body.light-theme .support-profile-summary-did code { color: #334155; }
body.light-theme .support-profile-summary-online { color: #64748b; }
body.light-theme .support-profile-summary-online strong { color: #0f172a; }
body.light-theme .support-profile-back {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.04);
    color: #334155;
}
.support-stats-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.support-stats-title { margin: 0; font-size: 1.35rem; color: #f3f6ff; }
.support-stats-sub { margin: 4px 0 0; color: #8f9ab8; font-size: 14px; }
.support-stats-growth {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    font-size: 12px;
    font-weight: 600;
}
.support-stats-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}
.support-stats-tab {
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: transparent;
    color: #9aa6c4;
    font-size: 13px;
    cursor: pointer;
}
.support-stats-tab.is-active {
    background: rgba(255,255,255,0.08);
    color: #f3f6ff;
    border-color: rgba(255,255,255,0.15);
}
.support-heatmap-block {
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}
.support-heatmap-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}
.support-heatmap-title { margin: 0; font-size: 12px; letter-spacing: 0.06em; color: #8f9ab8; text-transform: uppercase; }
.support-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14px, 1fr));
    gap: 4px;
    max-width: 100%;
}
.support-heatmap-cell {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: rgba(255,255,255,0.06);
}
.support-heatmap-cell--l1 { background: rgba(168, 85, 247, 0.25); }
.support-heatmap-cell--l2 { background: rgba(168, 85, 247, 0.45); }
.support-heatmap-cell--l3 { background: rgba(168, 85, 247, 0.65); }
.support-heatmap-cell--l4 { background: rgba(168, 85, 247, 0.9); }
.support-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 900px) {
    .support-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .support-stats-grid { grid-template-columns: 1fr; }
}
.support-stat-card {
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
}
.support-stat-label { font-size: 11px; letter-spacing: 0.05em; color: #8f9ab8; text-transform: uppercase; margin-bottom: 8px; }
.support-stat-value { font-size: 1.75rem; font-weight: 700; color: #f3f6ff; line-height: 1.1; }
.support-stat-note { margin: 8px 0 0; font-size: 12px; color: #6b7288; line-height: 1.4; }
.support-stat-progress {
    margin-top: 10px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
.support-stat-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #22d3ee, #4ade80);
}
/* Binds page */
.support-binds-page {
    padding: 24px;
    max-width: 560px;
    overflow-y: auto;
    height: 100%;
}
.support-page-heading { margin: 0 0 8px; font-size: 1.5rem; color: #f3f6ff; }
.support-binds-lead { margin: 0 0 24px; color: #8f9ab8; font-size: 14px; }
.support-binds-section-title { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: #e8ecf8; }
.support-binds-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.support-binds-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    text-align: left;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
}
.support-binds-option.is-selected {
    border-color: rgba(168, 85, 247, 0.5);
    background: rgba(168, 85, 247, 0.08);
}
.support-binds-option-title { font-size: 14px; font-weight: 600; color: #f3f6ff; }
.support-binds-option-sub { font-size: 12px; color: #8f9ab8; margin-top: 2px; }
.support-binds-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.25);
    flex-shrink: 0;
}
.support-binds-option.is-selected .support-binds-radio {
    border-color: #a855f7;
    background: radial-gradient(circle at center, #a855f7 40%, transparent 42%);
}
.support-binds-hotkey-wrap {
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
}
.support-binds-hotkey-label { font-size: 12px; color: #8f9ab8; margin-bottom: 8px; }
.support-binds-hotkey-row { display: flex; gap: 8px; align-items: center; }
.support-binds-hotkey-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(0,0,0,0.25);
    color: #f3f6ff;
    font-size: 14px;
}
.support-binds-reset {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    color: #b8c0d8;
    font-size: 13px;
    cursor: pointer;
}
.support-binds-hint { margin: 8px 0 0; font-size: 12px; color: #6b7288; }
/* Replies */
.support-replies-page { padding: 24px; overflow-y: auto; height: 100%; max-width: 720px; }
.support-replies-form {
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.support-replies-form-row {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 12px;
    margin-bottom: 12px;
}
@media (max-width: 640px) {
    .support-replies-form-row { grid-template-columns: 1fr; }
}
.support-replies-label {
    display: block;
    font-size: 12px;
    color: #8f9ab8;
    margin-bottom: 6px;
}
.support-replies-input,
.support-replies-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
    color: #f3f6ff;
    font: inherit;
}
.support-replies-textarea { min-height: 100px; resize: vertical; margin-bottom: 10px; }
.support-replies-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.support-replies-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.support-replies-char-count { font-size: 12px; color: #8f9ab8; }
.support-replies-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.support-replies-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
}
.support-replies-item.is-editing {
    border-color: rgba(109, 124, 242, 0.45);
    background: rgba(109, 124, 242, 0.08);
}
.support-replies-item-main { flex: 1; min-width: 0; }
.support-replies-item-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.support-replies-item-title { font-weight: 600; color: #f3f6ff; font-size: 14px; }
.support-replies-item-hotkey {
    font-size: 11px;
    color: #a78bfa;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(109, 124, 242, 0.15);
}
.support-replies-item-body { font-size: 13px; color: #8f9ab8; white-space: pre-wrap; word-break: break-word; }
.support-replies-item-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
}
.support-replies-edit {
    padding: 8px 12px;
    border: 1px solid rgba(109, 124, 242, 0.35);
    border-radius: 8px;
    background: rgba(109, 124, 242, 0.12);
    color: #c4b5fd;
    font-size: 12px;
    cursor: pointer;
}
.support-replies-edit:hover { background: rgba(109, 124, 242, 0.22); color: #fff; }
.support-replies-cancel {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #b8c0d8;
    font-size: 12px;
    cursor: pointer;
}
.support-replies-cancel:hover { background: rgba(255, 255, 255, 0.08); color: #f3f6ff; }
.support-replies-delete {
    flex-shrink: 0;
    padding: 8px 12px;
    border: 1px solid rgba(231, 76, 60, 0.35);
    border-radius: 8px;
    background: rgba(231, 76, 60, 0.12);
    color: #f5a8a0;
    font-size: 12px;
    cursor: pointer;
}
.support-replies-delete:hover { background: rgba(231, 76, 60, 0.22); color: #fff; }

/* Settings page */
.support-settings-layout {
    display: flex;
    gap: 32px;
    flex: 1;
    min-height: 0;
    padding: 24px 28px;
    box-sizing: border-box;
}
.support-settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 200px;
    flex-shrink: 0;
}
.support-settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #c8d0e8;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}
.support-settings-nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
}
.support-settings-nav-item.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #f3f6ff;
}
.support-settings-nav-icon {
    display: inline-flex;
    opacity: 0.85;
}
.support-settings-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}
.support-settings-panel[hidden] {
    display: none !important;
}
.support-settings-panel .support-binds-page,
.support-settings-panel .support-replies-page {
    padding: 0;
    max-width: 640px;
}
.support-theme-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.support-theme-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: #e8ecf8;
    font-size: 14px;
    cursor: pointer;
}
.support-theme-option.is-selected {
    border-color: rgba(109, 124, 242, 0.55);
    background: rgba(109, 124, 242, 0.12);
}
.support-profile-settings {
    max-width: 520px;
}
.support-profile-password-block {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.support-profile-password-title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #f3f6ff;
}
body.light-theme .support-profile-password-block {
    border-top-color: rgba(15, 23, 42, 0.1);
}
body.light-theme .support-profile-password-title {
    color: #1a1f33;
}
.support-profile-avatar-picker {
    margin-bottom: 22px;
}
.support-profile-avatar-wrap {
    position: relative;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.35);
    cursor: default;
    outline: none;
}
.support-profile-avatar-wrap:focus-visible {
    box-shadow: 0 0 0 2px rgba(109, 124, 242, 0.65), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.support-profile-avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.25s ease, filter 0.25s ease;
}
.support-profile-avatar-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: linear-gradient(180deg, rgba(5, 5, 8, 0.15) 0%, rgba(5, 5, 8, 0.82) 100%);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.22s ease;
}
.support-profile-avatar-wrap:hover .support-profile-avatar-overlay,
.support-profile-avatar-wrap:focus-within .support-profile-avatar-overlay {
    opacity: 1;
}
.support-profile-avatar-wrap:hover .support-profile-avatar-preview,
.support-profile-avatar-wrap:focus-within .support-profile-avatar-preview {
    transform: scale(1.04);
    filter: brightness(0.72);
}
.support-profile-avatar-overlay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(18, 18, 28, 0.88);
    color: #f3f6ff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.support-profile-avatar-overlay-btn:hover {
    transform: translateY(-1px);
}
.support-profile-avatar-overlay-btn--change:hover {
    background: rgba(109, 124, 242, 0.28);
    border-color: rgba(109, 124, 242, 0.5);
}
.support-profile-avatar-overlay-btn--remove:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fecaca;
}
.support-profile-avatar-picker:not(.has-custom-avatar) .support-profile-avatar-overlay-btn--remove {
    display: none;
}
.support-profile-name-field { margin-bottom: 16px; }

/* Avatar circular crop modal */
.support-avatar-crop-modal .support-avatar-crop-modal-content {
    width: min(440px, calc(100vw - 28px));
    max-width: 440px;
    padding: 22px 20px 18px;
}
.support-avatar-crop-lead {
    margin: 0 0 14px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.62);
}
body.light-theme .support-avatar-crop-lead {
    color: rgba(26, 31, 51, 0.65);
}
.support-avatar-crop-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-height: min(360px, 58vh);
    margin: 0 auto 16px;
    overflow: hidden;
    border-radius: 14px;
    background: #0a0a10;
    touch-action: none;
    cursor: grab;
    user-select: none;
}
.support-avatar-crop-stage.is-dragging {
    cursor: grabbing;
}
.support-avatar-crop-img {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: none;
    transform-origin: center center;
    pointer-events: none;
    will-change: transform;
}
.support-avatar-crop-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(78%, 280px);
    height: min(78%, 280px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 2;
}
.support-avatar-crop-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.support-avatar-crop-zoom {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.support-avatar-crop-zoom-ico {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.55);
    display: inline-flex;
}
body.light-theme .support-avatar-crop-zoom-ico {
    color: rgba(26, 31, 51, 0.5);
}
.support-avatar-crop-zoom-range {
    flex: 1;
    min-width: 0;
    accent-color: #8b95a8;
    height: 4px;
}
.support-avatar-crop-rotate {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
}
.support-avatar-crop-rotate:hover {
    background: rgba(255, 255, 255, 0.12);
}
body.light-theme .support-avatar-crop-rotate {
    border-color: rgba(26, 31, 51, 0.12);
    background: rgba(26, 31, 51, 0.05);
    color: #1a1f33;
}
body.light-theme .support-avatar-crop-rotate:hover {
    background: rgba(26, 31, 51, 0.1);
}

/* Auth boot shimmer (пока бэкенд подтверждает сессию) — на весь экран */
body.support-portal.support-auth-booting .support-rail,
body.support-portal.support-auth-booting .support-header,
body.support-portal.support-auth-booting .support-view,
body.support-portal.support-auth-booting #tickets-inbox-login {
    display: none !important;
}
body.support-portal.support-auth-booting .support-auth-boot-shimmer {
    display: flex !important;
}
body.support-portal.support-auth-booting .support-app {
    grid-template-columns: minmax(0, 1fr);
}
body.support-portal.support-auth-booting .support-main {
    min-height: 100vh;
    background: var(--support-bg-page);
}
.support-auth-boot-shimmer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    flex: 1;
    min-height: 100vh;
    width: 100%;
    display: none;
    flex-direction: column;
    padding: 16px 20px 20px;
    box-sizing: border-box;
    background: var(--support-bg-page, #0f1118);
}
.support-auth-boot-shimmer-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(200px, 260px);
    gap: 12px;
    height: min(100%, calc(100vh - 36px));
}
.support-auth-boot-shimmer-sidebar,
.support-auth-boot-shimmer-main,
.support-auth-boot-shimmer-profile {
    border-radius: 16px;
    border: 1px solid var(--support-border);
    background: var(--support-bg-card);
    padding: 16px;
    min-height: 0;
    overflow: hidden;
}
.support-auth-boot-shimmer-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.support-auth-boot-shimmer-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.support-auth-boot-shimmer-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
}
.support-auth-boot-shimmer-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.support-auth-boot-shimmer-head-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.support-auth-boot-shimmer-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 4px;
}
.support-auth-boot-bar {
    height: 14px;
    border-radius: 8px;
    width: 100%;
}
.support-auth-boot-bar--title { height: 20px; width: 55%; margin-bottom: 4px; }
.support-auth-boot-bar--md { width: 72%; }
.support-auth-boot-bar--sm { width: 42%; height: 12px; }
.support-auth-boot-bar--short { width: 38%; }
.support-auth-boot-row {
    height: 52px;
    border-radius: 12px;
    width: 100%;
}
.support-auth-boot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}
.support-auth-boot-avatar--lg {
    width: 72px;
    height: 72px;
}
.support-auth-boot-msg {
    height: 48px;
    border-radius: 14px;
    max-width: 62%;
}
.support-auth-boot-msg--left { align-self: flex-start; }
.support-auth-boot-msg--right { align-self: flex-end; }
.support-auth-boot-msg--wide { max-width: 78%; height: 64px; }
.support-auth-boot-msg--short { max-width: 40%; height: 36px; }
.support-auth-boot-compose {
    height: 88px;
    border-radius: 14px;
    width: 100%;
    flex-shrink: 0;
}
.support-auth-boot-stat {
    height: 36px;
    border-radius: 10px;
    width: 100%;
}
@media (max-width: 1100px) {
    .support-auth-boot-shimmer-grid {
        grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
    }
    .support-auth-boot-shimmer-profile { display: none; }
}
@media (max-width: 720px) {
    .support-auth-boot-shimmer-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .support-auth-boot-shimmer-sidebar { display: none; }
}

/* Login page */
body.support-portal.support-login-screen .support-rail,
body.support-portal.support-login-screen .support-header {
    display: none !important;
}
body.support-portal.support-login-screen #support-view-inbox {
    display: none !important;
}
body.support-portal.support-login-screen #tickets-inbox-login {
    display: flex !important;
}
body.support-portal.support-login-screen .support-app,
body.support-portal.support-portal-locked .support-app {
    grid-template-columns: minmax(0, 1fr);
    /* На логине не сдвигаем app через vv-top — иначе поля уезжают под клавиатуру. */
    margin-top: 0 !important;
    height: var(--support-vvh, 100dvh);
    max-height: var(--support-vvh, 100dvh);
    overflow: hidden;
}
body.support-portal.support-login-screen .support-main,
body.support-portal.support-portal-locked .support-main {
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(88, 80, 180, 0.08) 0%, transparent 55%), var(--support-bg-page);
}
.support-login-page {
    flex: 1;
    min-height: 0;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.support-login-center {
    width: min(100%, 400px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}
.support-login-brand {
    text-align: center;
}
.support-login-logo {
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6d7cf2 0%, #8b5cf6 55%, #a855f7 100%);
    color: #fff;
    font-weight: 700;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 32px rgba(109, 124, 242, 0.35);
}
.support-login-title {
    margin: 0 0 8px;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f8faff;
}
.support-login-subtitle {
    margin: 0;
    font-size: 14px;
    color: #8b93ad;
    line-height: 1.45;
}
.support-login-card {
    width: 100%;
    padding: 22px 22px 20px;
    border-radius: 16px;
    background: rgba(16, 16, 24, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
    margin: 0;
}
.support-login-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #a8b0c8;
    margin: 0 0 8px;
}
.support-login-label + .support-login-input,
.support-login-label + .support-login-password-wrap {
    margin-bottom: 16px;
}
.support-login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #f3f6ff;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.support-login-input::placeholder {
    color: #6b7288;
}
.support-login-input:focus {
    outline: none;
    border-color: rgba(109, 124, 242, 0.55);
    background: rgba(255, 255, 255, 0.06);
}
.support-login-password-wrap {
    position: relative;
}
.support-login-input--password {
    padding-right: 44px;
}
.support-login-password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #7c849c;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    padding: 0;
}
.support-login-password-toggle:hover {
    color: #c8d0e8;
    background: rgba(255, 255, 255, 0.06);
}
.support-login-eye--hide {
    display: none;
    position: relative;
    width: 18px;
    height: 18px;
}
.support-login-eye-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.support-login-password-toggle.is-visible .support-login-eye--show { display: none; }
.support-login-password-toggle.is-visible .support-login-eye--hide { display: block; }
.support-login-eye--show {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.support-login-submit {
    width: 100%;
    margin-top: 4px;
    padding: 13px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(109, 124, 242, 0.95) 0%, rgba(88, 101, 220, 0.95) 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.12s ease;
    box-shadow: 0 4px 16px rgba(109, 124, 242, 0.28);
}
.support-login-submit:hover {
    filter: brightness(1.06);
}
.support-login-submit:active {
    transform: translateY(1px);
}
.support-login-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
.support-login-error {
    margin: 12px 0 0;
    font-size: 13px;
    color: #f5a8a0;
    text-align: center;
}
/* Side panels */
.support-side-panel { position: fixed; inset: 0; z-index: 3000; display: flex; justify-content: flex-end; }
.support-side-panel[hidden] { display: none !important; }
.support-side-panel-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.support-side-panel-sheet {
    position: relative;
    width: min(100%, 380px);
    height: 100%;
    background: #0f0f16;
    border-left: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    animation: support-panel-in 0.2s ease;
}
@keyframes support-panel-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
.support-side-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.support-side-panel-head h2 { margin: 0; font-size: 1rem; color: #f3f6ff; }
.support-side-panel-close { border: none; background: transparent; color: #9aa6c4; font-size: 24px; cursor: pointer; line-height: 1; }
.support-side-panel-body { flex: 1; overflow-y: auto; padding: 12px 18px; }
.support-ban-row {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.support-ban-id { font-family: monospace; font-size: 13px; color: #e8ecf8; }
.support-ban-meta { font-size: 12px; color: #8f9ab8; margin-top: 4px; }
.support-probe-modal-content { max-width: 480px; }
.support-page-inner {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px 32px;
    max-width: 720px;
    background: var(--support-bg-page);
}
.support-page-heading {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--support-text-heading);
}
.support-page-lead {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--support-text-muted);
}
.support-banlist-page {
    overflow-y: auto;
    height: 100%;
    max-width: none;
}
.support-banlist-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.support-banlist-count { font-size: 14px; color: #b8c0d8; }
.support-banlist-count strong { color: #f3f6ff; font-weight: 600; }
.support-banlist-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #e8ecf8;
    font-size: 13px;
    cursor: pointer;
}
.support-banlist-refresh:hover { background: rgba(255, 255, 255, 0.08); }
.support-banlist-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}
.support-banlist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.support-banlist-table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #8f9ab8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}
.support-banlist-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    color: #e8ecf8;
}
.support-banlist-table tr:last-child td { border-bottom: none; }
.support-banlist-table tr.is-expired td { opacity: 0.72; }
.support-ban-player,
.support-ban-issuer {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.support-ban-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.support-ban-avatar--sm { width: 24px; height: 24px; }
.support-ban-username { 
    font-weight: 600; 
    color: #f3f6ff; 
    white-space: nowrap; 
    text-decoration: none;
}
.support-ban-cell--id code {
    font-size: 12px;
    color: #8f9ab8;
    background: transparent;
}
.support-ban-cell--reason {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #b8c0d8;
}
.support-ban-until { color: #e8ecf8; }
.support-ban-until-rel { color: #8f9ab8; }
.support-ban-expired,
.support-ban-term {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(234, 179, 8, 0.35);
    background: rgba(234, 179, 8, 0.12);
    color: #facc15;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.support-ban-term--forever {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}
.support-ban-delete {
    border: none;
    background: transparent;
    color: #8f9ab8;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.support-ban-delete .ui-icon { display: block; }
.support-ban-delete:hover { background: rgba(231, 76, 60, 0.15); color: #f5a8a0; }
.support-banlist-pagination {
    padding: 0 4px 8px;
    margin-top: 0;
}
.support-banlist-body:has(.support-banlist-table-wrap) + .support-banlist-pagination {
    margin-top: 12px;
}
.support-ban-meta { color: #8f9ab8; font-size: 13px; }
.support-probe-label { display: block; font-size: 12px; color: #8f9ab8; margin: 12px 0 6px; }
.support-probe-search-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 12px;
}
.support-probe-search-row .support-probe-input {
    flex: 1;
    margin-bottom: 0;
}
.support-probe-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #f3f6ff;
    margin-bottom: 12px;
}
select.support-probe-input {
    color-scheme: dark;
    cursor: pointer;
}
select.support-probe-input option {
    color: #f3f6ff;
    background: #12141a;
}
.support-probe-result { margin-top: 16px; font-size: 13px; color: #c8d0e8; }
.support-probe-hint { margin: 0; color: #8f9ab8; font-size: 13px; }

.support-user-messages-page {
    max-width: 720px;
}
.support-user-messages-form {
    margin: 0 0 20px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}
.support-user-msg-textarea {
    min-height: 110px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.45;
}
.support-user-msg-file {
    padding: 8px 10px;
}
.support-user-msg-status {
    margin: 10px 0 0;
    font-size: 0.88rem;
    color: #a7afc4;
}
.support-user-msg-status.is-ok { color: #86efac; }
.support-user-msg-status.is-error { color: #fca5a5; }
.support-user-messages-history {
    min-height: 80px;
}
.support-user-msg-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.support-user-msg-item {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
}
.support-user-msg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: baseline;
    margin-bottom: 8px;
    font-size: 12px;
    color: #8f9ab8;
}
.support-user-msg-time { color: #a5b4fc; }
.support-user-msg-role { font-weight: 650; color: #c4b5fd; }
.support-user-msg-nick { font-weight: 700; color: #e2e8f0; }
.support-user-msg-source {
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(129, 140, 248, 0.16);
    color: #c7d2fe;
    font-size: 11px;
    font-weight: 600;
}
.support-user-msg-target { color: #94a3b8; }
.support-user-msg-delete {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
    cursor: pointer;
}
.support-user-msg-delete:hover {
    background: rgba(248, 113, 113, 0.22);
    color: #fecaca;
}
.support-user-msg-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: #e8ecf8;
    white-space: pre-wrap;
    word-break: break-word;
}
body.support-portal.light-theme .support-user-messages-form,
body.support-portal.light-theme .support-user-msg-item {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.1);
}
body.support-portal.light-theme .support-user-msg-nick { color: #0f172a; }
body.support-portal.light-theme .support-user-msg-text { color: #1e293b; }
body.support-portal.light-theme .support-user-msg-role { color: #6d28d9; }
body.support-portal.light-theme .support-user-msg-delete {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
}

.support-devices-page {
    max-width: 760px;
}
.support-devices-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.support-devices-heading {
    margin: 0 !important;
}
.support-devices-title-ico {
    display: inline-flex;
    color: #e8ecf8;
    flex-shrink: 0;
}
.support-devices-refresh {
    margin: 12px 0 18px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #f3f6ff;
    cursor: pointer;
    font-size: 0.9rem;
}
.support-devices-refresh:hover {
    background: rgba(255, 255, 255, 0.1);
}
.support-devices-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.support-device-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}
.support-device-card-main {
    min-width: 0;
    flex: 1;
}
.support-device-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.support-device-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #f3f6ff;
}
.support-device-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.3;
}
.support-device-badge--current {
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
}
.support-device-badge--active {
    background: rgba(34, 197, 94, 0.85);
    color: #fff;
}
.support-device-badge--ended {
    background: rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
}
.support-device-ua {
    margin: 0 0 10px;
    font-size: 12px;
    color: #94a3b8;
    word-break: break-word;
    line-height: 1.4;
}
.support-device-meta {
    display: grid;
    gap: 4px;
    font-size: 13px;
    color: #a7afc4;
}
.support-device-meta-label {
    color: #8f9ab8;
    margin-right: 4px;
}
.support-device-card-actions {
    flex-shrink: 0;
}
.support-device-end-btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(15, 18, 28, 0.55);
    color: #f3f6ff;
    cursor: pointer;
    font-size: 0.88rem;
    white-space: nowrap;
}
.support-device-end-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
}
body.support-portal.light-theme .support-devices-title-ico { color: #0f172a; }
body.support-portal.light-theme .support-devices-refresh,
body.support-portal.light-theme .support-device-end-btn {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.14);
    color: #0f172a;
}
body.support-portal.light-theme .support-device-card {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.1);
}
body.support-portal.light-theme .support-device-name { color: #0f172a; }
body.support-portal.light-theme .support-device-ua,
body.support-portal.light-theme .support-device-meta,
body.support-portal.light-theme .support-device-meta-label { color: #64748b; }
body.support-portal.light-theme .support-device-badge--ended {
    background: rgba(100, 116, 139, 0.2);
    color: #334155;
}

.support-player-profile-page {
    max-width: 760px;
    padding-bottom: 32px;
}
.support-player-profile-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
    padding: 18px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.support-player-profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}
.support-player-profile-hero-meta { min-width: 0; }
.support-player-profile-head { margin-bottom: 18px; }
.support-player-profile-name {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #f3f6ff;
}
.support-player-profile-meta {
    margin: 0 0 6px;
    font-size: 13px;
    color: #8f9ab8;
}
.support-player-profile-meta code {
    font-size: 12px;
    color: #c8d0e8;
}
.support-player-profile-stats { margin-bottom: 20px; }
.support-player-profile-section {
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.support-player-profile-section-title {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8f9ab8;
}
.support-player-profile-section-lead {
    margin: 0;
    color: #8f9ab8;
    font-size: 13px;
}
body.light-theme .support-player-profile-hero {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.08);
}
body.light-theme .support-player-profile-name { color: #1e293b; }
body.light-theme .support-player-profile-meta { color: #64748b; }

/* Staff admin / staff ban list (Ст. Модератор+) */
.support-staff-admin-page {
    max-width: 960px;
}
.support-staff-ban-form {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 0 12px;
    align-items: end;
    margin: 20px 0 24px;
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.support-staff-ban-form .support-probe-label:nth-of-type(1),
.support-staff-ban-form #support-staff-ban-discord-id {
    grid-column: 1;
}
.support-staff-ban-form .support-probe-label:nth-of-type(2),
.support-staff-ban-form #support-staff-ban-duration {
    grid-column: 2;
}
.support-staff-ban-form .support-probe-label:nth-of-type(3),
.support-staff-ban-form #support-staff-ban-reason {
    grid-column: 1 / -1;
}
.support-staff-ban-submit {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 4px;
}
.support-staff-admin-table .support-staff-admin-actions {
    white-space: nowrap;
}
.support-staff-admin-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.support-staff-admin-profile-btn:hover .support-ban-username {
    text-decoration: none;
}
.support-staff-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.support-staff-admin-btn {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(124, 58, 237, 0.18);
    color: #e8d4ff;
    cursor: pointer;
    transition: background 0.15s ease;
}
.support-staff-admin-btn:hover {
    background: rgba(124, 58, 237, 0.32);
}
.support-staff-admin-btn--muted {
    background: rgba(255, 255, 255, 0.06);
    color: #c8d0e8;
}
.support-staff-admin-btn--muted:hover {
    background: rgba(255, 255, 255, 0.1);
}
.support-staff-admin-btn--danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.25);
}
.support-staff-admin-btn--danger:hover {
    background: rgba(239, 68, 68, 0.28);
}
.support-staff-admin-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
}
.support-staff-admin-badge--override {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}
.support-staff-admin-badge--ban {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}
@media (max-width: 640px) {
    .support-staff-ban-form {
        grid-template-columns: 1fr;
    }
    .support-staff-ban-form .support-probe-label:nth-of-type(2),
    .support-staff-ban-form #support-staff-ban-duration {
        grid-column: 1;
    }
}

/* Уведомления в шапке портала */
body.support-portal .header-notifications-dropdown {
    background: #0a0a10;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
body.support-portal .header-notifications-title {
    color: #8f9ab8;
}
body.support-portal .header-notifications-item {
    border-top-color: rgba(255, 255, 255, 0.05);
}
body.support-portal .header-notifications-item.is-unread {
    background: rgba(109, 124, 242, 0.06);
}
body.support-portal .header-notifications-empty {
    color: #8f9ab8;
}

/* Модалка запрета тикетов */
body.support-portal #ticket-ban-modal,
body.support-portal #reassign-ticket-modal,
body.support-portal #tickets-delete-dialogue-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(4, 7, 16, 0.78);
    backdrop-filter: blur(8px);
}
body.support-portal #ticket-ban-modal.is-open,
body.support-portal #reassign-ticket-modal.is-open,
body.support-portal #tickets-delete-dialogue-modal.is-open {
    display: flex;
}
body.support-portal .support-ticket-ban-modal .modal-content,
body.support-portal #ticket-ban-modal .support-ticket-ban-modal-content {
    background: #12121c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 24px 28px 22px;
    max-width: 420px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
}
body.support-portal #ticket-ban-modal .modal-content h2 {
    color: #f3f6ff;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 14px;
    font-size: 1.2rem;
    font-weight: 700;
}
body.support-portal #ticket-ban-modal .ticket-ban-user-info {
    color: #b8c0d8;
    margin-bottom: 18px;
}
body.support-portal #ticket-ban-modal .form-group label {
    color: #8f9ab8;
    font-size: 13px;
}
body.support-portal #ticket-ban-modal .form-group input,
body.support-portal #ticket-ban-modal .form-group textarea,
body.support-portal #ticket-ban-modal .form-group select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #f3f6ff;
}
body.support-portal #ticket-ban-modal .radio-group label {
    color: #e8ecf8;
}
body.support-portal #ticket-ban-modal .modal-actions {
    justify-content: flex-start;
    gap: 10px;
    margin-top: 22px;
    padding-top: 0;
}
body.support-portal #ticket-ban-modal .modal-actions .submit-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #e8ecf8;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
}
body.support-portal #ticket-ban-modal .modal-actions .submit-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}
body.support-portal #ticket-ban-modal .modal-actions .submit-btn:not(.secondary) {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}
body.support-portal #ticket-ban-modal .modal-actions .submit-btn:not(.secondary):hover {
    filter: brightness(1.06);
}
body.support-portal #ticket-ban-modal .modal-close {
    color: #8f9ab8;
}

/* Светлая тема — фоны и типографика портала */
body.support-portal.light-theme .support-shell,
body.support-portal.light-theme .support-main,
body.support-portal.light-theme .support-view,
body.support-portal.light-theme .support-settings-layout,
body.support-portal.light-theme .support-binds-page,
body.support-portal.light-theme .support-banlist-page,
body.support-portal.light-theme .support-player-profile-page {
    background: var(--support-bg-page);
    color: var(--support-text);
}

body.support-portal.light-theme .support-rail-online {
    color: var(--support-text-muted);
}
body.support-portal.light-theme .support-rail-online-name {
    color: var(--support-text-heading);
}
body.support-portal.light-theme .support-rail-online-role,
body.support-portal.light-theme .support-rail-online-did {
    color: var(--support-text-muted);
}
body.support-portal.light-theme .support-rail-nav {
    color: var(--support-text-muted);
}
body.support-portal.light-theme .support-rail-nav.is-active,
body.support-portal.light-theme .support-rail-nav:hover {
    color: #4338ca;
    background: rgba(109, 124, 242, 0.12);
}
body.support-portal.light-theme .support-header-link:hover {
    color: var(--support-text-heading);
    background: rgba(15, 23, 42, 0.05);
}

body.support-portal.light-theme :is(
    .support-page-heading,
    .support-stats-title,
    .support-stat-value,
    .support-binds-option-title,
    .support-binds-section-title,
    .support-replies-item-title,
    .support-side-panel-head h2,
    .support-ban-username,
    .support-banlist-count strong,
    .support-player-profile-name
) {
    color: var(--support-text-heading);
}

body.support-portal.light-theme :is(
    .support-page-lead,
    .support-binds-lead,
    .support-stats-sub,
    .support-probe-label,
    .support-probe-hint,
    .support-probe-result,
    .support-ban-meta,
    .support-banlist-count,
    .support-heatmap-title,
    .support-stat-label,
    .support-replies-char-count,
    .support-replies-item-body,
    .support-binds-option-sub,
    .support-binds-hotkey-label,
    .support-player-profile-meta
) {
    color: var(--support-text-muted);
}

body.support-portal.light-theme .support-binds-option,
body.support-portal.light-theme .support-banlist-table-wrap,
body.support-portal.light-theme .support-banlist-refresh {
    background: #ffffff;
    border-color: var(--support-border);
    color: var(--support-text);
}
body.support-portal.light-theme .support-banlist-table th {
    color: var(--support-text-muted);
    border-bottom-color: var(--support-border);
}
body.support-portal.light-theme .support-banlist-table td {
    color: var(--support-text);
    border-bottom-color: var(--support-border);
}
body.support-portal.light-theme .support-banlist-refresh {
    color: var(--support-text-heading);
}
body.support-portal.light-theme .support-banlist-refresh:hover {
    background: rgba(15, 23, 42, 0.04);
}

body.support-portal.light-theme .header-notifications-dropdown {
    background: #ffffff;
    border-color: var(--support-border);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}
body.support-portal.light-theme .header-notifications-title,
body.support-portal.light-theme .header-notifications-empty {
    color: var(--support-text-muted);
}
body.support-portal.light-theme .header-notifications-item {
    border-top-color: var(--support-border);
}
body.support-portal.light-theme .header-notifications-item-msg {
    color: var(--support-text);
}

body.support-portal.light-theme .support-login-input {
    background: #ffffff !important;
    border-color: var(--support-border-strong) !important;
    color: #0f172a !important;
}
body.support-portal.light-theme .support-login-label {
    color: var(--support-text-muted);
}
body.support-portal.light-theme .support-login-title {
    color: var(--support-text-heading);
}
body.support-portal.light-theme .support-login-subtitle {
    color: var(--support-text-muted);
}

body.support-portal.light-theme #ticket-ban-modal .support-ticket-ban-modal-content,
body.support-portal.light-theme .support-ticket-ban-modal .modal-content {
    background: #ffffff;
    border-color: var(--support-border);
    color: var(--support-text);
}
body.support-portal.light-theme #ticket-ban-modal .modal-close {
    color: var(--support-text-muted);
}

body.support-portal.light-theme .tickets-inbox-meta-label,
body.support-portal.light-theme .tickets-inbox-probe-tx-meta,
body.support-portal.light-theme .tickets-inbox-notes-title,
body.support-portal.light-theme .support-player-profile-section-lead {
    color: var(--support-text-muted);
}
body.support-portal.light-theme .tickets-inbox-meta-value,
body.support-portal.light-theme .tickets-inbox-probe-tx-label,
body.support-portal.light-theme .support-player-profile-section-title,
body.support-portal.light-theme .tickets-inbox-probe-name {
    color: var(--support-text-heading);
}
body.support-portal.light-theme .tickets-inbox-meta-row,
body.support-portal.light-theme .tickets-inbox-probe-tx {
    border-bottom-color: var(--support-border);
}
body.support-portal.light-theme .tickets-inbox-probe {
    border-top-color: var(--support-border);
}

/* Светлая тема — кнопки и навигация с читаемым контрастом */
body.support-portal.light-theme .support-settings-nav-item {
    color: #334155;
}
body.support-portal.light-theme .support-settings-nav-item:hover {
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
}
body.support-portal.light-theme .support-settings-nav-item.is-active {
    background: rgba(109, 124, 242, 0.12);
    color: #312e81;
}
body.support-portal.light-theme .support-settings-nav-icon,
body.support-portal.light-theme .support-settings-nav-item .ui-icon,
body.support-portal.light-theme .support-settings-nav-item svg {
    color: currentColor;
    fill: currentColor;
}

body.support-portal.light-theme .support-theme-option {
    background: #ffffff;
    border-color: var(--support-border-strong);
    color: #334155 !important;
}
body.support-portal.light-theme .support-theme-option span,
body.support-portal.light-theme .support-theme-option .ui-icon,
body.support-portal.light-theme .support-theme-option svg {
    color: #334155 !important;
    fill: currentColor !important;
}
body.support-portal.light-theme .support-theme-option.is-selected {
    background: rgba(109, 124, 242, 0.1);
    border-color: rgba(109, 124, 242, 0.45);
    color: #312e81 !important;
}
body.support-portal.light-theme .support-theme-option.is-selected span,
body.support-portal.light-theme .support-theme-option.is-selected .ui-icon,
body.support-portal.light-theme .support-theme-option.is-selected svg {
    color: #312e81 !important;
    fill: currentColor !important;
}

body.support-portal.light-theme .support-stats-tab {
    color: #475569;
    border-color: var(--support-border-strong);
    background: #ffffff;
}
body.support-portal.light-theme .support-stats-tab.is-active {
    background: rgba(109, 124, 242, 0.1);
    color: #312e81;
    border-color: rgba(109, 124, 242, 0.35);
}
body.support-portal.light-theme .support-stats-growth {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}
body.support-portal.light-theme .support-stat-card,
body.support-portal.light-theme .support-heatmap-block {
    background: #ffffff;
    border-color: var(--support-border);
}

body.support-portal.light-theme .support-staff-admin-btn {
    background: rgba(124, 58, 237, 0.1);
    color: #5b21b6;
    border-color: rgba(124, 58, 237, 0.28);
}
body.support-portal.light-theme .support-staff-admin-btn:hover {
    background: rgba(124, 58, 237, 0.18);
    color: #4c1d95;
}
body.support-portal.light-theme .support-staff-admin-btn--muted {
    background: #ffffff;
    color: #334155;
    border-color: var(--support-border-strong);
}
body.support-portal.light-theme .support-staff-admin-btn--muted:hover {
    background: rgba(15, 23, 42, 0.04);
    color: #0f172a;
}
body.support-portal.light-theme .support-staff-admin-btn--danger {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.32);
}
body.support-portal.light-theme .support-staff-admin-btn--danger:hover {
    background: rgba(239, 68, 68, 0.14);
    color: #991b1b;
}
body.support-portal.light-theme .support-staff-admin-badge--override {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}
body.support-portal.light-theme .support-staff-admin-badge--ban {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

body.support-portal.light-theme .support-replies-edit {
    color: #4338ca;
    background: rgba(109, 124, 242, 0.08);
    border-color: rgba(109, 124, 242, 0.2);
}
body.support-portal.light-theme .support-replies-edit:hover {
    background: rgba(109, 124, 242, 0.14);
    color: #312e81;
}
body.support-portal.light-theme .support-replies-cancel {
    color: #334155;
    background: rgba(15, 23, 42, 0.05);
    border-color: var(--support-border-strong);
}
body.support-portal.light-theme .support-replies-cancel:hover {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}
body.support-portal.light-theme .support-replies-delete {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}
body.support-portal.light-theme .support-replies-delete:hover {
    background: rgba(239, 68, 68, 0.14);
    color: #991b1b;
}

body.support-portal.light-theme .support-replies-input,
body.support-portal.light-theme .support-replies-textarea,
body.support-portal.light-theme .support-binds-hotkey-input,
body.support-portal.light-theme .support-probe-input,
body.support-portal.light-theme .support-login-input,
body.support-portal.light-theme .site-settings-field-input,
body.support-portal.light-theme .tickets-inbox-search,
body.support-portal.light-theme .tickets-inbox-quick-search,
body.support-portal.light-theme .tickets-inbox-reply-text,
body.support-portal.light-theme .tickets-inbox-notes-textarea,
body.support-portal.light-theme #ticket-ban-modal .form-group input,
body.support-portal.light-theme #ticket-ban-modal .form-group textarea,
body.support-portal.light-theme #ticket-ban-modal .form-group select {
    background: #ffffff !important;
    border: 1px solid var(--support-border-strong) !important;
    color: #0f172a !important;
    color-scheme: light;
    -webkit-text-fill-color: #0f172a;
}
body.support-portal.light-theme .support-replies-input:focus,
body.support-portal.light-theme .support-replies-textarea:focus,
body.support-portal.light-theme .support-binds-hotkey-input:focus,
body.support-portal.light-theme .support-probe-input:focus,
body.support-portal.light-theme .support-login-input:focus,
body.support-portal.light-theme .site-settings-field-input:focus,
body.support-portal.light-theme .tickets-inbox-search:focus,
body.support-portal.light-theme .tickets-inbox-quick-search:focus,
body.support-portal.light-theme .tickets-inbox-reply-text:focus,
body.support-portal.light-theme .tickets-inbox-notes-textarea:focus,
body.support-portal.light-theme #ticket-ban-modal .form-group input:focus,
body.support-portal.light-theme #ticket-ban-modal .form-group textarea:focus,
body.support-portal.light-theme #ticket-ban-modal .form-group select:focus {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(109, 124, 242, 0.45) !important;
    box-shadow: 0 0 0 2px rgba(109, 124, 242, 0.12) !important;
    outline: none;
}
body.support-portal.light-theme .support-replies-input::placeholder,
body.support-portal.light-theme .support-replies-textarea::placeholder,
body.support-portal.light-theme .support-binds-hotkey-input::placeholder,
body.support-portal.light-theme .support-probe-input::placeholder,
body.support-portal.light-theme .support-login-input::placeholder,
body.support-portal.light-theme .site-settings-field-input::placeholder,
body.support-portal.light-theme .tickets-inbox-search::placeholder,
body.support-portal.light-theme .tickets-inbox-reply-text::placeholder,
body.support-portal.light-theme .tickets-inbox-notes-textarea::placeholder {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8;
    opacity: 1;
}
body.support-portal.light-theme select.support-probe-input option {
    color: #0f172a;
    background: #ffffff;
}
body.support-portal.light-theme .support-replies-label {
    color: var(--support-text-muted);
}
body.support-portal.light-theme .support-binds-reset {
    color: #334155;
    border-color: var(--support-border-strong);
    background: #ffffff;
}
body.support-portal.light-theme .support-binds-reset:hover {
    background: rgba(15, 23, 42, 0.04);
}

body.support-portal.light-theme .support-binds-option.is-selected {
    border-color: rgba(109, 124, 242, 0.4);
    background: rgba(109, 124, 242, 0.06);
}

body.support-portal.light-theme .support-replies-item {
    background: #ffffff;
    border-color: var(--support-border);
}
body.support-portal.light-theme .support-replies-item.is-editing {
    background: rgba(109, 124, 242, 0.04);
    border-color: rgba(109, 124, 242, 0.2);
}

body.support-portal.light-theme .support-banlist-table-wrap {
    background: #ffffff;
}

/* Заметки к диалогу + кнопки формы ответов */
body.support-portal.light-theme .tickets-inbox-notes-title {
    color: #64748b;
}
body.support-portal.light-theme .tickets-inbox-notes-meta {
    color: #94a3b8;
}
body.support-portal.light-theme .tickets-inbox-notes-save {
    background: #6366f1 !important;
    color: #ffffff !important;
    border: none;
}
body.support-portal.light-theme .tickets-inbox-notes-save:hover:not(:disabled) {
    background: #4f46e5 !important;
}
body.support-portal.light-theme .tickets-inbox-notes-save:disabled {
    background: rgba(99, 102, 241, 0.35) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}
body.support-portal.light-theme .tickets-inbox-notes-cancel {
    background: #ffffff !important;
    color: #334155 !important;
    border: 1px solid var(--support-border-strong) !important;
}
body.support-portal.light-theme .tickets-inbox-notes-cancel:hover {
    background: rgba(15, 23, 42, 0.04) !important;
    color: #0f172a !important;
}
body.support-portal.light-theme .tickets-inbox-notes-delete {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #b91c1c !important;
    border: 1px solid rgba(239, 68, 68, 0.28) !important;
}
body.support-portal.light-theme .tickets-inbox-notes-delete:hover {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #991b1b !important;
}

body.support-portal.light-theme .support-replies-add,
body.support-portal.light-theme #support-reply-submit-btn {
    color: #ffffff !important;
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%) !important;
    border: none;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}
body.support-portal.light-theme .support-replies-add:hover,
body.support-portal.light-theme #support-reply-submit-btn:hover {
    filter: brightness(1.05);
}
body.support-portal.light-theme .support-replies-cancel,
body.support-portal.light-theme #support-reply-cancel-edit {
    border: 1px solid var(--support-border-strong) !important;
}

/* Светлая тема — кнопки действий в шапке чата (Заблокировать, Удалить) */
body.support-portal.light-theme .tickets-inbox-head-action-btn {
    color: #334155;
}
body.support-portal.light-theme .tickets-inbox-head-action-btn:hover {
    background: rgba(15, 23, 42, 0.06);
}
body.support-portal.light-theme .tickets-inbox-head-action-icon {
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
}
body.support-portal.light-theme .tickets-inbox-head-action-btn--danger {
    color: #b91c1c;
}
body.support-portal.light-theme .tickets-inbox-head-action-btn--danger .tickets-inbox-head-action-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}
body.support-portal.light-theme .tickets-inbox-head-action-btn--danger:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* Светлая тема — кнопки профиля тикета (Принять, Закрыть, Удалить и т.д.) */
body.support-portal.light-theme .tickets-inbox-profile-actions .accept-btn {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: #15803d;
}
body.support-portal.light-theme .tickets-inbox-profile-actions .accept-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    color: #166534;
}
body.support-portal.light-theme .tickets-inbox-profile-actions .reject-btn {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.35);
    color: #b91c1c;
}
body.support-portal.light-theme .tickets-inbox-profile-actions .reject-btn:hover {
    background: rgba(239, 68, 68, 0.14);
    color: #991b1b;
}
body.support-portal.light-theme .tickets-inbox-profile-actions .reassign-btn {
    background: #ffffff;
    border-color: var(--support-border-strong);
    color: #334155;
}
body.support-portal.light-theme .tickets-inbox-profile-actions .reassign-btn:hover {
    background: rgba(15, 23, 42, 0.04);
    color: #0f172a;
}
body.support-portal.light-theme .tickets-inbox-profile-actions .delete-btn {
    background: #ffffff;
    border-color: var(--support-border-strong);
    color: #475569;
}
body.support-portal.light-theme .tickets-inbox-profile-actions .delete-btn:hover {
    background: rgba(15, 23, 42, 0.04);
    color: #0f172a;
}

/* Светлая тема — выпадающий фильтр диалогов */
body.support-portal.light-theme .tickets-inbox-filter-btn {
    background: #ffffff;
    border: 1px solid var(--support-border-strong);
    color: #0f172a;
}
body.support-portal.light-theme .tickets-inbox-filter-btn:hover {
    background: rgba(15, 23, 42, 0.04);
}
body.support-portal.light-theme .tickets-inbox-filter-menu {
    background: #ffffff;
    border-color: var(--support-border-strong);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}
body.support-portal.light-theme .tickets-inbox-filter-option {
    color: #334155;
}
body.support-portal.light-theme .tickets-inbox-filter-option:hover {
    background: rgba(15, 23, 42, 0.04);
}
body.support-portal.light-theme .tickets-inbox-filter-option.active {
    color: #312e81;
    background: rgba(109, 124, 242, 0.12);
}
body.support-portal.light-theme .tickets-inbox-filter-option .ui-icon,
body.support-portal.light-theme .tickets-inbox-filter-option svg {
    color: currentColor;
    fill: currentColor;
}

/* Светлая тема — пробив: Steam / Discord рядом с аватаркой */
body.support-portal.light-theme .support-player-profile-meta code {
    color: var(--support-text-heading);
}
body.support-portal.light-theme .support-player-profile-meta a.tickets-inbox-probe-link code {
    color: #4338ca;
}
body.support-portal.light-theme .tickets-inbox-probe-link {
    color: #4338ca;
}
body.support-portal.light-theme .support-profile-summary-did code {
    color: var(--support-text-heading);
}

/* Светлая тема — системные уведомления в чате («Диалог открыт • #…») */
body.support-portal.light-theme .tickets-inbox-system-msg-text {
    color: #0f172a;
}
body.support-portal.light-theme .tickets-inbox-system-msg-sub {
    color: #64748b;
}

/* Светлая тема — модалки (бан, переназначение, удаление тикетов) */
body.support-portal.light-theme #ticket-ban-modal,
body.support-portal.light-theme #reassign-ticket-modal,
body.support-portal.light-theme #tickets-delete-dialogue-modal {
    background: rgba(15, 23, 42, 0.35);
}

body.support-portal.light-theme #ticket-ban-modal .modal-content,
body.support-portal.light-theme #ticket-ban-modal .support-ticket-ban-modal-content,
body.support-portal.light-theme #reassign-ticket-modal .modal-content,
body.support-portal.light-theme #tickets-delete-dialogue-modal .modal-content,
body.support-portal.light-theme .support-tickets-delete-modal-content {
    background: #ffffff !important;
    border-color: var(--support-border-strong) !important;
    color: #334155 !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14) !important;
}

body.support-portal.light-theme #ticket-ban-modal .modal-content h2,
body.support-portal.light-theme #reassign-ticket-modal .modal-content h2,
body.support-portal.light-theme #tickets-delete-dialogue-modal .modal-content h2 {
    color: #1d4ed8 !important;
    border-bottom-color: rgba(29, 78, 216, 0.2) !important;
}

body.support-portal.light-theme #ticket-ban-modal .modal-close,
body.support-portal.light-theme #reassign-ticket-modal .modal-close,
body.support-portal.light-theme #tickets-delete-dialogue-modal .modal-close {
    color: #64748b !important;
}
body.support-portal.light-theme #ticket-ban-modal .modal-close:hover,
body.support-portal.light-theme #reassign-ticket-modal .modal-close:hover,
body.support-portal.light-theme #tickets-delete-dialogue-modal .modal-close:hover {
    color: #0f172a !important;
}

body.support-portal.light-theme #ticket-ban-modal .ticket-ban-user-info,
body.support-portal.light-theme .tickets-delete-dialogue-user {
    color: #334155 !important;
}
body.support-portal.light-theme .tickets-delete-dialogue-hint,
body.support-portal.light-theme .tickets-delete-dialogue-row-meta,
body.support-portal.light-theme .tickets-delete-dialogue-empty {
    color: #64748b !important;
}

body.support-portal.light-theme #ticket-ban-modal .form-group label,
body.support-portal.light-theme #reassign-ticket-modal .form-group label {
    color: #64748b !important;
}
body.support-portal.light-theme #ticket-ban-modal .radio-group label {
    color: #334155 !important;
}

body.support-portal.light-theme #reassign-ticket-modal .form-group select {
    background: #ffffff !important;
    border: 1px solid var(--support-border-strong) !important;
    color: #0f172a !important;
    color-scheme: light;
    -webkit-text-fill-color: #0f172a;
}
body.support-portal.light-theme #reassign-ticket-modal .form-group select:focus {
    border-color: rgba(109, 124, 242, 0.45) !important;
    box-shadow: 0 0 0 2px rgba(109, 124, 242, 0.12) !important;
    outline: none;
}

body.support-portal.light-theme #ticket-ban-modal .modal-actions .submit-btn.secondary,
body.support-portal.light-theme #reassign-ticket-modal .modal-actions .submit-btn.secondary,
body.support-portal.light-theme #tickets-delete-dialogue-modal .modal-actions .submit-btn.secondary {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid var(--support-border-strong) !important;
}
body.support-portal.light-theme #ticket-ban-modal .modal-actions .submit-btn.secondary:hover,
body.support-portal.light-theme #reassign-ticket-modal .modal-actions .submit-btn.secondary:hover,
body.support-portal.light-theme #tickets-delete-dialogue-modal .modal-actions .submit-btn.secondary:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

body.support-portal.light-theme .tickets-delete-dialogue-row {
    background: rgba(15, 23, 42, 0.03);
    border-color: var(--support-border);
}
body.support-portal.light-theme .tickets-delete-dialogue-row-id {
    color: #0f172a !important;
}
body.support-portal.light-theme .tickets-delete-dialogue-row-status--open {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}
body.support-portal.light-theme .tickets-delete-dialogue-row-status--accepted {
    background: rgba(109, 124, 242, 0.12);
    color: #4338ca;
}
body.support-portal.light-theme .tickets-delete-dialogue-row-status--closed {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

/* ——— Mobile / iPhone (support portal) ——— */
.tickets-inbox-back-btn {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #e8ecf8;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.tickets-inbox-back-btn:hover,
.tickets-inbox-back-btn:active {
    background: rgba(109, 124, 242, 0.22);
    color: #fff;
}

@media (max-width: 820px) {
    html:has(body.support-portal),
    body.support-portal {
        overflow: hidden;
        height: 100%;
        overscroll-behavior: none;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .support-app {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
        height: var(--support-vvh, 100dvh);
        max-height: var(--support-vvh, 100dvh);
        margin-top: var(--support-vv-top, 0px);
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
    }

    .support-shell {
        grid-row: 1;
        min-height: 0;
    }

    .support-rail {
        grid-row: 2;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        gap: 4px;
        width: 100%;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
        border-right: 0;
        border-top: 1px solid var(--support-border);
        background: var(--support-bg-rail);
        z-index: 50;
    }

    .support-rail-brand {
        display: none;
    }

    .support-rail-online {
        order: 10;
        min-width: 44px;
        min-height: 44px;
        padding: 6px 8px;
        flex-direction: row;
        gap: 6px;
    }

    .support-rail-nav {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        border-radius: 14px;
    }

    .support-rail-online-popover {
        left: auto;
        right: 8px;
        bottom: calc(100% + 8px);
        top: auto;
        max-height: min(50vh, 320px);
    }

    .support-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title end"
            "actions actions";
        align-items: center;
        padding: 8px 12px;
        padding-top: max(8px, env(safe-area-inset-top, 0px));
        gap: 8px 10px;
        overflow: visible;
    }

    .support-header-left {
        grid-area: title;
        min-width: 0;
    }

    .support-header-title {
        font-size: 1.05rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: none;
        line-height: 1.25;
    }

    .support-header-actions {
        grid-area: actions;
        margin-left: 0;
        width: 100%;
        gap: 6px;
        flex-wrap: nowrap;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 2px 0 4px;
    }
    .support-header-actions::-webkit-scrollbar { display: none; }

    .support-header-end {
        grid-area: end;
        gap: 2px;
        z-index: 40;
    }

    .support-header-link {
        padding: 0;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        font-size: 0;
        gap: 0;
        flex: 0 0 auto;
    }
    .support-header-link .ui-icon,
    .support-header-link [data-icon] {
        margin: 0;
    }

    .support-header-username,
    .support-header-discord-id {
        display: none !important;
    }

    body.support-portal .support-header-user-block {
        min-height: 44px;
        min-width: 44px;
        padding: 2px;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
    }
    body.support-portal .support-header-avatar-wrap .user-avatar,
    body.support-portal .support-user-avatar {
        width: 36px;
        height: 36px;
    }
    body.support-portal .support-header-notifications .header-notifications-btn {
        width: 44px;
        height: 44px;
    }
    body.support-portal .support-header-notifications .header-notifications-dropdown {
        right: 0;
        left: auto;
        width: min(320px, calc(100vw - 20px));
        max-height: min(65vh, 400px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 100;
    }
    body.support-portal .support-user-dropdown {
        right: 0;
        left: auto;
        min-width: 200px;
        max-width: calc(100vw - 20px);
        z-index: 100;
    }
    body.support-portal .support-user-dropdown .header-dropdown-item {
        min-height: 48px;
        padding: 14px 16px;
        font-size: 15px;
    }

    body.support-portal .support-inbox-grid.tickets-inbox {
        grid-template-columns: minmax(0, 1fr) !important;
        height: 100%;
        max-height: 100% !important;
        min-height: 0 !important;
    }

    body.support-portal .tickets-inbox-sidebar,
    body.support-portal .tickets-inbox-chat,
    body.support-portal .tickets-inbox-profile {
        min-height: 0;
        max-height: none;
    }

    /* Профиль на телефоне — оверлей по кнопке, не перекрывает чат по умолчанию */
    body.support-portal .support-inbox-grid.tickets-inbox.tickets-inbox-profile-hidden .tickets-inbox-profile {
        display: none !important;
    }
    body.support-portal .support-inbox-grid.tickets-inbox:not(.tickets-inbox-profile-hidden) .tickets-inbox-profile {
        display: flex !important;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 80;
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
        border: none;
        background: var(--support-bg, #0b0f1a);
        padding: max(12px, env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: none;
    }

    body.support-portal .tickets-inbox-profile-toggle,
    body.support-portal .support-inbox-grid.tickets-inbox .tickets-inbox-profile-toggle {
        display: inline-flex !important;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }

    /* Список ↔ чат: по умолчанию список */
    body.support-portal:not(.support-inbox-chat-open) .tickets-inbox-chat {
        display: none !important;
    }
    body.support-portal.support-inbox-chat-open .tickets-inbox-sidebar {
        display: none !important;
    }
    body.support-portal.support-inbox-chat-open .tickets-inbox-chat {
        display: flex !important;
        min-height: 0;
    }

    .tickets-inbox-back-btn {
        display: inline-flex;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }

    body.support-portal .tickets-inbox-dialogue {
        min-height: 64px;
        padding: 12px 10px;
        gap: 12px;
        -webkit-tap-highlight-color: transparent;
    }
    body.support-portal .tickets-inbox-dialogue-avatar {
        width: 44px;
        height: 44px;
    }
    body.support-portal .tickets-inbox-dialogue-name {
        font-size: 15px;
    }
    body.support-portal .tickets-inbox-filter-btn,
    body.support-portal .tickets-inbox-assignee-btn,
    body.support-portal .tickets-inbox-compose-icon,
    body.support-portal .tickets-inbox-send-btn,
    body.support-portal .tickets-inbox-head-action-btn {
        min-width: 44px;
        min-height: 44px;
    }

    body.support-portal .tickets-inbox-chat-head {
        padding: 10px 12px;
        gap: 8px;
    }

    body.support-portal .tickets-inbox-compose-wrap {
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    }

    body.support-portal .tickets-inbox-reply-text,
    body.support-portal .tickets-inbox-search,
    body.support-portal .tickets-inbox-quick-search,
    .support-login-input,
    .support-replies-input,
    .support-replies-textarea,
    .support-binds-hotkey-input {
        font-size: 16px !important; /* iOS: без автозума */
    }

    .support-settings-layout {
        flex-direction: column;
        gap: 16px;
        padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    }
    .support-settings-nav {
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding-bottom: 4px;
    }
    .support-settings-nav-item {
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 44px;
    }

    .support-binds-page,
    .support-replies-page {
        padding: 14px 14px calc(20px + env(safe-area-inset-bottom, 0px));
        height: auto;
        max-height: 100%;
    }

    .support-login-page {
        min-height: 0;
        height: 100%;
        align-items: flex-start;
        justify-content: flex-start;
        padding: max(16px, env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
        padding-bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 16px));
    }
    body.support-portal.support-keyboard-open .support-login-page {
        /* Запас под клавиатуру: нижняя часть формы должна быть проскролливаема. */
        padding-bottom: max(48px, calc(var(--support-keyboard-inset, 0px) + 32px));
    }
    body.support-portal.support-login-screen .support-main,
    body.support-portal.support-login-screen .support-app,
    body.support-portal.support-portal-locked .support-main,
    body.support-portal.support-portal-locked .support-app {
        min-height: 0;
        height: var(--support-vvh, 100dvh);
        max-height: var(--support-vvh, 100dvh);
        margin-top: 0 !important;
    }
    body.support-portal.support-login-screen .support-login-center,
    body.support-portal.support-portal-locked .support-login-center {
        width: min(100%, 400px);
        margin: 0 auto;
        padding-bottom: 24px;
    }
    body.support-portal.support-keyboard-open .support-login-brand {
        display: none; /* освобождаем место над полями при открытой клавиатуре */
    }
    .support-login-title { font-size: 1.4rem; }
    .support-login-submit {
        min-height: 48px;
        font-size: 16px;
    }

    body.support-portal #ticket-ban-modal .support-ticket-ban-modal-content,
    body.support-portal .support-ticket-ban-modal .modal-content {
        width: calc(100% - 24px);
        max-width: none;
        max-height: calc(var(--support-vvh, 100dvh) - 24px);
        overflow-y: auto;
        margin: 12px;
        padding: 18px 16px;
    }

    .support-probe-modal-content {
        width: calc(100% - 24px);
        max-width: none;
    }
}

@media (max-width: 480px) {
    .support-rail-nav {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    .support-header-title {
        font-size: 1rem;
    }
}

/* ——— Light theme: online popover, login, compose, banlist contrast ——— */
body.support-portal.light-theme .support-rail-online-popover {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
    color: #0f172a;
}
body.support-portal.light-theme .support-rail-online-title {
    color: #475569;
}
body.support-portal.light-theme .support-rail-online-list {
    background: #ffffff;
    scrollbar-color: rgba(100, 116, 139, 0.45) #ffffff;
}
body.support-portal.light-theme .support-rail-online-list::-webkit-scrollbar-track {
    background: #ffffff;
}
body.support-portal.light-theme .support-rail-online-list::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.45);
    border-color: #ffffff;
}
body.support-portal.light-theme .support-rail-online-item {
    border-bottom-color: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}
body.support-portal.light-theme .support-rail-online-item:hover {
    background: rgba(15, 23, 42, 0.04);
}
body.support-portal.light-theme .support-rail-online-name {
    color: #0f172a !important;
}
body.support-portal.light-theme .support-rail-online-role,
body.support-portal.light-theme .support-rail-online-did,
body.support-portal.light-theme .support-rail-online-empty {
    color: #334155 !important;
}

body.support-portal.light-theme .support-login-card {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
    color: #0f172a;
}
body.support-portal.light-theme .support-login-label {
    color: #334155 !important;
}
body.support-portal.light-theme .support-login-title {
    color: #0f172a !important;
}
body.support-portal.light-theme .support-login-subtitle {
    color: #475569 !important;
}
body.support-portal.light-theme .support-login-input {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.18) !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a;
}
body.support-portal.light-theme .support-login-input::placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b;
}
body.support-portal.light-theme .support-login-password-toggle {
    color: #334155;
}

body.support-portal.light-theme .support-inbox-grid.tickets-inbox,
body.support-portal.light-theme .tickets-inbox-sidebar,
body.support-portal.light-theme .tickets-inbox-chat,
body.support-portal.light-theme .tickets-inbox-profile,
body.support-portal.light-theme .tickets-inbox-messages-wrap,
body.support-portal.light-theme .tickets-inbox-list {
    background: #ffffff !important;
    color: #0f172a;
}
body.support-portal.light-theme .tickets-inbox-compose-wrap,
body.support-portal.light-theme .tickets-inbox-compose {
    background: #ffffff !important;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}
body.support-portal.light-theme .tickets-inbox-reply-text,
body.support-portal.light-theme .tickets-inbox-search,
body.support-portal.light-theme .tickets-inbox-quick-search,
body.support-portal.light-theme .tickets-inbox-notes-textarea {
    background: #ffffff !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.16) !important;
}
body.support-portal.light-theme .tickets-inbox-chat-title,
body.support-portal.light-theme .tickets-inbox-dialogue-name,
body.support-portal.light-theme .tickets-inbox-profile-name,
body.support-portal.light-theme .tickets-inbox-msg-meta-name {
    color: #0f172a !important;
}
body.support-portal.light-theme .tickets-inbox-dialogue-preview,
body.support-portal.light-theme .tickets-inbox-dialogue-time,
body.support-portal.light-theme .tickets-inbox-placeholder,
body.support-portal.light-theme .tickets-inbox-list-empty {
    color: #334155 !important;
}
body.support-portal.light-theme .tickets-inbox-messages-wrap,
body.support-portal.light-theme .tickets-inbox-list,
body.support-portal.light-theme .tickets-inbox-profile {
    scrollbar-color: rgba(100, 116, 139, 0.45) #ffffff;
}
body.support-portal.light-theme .tickets-inbox-messages-wrap::-webkit-scrollbar-track,
body.support-portal.light-theme .tickets-inbox-list::-webkit-scrollbar-track,
body.support-portal.light-theme .tickets-inbox-profile::-webkit-scrollbar-track {
    background: #ffffff;
}
body.support-portal.light-theme .tickets-inbox-messages-wrap::-webkit-scrollbar-thumb,
body.support-portal.light-theme .tickets-inbox-list::-webkit-scrollbar-thumb,
body.support-portal.light-theme .tickets-inbox-profile::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.45);
    border-color: #ffffff;
}

/* Banlist: яркий чёрный текст на белом */
body.support-portal.light-theme .support-banlist-table th {
    color: #0f172a !important;
}
body.support-portal.light-theme .support-banlist-table td,
body.support-portal.light-theme .support-ban-username,
body.support-portal.light-theme .support-ban-until,
body.support-portal.light-theme .support-ban-cell--reason {
    color: #0f172a !important;
}
body.support-portal.light-theme .support-ban-cell--id code {
    color: #0f172a !important;
}
body.support-portal.light-theme .support-ban-until-rel,
body.support-portal.light-theme .support-ban-meta,
body.support-portal.light-theme .support-banlist-count {
    color: #334155 !important;
}
body.support-portal.light-theme .support-ban-expired,
body.support-portal.light-theme .support-ban-term {
    color: #854d0e !important;
    background: rgba(234, 179, 8, 0.18);
    border-color: rgba(161, 98, 7, 0.35);
}
body.support-portal.light-theme .support-ban-term--forever {
    color: #334155 !important;
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(100, 116, 139, 0.35);
}
body.support-portal.light-theme .support-ban-delete {
    color: #334155 !important;
}
body.support-portal.light-theme .support-banlist-table tr.is-expired td {
    opacity: 0.85;
}
body.support-portal.light-theme .tickets-inbox-presence-label {
    color: #475569 !important;
}

/* Меню назначения (скролл списка сотрудников) — светлая тема */
body.support-portal.light-theme .tickets-inbox-assignee-menu {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
    color: #0f172a;
    scrollbar-color: rgba(100, 116, 139, 0.45) #ffffff;
}
body.support-portal.light-theme .tickets-inbox-assignee-menu::-webkit-scrollbar-track {
    background: #ffffff;
}
body.support-portal.light-theme .tickets-inbox-assignee-menu::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.45);
    border-color: #ffffff;
}
body.support-portal.light-theme .tickets-inbox-assignee-option {
    color: #0f172a;
}
body.support-portal.light-theme .tickets-inbox-assignee-option:hover {
    background: rgba(15, 23, 42, 0.05);
}
body.support-portal.light-theme .tickets-inbox-assignee-option-name {
    color: #0f172a !important;
}
body.support-portal.light-theme .tickets-inbox-assignee-option-role,
body.support-portal.light-theme .tickets-inbox-assignee-loading,
body.support-portal.light-theme .tickets-inbox-assignee-empty {
    color: #475569 !important;
}

