/* Tiles Hub — минимальные дополнения к Bootstrap
 * Автор сайта: Оратор.К. (config/portal.php)
 */

/*
 * Тританопия (сине-жёлтый дальтонизм): избегаем чистых blue/yellow/cyan как единственных
 * различителей. Палитра: фиолетовый primary, оранжевый warning, тёмный teal info,
 * насыщенный красный danger, тёмный зелёный success + контраст по яркости.
 * Источник: Wong / Paul Tol, адаптация под Bootstrap 5.3 CSS variables.
 */
:root,
[data-bs-theme="light"] {
    --bs-primary: #6e5ba8;
    --bs-primary-rgb: 110, 91, 168;
    --bs-primary-text-emphasis: #453670;
    --bs-primary-bg-subtle: #efe8f8;
    --bs-primary-border-subtle: #d8c8ef;

    --bs-secondary: #6e7585;
    --bs-secondary-rgb: 110, 117, 133;
    --bs-secondary-text-emphasis: #3d424c;
    --bs-secondary-bg-subtle: #eef0f3;
    --bs-secondary-border-subtle: #d2d6dc;

    --bs-success: #4cc88a;
    --bs-success-rgb: 76, 200, 138;
    --bs-success-text-emphasis: #166534;
    --bs-success-bg-subtle: #edfbf3;
    --bs-success-border-subtle: #c5f0d8;

    --bs-danger: #e04e4e;
    --bs-danger-rgb: 224, 78, 78;
    --bs-danger-text-emphasis: #991b1b;
    --bs-danger-bg-subtle: #fce4e4;
    --bs-danger-border-subtle: #f5b8b8;

    --bs-warning: #f08c18;
    --bs-warning-rgb: 240, 140, 24;
    --bs-warning-text-emphasis: #9a3412;
    --bs-warning-bg-subtle: #fff0d9;
    --bs-warning-border-subtle: #f8d4a0;

    --bs-info: #e9ecef;
    --bs-info-rgb: 233, 236, 239;
    --bs-info-text-emphasis: #495057;
    --bs-info-bg-subtle: #f8f9fa;
    --bs-info-border-subtle: #dee2e6;

    --bs-light: #f8f9fa;
    --bs-light-rgb: 248, 249, 250;
    --bs-light-text-emphasis: #495057;
    --bs-light-bg-subtle: #fcfcfd;
    --bs-light-border-subtle: #e9ecef;

    --bs-dark: #2d3748;
    --bs-dark-rgb: 45, 55, 72;
    --bs-dark-text-emphasis: #1a202c;
    --bs-dark-bg-subtle: #dde1e8;
    --bs-dark-border-subtle: #a8b0bd;

    --bs-link-color: #6e5ba8;
    --bs-link-color-rgb: 110, 91, 168;
    --bs-link-hover-color: #5a4890;
    --bs-link-hover-color-rgb: 90, 72, 144;

    --bs-blue: #6e5ba8;
    --bs-cyan: #e9ecef;
    --bs-yellow: #f08c18;
    --bs-green: #4cc88a;
    --bs-red: #e04e4e;
    --bs-orange: #f08c18;
    --bs-teal: #159696;
    --bs-purple: #6e5ba8;
}

html {
    font-size: 14px;
}

.brand-logo {
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
}

.hero-logo {
    border-radius: 1.25rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.35);
}

.game-pick-input { position: absolute; opacity: 0; pointer-events: none; }

.game-pick-card {
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.game-pick-card:has(.game-pick-input:checked) {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .25);
}

.game-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    object-position: center;
    border-radius: .75rem;
}

.game-logo-sm {
    width: 36px;
    height: 36px;
    object-fit: contain;
    object-position: center;
    border-radius: .5rem;
}

.game-logo-lg {
    width: 80px;
    height: 80px;
    object-fit: contain;
    object-position: center;
    border-radius: 1rem;
}

.home-alliance-tile {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    border: 1px solid var(--bs-border-color);
}

.home-alliance-tiles__col {
    width: 18.5rem;
    max-width: calc(50% - .375rem);
}

.home-alliance-tile > .card-body {
    min-width: 0;
}

.home-tile--game-bg {
    position: relative;
    overflow: hidden;
    --bs-card-bg: transparent;
    background-color: var(--home-tile-bg-color, #eef1f4) !important;
}

.home-tile--game-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--home-tile-bg, none);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.45;
    pointer-events: none;
}

.home-tile--game-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.82) 100%);
    pointer-events: none;
}

.home-tile--game-bg > .card-body {
    position: relative;
    z-index: 1;
    background: transparent;
}

.home-popular-game-tile__meta {
    font-size: .75rem;
    line-height: 1.35;
}

.home-feature-card {
    border: 1px solid var(--bs-border-color);
    overflow: hidden;
}

.home-feature-card--games {
    background: linear-gradient(160deg, var(--bs-primary-bg-subtle) 0%, #fff 72%);
}

.home-feature-card--alliances {
    background: linear-gradient(160deg, var(--bs-success-bg-subtle) 0%, #fff 72%);
}

.home-feature-card--chat {
    background: linear-gradient(160deg, var(--bs-warning-bg-subtle) 0%, #fff 72%);
}

.home-alliance-tile:hover,
.home-alliance-tile:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 .65rem 1.25rem rgba(var(--bs-primary-rgb), .12) !important;
    border-color: var(--bs-primary-border-subtle);
}

.home-alliance-tile:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .25) !important;
}

.home-alliance-tile--empty {
    border-style: dashed;
    background: var(--bs-light-bg-subtle);
}

.home-alliance-tile__game {
    margin-bottom: .625rem;
    padding-bottom: .625rem;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    min-width: 0;
}

.home-alliance-tile__game-name {
    display: block;
    font-size: .6875rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: .04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-alliance-tile__tag {
    font-size: .6875rem;
    letter-spacing: .04em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-alliance-tile__name {
    font-weight: 600;
    font-size: .8125rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-alliance-tile__server {
    font-size: .6875rem;
    font-weight: 500;
    color: var(--bs-secondary-color) !important;
}

.home-feature-card__icon {
    font-size: 2rem;
    line-height: 1;
    height: 2rem;
    margin-bottom: .5rem;
}

.home-feature-card__title {
    margin-bottom: .75rem;
}

.home-feature-card__text {
    flex: 1 1 auto;
    min-height: 4.125rem;
    margin-bottom: 0;
    line-height: 1.5;
}

.home-feature-card__footer {
    margin-top: auto;
    border-color: rgba(var(--bs-body-color-rgb), 0.12) !important;
}

.emoji-preview { font-size: 1.75rem; line-height: 1; }

/* Alliance list entries — CSS Grid (no Bootstrap table) */
.alliance-list-grid {
    font-size: 0.875rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow-x: auto;
}

.alliance-list-grid__head-row,
.alliance-list-row {
    display: grid;
    align-items: stretch;
    min-width: 40rem;
}

.alliance-list-grid--edit .alliance-list-grid__head-row,
.alliance-list-grid--edit .alliance-list-row {
    grid-template-columns:
        2.5rem
        minmax(8rem, 1.4fr)
        repeat(var(--param-count, 1), minmax(5rem, 1fr))
        8.125rem
        2.5rem;
}

.alliance-list-grid--view .alliance-list-grid__head-row,
.alliance-list-grid--view .alliance-list-row {
    grid-template-columns:
        2.5rem
        minmax(8rem, 1.4fr)
        repeat(var(--param-count, 1), minmax(5rem, 1fr));
}

.alliance-list-grid--view.alliance-list-grid--manage .alliance-list-grid__head-row,
.alliance-list-grid--view.alliance-list-grid--manage .alliance-list-row {
    grid-template-columns:
        2.5rem
        minmax(8rem, 1.4fr)
        repeat(var(--param-count, 1), minmax(5rem, 1fr))
        8.125rem;
}

.alliance-list-grid__head-row {
    background-color: var(--bs-light, #f8f9fa);
    font-weight: 600;
}

.alliance-list-cell {
    padding: 0.5rem;
    border-right: 1px solid var(--bs-border-color);
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    min-height: 2.5rem;
    min-width: 0;
}

.alliance-list-cell:last-child {
    border-right: none;
}

.alliance-list-grid__body > :last-child .alliance-list-cell {
    border-bottom: none;
}

.alliance-list-empty {
    padding: 1.5rem;
    border-bottom: none;
}

.alliance-list-row.list-entry-highlighted {
    box-shadow: inset 5px 0 0 rgba(0, 0, 0, 0.35);
}

.alliance-list-row.list-entry-highlighted[data-highlight-variant="warning"],
.alliance-list-row.list-entry-highlighted[data-highlight-variant="light"],
.alliance-list-row.list-entry-highlighted[data-highlight-variant="info"] {
    box-shadow: inset 5px 0 0 rgba(0, 0, 0, 0.2);
}

.alliance-list-cell--actions,
.alliance-list-cell--status,
.alliance-list-cell--highlight,
.alliance-list-cell--remove {
    justify-content: center;
}

.list-entry-status-cell {
    font-weight: 600;
}

.list-entry-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid currentColor;
    border-radius: 999px;
    font-size: 0.7rem;
    line-height: 1;
}

.highlight-swatch-preview {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.highlight-palette-menu .palette-swatch {
    border-radius: 0.25rem;
    position: relative;
}

.highlight-palette-menu .palette-swatch::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.15rem;
    pointer-events: none;
}

.list-entry-row .entry-field {
    background-color: #fff;
    width: 100%;
}

.list-entry-row.list-entry-highlighted .entry-field {
    background-color: transparent;
    color: inherit;
    border-color: rgba(0, 0, 0, 0.15);
}

.list-entry-row .entry-highlight-controls .btn {
    line-height: 1;
    padding: 0.2rem 0.35rem;
}

@media (max-width: 767.98px) {
    .card:has(> .alliance-list-grid) {
        background: transparent;
        border: none;
        box-shadow: none !important;
    }

    .card:has(.alliance-list-grid--edit) .alliance-list-grid__body {
        padding: 0.75rem;
    }

    .alliance-list-grid {
        overflow-x: visible;
        border: none;
        border-radius: 0;
        font-size: 0.9375rem;
    }

    .alliance-list-grid .alliance-list-grid__head-row,
    .alliance-list-grid .alliance-list-row {
        display: block !important;
        min-width: 0 !important;
        grid-template-columns: none !important;
    }

    .alliance-list-grid__head {
        display: none;
    }

    .alliance-list-grid__body {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .card > .alliance-list-grid > .alliance-list-grid__body {
        padding: 0;
    }

    .alliance-list-row {
        border: 1px solid var(--bs-border-color);
        border-radius: var(--bs-border-radius);
        background: var(--bs-body-bg);
        box-shadow: var(--bs-box-shadow-sm);
        overflow: hidden;
    }

    .alliance-list-cell {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem 0.75rem;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.075));
        padding: 0.625rem 0.75rem;
    }

    .alliance-list-cell::before {
        content: attr(data-label);
        flex: 0 0 38%;
        max-width: 9rem;
        font-size: 0.6875rem;
        font-weight: 600;
        color: var(--bs-secondary-color);
        text-transform: uppercase;
        letter-spacing: 0.03em;
        line-height: 1.3;
    }

    .alliance-list-grid__body > :last-child.alliance-list-row .alliance-list-cell:last-child,
    .alliance-list-grid__body > .alliance-list-row:last-child .alliance-list-cell:last-child {
        border-bottom: none;
    }

    .alliance-list-cell--status {
        position: absolute;
        top: 0.625rem;
        left: 0.75rem;
        z-index: 1;
        width: auto;
        min-height: auto;
        padding: 0;
        border: none;
        font-weight: 700;
        font-size: 0.875rem;
    }

    .alliance-list-cell--status::before {
        display: none;
    }

    .alliance-list-grid--view .alliance-list-row {
        position: relative;
    }

    .alliance-list-grid--view .alliance-list-row > .alliance-list-cell:nth-child(2) {
        padding: 0.625rem 0.75rem 0.625rem 2.25rem;
        font-weight: 600;
        font-size: 1rem;
        border-bottom: 1px solid var(--bs-border-color);
    }

    .alliance-list-grid--view .alliance-list-row > .alliance-list-cell:nth-child(2)::before {
        display: none;
    }

    .alliance-list-cell--mobile-toolbar,
    .alliance-list-cell--actions,
    .alliance-list-cell--remove {
        position: static;
    }

    .alliance-list-cell--mobile-toolbar,
    .alliance-list-cell--actions,
    .alliance-list-cell--remove,
    .alliance-list-cell--highlight {
        justify-content: center;
    }

    .alliance-list-cell--mobile-toolbar,
    .alliance-list-cell--actions,
    .alliance-list-cell--remove {
        border-bottom: 1px solid var(--bs-border-color);
        background-color: var(--bs-light, #f8f9fa);
    }

    .alliance-list-cell--mobile-toolbar::before,
    .alliance-list-cell--actions::before,
    .alliance-list-cell--remove::before {
        display: none;
    }

    .alliance-list-mobile-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        width: 100%;
    }

    .alliance-list-grid--edit .alliance-list-row > .alliance-list-cell:nth-child(3) {
        border-bottom: 1px solid var(--bs-border-color);
    }

    .alliance-list-grid--edit .alliance-list-row > .alliance-list-cell:nth-child(3)::before {
        display: none;
    }

    .alliance-list-cell--highlight {
        flex-direction: column;
        align-items: stretch;
        background-color: var(--bs-light, #f8f9fa);
    }

    .alliance-list-cell--highlight::before {
        flex: 0 0 auto;
        max-width: none;
        width: 100%;
        text-align: center;
        margin-bottom: 0.25rem;
    }

    .alliance-list-cell--highlight .entry-highlight-controls {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(2.75rem, 1fr));
        gap: 0.5rem;
        width: min(100%, 15rem);
        margin-inline: auto;
    }

    .alliance-list-cell--highlight .entry-highlight-controls .highlight-color-input {
        display: none;
    }

    .alliance-list-cell--highlight .entry-highlight-controls .dropdown,
    .alliance-list-cell--highlight .entry-highlight-controls .btn {
        width: 100%;
    }

    .alliance-list-cell--highlight .entry-highlight-controls .btn {
        min-height: 2.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .alliance-list-cell--highlight .entry-highlight-controls .palette-toggle {
        width: 100%;
    }

    .alliance-list-cell .entry-field,
    .alliance-list-cell .form-control {
        flex: 1 1 58%;
        min-width: 0;
    }

    .alliance-list-empty {
        border: 1px dashed var(--bs-border-color);
        border-radius: var(--bs-border-radius);
        background: var(--bs-light, #f8f9fa);
    }
}

.chat-layout {
    overflow: hidden;
}

.alliance-settings-groups-row > td {
    vertical-align: top;
}

.alliance-settings-group-cell__hint {
    min-height: 1.125rem;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--bs-secondary-color);
    line-height: 1.125rem;
}

:root {
    --chat-dock-rail: 4.0625rem;
    --chat-dock-drawer: 400px;
    --chat-dock-btn: 3.125rem;
    --chat-dock-icon: 1.40625rem;
    --chat-dock-avatar: 2.5rem;
}

body.has-chat-dock {
    padding-right: var(--chat-dock-rail);
    transition: padding-right 0.2s ease;
}

body.has-chat-dock.chat-dock--expanded {
    padding-right: calc(var(--chat-dock-rail) + var(--chat-dock-drawer));
}

body > .modal:not(.show) {
    display: none !important;
}

.chat-dock {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    z-index: 1050;
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
    align-items: stretch;
    pointer-events: none;
}

.chat-dock__rail,
.chat-dock__drawer {
    pointer-events: auto;
}

.chat-dock__rail {
    width: var(--chat-dock-rail);
    height: 100%;
    background: #3b4654;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.46875rem;
    padding: 0.625rem 0;
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-dock__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--chat-dock-btn);
    height: var(--chat-dock-btn);
    padding: 0;
    border: none;
    border-radius: 0.625rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
    position: relative;
}

.chat-dock__btn:hover,
.chat-dock__btn.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.chat-dock__btn.is-active {
    box-shadow: inset 0 0 0 2px #2fc6f6;
}

.chat-dock__badge {
    position: absolute;
    top: 0.0625rem;
    right: 0.0625rem;
    min-width: 1.40625rem;
    height: 1.40625rem;
    padding: 0 0.3125rem;
    border-radius: 999px;
    background: #ff5752;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.40625rem;
    text-align: center;
    border: 2px solid #3b4654;
    pointer-events: none;
    box-sizing: content-box;
}

.chat-dock__btn--link {
    background: #2fc6f6;
    color: #fff;
    font-size: 1.5625rem;
    line-height: 1;
    margin-top: 0.3125rem;
}

.chat-dock__btn--link:hover {
    background: #1eb3e2;
    color: #fff;
}

.chat-dock__btn-avatar {
    width: var(--chat-dock-avatar);
    height: var(--chat-dock-avatar);
    border-radius: 50%;
    object-fit: cover;
}

.chat-dock__btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-dock__btn-icon svg {
    width: var(--chat-dock-icon);
    height: var(--chat-dock-icon);
}

.chat-dock__btn--global .chat-dock__btn-icon {
    color: #7dd3fc;
}

.chat-dock__btn--alliance .chat-dock__btn-icon {
    color: #a5d6a7;
}

.chat-dock__btn--officers .chat-dock__btn-icon {
    color: #ffcc80;
}

.chat-dock__btn--group .chat-dock__btn-icon {
    color: #ce93d8;
}

.chat-dock__divider {
    width: 2.1875rem;
    height: 1px;
    background: rgba(255, 255, 255, 0.18);
    margin: 0.3125rem 0;
    flex-shrink: 0;
}

.chat-dock__drawer {
    width: var(--chat-dock-drawer);
    height: 100%;
    background: #fff;
    border-left: 1px solid #dfe3e6;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
}

.chat-dock__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #dfe3e6;
    background: #eef2f4;
    flex-shrink: 0;
}

.chat-dock__header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.chat-dock__hide {
    border: none;
    background: transparent;
    color: #828b95;
    font-size: 1rem;
    line-height: 1;
    padding: 0.125rem 0.25rem;
    cursor: pointer;
}

.chat-dock__pin {
    border: none;
    background: transparent;
    color: #828b95;
    font-size: 1rem;
    line-height: 1;
    padding: 0.125rem 0.25rem;
    cursor: pointer;
}

.chat-dock__pin.is-active {
    color: #2067b0;
}

.chat-dock__pin:hover {
    color: #2067b0;
}

.chat-dock__hide:hover {
    color: #e04b4b;
}

.chat-dock__btn.is-pinned::after {
    content: '';
    position: absolute;
    top: 0.1875rem;
    right: 0.1875rem;
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: #2067b0;
    box-shadow: 0 0 0 1px #fff;
}

.chat-dock__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #333;
    line-height: 1.25;
}

.chat-dock__subtitle {
    font-size: 0.6875rem;
    color: #828b95;
    margin-top: 0.125rem;
}

.chat-dock__close {
    border: none;
    background: transparent;
    color: #828b95;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.chat-dock__close:hover {
    color: #333;
}

.chat-dock__messages {
    flex: 1;
    min-height: 0;
    padding: 0.5rem;
    font-size: 0.8125rem;
}

.chat-dock__messages .chat-bubble__body {
    font-size: 0.8125rem;
    padding: 0.375rem 0.5rem;
}

.chat-dock__messages .chat-avatar--sm {
    width: 1.5rem;
    height: 1.5rem;
}

.chat-dock #chat-dock-composer-wrap .chat-composer {
    padding: 0.5rem;
}

.chat-dock #chat-dock-composer-wrap .chat-composer__input {
    font-size: 0.8125rem;
    min-height: 2rem;
}

.chat-dock #chat-dock-composer-wrap .chat-composer__send {
    width: 2rem;
    height: 2rem;
}

.portal-body {
    background: #eef2f4;
}

.portal-app {
    display: flex;
    min-height: 100vh;
}

.portal-sidebar {
    width: 15.5rem;
    min-width: 15.5rem;
    background: #3b4654;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1040;
}

.portal-sidebar__brand-link {
    color: #fff;
    padding: 1rem 1rem 0.75rem;
    font-size: 1rem;
}

.portal-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.5rem 1rem;
}

.portal-sidebar__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.125rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 0.875rem;
}

.portal-sidebar__item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.portal-sidebar__item.is-active {
    background: #2fc6f6;
    color: #fff;
}

.portal-sidebar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    flex-shrink: 0;
    opacity: 0.95;
}

.portal-sidebar__footer {
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.portal-sidebar__user {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-sidebar__logout {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    padding: 0;
    font-size: 0.8125rem;
    cursor: pointer;
}

.portal-sidebar__logout:hover {
    color: #fff;
    text-decoration: underline;
}

.portal-shell {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.portal-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.25rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border-bottom: 1px solid #dfe3e6;
}

.portal-topbar__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #dfe3e6;
    border-radius: 0.5rem;
    background: #fff;
    color: #525c69;
}

.portal-topbar__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-main {
    flex: 1;
    min-height: 0;
}

.portal-main__inner {
    padding: 1.25rem;
    max-width: 100%;
}

.portal-main--flush .portal-main__inner {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.portal-body--flush .portal-main {
    display: flex;
    flex-direction: column;
}

.portal-sidebar-backdrop {
    display: none;
}

.alliance-shell {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 6.5rem);
    background: #fff;
    border: 1px solid #dfe3e6;
    border-radius: 0.75rem;
    overflow: hidden;
}

.alliance-shell--flush {
    min-height: calc(100vh - 3.25rem);
    height: calc(100vh - 3.25rem);
    border: none;
    border-radius: 0;
}

.alliance-sidebar {
    width: 13.5rem;
    min-width: 13.5rem;
    background: #eef2f4;
    border-right: 1px solid #dfe3e6;
    display: flex;
    flex-direction: column;
}

.alliance-sidebar__head {
    padding: 1rem;
    border-bottom: 1px solid #dfe3e6;
}

.alliance-sidebar__title {
    display: block;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.35;
}

.alliance-sidebar__title:hover {
    color: #2067b0;
}

.alliance-sidebar__tag {
    color: #2067b0;
}

.alliance-sidebar__meta {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #828b95;
}

.alliance-sidebar__nav {
    padding: 0.5rem 0;
    overflow-y: auto;
}

.alliance-sidebar__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
}

.alliance-sidebar__item:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #333;
}

.alliance-sidebar__item.is-active {
    background: #fff;
    border-left-color: #2fc6f6;
    font-weight: 600;
}

.alliance-sidebar__icon {
    display: inline-flex;
    color: #828b95;
    flex-shrink: 0;
}

.alliance-sidebar__badge {
    margin-left: auto;
    min-width: 1.25rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: #2fc6f6;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    text-align: center;
}

.alliance-sidebar__subnav {
    padding: 0.25rem 0 0.5rem 2.5rem;
}

.alliance-sidebar__subitem {
    display: block;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    color: #525c69;
    text-decoration: none;
    border-radius: 0.375rem;
}

.alliance-sidebar__subitem:hover {
    background: rgba(255, 255, 255, 0.65);
    color: #333;
}

.alliance-sidebar__subitem.is-active {
    background: #fff;
    color: #2067b0;
    font-weight: 600;
}

.alliance-main {
    flex: 1;
    min-width: 0;
    padding: 1.25rem;
    background: #f8fafb;
    overflow-y: auto;
}

.alliance-shell--flush .alliance-main {
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-app--nested {
    flex: 1;
    min-height: 0;
    height: 100%;
    max-height: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.chat-app--page {
    flex: 1;
    min-height: 0;
    height: 100%;
    width: 100%;
    max-height: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.chat-app {
    display: flex;
    min-height: 0;
    height: 100%;
    max-height: none;
    border: none;
    border-radius: 0;
    overflow: hidden;
    background: #fff;
    box-shadow: none;
}

.chat-sidebar {
    width: 18.5rem;
    min-width: 18.5rem;
    background: #eef2f4;
    border-right: 1px solid #dfe3e6;
    display: flex;
    flex-direction: column;
}

.chat-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #dfe3e6;
    background: #eef2f4;
}

.chat-sidebar__heading {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #333;
}

.chat-sidebar__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: #2fc6f6;
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.chat-sidebar__action:hover {
    background: #1eb3e2;
    color: #fff;
}

.chat-sidebar__list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.chat-sidebar__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: #333;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease;
}

.chat-sidebar__item:hover {
    background: rgba(255, 255, 255, 0.65);
    color: #333;
}

.chat-sidebar__item.is-active {
    background: #fff;
    border-left-color: #2fc6f6;
}

.chat-sidebar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #d5dde0;
    color: #525c69;
    flex-shrink: 0;
}

.chat-sidebar__item-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.chat-sidebar__title {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-sidebar__subtitle {
    font-size: 0.75rem;
    color: #828b95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-sidebar__empty {
    padding: 1rem;
    font-size: 0.875rem;
    color: #828b95;
}

.chat-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f8fafb;
}

.chat-main__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #dfe3e6;
    background: #fff;
}

.chat-main__header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.chat-main__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.chat-main__subtitle {
    font-size: 0.8125rem;
    color: #828b95;
}

.chat-main__subtitle a {
    color: #2067b0;
    text-decoration: none;
}

.chat-main__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    background:
        linear-gradient(#f8fafb, #f8fafb) center top / 100% 100% no-repeat,
        repeating-linear-gradient(
            45deg,
            rgba(47, 198, 246, 0.03) 0,
            rgba(47, 198, 246, 0.03) 1px,
            transparent 1px,
            transparent 12px
        );
}

.chat-main__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 12rem;
    color: #828b95;
    font-size: 0.9375rem;
}

.chat-main__welcome {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    align-content: start;
}

.chat-welcome-card {
    background: #fff;
    border: 1px solid #dfe3e6;
    border-radius: 0.75rem;
    padding: 1rem 1.125rem;
}

.chat-search-results {
    margin-top: 0.5rem;
    border: 1px solid #dfe3e6;
    border-radius: 0.5rem;
    background: #fff;
    max-height: 12rem;
    overflow-y: auto;
}

.chat-search-results__item,
.chat-search-results__empty {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: none;
    background: transparent;
    text-align: left;
    color: #333;
}

.chat-search-results__item:hover {
    background: #eef2f4;
}

.chat-search-results__empty {
    color: #828b95;
    font-size: 0.875rem;
}

.chat-autocomplete {
    position: relative;
}

.chat-autocomplete .chat-search-results {
    position: absolute;
    z-index: 1060;
    left: 0;
    right: 0;
}

.chat-compose-members {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 2rem;
}

.chat-compose-members__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem 0.25rem 0.625rem;
    border-radius: 999px;
    background: #eef2f4;
    font-size: 0.875rem;
}

.chat-compose-members__remove {
    border: none;
    background: transparent;
    color: #828b95;
    line-height: 1;
    padding: 0 0.125rem;
    font-size: 1.125rem;
}

.chat-compose-members__remove:hover {
    color: #333;
}

.chat-bubble-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.chat-bubble-row--own {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: min(34rem, 78%);
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.chat-bubble-row--other .chat-bubble {
    align-items: flex-start;
}

.chat-bubble-row--own .chat-bubble {
    align-items: flex-end;
}

.chat-bubble__author {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2067b0;
    padding: 0 0.25rem;
}

.chat-user-trigger {
    cursor: pointer;
}

.chat-bubble__author.chat-user-trigger {
    background: none;
    border: none;
    display: inline-block;
    text-align: left;
}

.chat-bubble__author.chat-user-trigger:hover {
    text-decoration: underline;
}

.chat-avatar-trigger {
    flex-shrink: 0;
    line-height: 0;
    border-radius: 50%;
}

.chat-avatar-trigger:hover {
    opacity: 0.88;
}

.chat-bubble__body {
    padding: 0.625rem 0.875rem;
    border-radius: 1rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-bubble-row--other .chat-bubble__body {
    background: #fff;
    border: 1px solid #dfe3e6;
    border-bottom-left-radius: 0.25rem;
}

.chat-bubble-row--own .chat-bubble__body {
    background: #d8f0fb;
    border: 1px solid #b9e6fa;
    border-bottom-right-radius: 0.25rem;
}

.chat-bubble__time {
    font-size: 0.6875rem;
    color: #828b95;
    padding: 0 0.25rem;
}

.chat-bubble__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0 0.25rem;
}

.chat-bubble__edited {
    font-size: 0.6875rem;
    color: #828b95;
    font-style: italic;
}

.chat-message-edit {
    border: none;
    background: transparent;
    color: #828b95;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.chat-bubble-row--own:hover .chat-message-edit,
.chat-bubble-row--editable:hover .chat-message-edit,
.chat-message-edit:focus {
    opacity: 1;
}

.chat-message-edit:hover {
    color: #2067b0;
}

.chat-bubble-row--own .chat-bubble__meta {
    justify-content: flex-end;
}

.chat-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #dfe3e6;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
    user-select: none;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-avatar--sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.6875rem;
}

.chat-avatar--md {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.8125rem;
}

.chat-composer {
    padding: 0.75rem 1rem 1rem;
    background: #fff;
    border-top: 1px solid #dfe3e6;
}

.chat-composer__bar {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem 0.375rem 0.75rem;
    border: 1px solid #dfe3e6;
    border-radius: 1.5rem;
    background: #f8fafb;
}

.chat-composer__input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    min-height: 1.5rem;
    max-height: 7.5rem;
    padding: 0.25rem 0;
    font-size: 0.9375rem;
    line-height: 1.4;
    outline: none;
    box-shadow: none;
}

.chat-composer__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    list-style: none;
}

.chat-composer__icon-btn::-webkit-details-marker {
    display: none;
}

.chat-composer__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 50%;
    background: #2fc6f6;
    color: #fff;
    flex-shrink: 0;
    cursor: pointer;
}

.chat-composer__send:hover {
    background: #1eb3e2;
}

.chat-composer--readonly {
    background: #fff;
    border-top: 1px solid #dfe3e6;
}

.chat-composer__notice {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #828b95;
}

.chat-composer__error {
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: #fdecea;
    color: #b42318;
    font-size: 0.8125rem;
}

.chat-smiley-picker {
    position: relative;
}

.chat-smiley-picker__popover {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 0;
    z-index: 5;
    width: 16rem;
    padding: 0.5rem;
    border: 1px solid #dfe3e6;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.chat-smiley-picker__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-height: 8rem;
    overflow-y: auto;
}

.chat-smiley-btn {
    min-width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    font-size: 1.125rem;
    cursor: pointer;
}

.chat-smiley-btn:hover {
    background: #eef2f4;
}

.chat-smiley {
    font-size: 1.125rem;
    line-height: 1.2;
}

.chat-group-modal .modal-content {
    border: none;
    border-radius: 0.75rem;
}

.chat-group-members {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 16rem;
    overflow-y: auto;
    border: 1px solid #dfe3e6;
    border-radius: 0.5rem;
    padding: 0.25rem;
    background: #f8fafb;
}

.chat-group-member {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    cursor: pointer;
    margin: 0;
}

.chat-group-member:hover {
    background: #eef2f4;
}

.chat-group-member__checkbox {
    flex-shrink: 0;
}

.chat-group-member__name {
    font-size: 0.875rem;
    color: #333;
}

@media (max-width: 991.98px) {
    body.has-chat-dock {
        padding-right: 0;
    }

    body.has-chat-dock.chat-dock--expanded {
        padding-right: 0;
    }

    .chat-dock {
        top: auto;
        bottom: 0;
        left: 0;
        flex-direction: column-reverse;
        height: auto;
    }

    .chat-dock__rail {
        flex-direction: row;
        width: 100%;
        height: var(--chat-dock-rail);
        overflow-x: auto;
        overflow-y: hidden;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .chat-dock__divider {
        width: 1px;
        height: 2.1875rem;
        margin: 0 0.3125rem;
        align-self: center;
        flex-shrink: 0;
    }

    .chat-dock__drawer {
        width: 100%;
        height: min(70vh, 28rem);
        border-left: none;
        border-top: 1px solid #dfe3e6;
    }

    .chat-app {
        flex-direction: column;
        height: 100%;
    }

    .chat-sidebar {
        width: 100%;
        min-width: 0;
        max-height: 12rem;
        border-right: none;
        border-bottom: 1px solid #dfe3e6;
    }
}

.profile-hero {
    position: relative;
    min-height: 220px;
    border-radius: var(--bs-border-radius-lg);
    background: linear-gradient(135deg, #2d3142, #4f5d75);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.profile-hero__overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.65));
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    padding: 1.25rem;
}

.profile-hero__content {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    width: 100%;
}

.profile-hero__avatar {
    width: 96px;
    height: 96px;
    object-fit: cover;
    background: #fff;
}

.profile-hero__bio {
    max-width: 42rem;
}

.profile-modal-hero {
    position: relative;
    min-height: 140px;
    border-radius: var(--bs-border-radius-lg);
    background: linear-gradient(135deg, #2d3142, #4f5d75);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.profile-modal-hero__overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.65));
    min-height: 140px;
    display: flex;
    align-items: flex-end;
    gap: 0.875rem;
    padding: 1rem;
}

.profile-modal-hero__avatar {
    width: 72px;
    height: 72px;
    object-fit: cover;
    background: #fff;
    flex-shrink: 0;
}

.profile-modal-hero__bio {
    margin-top: 0.25rem;
    opacity: 0.92;
}

.navbar-user-trigger {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
}

.navbar-user-trigger:hover,
.navbar-user-trigger:focus {
    color: #fff;
}

.navbar-user-trigger__avatar {
    width: 2rem;
    height: 2rem;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.navbar-user-trigger__name {
    font-size: 0.875rem;
    font-weight: 500;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-modal-manage__actions {
    gap: 0.5rem;
}

.profile-preset-option {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.profile-preset-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.profile-preset-option img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 2px solid transparent;
}

.profile-preset-option input:checked + img {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.profile-preset-option--cover img {
    width: 96px;
    height: 32px;
    border-radius: 0.375rem;
}

.profile-preset-confirm-preview__trigger {
    display: block;
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
    background: #eef1f4;
    cursor: zoom-in;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.profile-preset-confirm-preview__trigger:hover,
.profile-preset-confirm-preview__trigger:focus-visible {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
    outline: none;
}

.profile-preset-confirm-preview__img {
    display: block;
    width: 100%;
    object-fit: cover;
    background: #dfe3e6;
}

.profile-preset-confirm-preview--cover .profile-preset-confirm-preview__img {
    aspect-ratio: 3 / 1;
    max-height: 220px;
}

.profile-preset-confirm-preview--avatar .profile-preset-confirm-preview__img {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 50%;
}

.profile-preset-confirm-preview--avatar .profile-preset-confirm-preview__trigger {
    width: auto;
    margin: 0 auto;
}

.profile-preset-preview-large {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 8rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--bs-border-radius);
}

.profile-moderation-preview {
    width: 72px;
    height: 72px;
    object-fit: cover;
}
