:root {
    --bg: #080c10;
    --panel: rgba(13, 18, 24, .86);
    --panel-strong: #101820;
    --line: rgba(122, 255, 183, .16);
    --line-strong: rgba(122, 255, 183, .32);
    --text: #e7edf3;
    --muted: #8996a6;
    --green: #65f0a0;
    --green-strong: #38d47b;
    --blue: #7cb7ff;
    --danger: #ff867d;
    --danger-bg: rgba(255, 89, 89, .12);
    --success-bg: rgba(76, 222, 128, .12);
    --shadow: 0 24px 90px rgba(0, 0, 0, .42);
}

.vault-layout {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.vault-auth-panel,
.vault-master-panel {
    max-width: 760px;
}

.vault-auth-panel {
    display: grid;
    gap: 16px;
}

.vault-auth-panel > .button {
    justify-self: start;
    margin-top: 2px;
}

.vault-editor,
.vault-master-panel {
    align-self: start;
}

.vault-master-panel {
    grid-column: 1 / -1;
}

.vault-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.vault-form .button {
    justify-self: start;
}

.secret-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.secret-input button,
.vault-secret-grid button {
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    background: rgba(255, 255, 255, .035);
    cursor: pointer;
}

.secret-input button:hover,
.vault-secret-grid button:hover {
    color: var(--green);
    border-color: var(--line-strong);
}

.vault-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 14px;
}

.vault-list {
    display: grid;
    gap: 12px;
}

.vault-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.vault-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
}

.vault-card-head > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.vault-card-head strong,
.vault-card-head a {
    overflow-wrap: anywhere;
}

.vault-card-head a {
    color: var(--green);
    font-size: 13px;
}

.vault-card-head small {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.vault-secret-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.vault-secret-grid label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    align-items: end;
}

.vault-secret-grid label > span,
.vault-secret-grid label > small {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.vault-secret-grid input {
    min-width: 0;
}

.vault-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vault-tags span {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 3px 8px;
    border: 1px solid rgba(101, 240, 160, .22);
    border-radius: 999px;
    color: var(--green);
    font-size: 12px;
    font-weight: 650;
    background: rgba(101, 240, 160, .07);
}

.vault-notes {
    margin: 0;
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid rgba(124, 183, 255, .18);
    border-left: 3px solid var(--blue);
    border-radius: 8px;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(124, 183, 255, .08), transparent 70%),
        rgba(255, 255, 255, .026);
    overflow-wrap: anywhere;
}

.vault-notes > span {
    color: var(--blue);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.vault-notes > div {
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.5;
}

.vault-edit {
    display: grid;
    gap: 12px;
}

.vault-edit summary {
    width: max-content;
    color: var(--green);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.vault-edit[open] {
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.nav-group--admin:not(.is-open) .nav-submenu,
.cabinet-nav.is-open .nav-group--admin:not(.is-open) .nav-submenu {
    display: none !important;
    opacity: 0;
    pointer-events: none;
    transform: none;
}

.nav-group--admin:not(.is-open) .nav-chevron {
    transform: rotate(45deg) translateY(-2px);
}

.eyebrow,
.field > span,
.chat-thread-edit-grid label > span,
.chat-member-search-form label > span,
.dossier-field-key small,
.chat-admin-panel__head span,
.panel-title span,
.hero-meta span,
.hero-meta button {
    font-size: 10px;
}

.muted,
.auth-subtitle,
.button,
input,
textarea,
select,
.custom-select__button,
.custom-select__option,
.admin-subnav a,
.panel-title h2,
.chat-threads-title__label,
.chat-thread-list__meta strong,
.chat-message-bubble,
.chat-admin-panel__head strong,
.chat-admin-modal__head small,
.chat-create-modal__head small,
.chat-user-modal__head small,
.chat-audit-head small,
.chat-invite-chip > span:last-child strong,
.chat-invite-chip > span:nth-child(2) strong,
.dossier-field-key strong,
.role-card strong,
.dossier-card strong,
.guide-card h2,
.vault-card-head strong,
.vault-card-head a,
.profile-session-card strong,
.user-manage-form,
.withdraw-table,
.work-rank-row,
.admin-work-row {
    font-size: 12px;
}

input,
textarea,
select,
.custom-select__button {
    min-height: 38px;
    padding: 8px 11px;
}

select,
.custom-select__button {
    padding-right: 38px;
}

.cabinet-hero {
    padding: 16px 18px;
}

.cabinet-hero--compact {
    padding: 15px 18px;
}

.cabinet-hero:has(+ .chat-layout) h1,
.chat-thread-heading h1,
.chat-threads-title__label strong,
.panel-title h2,
.chat-admin-modal__head h2,
.chat-create-modal__head h2,
.chat-user-modal__head h2,
.chat-edit-modal__head h2,
.chat-rules-modal__head h2,
.confirm-modal__content h2,
.avatar-crop-head h2,
.vault-detail-title h2 {
    font-size: 16px;
}

.cabinet-hero h1,
.auth-heading h1,
.profile-top h1 {
    font-size: 20px;
}

.status-card strong,
.metric-card strong,
.chat-empty--direct strong,
.chat-bot-settings-summary strong,
.withdraw-balance-primary strong {
    font-size: 15px;
}

.data-panel,
.metric-card {
    padding: 14px;
}

.chat-message-author,
.chat-message-time,
.chat-thread-preview,
.chat-admin-empty,
.chat-admin-note,
.chat-invite-chip > span:last-child small,
.chat-invite-chip > span:nth-child(2) small,
.vault-card-head small,
.profile-session-card small,
.author-meta small,
.entity-author,
.hero-meta span,
.hero-meta button {
    font-size: 11px;
}

.chat-view-tabs button,
.chat-audit-filters button,
.balance-tabs a,
.work-profile-tabs a {
    font-size: 12px;
}

.chat-text-editor {
    font-size: 13px;
}

.vault-app {
    display: grid;
    grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.vault-rail,
.vault-browser,
.vault-items,
.vault-detail-card {
    border: 1px solid rgba(101, 240, 160, .16);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .035), transparent 64%),
        rgba(12, 17, 23, .78);
    box-shadow: 0 16px 48px rgba(0, 0, 0, .20);
}

.vault-rail {
    position: sticky;
    top: 14px;
    display: grid;
    gap: 10px;
    padding: 12px;
}

.vault-rail-head {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.vault-avatar,
.vault-item-icon,
.vault-detail-icon {
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    color: #06100b;
    background: linear-gradient(135deg, var(--green), #21e6c1);
    font-weight: 900;
}

.vault-avatar {
    width: 40px;
    height: 40px;
    font-size: 13px;
}

.vault-rail-head strong {
    min-width: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-section-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.vault-section-switch a,
.vault-rail-item {
    min-width: 0;
    min-height: 34px;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.vault-section-switch a {
    display: inline-flex;
    justify-content: center;
    padding: 7px 9px;
}

.vault-section-switch a:hover,
.vault-section-switch a.is-active {
    color: var(--green);
    border-color: rgba(101, 240, 160, .28);
    background: rgba(101, 240, 160, .08);
}

.vault-rail-item {
    width: 100%;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 7px 9px;
    text-align: left;
    cursor: pointer;
}

.vault-rail-item span:not(.vault-rail-icon):not(.vault-tag-dot) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-rail-item b {
    min-width: 26px;
    padding: 2px 6px;
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .10);
    font-size: 11px;
    text-align: center;
}

.vault-rail-item:hover,
.vault-rail-item.is-active {
    color: var(--green);
    border-color: rgba(101, 240, 160, .26);
    background: rgba(101, 240, 160, .075);
}

.vault-rail-icon {
    display: inline-grid;
    place-items: center;
    color: inherit;
    text-align: center;
}

.vault-rail-icon .vault-local-icon {
    width: 15px;
    height: 15px;
}

.vault-rail-section {
    display: grid;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, .12);
}

.vault-rail-section > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.vault-tag-dot {
    width: 8px;
    height: 8px;
    place-self: center;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(101, 240, 160, .10);
}

.vault-browser {
    min-width: 0;
    display: grid;
    gap: 14px;
    padding: 14px;
}

.vault-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.vault-search--app {
    margin: 0;
}

.vault-search--app input {
    min-height: 42px;
}

.vault-toolbar > .button {
    min-height: 42px;
}

.vault-workspace {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.vault-items {
    min-width: 0;
    display: grid;
    gap: 10px;
    padding: 12px;
}

.vault-items-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.vault-items-head strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
}

.vault-items-head span,
.vault-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.vault-item-list {
    display: grid;
    gap: 7px;
    max-height: min(640px, 66svh);
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(101, 240, 160, .34) transparent;
}

.vault-item,
.vault-empty {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.vault-item {
    min-height: 54px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding: 8px;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.vault-item:hover,
.vault-item.is-active {
    border-color: rgba(101, 240, 160, .34);
    background: rgba(101, 240, 160, .075);
}

.vault-item.is-filter-hidden {
    display: none;
}

.vault-item-icon,
.vault-detail-icon {
    width: 38px;
    height: 38px;
    font-size: 12px;
}

.vault-item-icon--2,
.vault-detail-icon.vault-item-icon--2 {
    background: linear-gradient(135deg, #7cb7ff, #65f0a0);
}

.vault-item-icon--3,
.vault-detail-icon.vault-item-icon--3 {
    background: linear-gradient(135deg, #f9d36a, #65f0a0);
}

.vault-item-icon--4,
.vault-detail-icon.vault-item-icon--4 {
    background: linear-gradient(135deg, #c084fc, #65f0a0);
}

.vault-item-icon--5,
.vault-detail-icon.vault-item-icon--5 {
    background: linear-gradient(135deg, #fb7185, #65f0a0);
}

.vault-item-icon--6,
.vault-detail-icon.vault-item-icon--6 {
    background: linear-gradient(135deg, #2dd4bf, #7cb7ff);
}

.vault-item-text {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.vault-item-text strong,
.vault-item-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-item-text strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
}

.vault-item-text small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.vault-empty {
    padding: 12px;
}

.vault-detail {
    min-width: 0;
    display: grid;
}

.vault-detail-card {
    display: none;
    gap: 14px;
    min-width: 0;
    padding: 14px;
}

.vault-detail-card.is-active {
    display: grid;
}

.vault-detail-title {
    min-width: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .13);
}

.vault-detail-title > div {
    min-width: 0;
}

.vault-detail-title h2 {
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-detail-title small {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-detail-title .button {
    min-height: 36px;
}

.vault-detail-title-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.vault-detail-icon {
    width: 44px;
    height: 44px;
    font-size: 13px;
}

.vault-field-table {
    display: grid;
    gap: 8px;
}

.vault-field-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(92px, .28fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.vault-field-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.vault-field-row input {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 13px;
}

.vault-field-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.vault-field-actions small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.vault-field-row--totp {
    grid-template-columns: minmax(92px, .22fr) minmax(120px, .5fr) minmax(190px, auto);
}

.vault-field-row--totp input {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0;
    text-align: center;
}

.vault-totp-ring {
    --totp-progress: 100%;
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: var(--green);
    background:
        radial-gradient(circle at center, rgba(12, 17, 23, .94) 57%, transparent 59%),
        conic-gradient(var(--green) var(--totp-progress), rgba(148, 163, 184, .18) 0);
    font-size: 11px;
    font-weight: 900;
}

.vault-totp-copy {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
}

.vault-icon-button,
.vault-tag-toggle {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .035);
    cursor: pointer;
    text-decoration: none;
}

.vault-icon-button:hover,
.vault-icon-button.is-copied,
.vault-tag-toggle:hover {
    color: var(--green);
    border-color: rgba(101, 240, 160, .32);
    background: rgba(101, 240, 160, .08);
}

.vault-local-icon {
    width: 17px;
    height: 17px;
}

.vault-item-marker {
    display: inline-block;
    margin-right: 5px;
    color: #f9d36a;
}

.vault-form--detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vault-form--detail .field--wide,
.vault-form--detail .vault-custom-fields,
.vault-form--detail .vault-form-actions {
    grid-column: 1 / -1;
}

.vault-form--detail .field {
    min-width: 0;
}

.vault-form--detail textarea {
    min-height: 96px;
    resize: vertical;
}

.vault-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.vault-password-field {
    display: grid;
    gap: 6px;
}

.vault-strength {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.vault-strength i {
    --strength-width: 0%;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, .16);
}

.vault-strength i::before {
    content: "";
    display: block;
    width: var(--strength-width);
    height: 100%;
    border-radius: inherit;
    background: var(--danger);
}

.vault-strength[data-score="3"] i::before {
    background: #f9d36a;
}

.vault-strength[data-score="4"] i::before,
.vault-strength[data-score="5"] i::before {
    background: var(--green);
}

.vault-generator,
.vault-flag-grid,
.vault-state-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.vault-generator {
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.vault-generator-head {
    display: flex;
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.vault-generator-head > span,
.vault-flag-grid span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.vault-generator label,
.vault-flag-grid label {
    min-height: 34px;
    display: inline-flex;
    gap: 7px;
    align-items: center;
    padding: 6px 9px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.vault-generator input[type="number"] {
    width: 74px;
    min-height: 32px;
    padding: 5px 8px;
}

.vault-generator input[type="checkbox"],
.vault-flag-grid input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    accent-color: var(--green);
}

.vault-state-tags span {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid rgba(101, 240, 160, .24);
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .08);
    font-size: 11px;
    font-weight: 820;
}

.vault-tag-control,
.secret-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.vault-tag-field {
    position: relative;
}

.vault-tag-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(12, 17, 23, .98);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .32);
}

.vault-tag-suggest[hidden] {
    display: none;
}

.vault-tag-suggest button {
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid rgba(101, 240, 160, .22);
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .08);
    font: inherit;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.vault-custom-fields {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px dashed rgba(101, 240, 160, .22);
    border-radius: 8px;
    background: rgba(101, 240, 160, .04);
}

.vault-custom-fields-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.vault-custom-fields-head span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.vault-custom-fields-list {
    display: grid;
    gap: 7px;
}

.vault-custom-field-row {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) auto;
    gap: 7px;
}

.vault-custom-field-row button {
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 134, 125, .25);
    border-radius: 8px;
    color: var(--danger);
    background: rgba(255, 134, 125, .08);
    font: inherit;
    font-size: 12px;
    font-weight: 760;
    cursor: pointer;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
}

html {
    background: #080c10;
    scrollbar-width: thin;
    scrollbar-color: rgba(101, 240, 160, .36) rgba(8, 12, 16, .72);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: rgba(8, 12, 16, .72);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    border: 2px solid rgba(8, 12, 16, .72);
    border-radius: 999px;
    background: rgba(101, 240, 160, .38);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: rgba(101, 240, 160, .58);
}

body {
    min-height: 100vh;
    min-height: 100svh;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 16%, rgba(58, 201, 117, .14), transparent 28%),
        radial-gradient(circle at 84% 72%, rgba(70, 126, 255, .10), transparent 30%),
        linear-gradient(var(--bg), #0a1118 58%, #070a0e);
    background-attachment: fixed;
    font: 13px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(122, 255, 183, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(122, 255, 183, .045) 1px, transparent 1px);
    background-size: 42px 42px;
    background-position: 0 0;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .9), transparent 82%);
    animation: gridDrift 28s linear infinite;
    will-change: background-position;
}

body::after {
    content: "";
    position: fixed;
    inset: -20%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(380px 260px at 18% 22%, rgba(101, 240, 160, .14), transparent 66%),
        radial-gradient(440px 300px at 82% 68%, rgba(124, 183, 255, .10), transparent 70%);
    opacity: .78;
    mix-blend-mode: screen;
    transform: translate3d(0, 0, 0);
    animation: ambientGridGlow 18s ease-in-out infinite alternate;
}

@keyframes gridDrift {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 42px 42px;
    }
}

@keyframes ambientGridGlow {
    0% {
        transform: translate3d(-1.5%, -1%, 0) scale(1);
        filter: hue-rotate(0deg);
    }
    50% {
        transform: translate3d(1.5%, .8%, 0) scale(1.035);
        filter: hue-rotate(8deg);
    }
    100% {
        transform: translate3d(-.5%, 1.6%, 0) scale(1.02);
        filter: hue-rotate(-5deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after {
        animation: none;
    }
}

a {
    color: var(--green);
    text-decoration: none;
}

a:hover {
    color: #9affc0;
}

.content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 36px 24px;
}

.content:has(.cabinet-shell) {
    place-items: start center;
    padding: 24px;
}

.auth-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.auth-shell--narrow {
    width: min(680px, 100%);
    grid-template-columns: 1fr;
}

.auth-shell--login {
    width: min(560px, 100%);
}

.auth-panel {
    width: 100%;
    position: relative;
    overflow: hidden;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 42%),
        var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.auth-shell--login .auth-panel {
    padding: 30px;
    border-color: rgba(101, 240, 160, .22);
    background:
        radial-gradient(circle at 16% 0%, rgba(101, 240, 160, .11), transparent 34%),
        linear-gradient(145deg, rgba(11, 19, 31, .96), rgba(4, 10, 18, .94) 62%, rgba(7, 20, 24, .96)),
        var(--panel);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .32), 0 0 0 1px rgba(255, 255, 255, .025);
}

.auth-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
    opacity: .55;
}

.auth-heading,
.profile-top {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.auth-heading--compact {
    margin-bottom: 14px;
}

.auth-heading--logo {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
    margin-top: 6px;
}

.auth-logo {
    width: min(240px, 70vw);
    height: auto;
    display: block;
    filter: drop-shadow(0 12px 28px rgba(101, 240, 160, .16));
}

.auth-subtitle {
    max-width: 360px;
    margin: 8px auto 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 620;
    line-height: 1.4;
}

.brand-mark,
.avatar-placeholder {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: #06100b;
    background: linear-gradient(135deg, var(--green), #a7ffd0);
    font-weight: 700;
    box-shadow: 0 0 28px rgba(101, 240, 160, .18);
}

.avatar-placeholder,
.avatar-preview {
    width: 64px;
    height: 64px;
    margin-left: auto;
    border-radius: 8px;
}

.avatar-placeholder,
.user-profile-avatar--placeholder {
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    color: #dfffee;
    border: 1px solid rgba(101, 240, 160, .34);
    background:
        radial-gradient(circle at 28% 22%, rgba(255, 255, 255, .22), transparent 28%),
        linear-gradient(135deg, rgba(20, 184, 166, .88), rgba(37, 99, 235, .74));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 10px 26px rgba(20, 184, 166, .14);
    font-weight: 850;
    text-transform: uppercase;
}

.avatar-preview {
    object-fit: cover;
    border: 1px solid var(--line-strong);
}

.eyebrow {
    margin: 0 0 3px;
    color: var(--green);
    font: 650 10px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1,
h2,
.muted {
    margin-top: 0;
}

h1,
h2 {
    margin-bottom: 0;
    color: var(--text);
    line-height: 1.13;
}

h1 {
    font-size: 24px;
    font-weight: 760;
}

h2 {
    font-size: 17px;
    font-weight: 730;
}

.muted {
    color: var(--muted);
    margin-bottom: 0;
    font-size: 13px;
}

.form-stack {
    display: grid;
    gap: 16px;
}

.local-captcha {
    display: grid;
    gap: 0;
}

.local-captcha__trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.local-captcha__button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 18px;
    overflow: hidden;
    border: 1px solid rgba(93, 243, 151, .34);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent),
        rgba(4, 12, 18, .78);
    color: #eaf2f8;
    font: 800 15px/1.1 inherit;
    cursor: pointer;
    isolation: isolate;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035);
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.local-captcha__button::before {
    content: "";
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border: 1px solid rgba(234, 255, 240, .34);
    border-radius: 999px;
    background:
        radial-gradient(circle at 50% 50%, rgba(101, 240, 160, .86) 0 3px, transparent 4px),
        rgba(15, 23, 42, .45);
    box-shadow: 0 0 18px rgba(101, 240, 160, .14);
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.local-captcha__button:hover,
.local-captcha__button:focus-visible {
    border-color: rgba(93, 243, 151, .72);
    background: rgba(14, 30, 29, .9);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 12px 34px rgba(16, 185, 129, .08);
}

.local-captcha__button:active {
    transform: translateY(1px);
}

.local-captcha__progress {
    position: absolute;
    inset: 0;
    z-index: -1;
    transform: scaleX(0);
    transform-origin: left center;
    background: linear-gradient(90deg, rgba(93, 243, 151, .18), rgba(56, 189, 248, .26), rgba(93, 243, 151, .46));
    transition: transform 1.08s linear;
}

.local-captcha:not(.is-holding) .local-captcha__progress {
    transition-duration: .16s;
}

.local-captcha.is-done .local-captcha__button {
    border-color: rgba(93, 243, 151, .8);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .04), transparent),
        rgba(27, 108, 72, .42);
    color: #eafff0;
}

.local-captcha.is-done .local-captcha__button::before {
    border-color: rgba(234, 255, 240, .7);
    background:
        linear-gradient(135deg, transparent 41%, #eafff0 42% 55%, transparent 56%),
        linear-gradient(45deg, transparent 50%, #eafff0 51% 62%, transparent 63%),
        rgba(16, 185, 129, .62);
    transform: scale(.96);
}

.form-stack .button,
.auth-panel > form .button,
.withdraw-actions .button,
.button.field--wide {
    width: 100%;
    justify-self: stretch;
}

.local-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    flex: 0 0 auto;
    background: currentColor;
    mask: var(--icon-url) center / contain no-repeat;
    -webkit-mask: var(--icon-url) center / contain no-repeat;
    pointer-events: none;
}

.vault-icon-button .local-icon,
.vault-tag-toggle .local-icon {
    width: 16px;
    height: 16px;
}

.field {
    display: grid;
    gap: 7px;
    color: #c8d2dc;
    font-weight: 650;
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    background: rgba(4, 9, 14, .74);
    font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    accent-color: var(--green);
    font: inherit;
}

select {
    appearance: none;
    min-height: 40px;
    padding: 10px 42px 10px 12px;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position:
        calc(100% - 20px) 50%,
        calc(100% - 14px) 50%;
    background-size: 8px 8px, 8px 8px;
    background-repeat: no-repeat;
    color-scheme: dark;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

select:hover {
    border-color: rgba(101, 240, 160, .34);
    background-color: rgba(7, 16, 22, .86);
}

select:disabled {
    cursor: not-allowed;
    opacity: .58;
}

select option {
    color: #e7edf3;
    background: #101820;
}

select::-ms-expand {
    display: none;
}

.is-native-select-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.custom-select {
    position: relative;
    width: 100%;
    display: block;
    min-width: 0;
}

.custom-select.is-open {
    z-index: 1400;
}

.data-panel:has(.custom-select.is-open),
.cabinet-hero:has(.custom-select.is-open),
.auth-panel:has(.custom-select.is-open),
.user-manage-panel:has(.custom-select.is-open) {
    position: relative;
    z-index: 1300;
}

.custom-select__button {
    width: 100%;
    min-height: 40px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 8px;
    color: var(--text);
    background: rgba(4, 9, 14, .74);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.custom-select__button:hover,
.custom-select.is-open .custom-select__button {
    border-color: rgba(101, 240, 160, .38);
    background: rgba(7, 16, 22, .90);
}

.custom-select__button:focus-visible {
    outline: 3px solid rgba(101, 240, 160, .14);
    border-color: var(--green-strong);
}

.custom-select.is-disabled {
    opacity: .58;
}

.custom-select.is-disabled .custom-select__button {
    cursor: not-allowed;
}

.custom-select__value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select__arrow {
    justify-self: end;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: .82;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .16s ease;
}

.custom-select.is-open .custom-select__arrow {
    transform: translateY(2px) rotate(225deg);
}

.custom-select__list {
    position: absolute;
    z-index: 1200;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    display: none;
    max-height: min(280px, 44svh);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid rgba(101, 240, 160, .28);
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .38);
    scrollbar-width: thin;
    scrollbar-color: rgba(101, 240, 160, .36) transparent;
}

.custom-select.is-open .custom-select__list {
    display: grid;
    gap: 3px;
}

.custom-select__option {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--text);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.custom-select__option:hover,
.custom-select__option.is-selected {
    color: var(--green);
    border-color: rgba(101, 240, 160, .24);
    background: rgba(101, 240, 160, .08);
}

.custom-select__option.is-selected::before {
    content: "";
    width: 6px;
    height: 10px;
    margin-right: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
}

.custom-select__option:disabled {
    cursor: not-allowed;
    opacity: .48;
}

textarea,
.mono-input,
.token-field {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

textarea {
    resize: vertical;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.token-field {
    color: #b9ffd4;
}

.token-reveal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(101, 240, 160, .34);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(101, 240, 160, .10), rgba(101, 240, 160, .035)),
        var(--panel);
}

.token-reveal div,
.token-reveal input {
    grid-column: 1;
}

.token-reveal strong,
.token-reveal small {
    display: block;
}

.token-reveal small {
    color: var(--muted);
}

.token-reveal input {
    width: 100%;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.token-reveal .button {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: end;
    justify-self: end;
    width: auto;
    min-width: 140px;
    height: 40px;
}

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(101, 240, 160, .14);
    border-color: var(--green-strong);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    width: auto;
    max-width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    min-width: 112px;
    min-height: 38px;
    padding: 8px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 680;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button--primary {
    color: #06100b;
    background: linear-gradient(135deg, var(--green), #9affc0);
    box-shadow: 0 14px 34px rgba(101, 240, 160, .14);
}

.button--secondary {
    color: #d9ffe9;
    background: rgba(101, 240, 160, .10);
    border-color: var(--line-strong);
}

.button--danger {
    color: #ffd9d6;
    background: rgba(255, 134, 125, .10);
    border-color: rgba(255, 134, 125, .28);
}

.button--close,
[data-chat-create-close].button--ghost,
[data-chat-admin-close].button--ghost,
[data-chat-rules-close].button--ghost,
[data-chat-user-close].button--ghost,
[data-chat-history-close].button--ghost,
[data-chat-crop-cancel].button--ghost {
    color: #ffaaa3;
    background: rgba(255, 96, 96, .075);
    border-color: rgba(255, 116, 116, .22);
}

.button--close:hover,
[data-chat-create-close].button--ghost:hover,
[data-chat-admin-close].button--ghost:hover,
[data-chat-rules-close].button--ghost:hover,
[data-chat-user-close].button--ghost:hover,
[data-chat-history-close].button--ghost:hover,
[data-chat-crop-cancel].button--ghost:hover {
    color: #ffd8d4;
    background: rgba(255, 96, 96, .12);
    border-color: rgba(255, 116, 116, .38);
}

.button:disabled {
    cursor: not-allowed;
    opacity: .45;
    transform: none;
}

.button--ghost {
    color: #c2cbd6;
    background: rgba(255, 255, 255, .03);
    border-color: rgba(148, 163, 184, .18);
}

.alert {
    display: none;
}

.toast-layer {
    position: fixed;
    z-index: 70;
    top: 18px;
    right: 18px;
    width: min(380px, calc(100vw - 28px));
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.toast-layer--chat {
    top: auto;
    right: 18px;
    bottom: 18px;
}

.toast {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .045), transparent),
        var(--panel-strong);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .32);
    color: var(--text);
    font-size: 13px;
    font-weight: 620;
    pointer-events: auto;
    animation: toast-in .18s ease-out;
}

.toast--success {
    border-color: rgba(101, 240, 160, .36);
}

.toast--error {
    border-color: rgba(255, 134, 125, .38);
}

.toast--success::before,
.toast--error::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-top: 6px;
    border-radius: 50%;
    grid-column: 1;
    grid-row: 1;
}

.toast span {
    grid-column: 1;
    grid-row: 1;
    padding-left: 16px;
}

.toast--success::before {
    background: var(--green);
}

.toast--error::before {
    background: var(--danger);
}

.toast button {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.toast.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease;
}

.toast-layer--chat .toast.is-hiding {
    transform: translateY(6px);
}

.toast--chat {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    text-decoration: none;
    border-color: rgba(101, 240, 160, .34);
    cursor: pointer;
}

.toast--chat .toast-chat-avatar {
    grid-column: auto;
    grid-row: auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding-left: 0;
    border-radius: 9px;
    color: #06100b;
    background: var(--green);
    font-size: 14px;
    font-weight: 850;
}

.toast--chat .toast-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.toast--chat .toast-chat-content {
    grid-column: auto;
    grid-row: auto;
    min-width: 0;
    display: grid;
    gap: 2px;
    padding-left: 0;
}

.toast--chat .toast-chat-content strong,
.toast--chat .toast-chat-content small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toast--chat .toast-chat-content strong {
    color: var(--text);
    font-size: 13px;
}

.toast--chat .toast-chat-content small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast-layer--chat .toast {
    animation-name: toast-in-up;
}

@keyframes toast-in-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.is-modal-open {
    overflow: hidden;
}

.image-modal[hidden] {
    display: none;
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: grid;
    place-items: center;
    padding: 24px;
}

.image-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 12, .82);
    backdrop-filter: blur(10px);
}

.image-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    max-height: calc(100svh - 48px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    justify-items: center;
}

.image-modal__toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}

.image-modal__toolbar span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.image-modal__dialog img {
    max-width: 100%;
    max-height: calc(100svh - 116px);
    display: block;
    justify-self: center;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    background: rgba(4, 9, 14, .78);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
    object-fit: contain;
}

.image-modal__action,
.image-modal__close,
.image-modal__nav {
    min-height: 34px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    color: var(--text);
    background: rgba(15, 23, 42, .92);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.image-modal__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
}

.image-modal__close {
    position: relative;
    width: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 0;
    line-height: 1;
}

.image-modal__close::before,
.image-modal__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 17px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: center;
}

.image-modal__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.image-modal__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.image-modal__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 42px;
    height: 52px;
    min-height: 52px;
    padding: 0;
    font-size: 24px;
    font-weight: 500;
    line-height: 1;
    transform: translateY(-50%);
}

.image-modal__nav--prev {
    left: 0;
}

.image-modal__nav--next {
    right: 0;
}

.image-modal__action:hover,
.image-modal__close:hover,
.image-modal__nav:hover {
    color: var(--green);
    border-color: rgba(101, 240, 160, .34);
    background: rgba(13, 18, 24, .96);
}

.image-modal__action[hidden],
.image-modal__nav[hidden] {
    display: none;
}

[data-image-modal] {
    cursor: pointer;
}

.avatar-crop-modal[hidden] {
    display: none;
}

.avatar-crop-modal {
    position: fixed;
    z-index: 1600;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
}

.avatar-crop-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 12, .78);
    backdrop-filter: blur(10px);
}

.avatar-crop-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: calc(100svh - 44px);
    display: grid;
    gap: 18px;
    overflow-y: auto;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.avatar-crop-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.avatar-crop-head > div {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.avatar-crop-head h2 {
    margin: 0;
    min-width: 0;
    color: var(--text);
    font-size: 22px;
    font-weight: 880;
    line-height: 1.1;
}

.avatar-crop-head small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.avatar-crop-head .button {
    min-width: 120px;
    justify-self: end;
}

.confirm-modal[hidden] {
    display: none;
}

.confirm-modal {
    position: fixed;
    z-index: 1002;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.confirm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 12, .76);
    backdrop-filter: blur(10px);
}

.confirm-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255, 134, 125, .28);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 134, 125, .06), transparent 46%),
        var(--panel-strong);
    box-shadow: var(--shadow);
}

.confirm-modal__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 134, 125, .34);
    border-radius: 8px;
    color: var(--danger);
    background: rgba(255, 134, 125, .10);
    font-size: 20px;
    font-weight: 900;
}

.confirm-modal__content {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.confirm-modal__content h2 {
    font-size: 17px;
}

.confirm-modal__content p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 620;
    line-height: 1.45;
}

.confirm-modal__actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.confirm-modal__actions .button {
    width: 100%;
    min-width: 0;
}

.avatar-crop-stage {
    position: relative;
    width: min(520px, 100%);
    aspect-ratio: 1;
    justify-self: center;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    background: #05080c;
    touch-action: none;
    cursor: grab;
}

.avatar-crop-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 16px;
    align-items: center;
}

.avatar-crop-preview-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.avatar-crop-preview-card canvas {
    width: 112px;
    height: 112px;
    border: 1px solid rgba(101, 240, 160, .34);
    border-radius: 50%;
    background: #05080c;
}

.avatar-crop-preview-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.avatar-crop-stage:active {
    cursor: grabbing;
}

.avatar-crop-stage img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    transform-origin: 0 0;
    user-select: none;
    pointer-events: none;
}

.avatar-crop-frame {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(101, 240, 160, .86);
    box-shadow: inset 0 0 0 999px rgba(0, 0, 0, .08);
    pointer-events: none;
}

.avatar-crop-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: center;
    justify-content: stretch;
}

.avatar-crop-actions .button {
    width: 100%;
    min-width: 0;
}

.avatar-crop-zoom input[type="range"] {
    accent-color: var(--green);
}

.logout-form {
    margin-top: 16px;
}

.nav-return {
    margin-top: 16px;
}

.profile-panel {
    max-width: 760px;
}

.profile-token-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, .14);
}

.profile-token-form strong,
.profile-token-form small {
    display: block;
}

.profile-token-form small {
    color: var(--muted);
}

.account-autosave-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
}

.account-autosave-status.is-saving {
    color: var(--warning);
}

.account-autosave-status.is-saved {
    color: var(--green);
}

.account-autosave-status.is-error {
    color: var(--danger);
}

.telegram-settings-card {
    display: grid;
    gap: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, .14);
}

.telegram-settings-card__identity {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.telegram-settings-card__identity strong,
.telegram-settings-card__identity small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.telegram-settings-card__identity small {
    color: var(--muted);
}

.telegram-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-width: 760px;
}

.telegram-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
    cursor: pointer;
}

.telegram-toggle--wide {
    grid-column: 1 / -1;
}

.telegram-toggle__text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.telegram-toggle__text strong {
    min-width: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 820;
    line-height: 1.25;
}

.telegram-toggle__text small {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.telegram-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.telegram-toggle__switch {
    position: relative;
    width: 42px;
    height: 24px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 999px;
    background: rgba(15, 23, 42, .82);
    transition: border-color .16s ease, background .16s ease;
}

.telegram-toggle__switch::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(226, 232, 240, .82);
    transition: transform .16s ease, background .16s ease;
}

.telegram-toggle input:checked + .telegram-toggle__switch {
    border-color: rgba(101, 240, 160, .66);
    background: rgba(28, 122, 76, .72);
}

.telegram-toggle input:checked + .telegram-toggle__switch::before {
    transform: translateX(18px);
    background: #eafff1;
}

.telegram-toggle:has(input:focus-visible) {
    outline: 2px solid rgba(101, 240, 160, .42);
    outline-offset: 2px;
}

.telegram-settings-card > .button {
    justify-self: start;
    min-width: 160px;
}

.presence-settings-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .018);
}

.presence-settings-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.presence-settings-card__head strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 880;
}

.presence-settings-card__head .account-autosave-status {
    min-height: 0;
    text-align: right;
}

.presence-mode-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.presence-mode-option {
    position: relative;
    display: grid;
    gap: 4px;
    min-width: 0;
    min-height: 76px;
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(15, 23, 42, .32);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.presence-mode-option input,
.presence-admin-override input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.presence-mode-option strong,
.presence-admin-override strong {
    display: block;
    color: var(--text);
    font-size: 13px;
    font-weight: 860;
    line-height: 1.2;
}

.presence-mode-option small,
.presence-admin-override small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 660;
    line-height: 1.25;
}

.presence-mode-option:has(input:checked) {
    border-color: rgba(101, 240, 160, .58);
    background: rgba(34, 197, 94, .12);
    box-shadow: inset 0 0 0 1px rgba(101, 240, 160, .16);
}

.presence-mode-option:has(input:focus-visible),
.presence-admin-override:has(input:focus-visible) {
    outline: 2px solid rgba(101, 240, 160, .42);
    outline-offset: 2px;
}

.presence-admin-override {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(101, 240, 160, .24);
    border-radius: 8px;
    background: rgba(20, 83, 45, .12);
    cursor: pointer;
}

.presence-admin-override i {
    position: relative;
    display: block;
    width: 34px;
    height: 20px;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    transition: border-color .16s ease, background .16s ease;
}

.presence-admin-override i::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(226, 232, 240, .82);
    transition: transform .16s ease, background .16s ease;
}

.presence-admin-override input:checked + i {
    border-color: rgba(101, 240, 160, .68);
    background: rgba(28, 122, 76, .74);
}

.presence-admin-override input:checked + i::before {
    transform: translateX(14px);
    background: #eafff1;
}

.profile-sessions {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, .14);
}

.profile-sessions__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.profile-sessions__head strong,
.profile-sessions__head small {
    display: block;
}

.profile-sessions__head strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 850;
}

.profile-sessions__head small,
.profile-session-card small,
.profile-session-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.profile-sessions__bulk {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.profile-sessions__bulk form {
    min-width: 0;
}

.profile-sessions__bulk .button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
}

.profile-session-list {
    display: grid;
    gap: 8px;
}

.profile-session-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.profile-session-card.is-current {
    border-color: rgba(101, 240, 160, .28);
    background: rgba(101, 240, 160, .06);
}

.profile-session-card__icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(101, 240, 160, .20);
    border-radius: 8px;
    background: rgba(101, 240, 160, .08);
}

.profile-session-card__icon::before {
    content: "";
    width: 18px;
    height: 18px;
    background: var(--green);
    mask: url("icons/session-desktop.svg") center / contain no-repeat;
    -webkit-mask: url("icons/session-desktop.svg") center / contain no-repeat;
}

.profile-session-card > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.profile-session-card strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-session-card__badge {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border: 1px solid rgba(101, 240, 160, .26);
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .08);
    font-size: 11px;
    font-weight: 800;
}

.profile-session-card form {
    margin: 0;
}

.profile-session-card .button {
    min-width: 82px;
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.profile-session-empty {
    padding: 10px;
    border: 1px dashed rgba(148, 163, 184, .18);
    border-radius: 8px;
}

.cabinet-shell {
    width: min(1280px, 100%);
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    min-width: 0;
}

.cabinet-main {
    grid-column: 2;
    display: grid;
    gap: 22px;
    min-width: 0;
}

.cabinet-main--solo {
    grid-column: 1 / -1;
    min-height: calc(100vh - 96px);
    place-items: center;
}

.cabinet-nav,
.cabinet-hero,
.data-panel,
.metric-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 42%),
        var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.cabinet-nav {
    position: sticky;
    top: 24px;
    z-index: 80;
    grid-column: 1;
    min-height: calc(100vh - 96px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
}

.cabinet-nav-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0;
    align-items: start;
}

.cabinet-nav-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.cabinet-brand {
    display: flex;
    gap: 11px;
    align-items: center;
    width: 100%;
    min-width: 0;
    padding: 6px 4px;
    border: 0;
    border-radius: 7px;
    color: var(--text);
    background: transparent;
}

.cabinet-logo-box {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(101, 240, 160, .11);
    border-radius: 9px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .13), rgba(33, 230, 193, .04)),
        rgba(101, 240, 160, .045);
}

.cabinet-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

.cabinet-wordmark {
    color: var(--green);
    font-weight: 760;
    font-size: 19px;
    line-height: 1;
    letter-spacing: 0;
}

.cabinet-wordmark span {
    color: var(--text);
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    color: var(--green);
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .13), rgba(124, 183, 255, .06)),
        rgba(255, 255, 255, .04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 22px rgba(0, 0, 0, .16);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.menu-toggle:hover,
.menu-toggle:focus-visible,
.cabinet-nav.is-open .menu-toggle {
    color: #07120c;
    border-color: rgba(101, 240, 160, .52);
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(101, 240, 160, .10), 0 14px 32px rgba(101, 240, 160, .18);
}

.menu-toggle__icon {
    width: 19px;
    height: 19px;
}

.menu-toggle__icon--close {
    display: none;
}

.cabinet-nav.is-open .menu-toggle__icon--open {
    display: none;
}

.cabinet-nav.is-open .menu-toggle__icon--close {
    display: block;
}

.cabinet-user-card small,
.metric-card span,
.status-card span,
.panel-title span,
.role-card span,
.dossier-card span,
.dossier-card small {
    color: var(--muted);
}

.cabinet-user-card strong {
    display: block;
}

.cabinet-user-card small {
    display: block;
    font-size: 12px;
    line-height: 1.35;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.hero-meta span,
.hero-meta button,
.author-meta,
.entity-author {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.hero-meta span,
.hero-meta button,
.entity-author {
    width: fit-content;
    max-width: 100%;
    padding: 6px 9px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.hero-meta button {
    font: inherit;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.hero-meta button:hover {
    color: var(--green);
    border-color: rgba(101, 240, 160, .34);
    background: rgba(101, 240, 160, .08);
}

.hero-meta .chat-realtime-status {
    position: relative;
    width: 32px;
    min-width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 9px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    box-shadow: none;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    opacity: 1;
    transition: opacity .28s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.hero-meta .chat-realtime-status[hidden] {
    display: none;
}

.hero-meta .chat-realtime-status.is-fading {
    opacity: 0;
    pointer-events: none;
}

.chat-realtime-status {
    position: relative;
}

.chat-realtime-status::before {
    content: "";
    display: block;
    box-sizing: border-box;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(245, 184, 95, .26);
    border-top-color: #f5b85f;
    border-radius: 50%;
    animation: chat-realtime-spin .72s linear infinite;
}

.chat-realtime-status.is-online {
    border-color: rgba(101, 240, 160, .20);
    color: #65f0a0;
    background: rgba(101, 240, 160, .06);
    opacity: 0;
    pointer-events: none;
}

.chat-realtime-status.is-online::before {
    content: "✓";
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 0;
    animation: none;
}

.chat-realtime-status.is-reconnecting {
    border-color: rgba(245, 184, 95, .20);
    color: #f5b85f;
    background: rgba(245, 184, 95, .055);
}

.chat-realtime-status.is-reconnecting:not(.is-visible) {
    display: none;
}

.chat-realtime-status.is-offline {
    border-color: rgba(240, 93, 103, .20);
    color: #f05d67;
    background: rgba(240, 93, 103, .055);
}

.chat-realtime-status.is-offline::before {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 17px;
    height: 3px;
    display: block;
    border: 0;
    border-radius: 999px;
    background: currentColor;
    animation: none;
    transform: translate(-50%, -50%) rotate(-45deg);
}

.chat-realtime-status.is-offline::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 17px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: none;
    transform: translate(-50%, -50%) rotate(45deg);
}

@keyframes chat-realtime-spin {
    to {
        transform: rotate(360deg);
    }
}

.entity-author {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
}

.entity-author strong {
    color: var(--text);
}

.author-meta {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.author-meta small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.cabinet-role-badge,
.cabinet-balance,
.cabinet-penalty {
    min-height: 32px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.cabinet-user-card {
    display: grid;
    gap: 7px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .055), transparent 62%),
        rgba(255, 255, 255, .022);
}

.cabinet-role-badge {
    width: fit-content;
    max-width: 100%;
    min-height: 24px;
    padding: 4px 8px;
    color: #b7c4cf;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cabinet-balance,
.cabinet-penalty {
    display: grid;
    align-content: center;
    justify-content: stretch;
    gap: 2px;
    padding: 7px 9px;
}

.cabinet-balance span,
.cabinet-penalty span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 620;
    text-transform: uppercase;
}

.cabinet-balance strong {
    color: var(--green);
    font-size: 15px;
    font-weight: 680;
    line-height: 1;
}

.cabinet-penalty strong,
.penalty-inline {
    color: var(--danger);
    font-size: 12px;
    font-weight: 680;
    line-height: 1;
}

.cabinet-money-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.cabinet-chip {
    width: fit-content;
    max-width: 100%;
    padding: 4px 7px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font-size: 10px;
    font-weight: 700;
}

.cabinet-chip--danger {
    color: var(--danger);
    border-color: rgba(255, 134, 125, .25);
    background: rgba(255, 134, 125, .07);
}

.cabinet-links {
    display: grid;
    gap: 3px;
    margin-top: 0;
}

.cabinet-links--primary {
    align-content: start;
}

.cabinet-links--utility {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, .10);
}

.nav-group {
    position: relative;
    display: grid;
    gap: 4px;
}

.cabinet-links a,
.nav-admin-trigger {
    position: relative;
    display: flex;
    gap: 9px;
    align-items: center;
    width: 100%;
    min-height: 42px;
    padding: 8px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #c8d2dc;
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.nav-submenu {
    position: static;
    width: 100%;
    display: none;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 4px 0 4px 17px;
    border: 0;
    border-left: 1px solid rgba(101, 240, 160, .16);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: none;
}

.nav-group--admin::after {
    display: none;
}

.nav-submenu a {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    color: #c8d2dc;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-submenu .nav-icon {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: transparent;
}

.nav-submenu .nav-icon .local-icon {
    width: 14px;
    height: 14px;
}

.nav-group--admin:focus-within .nav-submenu,
.nav-group--admin.is-open .nav-submenu {
    display: grid;
}

.nav-chevron {
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: .7;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .16s ease;
}

.nav-group--admin:hover .nav-chevron,
.nav-group--admin:focus-within .nav-chevron,
.nav-group--admin.is-open .nav-chevron {
    transform: rotate(225deg) translateY(-1px);
}

.nav-icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 6px;
    color: #75f2aa;
    background: rgba(101, 240, 160, .055);
    box-shadow: none;
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.nav-icon .local-icon {
    width: 15px;
    height: 15px;
    display: block;
}

.cabinet-links a:hover,
.nav-admin-trigger:hover,
.nav-group--admin.is-open .nav-admin-trigger,
.cabinet-links a.is-active,
.nav-admin-trigger.is-active {
    color: #f3fff8;
    border-color: rgba(101, 240, 160, .18);
    background: rgba(101, 240, 160, .065);
    transform: none;
}

.cabinet-links a.is-active::before,
.nav-admin-trigger.is-active::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 9px;
    bottom: 9px;
    width: 2px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 14px rgba(101, 240, 160, .28);
}

.cabinet-links a:hover .nav-icon,
.nav-admin-trigger:hover .nav-icon,
.nav-group--admin.is-open .nav-icon,
.cabinet-links a.is-active .nav-icon,
.nav-admin-trigger.is-active .nav-icon {
    color: var(--green);
    background: rgba(101, 240, 160, .12);
    transform: none;
}

.nav-chat-link {
    position: relative;
}

.nav-chat-link span:not(.nav-icon) {
    min-width: 0;
}

.nav-badge {
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 999px;
    color: #06100b;
    background: var(--green);
    font-size: 11px;
    font-weight: 780;
    line-height: 1;
}

.nav-badge--friends {
    color: #061020;
    background: #64c7ff;
    box-shadow: 0 0 18px rgba(100, 199, 255, .24);
}

.nav-badge[hidden] {
    display: none !important;
}

.admin-subnav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.admin-subnav a {
    min-height: 44px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
    line-height: 1.15;
    text-align: left;
}

.admin-subnav__icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: var(--green);
    background: rgba(101, 240, 160, .10);
}

.admin-subnav__glyph {
    width: 17px;
    height: 17px;
    stroke-width: 2.25;
}

.admin-subnav a.is-active,
.admin-subnav a:hover {
    color: var(--green);
    border-color: var(--line-strong);
    background: rgba(101, 240, 160, .08);
}

.admin-subnav a.is-active .admin-subnav__icon,
.admin-subnav a:hover .admin-subnav__icon {
    color: #06100b;
    background: var(--green);
}

.cabinet-logout .button {
    min-height: 38px;
    width: 100%;
    display: inline-flex;
    gap: 8px;
    padding: 7px 10px;
    color: #ffc2bc;
    border-color: rgba(255, 134, 125, .20);
    background: rgba(255, 134, 125, .045);
}

.cabinet-logout {
    margin-top: 0;
}

.button-icon {
    width: 16px;
    height: 16px;
}

.cabinet-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
}

.cabinet-hero--compact {
    align-items: center;
    padding: 18px 20px;
}

.cabinet-hero:has(+ .chat-layout) {
    gap: 16px;
    min-height: 104px;
    padding: 14px 18px;
}

.cabinet-hero:has(+ .chat-layout) .chat-thread-heading {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
}

.cabinet-hero:has(+ .chat-layout) .chat-thread-avatar--hero {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 15px;
}

.cabinet-hero:has(+ .chat-layout) .chat-thread-avatar--hero.chat-thread-avatar--direct {
    border-radius: 50%;
}

.cabinet-hero:has(+ .chat-layout) h1 {
    font-size: 20px;
    line-height: 1.05;
}

.cabinet-hero:has(+ .chat-layout) .hero-meta {
    gap: 6px;
    margin-top: 6px;
}

.cabinet-hero:has(+ .chat-layout) .hero-meta span,
.cabinet-hero:has(+ .chat-layout) .hero-meta button {
    min-height: 28px;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 11px;
}

.cabinet-hero:has(+ .chat-layout) .hero-action {
    min-width: 0;
    min-height: 36px;
    padding: 7px 13px;
    font-size: 12px;
}

.cabinet-hero:has(+ .chat-layout) .chat-settings-button {
    width: 38px;
    min-width: 38px;
}

.hero-action {
    width: auto;
    min-width: 170px;
    text-align: center;
}

.status-card {
    min-width: 220px;
    align-self: stretch;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(4, 9, 14, .42);
}

.status-card strong {
    font-size: 17px;
    font-weight: 680;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.metric-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    color: var(--text);
}

.metric-card strong {
    font-size: 18px;
    font-weight: 720;
    line-height: 1;
}

.data-panel {
    padding: 16px;
}

.chat-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    min-width: 0;
    --chat-workspace-height: clamp(620px, calc(100svh - 190px), 860px);
}

.chat-threads {
    align-self: stretch;
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
    gap: 14px;
    height: var(--chat-workspace-height);
    max-height: var(--chat-workspace-height);
    overflow: hidden;
}

.chat-threads:has(.custom-select.is-open) {
    overflow: visible;
    z-index: 30;
}

.chat-threads-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    justify-content: stretch;
    align-items: center;
    gap: 8px;
}

.chat-threads-title__label {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.chat-threads-title__actions {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.chat-threads-title .button {
    grid-column: 2;
    justify-self: end;
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
}

.chat-threads-title__actions .button {
    grid-column: auto;
    min-height: 32px;
    padding: 7px 9px;
    font-size: 11px;
}

.chat-threads-title__actions .chat-thread-create-compact {
    width: 34px;
    min-width: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    line-height: 1;
}

.chat-thread-create-compact__icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.8;
}

.chat-threads-title__label > span {
    min-width: 34px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border: 1px solid rgba(101, 240, 160, .24);
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .08);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.chat-thread-heading {
    min-width: 0;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.chat-thread-heading h1,
.chat-thread-heading .hero-meta {
    min-width: 0;
}

.chat-thread-avatar {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: visible;
    border: 1px solid rgba(101, 240, 160, .26);
    border-radius: 10px;
    color: #06100b;
    background: linear-gradient(135deg, rgba(101, 240, 160, .96), rgba(121, 245, 184, .72));
    font-weight: 880;
    box-shadow: 0 12px 30px rgba(101, 240, 160, .10);
}

button.chat-thread-avatar {
    padding: 0;
    font: inherit;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

button.chat-thread-avatar:hover {
    border-color: rgba(101, 240, 160, .46);
    box-shadow: 0 16px 34px rgba(101, 240, 160, .16);
    transform: translateY(-1px);
}

.chat-thread-avatar[data-image-modal] {
    cursor: pointer;
}

.chat-thread-avatar[data-image-modal]:hover {
    border-color: rgba(101, 240, 160, .46);
    box-shadow: 0 16px 34px rgba(101, 240, 160, .16);
}

.chat-thread-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    overflow: hidden;
    border-radius: inherit;
}

.chat-thread-avatar img[hidden] {
    display: none;
}

.chat-thread-avatar__initial {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

.chat-thread-avatar--hero {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.chat-thread-avatar--small {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 13px;
}

.chat-thread-avatar--direct {
    border-radius: 50%;
}

.chat-thread-avatar--group {
    border-radius: 9px;
}

.chat-thread-avatar--bot {
    border-radius: 10px;
    border-color: rgba(101, 240, 160, .48);
    background: rgba(101, 240, 160, .10);
}

.chat-monitor-avatar-stack {
    position: relative;
    width: 42px;
    height: 34px;
    display: block;
}

.chat-monitor-avatar-stack .chat-thread-avatar {
    position: absolute;
    width: 30px;
    height: 30px;
    border-width: 2px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .20);
}

.chat-monitor-avatar-stack .chat-thread-avatar:first-child {
    left: 0;
    top: 0;
    z-index: 2;
}

.chat-monitor-avatar-stack .chat-thread-avatar:last-child {
    right: 0;
    bottom: 0;
    z-index: 1;
}

.chat-thread-avatar--edit {
    width: 58px;
    height: 58px;
    font-size: 20px;
}

.chat-presence-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    z-index: 3;
    width: 14px;
    height: 14px;
    border: 2px solid #121821;
    border-radius: 50%;
    background: #f05d67;
    box-shadow: 0 0 0 3px rgba(240, 93, 103, .10), 0 8px 18px rgba(0, 0, 0, .30);
    pointer-events: none;
}

.chat-presence-dot--small {
    right: -1px;
    bottom: -1px;
    width: 11px;
    height: 11px;
    border-width: 2px;
}

.chat-presence-dot.is-online {
    background: #65f0a0;
    box-shadow: 0 0 0 3px rgba(101, 240, 160, .14), 0 8px 18px rgba(0, 0, 0, .30);
}

.chat-presence-dot.is-offline {
    background: #f05d67;
}

.chat-presence-label {
    --presence-device-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='12' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 20h8M12 16v4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
}

.chat-presence-label::before {
    content: "";
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    background: currentColor;
    mask: var(--presence-device-icon) center / contain no-repeat;
    -webkit-mask: var(--presence-device-icon) center / contain no-repeat;
    opacity: .9;
}

.chat-presence-label--mobile {
    --presence-device-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='7' y='2' width='10' height='20' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M11 18h2' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.chat-presence-label.is-online {
    color: var(--green);
}

.chat-settings-button {
    width: 44px;
    min-width: 44px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    line-height: 0;
}

.chat-settings-button .local-icon {
    width: 17px;
    height: 17px;
    display: block;
    pointer-events: none;
}

.chat-hero-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.chat-call-button {
    min-width: 104px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.chat-call-button .local-icon,
.chat-mobile-call .local-icon {
    width: 17px;
    height: 17px;
    pointer-events: none;
}

.chat-rules-button {
    min-width: 96px;
}

.chat-call-card {
    position: fixed;
    right: 22px;
    bottom: calc(var(--chat-composer-height, 76px) + 24px);
    z-index: 1200;
    width: min(430px, calc(100vw - 28px));
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border: 1px solid rgba(101, 240, 160, .28);
    border-radius: 15px;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .08), rgba(15, 23, 42, .02)),
        rgba(13, 20, 28, .98);
    box-shadow: 0 18px 52px rgba(0, 0, 0, .30), 0 0 0 1px rgba(255, 255, 255, .035) inset;
}

.chat-call-card[hidden] {
    display: none;
}

.chat-call-card__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(101, 240, 160, .26);
    border-radius: 999px;
    background: rgba(101, 240, 160, .10);
}

.chat-call-card__icon span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #05130b;
    background: #65f0a0;
    font-size: 15px;
    font-weight: 850;
}

.chat-call-card__icon img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
    object-fit: cover;
}

.chat-call-card.is-ringing .chat-call-card__icon {
    box-shadow: 0 0 0 0 rgba(101, 240, 160, .28);
    animation: chat-call-pulse 1.5s ease-out infinite;
}

.chat-call-card.is-ended .chat-call-card__icon {
    border-color: rgba(248, 113, 113, .26);
    background: rgba(127, 29, 29, .18);
}

.chat-call-card.is-ended .chat-call-card__icon span {
    background: #f87171;
    color: #2a0909;
    animation: none;
}

.chat-call-card__body {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.chat-call-card__body strong {
    overflow: hidden;
    font-size: 13px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-call-card__body b {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-call-card__meta {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
}

.chat-call-card__meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-call-card__body time {
    flex: 0 0 auto;
    color: #65f0a0;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
}

.chat-call-card__body em {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(148, 163, 184, .86);
    font-size: 10px;
    font-style: normal;
    font-weight: 760;
    letter-spacing: .02em;
}

.chat-call-card__body em::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: currentColor;
}

.chat-call-card__body em.is-encrypted {
    color: #65f0a0;
}

.chat-call-card__actions {
    display: inline-flex;
    gap: 7px;
    align-items: center;
}

.chat-call-card__button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 999px;
    color: var(--text);
    background: rgba(15, 23, 42, .46);
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
}

.chat-call-card__button[hidden] {
    display: none;
}

.chat-call-card__button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.chat-call-card__button--accept {
    color: #04130b;
    border-color: transparent;
    background: linear-gradient(135deg, #65f0a0, #96ffc4);
}

.chat-call-card__button--accept svg {
    transform: none;
}

.chat-call-card__button--mute.is-muted {
    color: #ffd6d6;
    border-color: rgba(248, 113, 113, .38);
    background: rgba(127, 29, 29, .30);
}

.chat-call-card__button--end {
    color: #ffd6d6;
    border-color: rgba(248, 113, 113, .36);
    background: rgba(127, 29, 29, .30);
}

.chat-call-card__button--end svg {
    transform: rotate(132deg);
}

@keyframes chat-call-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(101, 240, 160, .30);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(101, 240, 160, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(101, 240, 160, 0);
    }
}

@keyframes chat-feed-initial-reveal {
    to {
        opacity: 1;
    }
}

.chat-thread-create {
    display: grid;
    gap: 14px;
}

.chat-create-modal .chat-thread-create {
    padding: 0;
    min-height: 0;
}

.chat-monitor-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding: 4px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.chat-monitor-tabs a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.chat-monitor-tabs a:hover,
.chat-monitor-tabs a.is-active {
    color: var(--green);
    border-color: rgba(101, 240, 160, .28);
    background: rgba(101, 240, 160, .08);
}

.chat-monitor-page .chat-monitor-hero {
    border-color: rgba(101, 240, 160, .22);
    background:
        linear-gradient(145deg, rgba(101, 240, 160, .06), rgba(15, 23, 42, .18)),
        rgba(255, 255, 255, .025);
}

.chat-monitor-page .chat-layout {
    grid-template-columns: minmax(340px, 370px) minmax(0, 1fr);
}

.admin-chat-monitor-page {
    gap: 16px;
}

.admin-chat-monitor-page .admin-subnav {
    margin-bottom: 2px;
}

.admin-chat-monitor-hero {
    align-items: center;
}

.admin-chat-monitor-hero > div {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.admin-chat-monitor-hero h1 {
    margin: 0;
}

.admin-chat-monitor-page .chat-layout {
    min-height: min(760px, calc(100svh - 230px));
    --chat-workspace-height: clamp(620px, calc(100svh - 250px), 790px);
}

.chat-monitor-hero .hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.chat-monitor-hero .hero-meta > span {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .035);
}

.chat-threads--monitor {
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
    gap: 8px;
    overflow: hidden;
}

.chat-monitor-scroll-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    gap: 6px;
    align-items: center;
}

.chat-monitor-scroll-btn {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.chat-monitor-scroll-btn:hover {
    border-color: rgba(101, 240, 160, .34);
    color: var(--green);
    background: rgba(101, 240, 160, .09);
}

.chat-monitor-scroll-icon {
    width: 15px;
    height: 15px;
}

.chat-monitor-type-chips,
.chat-monitor-risk-chips {
    display: flex;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding: 0 2px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(101, 240, 160, .28) transparent;
}

.chat-monitor-type-chips::-webkit-scrollbar,
.chat-monitor-risk-chips::-webkit-scrollbar {
    height: 3px;
}

.chat-monitor-type-chips::-webkit-scrollbar-thumb,
.chat-monitor-risk-chips::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(101, 240, 160, .32);
}

.chat-monitor-type-chips button,
.chat-monitor-risk-chips button {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font: inherit;
    font-size: 10px;
    font-weight: 850;
    cursor: pointer;
}

.chat-monitor-type-chips button span {
    color: var(--green);
    font-size: 10px;
}

.chat-monitor-type-chips button:hover,
.chat-monitor-type-chips button.is-active,
.chat-monitor-risk-chips button:hover,
.chat-monitor-risk-chips button.is-active {
    border-color: rgba(101, 240, 160, .38);
    color: var(--green);
    background: rgba(101, 240, 160, .10);
}

.chat-monitor-risk-chips button.is-active {
    box-shadow: inset 0 0 0 1px rgba(101, 240, 160, .10);
}

.chat-monitor-filter-toggle {
    width: max-content;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font: inherit;
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.chat-monitor-filter-toggle:hover,
.chat-monitor-filter-toggle[aria-expanded="true"],
.chat-monitor-filter-toggle.has-active-filters {
    border-color: rgba(101, 240, 160, .34);
    color: var(--green);
    background: rgba(101, 240, 160, .09);
}

.chat-monitor-filter-toggle span {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: #07140d;
    background: var(--green);
    font-size: 10px;
    font-weight: 950;
}

.chat-monitor-filter-toggle span[hidden],
.chat-monitor-advanced[hidden] {
    display: none;
}

.chat-monitor-advanced {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 9px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 10px;
    background: rgba(255, 255, 255, .018);
}

.chat-monitor-thread-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.chat-monitor-type-badge {
    width: max-content;
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 3px 7px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .03);
    font-size: 9px;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
}

.chat-monitor-type-badge--group {
    color: var(--green);
    border-color: rgba(101, 240, 160, .24);
    background: rgba(101, 240, 160, .08);
}

.chat-monitor-type-badge--direct {
    color: #93c5fd;
    border-color: rgba(147, 197, 253, .28);
    background: rgba(59, 130, 246, .10);
}

.chat-monitor-type-badge--ai {
    color: #c4b5fd;
    border-color: rgba(196, 181, 253, .26);
    background: rgba(124, 58, 237, .10);
}

.chat-monitor-type-badge--blocked,
.chat-monitor-type-badge--risk {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, .30);
    background: rgba(127, 29, 29, .12);
}

.chat-monitor-inspector {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015)),
        rgba(2, 6, 23, .16);
}

.chat-panel--monitor .chat-message-search {
    padding: 12px 16px;
}

.chat-panel--monitor .chat-message-search > strong {
    font-size: 11px;
}

.chat-monitor-inspector__main,
.chat-monitor-inspector__meta {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 8px;
}

.chat-monitor-inspector__main strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 15px;
    font-weight: 950;
}

.chat-monitor-inspector__main small,
.chat-monitor-inspector__meta {
    flex-basis: 100%;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    line-height: 1.35;
}

.chat-monitor-inspector__meta b {
    color: var(--text);
}

.chat-monitor-inspector__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.chat-monitor-inspector__stats span {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
}

.chat-monitor-inspector__stats b {
    color: var(--green);
    font-size: 18px;
    font-weight: 950;
}

.chat-monitor-inspector__stats small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.chat-monitor-inspector__action {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

.chat-search {
    display: grid;
    gap: 6px;
}

.chat-search span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 780;
    text-transform: uppercase;
}

.chat-search input {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 12px;
}

.chat-user-exact-search {
    display: grid;
    gap: 7px;
    padding: 11px;
    border: 1px solid rgba(101, 240, 160, .20);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .08), transparent 70%),
        rgba(255, 255, 255, .025);
}

.chat-user-exact-search[hidden] {
    display: none;
}

.chat-user-exact-search span,
.chat-user-exact-search small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.chat-user-exact-search span {
    color: var(--text);
    font-size: 12px;
    font-weight: 760;
}

.chat-user-exact-search .button {
    width: 100%;
    min-height: 36px;
    font-size: 11px;
}

.chat-invite-box,
.chat-members-form {
    display: grid;
    gap: 9px;
}

.chat-create-modal .chat-invite-box {
    min-height: 0;
}

.chat-invite-box > strong,
.chat-members-form > strong {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    text-transform: uppercase;
}

.chat-create-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.chat-create-settings > span,
.chat-create-empty {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid rgba(101, 240, 160, .16);
    border-radius: 8px;
    background: rgba(101, 240, 160, .055);
}

.chat-create-settings strong {
    color: var(--green);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.chat-create-settings small,
.chat-create-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 680;
}

.chat-create-encryption {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 11px;
    border: 1px solid rgba(101, 240, 160, .20);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .10), transparent 72%),
        rgba(255, 255, 255, .025);
    cursor: pointer;
}

.chat-create-encryption input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chat-create-encryption__icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(101, 240, 160, .24);
    border-radius: 8px;
    color: var(--green);
    background: rgba(101, 240, 160, .08);
}

.chat-create-encryption__glyph,
.chat-encrypted-badge__icon,
.chat-thread-lock__icon,
.chat-encryption-lock__glyph {
    width: 17px;
    height: 17px;
    display: block;
}

.chat-create-encryption strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.chat-create-encryption small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.chat-create-encryption:has(input:checked) {
    border-color: rgba(101, 240, 160, .44);
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .16), rgba(16, 185, 129, .05)),
        rgba(101, 240, 160, .035);
    box-shadow: inset 0 0 0 1px rgba(101, 240, 160, .10);
}

.chat-create-password {
    display: none;
}

.chat-create-encryption:has(input:checked) + .chat-create-password {
    display: grid;
}

.chat-invite-box__head {
    display: grid;
    grid-template-columns: minmax(0, .72fr) minmax(220px, 1fr);
    gap: 10px;
    align-items: end;
}

.chat-invite-box__head > span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.chat-invite-box__head strong {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.chat-invite-box__head small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 680;
}

.chat-invite-box__head b {
    color: var(--green);
}

.chat-invite-box__head input {
    min-height: 36px;
}

.chat-invite-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
}

.chat-invite-selected[hidden] {
    display: none;
}

.chat-invite-selected button {
    min-width: 0;
    max-width: 100%;
    min-height: 30px;
    display: inline-grid;
    grid-template-columns: minmax(0, auto) auto;
    gap: 6px;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid rgba(101, 240, 160, .24);
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .075);
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.chat-invite-selected button::after {
    content: "×";
    color: #ffaaa3;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.chat-invite-selected button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-invite-selected button small {
    display: none;
}

.chat-invite-empty {
    min-height: 46px;
    display: grid;
    place-items: center;
    padding: 10px;
    border: 1px dashed rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .018);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.chat-invite-empty[hidden] {
    display: none;
}

.chat-invite-hidden {
    display: none;
}

.chat-invite-list {
    max-height: min(260px, 32svh);
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    overflow-y: auto;
    padding-right: 3px;
    scrollbar-width: thin;
    scrollbar-color: rgba(101, 240, 160, .34) transparent;
}

.chat-invite-chip {
    min-width: 0;
    min-height: 42px;
    display: grid;
    grid-template-columns: 16px 30px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 7px 9px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease;
}

.chat-invite-list .chat-invite-chip {
    width: 100%;
    grid-template-columns: 30px minmax(0, 1fr);
    color: var(--text);
    font: inherit;
    text-align: left;
}

.chat-invite-chip[hidden] {
    display: none;
}

.chat-invite-chip:hover,
.chat-invite-chip:has(input:checked) {
    border-color: rgba(101, 240, 160, .36);
    background: rgba(101, 240, 160, .09);
}

.chat-invite-chip input {
    width: 15px;
    height: 15px;
    accent-color: var(--green);
}

.chat-invite-chip > span:last-child,
.chat-invite-chip > span:nth-child(2) {
    display: grid;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.chat-invite-chip > span:last-child strong,
.chat-invite-chip > span:last-child small,
.chat-invite-chip > span:nth-child(2) strong,
.chat-invite-chip > span:nth-child(2) small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-invite-chip > span:last-child strong,
.chat-invite-chip > span:nth-child(2) strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 720;
}

.chat-invite-chip > span:last-child small,
.chat-invite-chip > span:nth-child(2) small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 680;
}

.chat-invite-avatar {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    color: #06100b;
    background: var(--green);
    font-size: 11px;
    font-weight: 850;
}

.chat-invite-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-create-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 2px;
}

.chat-members-form {
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, .14);
}

.chat-member-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.chat-member-search-form label {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.chat-member-search-form label > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.chat-member-search-form input {
    width: 100%;
    min-height: 38px;
    font-size: 12px;
}

.chat-member-search-form .button {
    min-height: 38px;
    padding: 8px 14px;
}

.chat-admin-note {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.chat-admin-note.is-success {
    color: var(--green);
}

.chat-admin-note.is-error {
    color: #ff8b8b;
}

.chat-thread-edit-form {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 14px;
    padding-top: 0;
    border-top: 0;
}

.chat-thread-edit-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 230px;
    gap: 12px;
    align-items: center;
}

.chat-thread-edit-grid label {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.chat-thread-edit-grid label:last-child {
    grid-column: auto;
}

.chat-avatar-picker {
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
}

.chat-avatar-picker > span {
    grid-column: 1 / -1;
}

.chat-avatar-picker .button {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    font-size: 12px;
}

.chat-avatar-picker small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-thread-edit-grid label > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.chat-thread-edit-grid input[type="file"] {
    min-height: 36px;
    padding: 7px;
    font-size: 11px;
}

.chat-thread-edit-form > .button[type="submit"] {
    grid-column: 2;
    min-width: 190px;
    justify-self: end;
}

.chat-admin-panel {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, .14);
}

.chat-admin-panel--danger {
    border-top-color: rgba(255, 134, 125, .28);
}

.chat-admin-panel--danger form,
.chat-admin-panel--danger .button {
    width: 100%;
}

.chat-admin-panel--danger {
    grid-template-columns: 1fr 1fr;
}

.chat-admin-panel--bot-danger {
    grid-template-columns: minmax(0, 1fr);
}

.chat-admin-panel--danger .chat-admin-panel__head {
    grid-column: 1 / -1;
}

.chat-admin-danger-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.chat-admin-danger-actions form {
    width: auto;
    min-width: min(320px, 100%);
}

.chat-admin-danger-actions form:only-child {
    min-width: min(360px, 100%);
}

.chat-admin-danger-actions .button {
    width: 100%;
}

.chat-admin-panel--bot {
    gap: 14px;
}

.chat-bot-settings-summary {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(48, 224, 142, .22);
    border-radius: 10px;
    background: rgba(13, 23, 31, .48);
}

.chat-bot-settings-summary strong {
    display: block;
    color: var(--text);
    font-size: 16px;
    font-weight: 820;
}

.chat-bot-settings-summary small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
}

.chat-create-modal[hidden],
.chat-admin-modal[hidden] {
    display: none;
}

.chat-create-modal,
.chat-admin-modal,
.chat-user-modal,
.chat-rules-modal {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: grid;
    place-items: center;
    padding: 20px;
}

.chat-user-modal[hidden] {
    display: none;
}

.chat-rules-modal[hidden] {
    display: none;
}

.chat-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: grid;
    place-items: center;
    padding: 20px;
}

.chat-edit-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 12, .78);
    backdrop-filter: blur(10px);
}

.chat-edit-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: calc(100svh - 40px);
    display: grid;
    gap: 14px;
    overflow-y: auto;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.chat-edit-modal__head,
.chat-edit-modal__footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.chat-edit-modal__head h2 {
    margin: 0;
    font-size: 18px;
}

.chat-edit-modal__head small,
.chat-edit-modal__footer small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.chat-edit-modal textarea {
    min-height: 128px;
    max-height: 320px;
    resize: vertical;
    font-size: 14px;
    line-height: 1.5;
}

.chat-edit-modal__footer {
    align-items: center;
}

.chat-edit-modal__footer span {
    display: inline-flex;
    gap: 8px;
}

.chat-edit-modal__footer .button {
    min-width: 116px;
}

.chat-history-modal[hidden] {
    display: none;
}

.chat-history-modal {
    position: fixed;
    inset: 0;
    z-index: 1550;
    display: grid;
    place-items: center;
    padding: 20px;
}

.chat-history-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 12, .78);
    backdrop-filter: blur(10px);
}

.chat-history-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: calc(100svh - 40px);
    display: grid;
    gap: 12px;
    overflow-y: auto;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.chat-history-modal__head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .13);
}

.chat-history-modal__head h2 {
    margin: 0;
    font-size: 18px;
}

.chat-history-modal__head small,
.chat-history-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.chat-history-modal__body {
    display: grid;
    gap: 10px;
}

.chat-history-card,
.chat-history-edit {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .22);
}

.chat-history-card--danger {
    border-color: rgba(248, 113, 113, .28);
    background: rgba(127, 29, 29, .12);
}

.chat-history-card > div,
.chat-history-edit > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.chat-history-card strong,
.chat-history-edit strong,
.chat-history-section-title {
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
}

.chat-history-card small,
.chat-history-edit small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.chat-history-card p,
.chat-history-edit p {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.chat-history-edit label {
    display: grid;
    gap: 5px;
}

.chat-history-edit label span,
.chat-history-section-title {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.chat-create-modal__backdrop,
.chat-admin-modal__backdrop,
.chat-user-modal__backdrop,
.chat-rules-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 12, .78);
    backdrop-filter: blur(10px);
}

.chat-create-modal__dialog,
.chat-admin-modal__dialog,
.chat-user-modal__dialog,
.chat-rules-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: calc(100svh - 40px);
    display: grid;
    gap: 12px;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.chat-user-modal__dialog {
    width: min(480px, 100%);
}

.chat-rules-modal__dialog {
    width: min(680px, 100%);
}

.chat-create-modal__dialog {
    width: min(620px, 100%);
    overflow: hidden;
}

.chat-create-modal__dialog > .chat-thread-create {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-create-modal__dialog .field,
.chat-create-modal__dialog .chat-create-settings,
.chat-create-modal__dialog .chat-create-empty,
.chat-create-modal__actions {
    flex: 0 0 auto;
}

.chat-create-modal__dialog .chat-invite-box {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-create-modal__dialog .chat-invite-list {
    flex: 1 1 auto;
    min-height: 0;
}

.chat-create-modal__head,
.chat-admin-modal__head,
.chat-user-modal__head,
.chat-rules-modal__head {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .13);
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
}

.chat-user-modal__head {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    justify-content: stretch;
}

.chat-user-modal__head > div {
    min-width: 0;
    justify-self: start;
}

.chat-user-modal__head .button {
    justify-self: end;
}

.chat-create-modal__head h2,
.chat-admin-modal__head h2 {
    font-size: 18px;
}

.chat-rules-modal__head h2 {
    font-size: 18px;
}

.chat-create-modal__head small,
.chat-admin-modal__head small,
.chat-rules-modal__head small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.chat-user-modal__avatar {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    color: #06100b;
    background: var(--green);
    font-size: 20px;
    font-weight: 880;
    text-decoration: none;
}

.chat-user-modal__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-user-modal__avatar img[hidden] {
    display: none;
}

.chat-user-modal__head h2 {
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-user-modal__head small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.chat-user-modal__info {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
}

.chat-user-modal__info span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.chat-user-modal__info strong {
    color: var(--text);
    font-size: 13px;
}

.chat-user-modal__telegram {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.chat-user-modal__telegram::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--muted);
}

.chat-user-modal__telegram.is-linked {
    color: var(--green);
}

.chat-user-modal__telegram.is-linked::before {
    background: var(--green);
    box-shadow: 0 0 14px rgba(95, 239, 151, .36);
}

.chat-user-modal__telegram.is-disabled,
.chat-user-modal__telegram.is-unlinked {
    color: var(--muted);
}

.chat-user-modal__telegram.is-error {
    color: #ff9b9b;
}

.chat-user-modal__telegram.is-error::before {
    background: #ff7d7d;
}

.chat-user-modal__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

.chat-user-modal__actions .button,
.chat-user-modal__danger .button {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding-inline: 16px;
    justify-content: center;
    white-space: nowrap;
}

.chat-user-modal__danger {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
}

.chat-user-modal__danger .button {
    min-height: 40px;
}

.chat-rules-content {
    display: grid;
    gap: 10px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.55;
}

.chat-rules-content p,
.chat-rules-content ul {
    margin: 0;
}

.chat-rules-content ul {
    display: grid;
    gap: 6px;
    padding-left: 18px;
}

.chat-rules-content strong {
    color: var(--danger);
    font-size: 12px;
    text-transform: uppercase;
}

.friends-page {
    gap: 12px;
}

.friends-page .cabinet-hero--compact {
    padding-block: 12px;
}

.friends-page .cabinet-hero h1 {
    font-size: 18px;
}

.friends-page .eyebrow {
    font-size: 9px;
}

.friends-page .panel-title {
    margin-bottom: 10px;
}

.friends-page .panel-title h2 {
    font-size: 14px;
}

.friends-page .data-panel {
    padding-block: 14px;
}

.friends-hero-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.friends-hero-stats span {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .035);
    font-size: 11px;
    font-weight: 780;
}

.friends-hero-stats strong {
    color: var(--text);
    font-size: 13px;
}

.friends-grid {
    display: grid;
    grid-template-columns: minmax(280px, .8fr) minmax(320px, 1.2fr);
    gap: 14px;
}

.friends-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.friends-tabs a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 820;
    text-decoration: none;
}

.friends-tabs a:hover,
.friends-tabs a.is-active {
    color: var(--green);
    border-color: rgba(101, 240, 160, .42);
    background: rgba(101, 240, 160, .10);
}

.friends-tabs b {
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 999px;
    color: #061020;
    background: #64c7ff;
    font-size: 10px;
    line-height: 1;
}

.friends-add-panel,
.friends-requests-panel,
.friends-main-panel {
    display: grid;
    align-content: start;
    gap: 10px;
}

.friends-add-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: 10px;
}

.friends-add-form .button {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 8px 14px;
    justify-content: center;
}

.friends-privacy-note {
    color: var(--muted);
    font-size: 12px;
    font-weight: 680;
}

.friends-list {
    display: grid;
    gap: 10px;
}

.friends-list--cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.friend-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
}

.friend-card--full {
    grid-template-columns: 46px minmax(0, 1fr);
    align-content: start;
    gap: 12px;
}

.friend-avatar {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    color: #06100b;
    background: linear-gradient(135deg, var(--green), #64c7ff);
    font-size: 16px;
    font-weight: 900;
}

.friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.friend-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.friend-main strong,
.friend-main small {
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-main strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
    white-space: nowrap;
}

.friend-main small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 680;
}

.friend-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 12px;
    row-gap: 2px;
    line-height: 1.22;
}

.friend-meta span {
    position: relative;
    min-width: 0;
}

.friend-meta span + span::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 50%;
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    opacity: .58;
    transform: translateY(-50%);
}

.friend-card form {
    margin: 0;
}

.friend-card-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.friend-card-actions form {
    display: contents;
}

.friend-icon-button {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, .035);
    box-shadow: none;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.friend-icon-button:hover,
.friend-icon-button:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(148, 163, 184, .32);
    background: rgba(255, 255, 255, .07);
    outline: none;
}

.friend-icon-button--profile {
    color: var(--green);
    border-color: rgba(101, 240, 160, .28);
    background: rgba(101, 240, 160, .08);
}

.friend-icon-button--message {
    color: #061020;
    border-color: rgba(101, 240, 160, .72);
    background: linear-gradient(135deg, #66f0a5, #6ee7b7);
}

.friend-icon-button--danger {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, .30);
    background: rgba(248, 113, 113, .08);
}

.friend-icon-button--danger:hover,
.friend-icon-button--danger:focus-visible {
    border-color: rgba(248, 113, 113, .50);
    background: rgba(248, 113, 113, .14);
}

.friend-icon {
    width: 18px;
    height: 18px;
    display: block;
    stroke-width: 2.35;
}

.friend-card .button {
    min-height: 36px;
    padding-inline: 12px;
    white-space: nowrap;
}

.friends-empty {
    min-height: 46px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(148, 163, 184, .18);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 720;
    background: rgba(255, 255, 255, .02);
}

.friend-profile-modal[hidden] {
    display: none !important;
}

.friend-profile-modal {
    position: fixed;
    z-index: 120;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.friend-profile-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 12, .78);
    backdrop-filter: blur(10px);
}

.friend-profile-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.friend-profile-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 18px;
}

.friend-profile-card__avatar {
    width: 58px;
    height: 58px;
}

.friend-profile-card__main {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.friend-profile-card__main strong,
.friend-profile-card__main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-profile-card__main strong {
    color: var(--text);
    font-size: 18px;
    font-weight: 880;
}

.friend-profile-card__main small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 720;
}

.admin-api-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.api-status-card {
    min-height: 104px;
    display: grid;
    align-content: space-between;
    gap: 8px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018));
}

.api-status-card span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.api-status-card strong {
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
}

.api-status-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.api-status-card.is-active {
    border-color: rgba(101, 240, 160, .3);
    box-shadow: inset 0 0 0 1px rgba(101, 240, 160, .04);
}

.api-status-card.is-active strong {
    color: var(--green);
}

.api-status-card.is-muted strong {
    color: #facc15;
}

.admin-api-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.api-section-card {
    display: grid;
    align-content: start;
    gap: 14px;
}

.api-section-card--translate,
.api-section-card--clients {
    grid-column: 1 / -1;
}

.api-secret-field {
    position: relative;
}

.api-secret-field input {
    padding-right: 118px;
}

.api-secret-field .button {
    position: absolute;
    right: 8px;
    bottom: 8px;
    min-height: 34px;
    padding: 7px 12px;
}

.api-section-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

.api-test-inline {
    align-self: start;
    margin-top: -4px;
}

.api-extension-key-form {
    margin: 0;
}

.api-extension-key-form .button {
    width: max-content;
    max-width: 100%;
}

.api-clients-panel {
    display: grid;
    gap: 12px;
}

.api-client-list {
    display: grid;
    gap: 10px;
}

.api-client-card {
    display: grid;
    grid-template-columns: minmax(220px, 1.1fr) minmax(120px, .55fr) minmax(92px, auto) minmax(150px, .55fr) minmax(360px, auto);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.api-client-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.api-client-main strong,
.api-client-main small,
.api-client-used,
.api-client-card code {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.api-client-main strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
}

.api-client-main small,
.api-client-used {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.api-client-card code {
    color: var(--text);
    font-size: 12px;
    font-weight: 850;
}

.api-client-status {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.api-client-status.is-active {
    color: var(--green);
    border-color: rgba(101, 240, 160, .32);
    background: rgba(101, 240, 160, .08);
}

.api-client-status.is-disabled {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, .28);
    background: rgba(248, 113, 113, .08);
}

.api-client-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, auto));
    gap: 8px;
    justify-content: end;
}

.api-client-actions form {
    margin: 0;
}

.api-client-actions .button {
    min-height: 34px;
    padding: 7px 10px;
    white-space: nowrap;
}

.friend-profile-card__stats,
.friend-profile-card__actions {
    grid-column: 1 / -1;
}

.friend-profile-card__stats {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
}

.friend-profile-card__stats span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
}

.friend-profile-card__stats strong {
    color: var(--text);
}

.friend-profile-card__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.user-public-profile-page {
    gap: 12px;
    align-content: start;
}

.user-profile-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.user-profile-toolbar .button {
    width: auto;
}

.user-public-profile {
    display: grid;
    gap: 18px;
    max-width: 760px;
}

.user-public-profile__head {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.user-public-profile__avatar {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    overflow: hidden;
    border: 1px solid rgba(101, 240, 160, .28);
    border-radius: 18px;
    background: rgba(101, 240, 160, .12);
    color: var(--green);
    font-size: 32px;
    font-weight: 900;
}

.user-public-profile__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-public-profile__head h1 {
    margin: 4px 0 0;
    color: var(--text);
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1;
}

.user-public-profile__head p {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 800;
}

.user-public-profile__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.user-public-profile__stats span {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .16);
}

.user-public-profile__stats small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 780;
    text-transform: uppercase;
}

.user-public-profile__stats strong {
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.user-public-profile__stats--private span {
    border-color: rgba(101, 240, 160, .18);
    background: rgba(101, 240, 160, .055);
}

.user-public-profile__telegram {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .16);
}

.user-public-profile__telegram > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.user-public-profile__telegram small,
.user-public-profile__telegram span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 780;
}

.user-public-profile__telegram small {
    text-transform: uppercase;
}

.user-public-profile__telegram strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.user-public-profile__telegram span {
    overflow-wrap: anywhere;
}

.user-public-profile__telegram.is-linked {
    border-color: rgba(101, 240, 160, .24);
    background: rgba(101, 240, 160, .06);
}

.user-public-profile__telegram.is-linked strong {
    color: var(--green);
}

.user-public-profile__telegram.is-disabled {
    border-color: rgba(251, 191, 36, .24);
    background: rgba(120, 53, 15, .08);
}

.user-public-profile__telegram.is-disabled strong {
    color: #fbbf24;
}

.user-public-profile__telegram.is-unlinked {
    border-color: rgba(248, 113, 113, .22);
    background: rgba(127, 29, 29, .08);
}

.user-public-profile__telegram.is-unlinked strong {
    color: #fca5a5;
}

.user-public-profile__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.user-public-profile__actions form {
    margin: 0;
}

.user-public-profile__actions .button {
    width: auto;
    min-width: 150px;
}

.friend-transfer-panel,
.friend-transfer-history {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(101, 240, 160, .18);
    border-radius: 8px;
    background: rgba(2, 6, 23, .16);
}

.friend-transfer-history[hidden] {
    display: none;
}

.friend-transfer-panel .panel-title,
.friend-transfer-history .panel-title {
    margin: 0;
}

.friend-transfer-panel .panel-title span,
.friend-transfer-history .panel-title span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.friend-transfer-launch {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    width: fit-content;
    max-width: 100%;
}

.friend-transfer-open {
    width: auto;
    min-width: 160px;
}

.friend-transfer-history-open {
    width: auto;
    min-width: 116px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-6px);
    transition: opacity .14s ease, transform .14s ease;
}

.friend-transfer-panel:hover .friend-transfer-history-open,
.friend-transfer-panel:focus-within .friend-transfer-history-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.friend-transfer-note {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
}

.friend-transfer-list {
    display: grid;
    gap: 8px;
}

.friend-transfer-row {
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.friend-transfer-row span {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.friend-transfer-row strong {
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.friend-transfer-row.is-credit strong {
    color: var(--green);
}

.friend-transfer-row.is-debit strong {
    color: #fca5a5;
}

.friend-transfer-row small,
.friend-transfer-row em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 740;
    overflow-wrap: anywhere;
}

.friend-transfer-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.friend-transfer-pages a {
    min-width: 34px;
    min-height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0 10px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font-size: 12px;
    font-weight: 900;
}

.friend-transfer-pages a:hover,
.friend-transfer-pages a.is-active {
    color: var(--green);
    border-color: rgba(101, 240, 160, .34);
    background: rgba(101, 240, 160, .08);
}

.friend-transfer-modal[hidden] {
    display: none;
}

.friend-transfer-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.friend-transfer-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(2, 6, 12, .72);
    backdrop-filter: blur(12px);
    cursor: pointer;
}

.friend-transfer-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(620px, calc(100vw - 28px));
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(101, 240, 160, .26);
    border-radius: 10px;
    background:
        linear-gradient(145deg, rgba(101, 240, 160, .07), rgba(56, 189, 248, .025)),
        rgba(10, 15, 22, .98);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .46);
}

.friend-transfer-modal__head,
.friend-transfer-modal__actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.friend-transfer-modal__head h2 {
    margin: 3px 0 0;
    color: var(--text);
    font-size: 22px;
    line-height: 1.12;
}

.friend-transfer-modal__summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.friend-transfer-modal__summary span {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .18);
}

.friend-transfer-modal__summary small,
.friend-transfer-modal__actions small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 780;
    line-height: 1.35;
}

.friend-transfer-modal__summary strong {
    color: var(--text);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.friend-transfer-modal__form {
    display: grid;
    grid-template-columns: minmax(150px, .65fr) minmax(0, 1fr);
    gap: 10px;
}

.friend-transfer-modal__actions .button {
    width: auto;
    min-width: 190px;
}

.chat-admin-panel__head {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.chat-admin-panel__head strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 780;
}

.chat-admin-panel__head span,
.chat-admin-empty {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.chat-invite-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.chat-invite-link input {
    min-width: 0;
    height: 36px;
    padding: 8px 10px;
    font-size: 11px;
}

.chat-invite-link .button,
.chat-admin-actions .button {
    min-width: 0;
    min-height: 36px;
    padding: 7px 10px;
    font-size: 11px;
}

.chat-admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.chat-admin-actions form,
.chat-admin-actions .button {
    width: 100%;
}

.chat-member-list {
    display: grid;
    gap: 7px;
}

.chat-member-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 7px 8px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.chat-member-row--blocked {
    border-color: rgba(255, 134, 125, .22);
    background: rgba(255, 134, 125, .055);
}

.chat-member-row > span:nth-child(2) {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.chat-member-row strong,
.chat-member-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-member-row strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 760;
}

.chat-member-row small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
}

.chat-member-row button {
    min-height: 28px;
    padding: 5px 7px;
    border: 1px solid rgba(255, 134, 125, .24);
    border-radius: 7px;
    color: var(--danger);
    background: rgba(255, 134, 125, .08);
    font: inherit;
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
}

.chat-member-row--blocked button {
    border-color: rgba(101, 240, 160, .26);
    color: var(--green);
    background: rgba(101, 240, 160, .08);
}

.chat-edit-log-list {
    display: grid;
    gap: 7px;
    max-height: 260px;
    overflow: auto;
}

.chat-edit-log-row {
    display: grid;
    gap: 5px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.chat-edit-log-row span,
.chat-edit-log-row small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.chat-edit-log-row strong {
    display: block;
    color: var(--text);
    font-size: 12px;
}

.chat-edit-log-row small {
    color: var(--muted);
    font-size: 11px;
}

.chat-thread-list {
    display: grid;
    gap: 7px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color .16s ease;
}

.chat-thread-list:hover,
.chat-thread-list:focus-within,
.chat-thread-list.is-scrolling {
    scrollbar-color: rgba(101, 240, 160, .46) transparent;
}

.chat-thread-list::-webkit-scrollbar {
    width: 4px;
}

.chat-thread-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-thread-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: transparent;
}

.chat-thread-list:hover::-webkit-scrollbar-thumb,
.chat-thread-list:focus-within::-webkit-scrollbar-thumb,
.chat-thread-list.is-scrolling::-webkit-scrollbar-thumb {
    background: rgba(101, 240, 160, .46);
}

.chat-thread-list::-webkit-scrollbar-thumb:hover {
    background: rgba(101, 240, 160, .68);
}

.chat-thread-list a {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) minmax(66px, auto);
    gap: 3px;
    column-gap: 9px;
    align-items: center;
    padding: 10px 11px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, .025);
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.chat-thread-actions {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: end;
    justify-items: end;
    gap: 4px 6px;
    min-width: 66px;
}

.chat-thread-actions time {
    grid-column: 1 / -1;
    color: color-mix(in srgb, var(--muted) 82%, var(--text));
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.chat-thread-list a[hidden],
.chat-thread-list a.is-search-hidden {
    display: none !important;
}

.chat-thread-list a:hover,
.chat-thread-list a.is-active {
    border-color: rgba(101, 240, 160, .36);
    background: rgba(101, 240, 160, .08);
}

.chat-thread-list a.is-fresh {
    animation: chatThreadIn .26s ease-out both;
}

@keyframes chatThreadIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-thread-list strong {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    font-size: 13px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-thread-list strong > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-thread-lock {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(101, 240, 160, .22);
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .08);
}

.chat-thread-lock .chat-thread-lock__icon {
    width: 13px;
    height: 13px;
    margin: 0;
    color: currentColor;
    background: currentColor;
}

.chat-thread-list__meta {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.chat-thread-list small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.chat-thread-preview {
    display: block;
    min-width: 0;
}

.chat-thread-preview span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-thread-preview time {
    color: color-mix(in srgb, var(--muted) 82%, var(--text));
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.chat-monitor-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    align-items: start;
    min-width: 0;
}

.chat-monitor-filters > input[type="date"] {
    grid-column: 1 / -1;
}

.chat-monitor-filters select,
.chat-monitor-filters input {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 7px 8px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: var(--text);
    background: rgba(2, 6, 23, .35);
    font: inherit;
    font-size: 10px;
    font-weight: 700;
}

.chat-threads--monitor .chat-thread-list {
    margin-top: 2px;
}

.chat-quick-results {
    display: grid;
    gap: 7px;
    padding-top: 2px;
}

.chat-quick-results[hidden] {
    display: none;
}

.chat-quick-results strong {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.chat-quick-results button,
.chat-quick-results a {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 8px 9px;
    border: 1px solid rgba(101, 240, 160, .18);
    border-radius: 8px;
    color: var(--text);
    background: rgba(101, 240, 160, .045);
    text-align: left;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.chat-quick-results button:hover,
.chat-quick-results a:hover {
    border-color: rgba(101, 240, 160, .36);
    background: rgba(101, 240, 160, .08);
}

.chat-quick-results span,
.chat-quick-results small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-quick-results span {
    color: var(--green);
    font-size: 12px;
    font-weight: 760;
}

.chat-quick-results small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.chat-thread-unread {
    min-width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 999px;
    color: #06100b;
    background: var(--green);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(101, 240, 160, .20);
}

.chat-thread-sound {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .035);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: scale(.96);
    transition: opacity .16s ease, transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.chat-thread-list a:hover .chat-thread-sound,
.chat-thread-list a:focus-within .chat-thread-sound,
.chat-thread-sound.is-muted {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.chat-thread-sound:hover {
    border-color: rgba(101, 240, 160, .30);
    color: var(--green);
    background: rgba(101, 240, 160, .08);
}

.chat-thread-sound.is-muted {
    color: var(--danger);
    border-color: rgba(255, 134, 125, .24);
    background: rgba(255, 134, 125, .07);
}

.chat-thread-sound-icon {
    width: 17px;
    height: 17px;
}

.chat-thread-sound-icon--off,
.chat-thread-sound.is-muted .chat-thread-sound-icon--on {
    display: none;
}

.chat-thread-sound.is-muted .chat-thread-sound-icon--off {
    display: block;
}

.chat-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-self: stretch;
    height: var(--chat-workspace-height);
    max-height: var(--chat-workspace-height);
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.chat-panel::before {
    content: "Отпустите, чтобы отправить фото";
    position: absolute;
    inset: 12px;
    z-index: 12;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(101, 240, 160, .58);
    border-radius: 10px;
    color: var(--green);
    background: rgba(2, 8, 15, .62);
    box-shadow: inset 0 0 0 1px rgba(101, 240, 160, .10), 0 18px 44px rgba(0, 0, 0, .28);
    font-size: 14px;
    font-weight: 900;
    opacity: 0;
    pointer-events: none;
    transform: scale(.992);
    transition: opacity .14s ease, transform .14s ease;
}

.chat-panel.is-dragging-files::before {
    opacity: 1;
    transform: scale(1);
}

.chat-mobile-back {
    display: none;
}

.chat-mobile-toolbar,
.chat-mobile-search {
    display: none;
}

.chat-feed {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: flex-start;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(101, 240, 160, .36) transparent;
}

.chat-feed.is-initial-scroll {
    opacity: 0;
    animation: chat-feed-initial-reveal .9s step-end forwards;
}

.chat-feed.is-initial-scroll > * {
    pointer-events: none;
}

.chat-panel--empty .chat-message-search {
    display: none;
}

.chat-panel--empty .chat-feed {
    justify-content: center;
    align-items: center;
    padding-top: 28px;
    padding-bottom: 28px;
}

.chat-panel--empty .chat-feed::before {
    display: none;
}

.chat-panel::after {
    content: "";
    position: absolute;
    top: 92px;
    left: 50%;
    z-index: 9;
    min-height: 30px;
    padding: 7px 12px;
    border: 1px solid rgba(101, 240, 160, .28);
    border-radius: 999px;
    color: var(--green);
    background: rgba(13, 18, 24, .86);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .26);
    font-size: 11px;
    font-weight: 850;
    line-height: 1.15;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -6px);
    transition: opacity .16s ease, transform .16s ease;
}

.chat-panel.is-chat-syncing::after {
    content: "Синхронизация...";
    opacity: 1;
    transform: translate(-50%, 0);
}

.chat-panel.is-chat-loading-older::after {
    content: "Загрузка старых...";
    opacity: 1;
    transform: translate(-50%, 0);
}

.chat-feed:not(.is-overflowing)::before {
    content: "";
    flex: 1 1 auto;
    min-height: 0;
}

.chat-feed.is-overflowing::before {
    display: none;
}

.chat-feed::-webkit-scrollbar {
    width: 6px;
}

.chat-feed::-webkit-scrollbar-track {
    background: transparent;
}

.chat-feed::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(101, 240, 160, .30);
}

.chat-feed::-webkit-scrollbar-thumb:hover {
    background: rgba(101, 240, 160, .48);
}

.chat-pins,
.chat-message-search {
    min-width: 0;
    display: grid;
    gap: 0;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    background: rgba(255, 255, 255, .018);
}

.chat-view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    background: rgba(255, 255, 255, .015);
}

.chat-view-tabs button {
    min-height: 32px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 7px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.chat-view-tabs button:hover,
.chat-view-tabs button.is-active {
    border-color: rgba(101, 240, 160, .42);
    color: var(--green);
    background: rgba(101, 240, 160, .10);
}

.chat-view-tabs span {
    margin-left: 6px;
    color: inherit;
    font-size: 11px;
    opacity: .75;
}

.chat-audit-view {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
}

.chat-audit-view[hidden] {
    display: none;
}

.chat-panel.is-log-view .chat-pins,
.chat-panel.is-log-view .chat-message-search,
.chat-panel.is-log-view .chat-feed,
.chat-panel.is-log-view .chat-new-messages,
.chat-panel.is-log-view .chat-compose,
.chat-panel.is-log-view .chat-monitor-readonly {
    display: none;
}

.chat-panel.is-members-view .chat-pins,
.chat-panel.is-members-view .chat-message-search,
.chat-panel.is-members-view .chat-feed,
.chat-panel.is-members-view .chat-new-messages,
.chat-panel.is-members-view .chat-compose,
.chat-panel.is-members-view .chat-monitor-readonly {
    display: none;
}

.chat-audit-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .10);
}

.chat-audit-head strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
}

.chat-audit-head small,
.chat-audit-head > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
}

.chat-audit-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, .10);
    scrollbar-width: none;
}

.chat-audit-filters::-webkit-scrollbar {
    display: none;
}

.chat-audit-filters button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 7px 12px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font: inherit;
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
}

.chat-audit-filters button:hover,
.chat-audit-filters button.is-active {
    border-color: rgba(101, 240, 160, .40);
    color: var(--green);
    background: rgba(101, 240, 160, .10);
}

.chat-audit-list {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 16px 20px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(101, 240, 160, .30) transparent;
}

.chat-panel--monitor .chat-audit-list {
    position: relative;
    gap: 0;
    padding-left: 34px;
}

.chat-panel--monitor .chat-audit-list::before {
    content: "";
    position: absolute;
    left: 20px;
    top: 20px;
    bottom: 20px;
    width: 1px;
    background: linear-gradient(to bottom, rgba(101, 240, 160, .34), rgba(148, 163, 184, .08));
}

.chat-audit-list::-webkit-scrollbar {
    width: 6px;
}

.chat-audit-list::-webkit-scrollbar-track {
    background: transparent;
}

.chat-audit-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(101, 240, 160, .30);
}

.chat-audit-row {
    position: relative;
    display: grid;
    gap: 9px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.chat-panel--monitor .chat-audit-row {
    margin-bottom: 12px;
    border-radius: 8px;
}

.chat-panel--monitor .chat-audit-row::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 18px;
    width: 9px;
    height: 9px;
    border: 2px solid rgba(101, 240, 160, .70);
    border-radius: 999px;
    background: rgb(15, 23, 42);
}

.chat-audit-row--moderation {
    border-color: rgba(251, 191, 36, .24);
    background: rgba(120, 53, 15, .08);
}

.chat-audit-time {
    position: absolute;
    left: -34px;
    top: 36px;
    transform: rotate(-90deg);
    transform-origin: left top;
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .04em;
}

.chat-audit-row--delete {
    border-color: rgba(248, 113, 113, .24);
    background: rgba(127, 29, 29, .08);
}

.chat-audit-row--pin {
    border-color: rgba(101, 240, 160, .24);
    background: rgba(101, 240, 160, .055);
}

.chat-audit-row__top,
.chat-audit-row__meta {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.chat-audit-row__top {
    flex-wrap: wrap;
}

.chat-audit-row__top strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.chat-audit-row__top small,
.chat-audit-row__meta {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.chat-audit-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .11);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.chat-audit-diff {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.chat-audit-diff label,
.chat-audit-snapshot {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .11);
    border-radius: 8px;
    background: rgba(2, 6, 23, .22);
}

.chat-audit-diff span,
.chat-audit-snapshot span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.chat-audit-diff p,
.chat-audit-snapshot p {
    margin: 0;
    color: var(--text);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.chat-audit-empty {
    display: grid;
    place-items: center;
    min-height: 180px;
    border: 1px dashed rgba(148, 163, 184, .18);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
}

.chat-members-view {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.chat-members-view[hidden] {
    display: none;
}

.chat-monitor-member-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    overflow-y: auto;
    padding: 16px 20px 20px;
}

.chat-monitor-member-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 11px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.chat-monitor-member-card strong,
.chat-monitor-member-card small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-monitor-member-card strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.chat-monitor-member-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
}

.chat-pins {
    position: relative;
    z-index: 7;
    padding: 7px 10px;
}

.chat-message-search {
    position: relative;
    z-index: 2;
    min-height: 50px;
    display: grid;
    gap: 8px 12px;
    align-items: center;
    padding: 8px 16px;
    background: transparent;
}

.chat-message-search.is-open {
    min-height: 54px;
    grid-template-columns: minmax(170px, .28fr) minmax(0, 1fr);
}

.chat-message-search__head strong {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.chat-pins__bar {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid rgba(101, 240, 160, .20);
    border-radius: 8px;
    color: var(--text);
    background: rgba(101, 240, 160, .055);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.chat-pins__bar:hover,
.chat-pins.is-open .chat-pins__bar {
    border-color: rgba(101, 240, 160, .38);
    background: rgba(101, 240, 160, .09);
}

.chat-pins__icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(101, 240, 160, .12);
}

.chat-pins__icon::before {
    content: "";
    width: 15px;
    height: 15px;
    background: var(--green);
    mask: url("icons/pin.svg") center / contain no-repeat;
    -webkit-mask: url("icons/pin.svg") center / contain no-repeat;
}

.chat-pins__main {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 7px;
    align-items: center;
}

.chat-pins__main strong {
    color: var(--green);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.chat-pins__main span,
.chat-pins__main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-pins__main span {
    color: var(--text);
    font-size: 12px;
    font-weight: 760;
}

.chat-pins__main small {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.chat-pins__bar b {
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #06100b;
    background: var(--green);
    font-size: 11px;
    font-weight: 900;
}

.chat-pins__list {
    position: absolute;
    top: calc(100% - 3px);
    left: 10px;
    right: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    max-height: min(260px, 42svh);
    overflow-y: auto;
    padding: 9px;
    border: 1px solid rgba(101, 240, 160, .22);
    border-radius: 8px;
    background: rgba(12, 17, 23, .98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .34);
}

.chat-pins__list[hidden] {
    display: none;
}

.chat-pins__list button {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 8px 9px;
    border: 1px solid rgba(101, 240, 160, .20);
    border-radius: 8px;
    color: var(--text);
    background: rgba(101, 240, 160, .055);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.chat-pins__list button:hover {
    border-color: rgba(101, 240, 160, .38);
    background: rgba(101, 240, 160, .09);
}

.chat-pins__list span {
    overflow: hidden;
    color: var(--green);
    font-size: 12px;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-pins__list small {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-pins-modal[hidden] {
    display: none;
}

.chat-pins-modal {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.chat-pins-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 12, .68);
    backdrop-filter: blur(8px);
}

.chat-pins-modal__dialog {
    position: absolute;
    left: calc(var(--chat-pins-modal-left, 0px) + (var(--chat-pins-modal-width, 100vw) - min(560px, calc(var(--chat-pins-modal-width, 100vw) - 36px))) / 2);
    top: calc(var(--chat-pins-modal-top, 0px) + (var(--chat-pins-modal-height, 100dvh) - min(680px, calc(var(--chat-pins-modal-height, 100dvh) - 36px))) / 2);
    z-index: 1;
    width: min(560px, calc(var(--chat-pins-modal-width, 100vw) - 36px));
    max-height: min(680px, calc(var(--chat-pins-modal-height, 100dvh) - 36px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(101, 240, 160, .24);
    border-radius: 8px;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(101, 240, 160, .055), transparent 180px),
        rgba(13, 20, 28, .98);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .42);
}

.chat-pins-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.chat-pins-modal__head h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
}

.chat-pins-modal__head small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    text-transform: uppercase;
}

.chat-pins-modal__list {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 8px;
    overflow-y: auto;
    padding: 12px;
}

.chat-pins-modal__list button {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid rgba(101, 240, 160, .20);
    border-radius: 8px;
    color: var(--text);
    background: rgba(101, 240, 160, .055);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.chat-pins-modal__list button:hover {
    border-color: rgba(101, 240, 160, .40);
    background: rgba(101, 240, 160, .10);
}

.chat-pins-modal__list span,
.chat-pins-modal__list small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-pins-modal__list span {
    color: var(--green);
    font-size: 13px;
    font-weight: 850;
}

.chat-pins-modal__list small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.chat-pins-modal__empty {
    padding: 18px;
    border: 1px dashed rgba(148, 163, 184, .24);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
    font-weight: 760;
}

.chat-message-search__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    min-height: 34px;
    padding: 0;
}

.chat-message-search.is-open .chat-message-search__head {
    grid-column: 1;
}

.chat-message-search.is-open .chat-message-search__head .button {
    display: none;
}

.chat-message-search__head .button {
    min-width: 74px;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
}

.chat-message-search__form {
    position: static;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(112px, .34fr) 82px;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.chat-message-search.is-open .chat-message-search__form {
    grid-column: 2;
}

.chat-message-search__form[hidden] {
    display: none;
}

.chat-message-search__form input[type="search"] {
    grid-column: auto;
}

.chat-message-search__form input[type="date"] {
    display: none;
}

.chat-message-search__form input,
.chat-message-search__form .button {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    border-radius: 8px;
    font-size: 12px;
}

.chat-message-search__form input {
    height: 32px;
    padding: 6px 10px;
    background: rgba(2, 8, 15, .56);
}

.chat-message-search__form .button {
    padding: 0 12px;
    font-size: 12px;
}

.chat-message-search__results {
    position: absolute;
    top: calc(100% + 6px);
    left: 20px;
    right: 20px;
    z-index: 20;
    max-height: min(280px, 42svh);
    display: grid;
    gap: 7px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(12, 17, 23, .98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .34);
}

.chat-message-search__results[hidden] {
    display: none;
}

.chat-message-search__results button {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 8px 9px;
    border: 1px solid rgba(101, 240, 160, .20);
    border-radius: 8px;
    color: var(--text);
    background: rgba(101, 240, 160, .055);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.chat-message-search__results button:hover {
    border-color: rgba(101, 240, 160, .38);
    background: rgba(101, 240, 160, .09);
}

.chat-message-search__results span {
    overflow: hidden;
    color: var(--green);
    font-size: 12px;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-message-search__results small {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-load-more {
    justify-self: center;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.chat-load-more:hover {
    color: var(--green);
    border-color: rgba(101, 240, 160, .34);
    background: rgba(101, 240, 160, .08);
}

.chat-load-more[hidden] {
    display: none;
}

.chat-new-messages {
    position: absolute;
    left: 50%;
    bottom: 92px;
    z-index: 8;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid rgba(101, 240, 160, .36);
    border-radius: 999px;
    color: #06100b;
    background: var(--green);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transform: translateX(-50%);
}

.chat-new-messages::before {
    content: "↓";
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    color: #06100b;
    background: rgba(255, 255, 255, .36);
    line-height: 1;
}

.chat-new-messages[data-mode="latest"] {
    color: var(--text);
    border-color: rgba(148, 163, 184, .24);
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .15), rgba(15, 23, 42, .88)),
        rgba(15, 23, 42, .92);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .30), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.chat-new-messages[data-mode="latest"]::before {
    color: #06100b;
    background: var(--green);
}

.chat-new-messages[hidden] {
    display: none;
}

.chat-typing {
    position: absolute;
    left: 14px;
    bottom: calc(100% + 6px);
    z-index: 7;
    max-width: min(360px, calc(100% - 28px));
    min-height: 0;
    padding: 3px 8px;
    color: var(--muted);
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 999px;
    background: rgba(12, 17, 23, .88);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-typing[hidden] {
    display: none;
}

.chat-date-divider {
    display: inline-flex;
    flex: 0 0 auto;
    align-self: center;
    margin: 4px auto;
    width: fit-content;
    min-width: 0;
    max-width: calc(100% - 40px);
    padding: 5px 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .045);
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
}

.chat-unread-divider {
    display: grid;
    grid-template-columns: minmax(20px, 1fr) auto minmax(20px, 1fr);
    gap: 10px;
    align-items: center;
    width: 100%;
    margin: 6px 0;
    color: var(--green);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.chat-unread-divider::before,
.chat-unread-divider::after {
    content: "";
    height: 1px;
    background: rgba(101, 240, 160, .32);
}

.chat-unread-divider span {
    padding: 4px 9px;
    border: 1px solid rgba(101, 240, 160, .26);
    border-radius: 999px;
    background: rgba(101, 240, 160, .07);
}

.chat-message {
    width: fit-content;
    max-width: min(680px, calc(100% - 8px));
    min-width: 0;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    align-self: start;
}

.chat-message.is-fresh {
    animation: chatMessageIn .24s ease-out both;
}

@keyframes chatMessageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message--system {
    max-width: min(520px, 92%);
    display: block;
    align-self: center;
}

.chat-message--system.is-own {
    max-width: min(520px, 92%);
    display: block;
    align-self: center;
    grid-template-columns: none;
}

.chat-system-event {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .035);
    font-size: 11px;
    font-weight: 700;
}

.chat-system-event button {
    min-height: 0;
    padding: 0 2px;
    border: 0;
    color: var(--danger);
    background: transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.chat-system-event button:hover {
    text-decoration: underline;
}

.chat-system-event time {
    opacity: .78;
}

.chat-message.is-highlighted .chat-bubble {
    animation: chat-message-jump-highlight 1.8s ease-out both;
}

@keyframes chat-message-jump-highlight {
    0% {
        border-color: rgba(101, 240, 160, .86);
        background:
            linear-gradient(135deg, rgba(101, 240, 160, .16), rgba(101, 240, 160, .035)),
            var(--card);
        box-shadow:
            0 0 0 1px rgba(101, 240, 160, .32),
            0 0 0 7px rgba(101, 240, 160, .13),
            0 18px 52px rgba(101, 240, 160, .10);
    }
    36% {
        border-color: rgba(101, 240, 160, .58);
        box-shadow:
            0 0 0 1px rgba(101, 240, 160, .22),
            0 0 0 5px rgba(101, 240, 160, .08),
            0 12px 36px rgba(101, 240, 160, .07);
    }
    100% {
        border-color: var(--line);
        background: var(--card);
        box-shadow: none;
    }
}

.chat-message.is-own {
    align-self: end;
    grid-template-columns: minmax(0, 1fr) 36px;
    max-width: min(680px, calc(100% - 8px));
}

.chat-message.is-own .chat-avatar {
    grid-column: 2;
    grid-row: 1;
}

.chat-message.is-own .chat-bubble {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    min-width: min(360px, 100%);
    padding-right: 38px;
    padding-bottom: 18px;
    border-color: rgba(101, 240, 160, .30);
    background: rgba(101, 240, 160, .09);
}

.chat-message.is-own.is-pending {
    width: auto;
}

.chat-message.is-own.is-pending .chat-bubble {
    min-width: min(360px, 100%);
}
.chat-message.is-compact {
    margin-top: -7px;
}

.chat-message.is-compact .chat-avatar {
    visibility: hidden;
}

.chat-message.is-compact .chat-meta {
    display: none;
}

.chat-message.is-compact .chat-bubble {
    gap: 0;
    padding-top: 7px;
    padding-bottom: 7px;
}

.chat-message.is-compact .chat-bubble p {
    line-height: 1.34;
}

.chat-message.is-compact:not(.is-own) .chat-bubble {
    border-top-left-radius: 5px;
}

.chat-message.is-compact.is-own .chat-bubble {
    border-top-right-radius: 5px;
}

.chat-message.is-deleted .chat-bubble {
    border-style: dashed;
    background: rgba(148, 163, 184, .035);
}

.chat-deleted-message {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
}

.chat-deleted-snapshot {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px dashed rgba(91, 240, 153, .26);
    border-radius: 8px;
    background: rgba(91, 240, 153, .055);
}

.chat-deleted-snapshot span {
    color: var(--green);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.chat-deleted-snapshot p,
.chat-deleted-snapshot small {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.chat-deleted-snapshot small {
    color: var(--muted);
    font-size: 11px;
}

.chat-message.is-pending .chat-bubble {
    opacity: .72;
}

.chat-message.is-failed .chat-bubble {
    border-color: rgba(240, 93, 103, .42);
    background: rgba(240, 93, 103, .06);
}

.chat-avatar {
    padding: 0;
    border: 0;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    color: #06100b;
    background: var(--green);
    font-size: 13px;
    font-weight: 800;
}

.chat-avatar:disabled {
    cursor: default;
    opacity: 1;
}

.chat-avatar.is-clickable {
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease;
}

.chat-avatar.is-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px rgba(101, 240, 160, .14);
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-bubble {
    position: relative;
    display: grid;
    gap: 8px;
    align-items: start;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
}

.chat-bubble > :not(.chat-actions) {
    grid-column: 1;
    min-width: 0;
}

.chat-message:not(.is-own) .chat-bubble {
    justify-self: start;
}

.chat-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.15;
}

.chat-actions {
    position: static;
    width: 0;
    height: 0;
    z-index: 5;
}

.chat-actions__toggle {
    position: absolute;
    width: 26px;
    height: 26px;
    min-height: 0;
    display: none;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(2, 6, 23, .22);
    font: inherit;
    font-size: 0;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.chat-actions__toggle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: -7px 0 0 currentColor, 7px 0 0 currentColor;
    transform: translate(-50%, -50%);
}

.chat-actions__toggle:hover,
.chat-actions.is-open .chat-actions__toggle {
    color: var(--green);
    border-color: rgba(101, 240, 160, .28);
    background: rgba(101, 240, 160, .08);
}

.chat-actions__menu {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    z-index: 1500;
    width: max-content;
    min-width: 150px;
    max-width: calc(100vw - 20px);
    overflow: auto;
    overscroll-behavior: contain;
    display: grid;
    gap: 3px;
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(12, 17, 23, .98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .34);
}

.chat-actions.is-up .chat-actions__menu {
    top: 0;
    bottom: auto;
}

.chat-actions__menu[hidden] {
    display: none;
}

.chat-actions__reactions {
    display: grid;
    grid-template-columns: repeat(5, 32px);
    gap: 4px;
    padding: 2px 2px 6px;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    margin-bottom: 2px;
}

.chat-actions__reactions button {
    width: 32px;
    height: 32px;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 999px;
    color: var(--text);
    background: rgba(255, 255, 255, .035);
    font-size: 16px;
    cursor: pointer;
}

.chat-actions__reactions button:hover {
    border-color: rgba(101, 240, 160, .34);
    background: rgba(101, 240, 160, .10);
}

.chat-actions__menu button {
    min-height: 0;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding: 8px 9px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--danger);
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 760;
    text-align: left;
    cursor: pointer;
}

.chat-meta button:not(.chat-author-button) {
    min-height: 0;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--danger);
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 760;
    text-align: left;
    cursor: pointer;
}

.chat-actions__menu button::before {
    content: "";
    width: 16px;
    height: 16px;
    display: block;
    background: currentColor;
    mask: var(--chat-menu-icon) center / contain no-repeat;
    -webkit-mask: var(--chat-menu-icon) center / contain no-repeat;
    opacity: .96;
}

.chat-actions__menu .chat-actions__reactions button {
    width: 32px;
    height: 32px;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    gap: 0;
    padding: 0;
    border-color: rgba(148, 163, 184, .12);
    border-radius: 999px;
    color: var(--text);
    background: rgba(255, 255, 255, .035);
    font-size: 16px;
    text-align: center;
}

.chat-actions__menu .chat-actions__reactions button::before {
    display: none;
}

.chat-actions__menu button[data-icon="copy"] {
    --chat-menu-icon: url("icons/copy.svg");
}

.chat-actions__menu button[data-icon="reply"] {
    --chat-menu-icon: url("icons/reply.svg");
}

.chat-actions__menu button[data-icon="profile"] {
    --chat-menu-icon: url("icons/profile.svg");
}

.chat-actions__menu button[data-icon="edit"] {
    --chat-menu-icon: url("icons/edit.svg");
}

.chat-actions__menu button[data-icon="pin"] {
    --chat-menu-icon: url("icons/pin.svg");
}

.chat-actions__menu button[data-icon="history"] {
    --chat-menu-icon: url("icons/history.svg");
}

.chat-actions__menu button[data-icon="delete"] {
    --chat-menu-icon: url("icons/delete.svg");
}

.chat-actions__menu button[data-icon="delete-hard"] {
    --chat-menu-icon: url("icons/delete-hard.svg");
}

.chat-actions__menu button[data-icon="bell"] {
    --chat-menu-icon: url("icons/lucide/bell.svg");
}

.chat-actions__menu button[data-icon="bell-off"] {
    --chat-menu-icon: url("icons/lucide/bell-off.svg");
}

.chat-actions__menu button[data-icon="archive"] {
    --chat-menu-icon: url("icons/lucide/archive.svg");
}

.chat-actions__menu button[data-icon="archive-restore"] {
    --chat-menu-icon: url("icons/lucide/archive-restore.svg");
}

.chat-pin-actions .chat-actions__menu {
    z-index: 1700;
    min-width: 188px;
}

.chat-pin-actions .chat-actions__menu button[data-pin-menu-jump] {
    color: var(--green);
}

.chat-pin-actions .chat-actions__menu button[data-pin-menu-unpin] {
    color: var(--danger);
}

.chat-actions__menu button:hover {
    border-color: rgba(148, 163, 184, .16);
    background: rgba(255, 255, 255, .045);
}

.chat-actions__menu button[data-chat-edit],
.chat-actions__menu button[data-chat-pin],
.chat-actions__menu button[data-chat-history],
.chat-actions__menu button[data-chat-copy],
.chat-actions__menu button[data-chat-reply-menu],
.chat-actions__menu button[data-chat-open-author],
.chat-meta button:not(.chat-author-button)[data-chat-edit],
.chat-meta button:not(.chat-author-button)[data-chat-pin] {
    color: var(--green);
}

.chat-actions__menu button[data-chat-delete-hard] {
    color: var(--danger);
}

.chat-meta strong,
.chat-meta .chat-author-button {
    width: auto;
    max-width: min(170px, 52vw);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font: inherit;
    line-height: inherit;
    text-align: left;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.chat-meta span,
.chat-meta time {
    min-width: 0;
    white-space: nowrap;
}

.chat-meta .chat-author-button {
    color: var(--green);
    font-weight: 800;
}

.chat-meta .chat-author-button:hover {
    color: #9affc0;
    text-decoration: none;
}

.chat-bubble p {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.chat-hashtag {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--green);
    font: inherit;
    font-weight: 800;
    letter-spacing: 0;
    cursor: pointer;
}

.chat-hashtag:hover,
.chat-hashtag:focus-visible {
    color: #9affc0;
    text-decoration: underline;
    text-underline-offset: 2px;
    outline: none;
}

.chat-bubble p.chat-message-emoji {
    line-height: 1.08;
    letter-spacing: 0;
    overflow-wrap: normal;
    white-space: normal;
}

.chat-bubble p.chat-message-emoji--single {
    font-size: 52px;
}

.chat-bubble p.chat-message-emoji--multi {
    font-size: 36px;
}



.chat-message.is-editing .chat-bubble {
    border-color: rgba(101, 240, 160, .34);
    box-shadow: 0 0 0 1px rgba(101, 240, 160, .08), 0 14px 34px rgba(0, 0, 0, .18);
}

.chat-inline-edit {
    display: grid;
    gap: 8px;
    width: min(520px, 100%);
    min-width: min(360px, 70vw);
}

.chat-inline-edit textarea {
    width: 100%;
    min-height: 68px;
    max-height: 220px;
    resize: none;
    padding: 9px 10px;
    border: 1px solid rgba(101, 240, 160, .28);
    border-radius: 8px;
    color: var(--text);
    background: rgba(2, 6, 23, .38);
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
    outline: none;
}

.chat-inline-edit textarea:focus {
    border-color: rgba(101, 240, 160, .55);
    box-shadow: 0 0 0 3px rgba(101, 240, 160, .10);
}

.chat-inline-edit__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-inline-edit__footer small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.chat-inline-edit__footer span {
    display: inline-flex;
    gap: 7px;
}

.chat-inline-edit button {
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .026);
    font: inherit;
    font-size: 11px;
    font-weight: 820;
    cursor: pointer;
}

.chat-inline-edit button:hover {
    border-color: rgba(101, 240, 160, .28);
    color: var(--green);
    background: rgba(101, 240, 160, .08);
}

.chat-inline-edit__save {
    color: #06100b !important;
    border-color: rgba(101, 240, 160, .58) !important;
    background: var(--green) !important;
}

.chat-inline-edit__save:hover {
    color: #06100b !important;
    background: #8cffb3 !important;
}

.chat-inline-edit button:disabled,
.chat-inline-edit textarea:disabled {
    cursor: wait;
    opacity: .68;
}

.chat-message.is-album-hidden {
    display: none;
}

.chat-attachment.is-album-source {
    display: none;
}

.chat-attachment-album {
    position: relative;
    display: grid;
    gap: 4px;
    width: min(330px, 100%);
    overflow: hidden;
    border-radius: 8px;
}

.chat-attachment-album--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-attachment-album--3,
.chat-attachment-album--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-attachment-album__item {
    position: relative;
    display: block;
    overflow: hidden;
    min-height: 0;
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 7px;
    background: rgba(2, 6, 23, .38);
}

.chat-attachment-album--2 .chat-attachment-album__item {
    aspect-ratio: 4 / 5;
}

.chat-attachment-album--3 .chat-attachment-album__item:first-child {
    grid-row: span 2;
    aspect-ratio: auto;
}

.chat-attachment-album__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-read-status {
    position: absolute;
    right: 9px;
    bottom: 6px;
    width: auto;
    min-width: 17px;
    height: 14px;
    min-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    border: 0;
    color: rgba(148, 163, 184, .72);
    background: transparent;
    font: inherit;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    letter-spacing: -1px;
    opacity: .82;
}

.chat-delivery-status.is-pending,
.chat-delivery-status.is-sent,
.chat-delivery-status.is-delivered {
    cursor: default;
}

.chat-delivery-status.is-failed {
    color: #ff8b8b;
    cursor: pointer;
    letter-spacing: 0;
}

.chat-delivery-status.is-read {
    color: rgba(101, 240, 160, .72);
}

.chat-attachment-pending {
    width: fit-content;
    max-width: 100%;
    padding: 7px 9px;
    border: 1px dashed rgba(148, 163, 184, .28);
    border-radius: 8px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-attachment-pending-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 86px));
    gap: 6px;
}

.chat-attachment-pending-grid .chat-attachment-pending {
    display: block;
    width: 86px;
    height: 86px;
    padding: 0;
    overflow: hidden;
}

.chat-attachment-pending-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-read-status:hover {
    opacity: 1;
    color: var(--green);
}

.chat-read-status[hidden] {
    display: none;
}

.chat-read-popover {
    position: fixed;
    z-index: 1400;
    width: min(240px, calc(100vw - 24px));
    max-height: 280px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
    color: var(--text);
}

.chat-read-popover[hidden] {
    display: none;
}

.chat-read-popover > strong {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
}

.chat-read-popover small {
    color: var(--muted);
}

.chat-read-popover__user {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 5px 0;
}

.chat-read-popover__user > span {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 50%;
    background: rgba(33, 230, 193, 0.13);
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
}

.chat-read-popover__user img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-read-popover__user b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.chat-reply-ref {
    display: grid;
    gap: 3px;
    padding: 8px 9px;
    border: 1px solid rgba(101, 240, 160, .26);
    border-radius: 8px;
    border-left-width: 3px;
    background: rgba(101, 240, 160, .07);
    text-align: left;
}

.chat-reply-ref {
    width: 100%;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.chat-reply-ref span {
    color: var(--green);
    font-size: 12px;
    font-weight: 760;
}

.chat-reply-ref small {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-attachment {
    display: block;
    overflow: hidden;
    width: fit-content;
    max-width: min(520px, 100%);
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .38);
}

.chat-attachment img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(430px, 46svh);
    object-fit: contain;
}

.chat-attachment--gif {
    position: relative;
    width: min(340px, 68vw);
    max-width: 100%;
    border-color: rgba(101, 240, 160, .24);
    background: rgba(2, 6, 23, .58);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

.chat-attachment--gif::after {
    content: "GIF";
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 1;
    padding: 3px 6px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 6px;
    color: rgba(255, 255, 255, .9);
    background: rgba(2, 6, 23, .72);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
}

.chat-attachment--gif img {
    width: 100%;
    max-height: min(340px, 42svh);
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.chat-youtube-embed {
    width: min(520px, 72vw);
    max-width: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(101, 240, 160, .22);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .08), transparent 62%),
        rgba(2, 6, 23, .62);
    box-shadow: 0 14px 38px rgba(0, 0, 0, .24);
}

.chat-youtube-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.chat-youtube-embed--pending {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    color: var(--text);
}

.chat-youtube-embed--pending span {
    font-size: 18px;
    font-weight: 900;
}

.chat-youtube-embed--pending small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.chat-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    min-height: 32px;
    margin-top: 4px;
    padding: 0 11px;
    border: 1px solid rgba(94, 234, 145, .52);
    border-radius: 7px;
    background: rgba(23, 80, 58, .62);
    color: #d7ffe5;
    font-size: 12px;
    font-weight: 760;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(24, 185, 112, .10);
}

.chat-action-button:hover {
    border-color: rgba(94, 234, 145, .78);
    background: rgba(32, 111, 75, .72);
    color: #ffffff;
}

.chat-sticker {
    display: block;
    width: 160px;
    height: 160px;
    max-width: 100%;
    overflow: hidden;
}

.chat-sticker svg,
.chat-sticker canvas,
.chat-sticker-media {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

img.chat-sticker-media,
video.chat-sticker-media {
    object-fit: contain;
}

.chat-custom-emoji {
    display: inline-block;
    width: 1.35em;
    height: 1.35em;
    margin: 0 .05em;
    vertical-align: -.28em;
}

.chat-custom-emoji svg,
.chat-custom-emoji canvas,
img.chat-custom-emoji,
video.chat-custom-emoji {
    display: inline-block;
    width: 1.35em !important;
    height: 1.35em !important;
    object-fit: contain;
}

.chat-message--sticker,
.chat-message--sticker.is-own,
.chat-message--sticker.is-own.is-pending {
    width: fit-content;
    max-width: min(260px, calc(100% - 8px));
}

.chat-message--sticker .chat-bubble,
.chat-message--sticker.is-own .chat-bubble,
.chat-message--sticker.is-own.is-pending .chat-bubble {
    min-width: 0;
    padding: 0 22px 16px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.chat-message--sticker:not(.is-own) .chat-bubble {
    padding-right: 0;
}

.chat-message--sticker .chat-sticker {
    width: 178px;
    height: 178px;
    max-width: min(178px, 100%);
}

.chat-message--sticker .chat-read-status {
    right: 2px;
    bottom: 5px;
    min-width: 18px;
    color: rgba(148, 163, 184, .86);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .55);
}

.chat-message--sticker.is-own .chat-read-status {
    color: rgba(101, 240, 160, .82);
}

.chat-message--gif,
.chat-message--gif.is-own,
.chat-message--gif.is-own.is-pending {
    width: fit-content;
    max-width: min(390px, calc(100% - 8px));
}

.chat-message--gif .chat-bubble,
.chat-message--gif.is-own .chat-bubble,
.chat-message--gif.is-own.is-pending .chat-bubble {
    gap: 7px;
    padding: 8px 8px 22px;
    border-color: rgba(101, 240, 160, .22);
    background: rgba(8, 18, 24, .72);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .20);
}

.chat-message--gif .chat-meta {
    padding: 0 2px;
}

.chat-message--gif .chat-read-status {
    right: 10px;
    bottom: 6px;
    color: rgba(101, 240, 160, .78);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .55);
}

.chat-quick-reactions {
    position: absolute;
    left: 10px;
    top: -18px;
}

.chat-thread-meta-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--muted);
    background: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.2;
}

.chat-encrypted-badge {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    color: var(--green);
    background: transparent;
    opacity: 1;
}

.chat-encrypted-badge .chat-encrypted-badge__icon {
    display: block;
    margin: 0;
    color: var(--green);
    background: currentColor;
    stroke: currentColor;
    opacity: 1;
}

.chat-encryption-lock-now {
    display: contents;
}

.chat-lock-now-icon {
    width: 16px;
    height: 16px;
}

.chat-encryption-lock {
    width: min(420px, calc(100% - 28px));
    align-self: center;
    justify-self: center;
    display: grid;
    gap: 14px;
    justify-items: center;
    margin: auto;
    padding: 24px;
    border: 1px solid rgba(101, 240, 160, .24);
    border-radius: 10px;
    background:
        radial-gradient(circle at 50% 0%, rgba(101, 240, 160, .13), transparent 58%),
        rgba(15, 23, 42, .52);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.chat-encryption-lock__icon {
    width: 54px;
    height: 54px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(101, 240, 160, .30);
    border-radius: 14px;
    color: var(--green);
    background: rgba(101, 240, 160, .10);
}

.chat-encryption-lock strong {
    color: var(--text);
    font-size: 20px;
    font-weight: 950;
}

.chat-encryption-lock label {
    width: 100%;
    display: grid;
    gap: 8px;
    margin-top: 2px;
}

.chat-encryption-lock label span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.chat-encryption-lock input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    color: var(--text);
    background: rgba(2, 6, 23, .40);
    font: inherit;
    font-size: 14px;
}

.chat-encryption-lock .button {
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
}

.chat-panel[data-encrypted-thread="1"] .chat-file,
.chat-panel[data-encrypted-thread="1"] [data-chat-picker-tab="stickers"],
.chat-panel[data-encrypted-thread="1"] [data-chat-picker-tab="gif"],
.chat-panel[data-encrypted-thread="1"] [data-chat-picker-section="stickers"],
.chat-panel[data-encrypted-thread="1"] [data-chat-picker-section="gif"] {
    display: none;
}
.chat-quick-reactions {
    z-index: 3;
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    background: rgba(12, 18, 28, .96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .14s ease, transform .14s ease;
}

.chat-message.is-own .chat-quick-reactions {
    right: 10px;
    left: auto;
}

.chat-message.is-reactions-open .chat-quick-reactions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.chat-quick-reactions button,
.chat-reactions button {
    min-width: 0;
    border: 1px solid transparent;
    color: var(--text);
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.chat-quick-reactions button {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 16px;
}

.chat-quick-reactions button:hover {
    background: rgba(101, 240, 160, .10);
}

.chat-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-right: 22px;
}

.chat-reactions[hidden] {
    display: none;
}

.chat-reactions button {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-color: rgba(148, 163, 184, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
}

.chat-reactions button:hover,
.chat-reactions button.is-active {
    border-color: rgba(101, 240, 160, .38);
    background: rgba(101, 240, 160, .12);
}

.chat-reactions small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.chat-empty {
    margin: 0 auto;
    color: var(--muted);
    font-size: 14px;
}

.chat-empty--blocked {
    width: min(320px, 100%);
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 120, 127, .22);
    border-radius: 8px;
    background: rgba(65, 31, 36, .20);
    text-align: center;
}

.chat-empty--blocked span {
    display: inline-grid;
    min-height: 24px;
    place-items: center;
    padding: 0 10px;
    border: 1px solid rgba(255, 120, 127, .24);
    border-radius: 999px;
    color: #ff858b;
    background: rgba(255, 120, 127, .08);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.chat-empty--blocked strong {
    color: var(--text);
    font-size: 18px;
    font-weight: 850;
    line-height: 1.1;
}

.chat-empty--direct {
    width: min(340px, 100%);
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 16px;
    border: 1px solid rgba(101, 240, 160, .18);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .055), transparent 72%),
        rgba(255, 255, 255, .022);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .16);
    text-align: center;
}

.chat-empty--direct strong {
    color: var(--text);
    font-size: 16px;
    font-weight: 850;
    line-height: 1.1;
}

.chat-empty--direct small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.chat-empty-avatar {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    color: #06100b;
    background: var(--green);
    font-size: 22px;
    font-weight: 900;
    box-shadow: 0 18px 42px rgba(101, 240, 160, .14);
}

.chat-empty-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-compose {
    --chat-compose-input-height: 46px;
    --chat-compose-action-size: 42px;
    position: relative;
    z-index: 6;
    flex: 0 0 auto;
    min-width: 0;
    display: grid;
    grid-template-columns: var(--chat-compose-action-size) minmax(0, 1fr) var(--chat-compose-action-size);
    align-items: center;
    grid-auto-rows: minmax(var(--chat-compose-input-height), auto);
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid rgba(148, 163, 184, .14);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .026), rgba(255, 255, 255, .014)),
        rgba(10, 15, 22, .72);
}

.chat-compose__bar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: var(--chat-compose-action-size) minmax(0, 1fr) var(--chat-compose-action-size);
    align-items: end;
    gap: 10px;
    min-width: 0;
}

.chat-compose__bar .chat-file {
    grid-column: 1;
    order: 0;
}

.chat-compose__bar .chat-input-wrap {
    grid-column: 2;
    order: 0;
    width: 100%;
    max-width: 100%;
}

.chat-compose__bar .chat-send-button {
    grid-column: 3;
    order: 0;
}

.chat-panel--monitor {
    grid-template-rows: auto auto minmax(0, 1fr);
}

.chat-panel--monitor .chat-feed {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 18px;
}

.chat-panel--monitor .chat-message,
.chat-panel--monitor .chat-message.is-own {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-self: stretch;
}

.chat-panel--monitor .chat-message--system,
.chat-panel--monitor .chat-message--system.is-own {
    width: 100%;
    max-width: none;
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    justify-content: stretch;
    align-self: stretch;
    padding-left: 2px;
}

.chat-panel--monitor .chat-message--system::before,
.chat-panel--monitor .chat-message--system.is-own::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-top: 12px;
    border: 2px solid rgba(101, 240, 160, .42);
    border-radius: 999px;
    background: rgba(5, 11, 18, .96);
    box-shadow: 0 0 0 4px rgba(101, 240, 160, .07);
}

.chat-panel--monitor .chat-message--system .chat-system-event {
    max-width: 100%;
    justify-content: flex-start;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    border-radius: 8px;
    border-color: rgba(148, 163, 184, .14);
    background: rgba(255, 255, 255, .022);
}

.chat-panel--monitor .chat-message.is-own .chat-avatar,
.chat-panel--monitor .chat-message.is-own .chat-bubble {
    grid-column: auto;
    grid-row: auto;
}

.chat-panel--monitor .chat-message.is-own .chat-avatar {
    grid-column: 1;
}

.chat-panel--monitor .chat-message.is-own .chat-bubble {
    grid-column: 2;
    justify-self: stretch;
}

.chat-panel--monitor .chat-bubble,
.chat-panel--monitor .chat-message.is-own .chat-bubble,
.chat-panel--monitor .chat-message:not(.is-own) .chat-bubble {
    width: 100%;
    justify-self: stretch;
    grid-template-columns: minmax(190px, auto) minmax(0, 1fr);
    align-items: start;
    gap: 8px 16px;
    border-color: rgba(148, 163, 184, .14);
    background: rgba(255, 255, 255, .03);
}

.chat-panel--monitor .chat-meta {
    min-width: 0;
    grid-column: 1;
}

.chat-panel--monitor .chat-bubble p {
    grid-column: 2;
    padding-top: 1px;
}

.chat-panel--monitor .chat-reply-ref,
.chat-panel--monitor .chat-attachment {
    grid-column: 1 / -1;
}

.chat-monitor-readonly {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid rgba(148, 163, 184, .14);
    color: var(--muted);
    background: rgba(255, 255, 255, .02);
    font-size: 12px;
    font-weight: 750;
}

.chat-monitor-readonly strong {
    color: var(--green);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.chat-reply-compose {
    order: 2;
    grid-column: 1 / -1;
    min-width: 0;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 8px 9px;
    border: 1px solid rgba(101, 240, 160, .24);
    border-left: 3px solid var(--green);
    border-radius: 10px;
    background:
        linear-gradient(90deg, rgba(101, 240, 160, .10), rgba(101, 240, 160, .035)),
        rgba(2, 6, 23, .24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.chat-reply-compose[hidden] {
    display: none;
}

.chat-reply-compose__icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--green);
    background: rgba(101, 240, 160, .10);
}

.chat-reply-compose__icon .local-icon,
.chat-reply-compose button .local-icon {
    width: 16px;
    height: 16px;
}

.chat-reply-compose__body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.chat-reply-compose strong,
.chat-reply-compose small {
    display: block;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-reply-compose strong {
    color: var(--green);
    font-size: 12px;
    font-weight: 850;
}

.chat-reply-compose small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.chat-reply-compose button {
    width: 30px;
    height: 30px;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font: inherit;
    font-size: 0;
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.chat-reply-compose button:hover {
    color: var(--danger);
    border-color: rgba(255, 134, 125, .30);
    background: rgba(255, 134, 125, .08);
}

.chat-file {
    order: 0;
    position: relative;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--chat-compose-action-size);
    min-height: var(--chat-compose-action-size);
    min-width: 0;
}

.chat-file__trigger {
    width: var(--chat-compose-action-size);
    height: var(--chat-compose-action-size);
    min-width: var(--chat-compose-action-size);
    min-height: var(--chat-compose-action-size);
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(101, 240, 160, .30);
    border-radius: 999px;
    color: var(--green);
    background:
        linear-gradient(180deg, rgba(101, 240, 160, .12), rgba(101, 240, 160, .055)),
        rgba(255, 255, 255, .025);
    font: inherit;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.chat-file__trigger .local-icon {
    width: 18px;
    height: 18px;
}

.chat-file__trigger:hover,
.chat-file__trigger:focus-visible,
.chat-file.is-open .chat-file__trigger {
    border-color: rgba(101, 240, 160, .42);
    background: rgba(101, 240, 160, .12);
    box-shadow: 0 0 0 3px rgba(101, 240, 160, .10);
    outline: 0;
}

.chat-file-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 18;
    min-width: 172px;
    display: grid;
    gap: 4px;
    padding: 7px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 10px;
    background: rgba(12, 17, 23, .98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .34);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .14s ease, transform .14s ease;
}

.chat-file-menu[hidden] {
    display: none;
}

.chat-file.is-open .chat-file-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.chat-file-menu button {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--text);
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.chat-file-menu__icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: var(--green);
}

.chat-file-menu button:hover,
.chat-file-menu button:focus {
    color: var(--green);
    border-color: rgba(101, 240, 160, .24);
    background: rgba(101, 240, 160, .08);
    outline: 0;
}

.chat-file small {
    display: none;
}

.chat-video-modal[hidden] {
    display: none;
}

.chat-video-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
}

.chat-video-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 12, .68);
    backdrop-filter: blur(8px);
}

.chat-video-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(101, 240, 160, .22);
    border-radius: 10px;
    background: rgba(12, 17, 23, .98);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .46);
}

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

.chat-video-modal__head strong {
    color: var(--text);
    font-size: 20px;
    font-weight: 850;
}

.chat-video-modal__head button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .035);
    cursor: pointer;
}

.chat-video-modal__close-icon {
    width: 18px;
    height: 18px;
}

.chat-video-disabled,
.chat-video-link {
    width: 100%;
    display: grid;
    gap: 7px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
}

.chat-video-disabled {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    color: var(--muted);
    text-align: left;
    cursor: not-allowed;
    opacity: .62;
}

.chat-video-disabled__icon {
    width: 18px;
    height: 18px;
}

.chat-video-disabled span,
.chat-video-link span {
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
}

.chat-video-disabled small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.chat-video-link input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    color: var(--text);
    background: rgba(2, 6, 12, .46);
    font: inherit;
    font-size: 14px;
    outline: 0;
}

.chat-video-link input:focus {
    border-color: rgba(101, 240, 160, .42);
    box-shadow: 0 0 0 3px rgba(101, 240, 160, .10);
}

.chat-video-status {
    min-height: 14px;
    color: #ff8d92;
    font-size: 12px;
    font-weight: 750;
}

.chat-video-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.chat-file-preview {
    order: 4;
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    width: 100%;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    background: rgba(2, 6, 23, .18);
}

.chat-file-preview[hidden] {
    display: none;
}

.chat-file-preview__item {
    position: relative;
    width: 76px;
    height: 76px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(2, 6, 23, .38);
}

.chat-file-preview__item a,
.chat-file-preview__item img {
    display: block;
    width: 100%;
    height: 100%;
}

.chat-file-preview__item img {
    object-fit: cover;
}

.chat-file-preview__item button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    min-height: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 134, 125, .35);
    border-radius: 50%;
    color: #ffd6d6;
    background: rgba(20, 24, 32, .88);
    font: inherit;
    font-size: 0;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.chat-file-preview__item .chat-file-preview__crop {
    right: auto;
    left: 4px;
    border-color: rgba(101, 240, 160, .38);
    color: var(--green);
}

.chat-file-preview__item button::before {
    content: "×";
    display: block;
    color: #ffd6d6;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-1px);
}

.chat-file-preview__item .chat-file-preview__crop::before {
    content: "⌗";
    color: var(--green);
    font-size: 14px;
    transform: none;
}

.chat-input-wrap {
    order: 0;
    position: relative;
    min-width: 0;
    min-height: 46px;
    align-self: center;
    display: flex;
    align-items: center;
}

.chat-input-wrap textarea {
    position: relative;
    z-index: 2;
    width: 100%;
    display: block;
    padding-right: 54px;
}

.chat-input-wrap .chat-input-shadow {
    display: none !important;
}

.chat-text-editor {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: var(--chat-compose-input-height, 46px);
    height: var(--chat-compose-input-height, 46px);
    display: block;
    overflow: hidden;
    padding: 10px 52px 10px 18px;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 24px;
    color: var(--text);
    background: rgba(2, 8, 15, .78);
    font: inherit;
    line-height: 22px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    caret-color: var(--text);
    outline: 0;
    -webkit-user-select: text;
    user-select: text;
}

.chat-text-editor.is-empty::before {
    content: attr(data-placeholder);
    position: absolute;
    left: 18px;
    right: 52px;
    top: 10px;
    z-index: 0;
    overflow: hidden;
    color: var(--muted);
    pointer-events: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-text-editor > * {
    position: relative;
    z-index: 1;
}

.chat-text-editor:focus {
    border-color: rgba(101, 240, 160, .62);
    box-shadow:
        inset 0 0 0 1px rgba(101, 240, 160, .32),
        0 0 0 2px rgba(101, 240, 160, .08);
}

.chat-input-wrap textarea.has-custom-emoji-preview {
    color: var(--text);
    -webkit-text-fill-color: currentColor;
    caret-color: var(--text);
    background: transparent;
}

.chat-text-editor.has-custom-emoji-preview {
    color: var(--text);
    -webkit-text-fill-color: currentColor;
    caret-color: var(--text);
}

.chat-input-wrap textarea.has-custom-emoji-preview::selection,
.chat-text-editor.has-custom-emoji-preview::selection {
    color: var(--text);
    background: rgba(101, 240, 160, .18);
}

.chat-text-editor.has-custom-emoji-preview * {
    text-decoration: none !important;
}

.chat-input-emoji-chip {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 1.45em;
    height: 1.45em;
    margin: 0 .03em;
    vertical-align: -.32em;
    pointer-events: none;
    user-select: text;
    -webkit-user-select: text;
    -webkit-user-drag: none;
}

.chat-input-emoji-chip.is-selection-visible {
    border-radius: 0;
    background: Highlight;
    box-shadow: 0 0 0 2px Highlight;
    color: HighlightText;
}

/* Friends/privacy polish and chat settings action alignment. */
.chat-thread-edit-form {
    grid-template-columns: 52px minmax(0, 1fr) !important;
    align-items: start;
}

.chat-thread-edit-grid {
    display: contents;
}

.chat-thread-edit-form > .button[type="submit"] {
    grid-column: 2 !important;
    grid-row: 4 !important;
    justify-self: end;
    width: auto;
    min-width: 210px;
    max-width: 100%;
    min-height: 40px;
    margin: 0 14px 14px 12px;
    padding: 8px 18px;
}

.chat-admin-actions .button,
.chat-member-search-form .button,
.friends-add-form .button {
    gap: 8px;
    white-space: nowrap;
}

.chat-member-search-form .button {
    width: auto;
    min-width: 148px;
}

.chat-input-emoji-chip .chat-custom-emoji,
.chat-input-emoji-chip [data-chat-tgs],
.chat-input-emoji-chip [data-chat-tgs-lazy],
.chat-input-emoji-chip img,
.chat-input-emoji-chip video {
    display: block;
    width: 100% !important;
    height: 100% !important;
    margin: 0;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.chat-input-preview {
    position: absolute;
    inset: 0;
    z-index: 1;
    min-height: 46px;
    overflow: hidden;
    padding: 0 54px 0 18px;
    display: flex;
    align-items: center;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    pointer-events: none;
}

.chat-input-preview .chat-custom-emoji {
    width: 1.25em;
    height: 1.25em;
    margin-inline: .02em;
    vertical-align: -.22em;
}

.chat-input-preview[hidden] {
    display: none;
}

.chat-compose.is-multiline .chat-input-preview {
    align-items: flex-start;
    padding-top: 12px;
    overflow-y: auto;
}

.chat-compose > .button {
    order: 5;
}

.chat-compose-hint {
    order: 6;
}

.chat-emoji-trigger {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .08);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.chat-emoji-trigger:hover,
.chat-emoji-trigger[aria-expanded="true"] {
    border-color: rgba(101, 240, 160, .34);
    background: rgba(101, 240, 160, .13);
}

.chat-emoji-trigger .local-icon {
    width: 17px;
    height: 17px;
    pointer-events: none;
}

.chat-emoji-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 15;
    width: min(396px, calc(100vw - 28px));
    max-height: min(560px, 62svh);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.chat-emoji-panel[hidden] {
    display: none;
}

.chat-picker-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 3px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.chat-picker-tabs button {
    min-width: 0;
    min-height: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.chat-picker-tabs button .chat-custom-emoji {
    width: 22px;
    height: 22px;
    margin: 0;
}

.chat-picker-tabs button:hover,
.chat-picker-tabs button.is-active {
    color: var(--green);
    border-color: rgba(101, 240, 160, .26);
    background: rgba(101, 240, 160, .08);
}

.chat-picker-section {
    position: relative;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    align-content: start;
    gap: 8px;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(101, 240, 160, .34) transparent;
}

.chat-picker-section[hidden] {
    display: none;
}

.chat-picker-section.chat-picker-section--packs,
.chat-picker-section[data-chat-picker-section="stickers"] {
    overflow: hidden;
    grid-template-rows: minmax(0, 1fr) auto;
    align-content: stretch;
    padding-right: 0;
}

.chat-picker-section--gif {
    gap: 8px;
}

.chat-giphy-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.chat-giphy-modes button {
    min-width: 0;
    height: 32px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .035);
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.chat-giphy-modes button.is-active {
    border-color: rgba(101, 240, 160, .36);
    color: var(--green);
    background: rgba(101, 240, 160, .11);
}

.chat-giphy-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(88px, auto);
    gap: 8px;
    align-items: center;
}

.chat-giphy-search input {
    min-width: 0;
    height: 36px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--text);
    background: rgba(255, 255, 255, .04);
    font: inherit;
    font-size: 13px;
    outline: none;
}

.chat-giphy-search input:focus {
    border-color: rgba(101, 240, 160, .36);
    box-shadow: 0 0 0 3px rgba(101, 240, 160, .10);
}

.chat-giphy-search button {
    appearance: none;
    -webkit-appearance: none;
    width: auto;
    min-width: 88px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(101, 240, 160, .28);
    border-radius: 8px;
    padding: 0;
    color: var(--green);
    background: rgba(101, 240, 160, .08);
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: none;
    line-height: 1;
}

.chat-giphy-search button:hover {
    border-color: rgba(101, 240, 160, .42);
    background: rgba(101, 240, 160, .14);
}

.chat-giphy-search__icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.chat-giphy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.chat-giphy-grid button {
    width: 100%;
    aspect-ratio: 1.25;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    padding: 0;
    background: rgba(255, 255, 255, .035);
    cursor: pointer;
}

.chat-giphy-grid button:hover {
    border-color: rgba(101, 240, 160, .38);
}

.chat-giphy-grid img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.chat-giphy-sentinel {
    min-height: 1px;
}

.chat-giphy-skeleton {
    width: 100%;
    aspect-ratio: 1.25;
    display: block;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(148, 163, 184, .10), rgba(148, 163, 184, .20), rgba(148, 163, 184, .10));
    background-size: 220% 100%;
    animation: chat-giphy-skeleton 1.1s ease-in-out infinite;
}

@keyframes chat-giphy-skeleton {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.chat-message--gif .chat-attachment--gif {
    width: min(320px, 56vw);
}

.chat-message--gif .chat-attachment--gif img {
    width: 100%;
    height: auto;
    max-height: min(320px, 38svh);
    aspect-ratio: auto;
    object-fit: contain;
}

.chat-giphy-brand {
    justify-self: end;
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.chat-sticker-pack-panel,
.chat-custom-emoji-pack-panel {
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(101, 240, 160, .34) transparent;
    content-visibility: auto;
    contain-intrinsic-size: 420px;
}

.chat-sticker-pack-panel[hidden],
.chat-custom-emoji-pack-panel[hidden] {
    display: none;
}

.chat-picker-empty {
    min-height: 76px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 740;
}

.chat-picker-empty[hidden] {
    display: none;
}

.chat-emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}

.chat-emoji-grid button {
    width: 100%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 7px;
    background: rgba(255, 255, 255, .035);
    font-size: 20px;
    cursor: pointer;
}

.chat-emoji-grid button:hover,
.chat-sticker-grid button:hover {
    border-color: rgba(101, 240, 160, .38);
    background: rgba(101, 240, 160, .10);
}

.chat-emoji-categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.chat-emoji-categories::-webkit-scrollbar {
    display: none;
}

.chat-emoji-categories button {
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font: inherit;
    font-size: 11px;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.chat-emoji-categories button.is-active,
.chat-emoji-categories button:hover {
    color: var(--green);
    border-color: rgba(101, 240, 160, .30);
    background: rgba(101, 240, 160, .09);
}

.chat-picker-label,
.chat-sticker-pack-title {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.chat-sticker-pack-title {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding-top: 2px;
}

.chat-sticker-pack-title strong {
    color: var(--text);
    font-size: 12px;
}

.chat-sticker-pack-title small {
    color: var(--muted);
    font-size: 11px;
}

.chat-sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.chat-custom-emoji-packs {
    display: grid;
    gap: 10px;
    padding-top: 10px;
}

.chat-custom-emoji-grid button .chat-custom-emoji {
    width: 30px;
    height: 30px;
    margin: 0;
    vertical-align: middle;
}

.chat-custom-emoji-grid button[data-chat-custom-emoji-lazy]:not([data-chat-custom-emoji-ready="1"])::before {
    content: "";
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .14), rgba(59, 130, 246, .08)),
        rgba(148, 163, 184, .08);
}

.chat-sticker-grid--compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.chat-sticker-grid button {
    width: 100%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
    cursor: pointer;
}

.chat-sticker-grid [data-chat-tgs] {
    width: 100%;
    height: 100%;
}

.chat-sticker-grid [data-chat-tgs-lazy],
.chat-sticker-grid .chat-sticker-media {
    width: 100%;
    height: 100%;
    border-radius: 7px;
}

.chat-sticker-grid [data-chat-tgs-lazy] {
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .10), transparent),
        rgba(255, 255, 255, .035);
}

.chat-sticker-grid button[data-chat-sticker-lazy]:not([data-chat-sticker-ready="1"])::before {
    content: "";
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .12), rgba(59, 130, 246, .08)),
        rgba(148, 163, 184, .08);
}

.chat-sticker-grid [data-chat-tgs].is-tgs-failed,
.chat-sticker-grid [data-chat-tgs-lazy].is-tgs-failed,
.chat-sticker.is-tgs-failed {
    display: grid;
    place-items: center;
}

.chat-tgs-fallback {
    position: relative;
    display: block;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(148, 163, 184, .26);
    border-radius: 9px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .16), transparent 58%),
        rgba(15, 23, 42, .34);
}

.chat-tgs-fallback::after {
    content: "";
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 9px;
    height: 9px;
    border-right: 1px solid rgba(101, 240, 160, .62);
    border-bottom: 1px solid rgba(101, 240, 160, .62);
    border-radius: 0 0 4px 0;
}

.chat-sticker-pack-bar {
    display: flex;
    min-height: 56px;
    gap: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 2px 2px;
    border-top: 1px solid rgba(148, 163, 184, .12);
    background: linear-gradient(180deg, transparent, var(--panel-strong) 22%);
    scrollbar-width: none;
}

.chat-sticker-pack-bar::-webkit-scrollbar {
    display: none;
}

.chat-sticker-pack-bar button {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(101, 240, 160, .38);
    border-radius: 8px;
    background: rgba(101, 240, 160, .08);
    font-size: 20px;
    line-height: 0;
    cursor: pointer;
}

.chat-sticker-pack-bar button.is-active,
.chat-sticker-pack-bar button:hover {
    border-color: rgba(101, 240, 160, .72);
    background: rgba(101, 240, 160, .14);
}

.chat-sticker-pack-bar [data-chat-tgs],
.chat-sticker-pack-bar [data-chat-tgs-lazy],
.chat-sticker-pack-bar .chat-sticker-media,
.chat-sticker-pack-bar .chat-custom-emoji {
    width: 30px !important;
    height: 30px !important;
    display: block;
    margin: 0;
    align-self: center;
    justify-self: center;
    object-fit: contain;
    object-position: center;
    vertical-align: middle;
}

.chat-picker-preview {
    position: absolute;
    right: 10px;
    bottom: 12px;
    z-index: 16;
    width: 148px;
    height: 148px;
    padding: 8px;
    border: 1px solid rgba(101, 240, 160, .28);
    border-radius: 8px;
    background: rgba(12, 18, 28, .96);
    box-shadow: var(--shadow);
    pointer-events: none;
}

.chat-picker-preview[hidden] {
    display: none;
}

.chat-picker-preview [data-chat-tgs] {
    width: 100%;
    height: 100%;
}
.chat-compose textarea {
    min-height: var(--chat-compose-input-height);
    height: var(--chat-compose-input-height);
    padding: 10px 52px 10px 18px;
    border-color: rgba(148, 163, 184, .24);
    border-radius: 24px;
    background: rgba(2, 8, 15, .78);
    line-height: 22px;
    max-height: 118px;
    overflow: hidden;
    resize: none;
}

.chat-compose .chat-text-editor {
    min-height: var(--chat-compose-input-height);
    height: var(--chat-compose-input-height);
    max-height: 118px;
}

.chat-compose textarea:focus {
    outline: 0;
    border-color: rgba(101, 240, 160, .62);
    box-shadow:
        inset 0 0 0 1px rgba(101, 240, 160, .32),
        0 0 0 2px rgba(101, 240, 160, .08);
}

.chat-compose.is-multiline {
    align-items: end;
}

.chat-compose.is-multiline .chat-file,
.chat-compose.is-multiline .chat-send-button {
    align-self: end;
}

.chat-compose.is-multiline .chat-input-wrap {
    min-height: 0;
    align-items: stretch;
}

.chat-compose.is-multiline textarea {
    border-radius: 22px;
}

.chat-compose.is-multiline .chat-emoji-trigger {
    top: auto;
    bottom: 7px;
    transform: none;
}

.chat-send-button {
    align-self: center;
    justify-self: center;
    width: var(--chat-compose-action-size);
    min-width: var(--chat-compose-action-size);
    height: var(--chat-compose-action-size);
    min-height: var(--chat-compose-action-size);
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 999px;
    color: #06100b;
    box-shadow:
        0 14px 34px rgba(101, 240, 160, .24),
        inset 0 1px 0 rgba(255, 255, 255, .30);
}

.chat-send-button .local-icon {
    width: 18px;
    height: 18px;
}

.chat-compose-hint {
    display: none;
}

.chat-compose-hint__mobile {
    display: none;
}

.chat-compose .chat-text-editor,
.chat-compose textarea {
    width: 100%;
    min-width: 0;
    writing-mode: horizontal-tb;
}

.panel-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.panel-title h2 {
    margin: 0;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.role-card {
    display: grid;
    gap: 6px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.permissions-table {
    display: grid;
    gap: 1px;
    overflow-x: auto;
    margin-bottom: 18px;
}

.admin-rights {
    gap: 14px;
    overflow: hidden;
}

.admin-rights__title {
    margin-bottom: 0;
}

.admin-rights-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 2px;
}

.admin-rights-search {
    display: grid;
    gap: 6px;
    width: min(100%, 420px);
}

.admin-rights-search span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-rights-search input {
    min-height: 40px;
    border-radius: 8px;
}

.admin-rights-change-counter {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 13px;
    border: 1px solid rgba(92, 255, 160, .28);
    border-radius: 8px;
    color: var(--green);
    background: rgba(92, 255, 160, .09);
    font-weight: 800;
}

.permissions-table--grouped {
    overflow: auto;
    gap: 0;
    margin-top: 2px;
    border: 1px solid rgba(92, 255, 160, .18);
    border-radius: 8px;
    background: rgba(2, 6, 23, .16);
}

.admin-rights-sticky {
    position: sticky;
    top: 0;
    z-index: 12;
    box-shadow: none;
}

.admin-rights-sticky > * {
    background: rgba(19, 25, 34, .98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(92, 255, 160, .16);
}

.permissions-group {
    display: grid;
    gap: 1px;
    min-width: 720px;
}

.permissions-group__head {
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    padding: 9px 12px;
    border: 0;
    border-top: 1px solid rgba(92, 255, 160, .18);
    border-bottom: 1px solid rgba(92, 255, 160, .12);
    border-radius: 0;
    color: var(--green);
    background: rgba(8, 18, 18, .48);
    font-weight: 900;
}

.permissions-group__head span {
    min-width: 24px;
    min-height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(92, 255, 160, .12);
    font-size: 12px;
}

.permissions-row strong {
    display: grid;
    align-content: center;
    gap: 3px;
}

.permissions-row strong small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    text-transform: none;
}

.permissions-row.has-changes > * {
    background: rgba(245, 158, 11, .08);
}

.toggle-cell.is-changed {
    outline: 1px solid rgba(245, 158, 11, .45);
    outline-offset: -1px;
}

.admin-rights-actions {
    position: sticky;
    bottom: 12px;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 4px;
}

.admin-rights-actions .button {
    min-width: 180px;
}

.user-account-list {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.pending-users-panel {
    display: grid;
    gap: 12px;
}

.pending-user-list {
    display: grid;
    gap: 8px;
}

.pending-user-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(270px, .72fr) minmax(120px, auto);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(101, 240, 160, .22);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .08), rgba(255, 255, 255, .015)),
        rgba(255, 255, 255, .02);
}

.pending-user-main {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.pending-user-main span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.pending-user-main strong,
.pending-user-main small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-user-main small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.pending-user-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(96px, auto);
    gap: 8px;
    min-width: 0;
}

.pending-user-actions select,
.pending-user-actions .button,
.pending-user-reject .button {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 7px 10px;
    font-size: 12px;
}

.pending-user-reject {
    min-width: 0;
}

.user-account-card {
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .014)),
        rgba(255, 255, 255, .02);
    overflow: hidden;
}

.user-account-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 140px 150px;
    gap: 10px;
    align-items: center;
    padding: 10px;
}

.users-panel h2 {
    font-size: 18px;
}

.users-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 10px;
    margin-bottom: 14px;
}

.users-search input,
.user-account-row .button,
.user-manage-form select,
.user-manage-form .button,
.balance-controls input {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
}

.balance-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px 38px;
    gap: 6px;
}

.balance-controls .button {
    padding: 8px 0;
    font-size: 15px;
}

.user-account-pill,
.user-account-balance {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(4, 9, 14, .35);
    font-size: 12px;
    font-weight: 650;
}

.user-account-balance {
    color: var(--green);
}

.user-account-frozen {
    color: var(--accent);
}

.user-manage-toggle {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
}

.user-role-row strong,
.user-role-row small,
.user-profile-head strong,
.user-profile-head small {
    display: block;
}

.user-role-row strong {
    font-size: 14px;
    font-weight: 680;
    line-height: 1.2;
}

.user-role-row small {
    color: var(--muted);
    font-size: 12px;
}

.users-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 14px;
    font-weight: 620;
}

.pagination a {
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
}

.save-roles-button {
    width: min(220px, 100%);
}

.admin-tools-page .admin-subnav {
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.admin-tools-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    grid-template-areas:
        "preview hash"
        "retention retention"
        "limits limits";
    gap: 12px;
    align-items: start;
}

.admin-tools-grid > .data-panel {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 0;
}

.preview-panel {
    grid-area: preview;
}

.hash-panel {
    grid-area: hash;
}

.chat-media-retention-panel {
    grid-area: retention;
}

.chat-limits-panel {
    grid-area: limits;
}

.hash-panel {
    min-height: 150px;
}

.chat-media-retention-panel .muted {
    display: grid;
    gap: 4px;
    margin: 0;
    overflow-wrap: anywhere;
}

.chat-media-retention-panel .mono-input {
    display: inline-grid;
    min-height: 28px;
    padding: 4px 7px;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 7px;
    background: rgba(2, 8, 15, .42);
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.chat-media-storage {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.chat-media-storage span {
    min-width: 0;
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.chat-media-storage b,
.chat-media-storage small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-media-storage b {
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
}

.chat-media-storage small {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 760;
}

.chat-media-storage span:first-child b {
    color: var(--green);
}

.form-grid {
    display: grid;
    gap: 12px;
}

.form-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-ai-panel textarea,
.api-translate-panel textarea {
    min-height: 132px;
    resize: vertical;
}

.chat-ai-panel .telegram-toggle,
.api-translate-panel .telegram-toggle {
    max-width: 620px;
}

.chat-ai-panel > .button,
.hash-panel > .button,
.telegram-translate-ai-panel > .button,
.api-translate-panel > .button,
.chat-media-retention-panel > .button,
.chat-limits-panel > .button {
    justify-self: start;
}

.chat-ws-status {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.chat-ws-status strong {
    font-size: 16px;
}

.chat-ws-status span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.chat-ws-status.is-online {
    border-color: rgba(101, 240, 160, .38);
    background: rgba(101, 240, 160, .08);
}

.chat-ws-status.is-online strong {
    color: var(--green);
}

.chat-ws-status.is-offline {
    border-color: rgba(255, 128, 128, .40);
    background: rgba(255, 128, 128, .08);
}

.chat-ws-status.is-offline strong {
    color: #ff9a9a;
}

.chat-ws-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.chat-ws-grid span {
    display: grid;
    gap: 4px;
    min-height: 62px;
    padding: 9px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .02);
}

.chat-ws-grid b {
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    font-size: 14px;
    white-space: nowrap;
}

.chat-ws-grid small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.server-dashboard,
.server-actions-panel,
.server-diagnostics-panel {
    display: grid;
    gap: 14px;
}

.server-status-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.server-ws-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.server-ws-pill > span {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(255, 128, 128, .12);
}

.server-ws-pill strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.server-ws-pill small,
.server-status-meta {
    color: var(--muted);
    font-size: 11px;
    font-weight: 740;
}

.server-ws-pill.is-online {
    border-color: rgba(101, 240, 160, .34);
    background: rgba(101, 240, 160, .08);
}

.server-ws-pill.is-online > span {
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(101, 240, 160, .14);
}

.server-status-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.server-status-meta span {
    padding: 7px 9px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .02);
}

.server-status-meta b {
    color: var(--text);
}

.server-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.server-metric-card {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    min-height: 96px;
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.server-metric-card span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.server-metric-card strong {
    overflow: hidden;
    color: var(--text);
    font-size: 21px;
    font-weight: 850;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-metric-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
    line-height: 1.3;
    white-space: normal;
}

.server-metric-card i {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    height: 6px;
    margin-top: 3px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .16);
}

.server-metric-card i::before {
    content: "";
    display: block;
    width: var(--value, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(101, 240, 160, .86), rgba(56, 189, 248, .72));
    transition: width .25s ease;
}

.server-actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.server-actions-grid form,
.server-actions-grid .button {
    min-width: min(220px, 100%);
}

.server-diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.server-log-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.server-log-grid article {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, .025);
}

.server-log-grid h3 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 13px;
}

.server-log-grid pre {
    max-height: 220px;
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.server-backups-panel {
    display: grid;
    gap: 14px;
}

.server-backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.server-backup-actions form,
.server-backup-actions .button {
    min-width: min(220px, 100%);
}

.server-backup-list {
    display: grid;
    gap: 8px;
}

.server-backup-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 88px minmax(190px, auto) minmax(190px, auto);
    gap: 10px;
    align-items: center;
    min-width: 0;
    min-height: 44px;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.admin-page {
    min-width: 0;
}

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.admin-health-card {
    display: grid;
    gap: 7px;
    min-height: 118px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    background: rgba(255, 255, 255, .025);
}

.admin-health-card:hover {
    border-color: rgba(101, 240, 160, .32);
    background: rgba(101, 240, 160, .055);
}

.admin-health-card span,
.admin-status-row small,
.admin-health-list small,
.admin-audit-row small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
}

.admin-health-card strong {
    color: var(--text);
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
}

.admin-health-card.is-ok strong,
.admin-status-row.is-ok > span {
    color: var(--green);
}

.admin-health-card.is-warning strong,
.admin-status-row.is-warning > span {
    color: #f8d26a;
}

.admin-health-card.is-danger strong,
.admin-status-row.is-danger > span {
    color: var(--danger);
}

.admin-dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 12px;
}

.admin-chat-stats-panel {
    display: grid;
    gap: 12px;
}

.admin-chat-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.admin-chat-stats article {
    display: grid;
    align-content: center;
    gap: 7px;
    min-height: 98px;
    padding: 13px;
    border: 1px solid rgba(101, 240, 160, .18);
    border-radius: 8px;
    background: rgba(101, 240, 160, .045);
}

.admin-chat-stats span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 820;
    text-transform: uppercase;
}

.admin-chat-stats strong {
    min-width: 0;
    color: var(--text);
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    overflow-wrap: anywhere;
}

.admin-chat-stats small {
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    overflow-wrap: anywhere;
}

.admin-status-list,
.admin-health-list,
.admin-audit-list {
    display: grid;
    gap: 8px;
}

.admin-status-row,
.admin-audit-row,
.admin-health-list > span {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.admin-status-row strong,
.admin-audit-row strong,
.admin-health-list b {
    color: var(--text);
    font-size: 13px;
}

.admin-status-row > span,
.admin-audit-row time {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
}

.admin-health-list > span {
    grid-template-columns: 92px minmax(0, 1fr);
}

.server-backup-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.server-backup-row__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.server-backup-row__actions form {
    margin: 0;
}

.server-backup-row__actions .button {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 7px;
    font-size: 11px;
}

.server-backup-row strong,
.server-backup-row span,
.server-backup-row small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-backup-row strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.server-backup-row span {
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
}

.server-backup-row small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.chat-limits-table {
    display: grid;
    gap: 8px;
}

.chat-limits-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 150px 150px;
    gap: 10px;
    align-items: end;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .02);
}

.chat-limits-row--head {
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.chat-limits-row strong {
    display: grid;
    gap: 3px;
    min-width: 0;
    font-size: 14px;
}

.chat-limits-row strong small {
    color: var(--muted);
    font-size: 11px;
}

.chat-limits-row label {
    display: grid;
    gap: 5px;
}

.chat-limits-row label span {
    display: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.chat-limits-row input {
    min-height: 42px;
}

.preview-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.preview-controls .button {
    width: 100%;
    justify-content: center;
}

.preview-stop {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: rgba(101, 240, 160, .08);
}

.preview-stop span {
    color: var(--green);
    font-weight: 650;
}

.preview-stop .button {
    min-height: 34px;
    padding: 7px 10px;
}

.user-manage-panel {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(260px, 1fr) minmax(360px, 1.4fr) minmax(170px, .7fr) minmax(170px, .7fr);
    gap: 10px;
    padding: 10px;
    border-top: 1px solid rgba(148, 163, 184, .12);
    background: rgba(4, 9, 14, .24);
}

.user-manage-panel[hidden] {
    display: none;
}

.user-manage-form {
    display: grid;
    gap: 8px;
    align-content: end;
    min-width: 0;
}

.user-manage-form--wide {
    grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) 170px;
    align-items: end;
}

.user-manage-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.user-manage-form .button {
    width: 100%;
}

.admin-user-summary {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.admin-user-identity {
    display: flex;
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.admin-user-identity h2 {
    margin: 0 0 4px;
}

.admin-user-identity p,
.admin-user-balance span {
    margin: 0;
    color: var(--muted);
    font-weight: 620;
}

.admin-user-avatar {
    width: 64px;
    height: 64px;
    margin-left: 0;
    border-radius: 8px;
    object-fit: cover;
}

.admin-user-balance {
    display: grid;
    gap: 4px;
    text-align: right;
}

.admin-user-balance strong {
    color: var(--green);
    font-size: 19px;
    font-weight: 680;
}

.admin-user-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-user-card {
    display: grid;
    gap: 14px;
    align-content: start;
}

.admin-user-card--wide {
    grid-column: 1 / -1;
}

.admin-user-card--danger {
    border-color: rgba(255, 134, 125, .22);
}

.admin-user-card--danger form {
    display: grid;
}

.penalty-list {
    display: grid;
    gap: 8px;
}

.penalty-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 90px 150px minmax(220px, auto);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.penalty-row strong {
    display: block;
    color: var(--danger);
}

.penalty-row small,
.penalty-row span {
    color: var(--muted);
}

.penalty-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.admin-user-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.admin-user-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.admin-user-overview {
    display: grid;
    grid-template-columns: minmax(360px, 1.1fr) minmax(0, 1.35fr);
    gap: 12px;
    align-items: stretch;
}

.admin-user-profile-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
}

.admin-user-profile-main {
    min-width: 0;
}

.admin-user-profile-main h2 {
    margin: 0 0 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
}

.admin-user-profile-main p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 620;
}

.admin-user-profile-card .admin-user-avatar {
    width: 56px;
    height: 56px;
}

.admin-user-tags {
    display: grid;
    gap: 6px;
    justify-items: end;
    padding-top: 0;
    border-top: 0;
}

.admin-user-tags span {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font-size: 12px;
    font-weight: 650;
}

.admin-user-telegram {
    grid-column: 1 / -1;
    min-width: 0;
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.admin-user-telegram > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-user-telegram span,
.admin-user-telegram small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
}

.admin-user-telegram span {
    text-transform: uppercase;
}

.admin-user-telegram strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
    text-align: right;
}

.admin-user-telegram small {
    overflow-wrap: anywhere;
}

.admin-user-telegram.is-linked {
    border-color: rgba(101, 240, 160, .24);
    background: rgba(101, 240, 160, .055);
}

.admin-user-telegram.is-linked strong {
    color: var(--green);
}

.admin-user-telegram.is-disabled {
    border-color: rgba(245, 184, 95, .24);
    background: rgba(245, 184, 95, .055);
}

.admin-user-telegram.is-disabled strong {
    color: #f5b85f;
}

.admin-user-telegram.is-unlinked {
    border-color: rgba(148, 163, 184, .12);
    background: rgba(255, 255, 255, .018);
}

.admin-user-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.admin-stat {
    min-height: 84px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 14px;
}

.admin-stat span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
    text-transform: uppercase;
}

.admin-stat strong {
    min-width: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 720;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.admin-stat strong.is-success {
    color: var(--green);
}

.admin-stat strong.is-danger {
    color: var(--danger);
}

.admin-user-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
    gap: 16px;
    align-items: start;
}

.admin-user-column {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.admin-user-section {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.admin-user-section .button {
    min-width: 148px;
}

.admin-user-section--danger {
    border-color: rgba(255, 134, 125, .20);
}

.admin-user-danger-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.admin-user-danger-actions form,
.admin-user-danger-actions .button {
    width: 100%;
}

.admin-user-history {
    grid-column: 1 / -1;
}

.admin-user-history .penalty-row {
    grid-template-columns: minmax(220px, 1fr) 110px 160px minmax(220px, auto);
}

.user-profile-card {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.user-profile-head {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
    align-self: center;
}

.user-profile-head > span {
    min-width: 0;
}

.user-profile-head strong,
.user-profile-head small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-profile-avatar {
    width: 42px;
    height: 42px;
    margin-left: 0;
    object-fit: cover;
}

.user-profile-form {
    display: contents;
}

.user-profile-form .field {
    min-width: 0;
}

.user-profile-form .button,
.user-token-form .button {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
}

.user-token-form {
    display: grid;
    align-self: end;
}

.permissions-row {
    min-width: 720px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) repeat(2, minmax(140px, .44fr));
    align-items: center;
    gap: 0;
}

.permissions-row > * {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .09);
    background: rgba(255, 255, 255, .018);
}

.permissions-row > * + * {
    border-left: 1px solid rgba(148, 163, 184, .08);
}

.permissions-row--head > * {
    min-height: 44px;
    color: var(--green);
    background: rgba(19, 25, 34, .98);
    font: 750 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    text-transform: uppercase;
}

.toggle-cell {
    justify-content: center;
}

.toggle-cell input {
    width: 20px;
    height: 20px;
    accent-color: var(--green);
}

.admin-rights .permissions-table--grouped {
    display: grid;
    gap: 12px;
    overflow: visible;
    margin-top: 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.admin-rights .permissions-group {
    min-width: 0;
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .022);
}

.admin-rights .permissions-group__head {
    min-height: 0;
    padding: 0 0 8px;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    border-radius: 0;
    color: var(--text);
    background: transparent;
}

.admin-rights .permissions-group__head strong {
    color: var(--green);
    font-size: 14px;
    font-weight: 850;
}

.admin-rights .permissions-group__head span {
    min-width: 28px;
    min-height: 24px;
    color: var(--green);
    background: rgba(92, 255, 160, .10);
    font-size: 12px;
    font-weight: 850;
}

.admin-rights .permissions-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(300px, auto);
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .10);
    border-radius: 8px;
    background: rgba(10, 15, 22, .42);
}

.admin-rights .permissions-row > * {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.admin-rights .permissions-row > * + * {
    border-left: 0;
}

.admin-rights .permissions-row strong span {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.admin-rights .permissions-row strong small {
    max-width: 760px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.admin-rights .permissions-row__roles {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-rights .toggle-cell {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .03);
    cursor: pointer;
    user-select: none;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.admin-rights .toggle-cell:hover {
    color: var(--text);
    border-color: rgba(92, 255, 160, .28);
}

.admin-rights .toggle-cell input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

.admin-rights .toggle-cell__switch {
    width: 28px;
    height: 16px;
    position: relative;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(148, 163, 184, .24);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .16);
}

.admin-rights .toggle-cell__switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(226, 232, 240, .92);
    transition: transform .16s ease, background .16s ease;
}

.admin-rights .toggle-cell__label {
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.admin-rights .toggle-cell:has(input:checked) {
    color: #06130d;
    border-color: rgba(92, 255, 160, .45);
    background: rgba(92, 255, 160, .86);
}

.admin-rights .toggle-cell:has(input:checked) .toggle-cell__switch {
    background: rgba(6, 19, 13, .24);
    box-shadow: inset 0 0 0 1px rgba(6, 19, 13, .12);
}

.admin-rights .toggle-cell:has(input:checked) .toggle-cell__switch::after {
    transform: translateX(12px);
    background: #06130d;
}

.admin-rights .toggle-cell.is-changed {
    outline: 0;
    border-color: rgba(245, 158, 11, .7);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, .12);
}

.admin-rights .permissions-row.has-changes {
    border-color: rgba(245, 158, 11, .34);
    background: rgba(245, 158, 11, .055);
}

.admin-rights .permissions-row.has-changes > * {
    background: transparent;
}

.dossier-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.dossier-page-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.filters-panel {
    display: grid;
    gap: 16px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.dossier-admin-filters__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dossier-admin-filters .field--wide {
    grid-column: span 2;
}

.dossier-filter-total {
    display: inline-flex;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.filters-submit {
    width: min(220px, 100%);
}

.folder-list {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.folder-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, .025);
}

.folder-list a.is-active {
    border-color: var(--line-strong);
    color: var(--green);
}

.folder-create-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px;
    gap: 10px;
}

.folder-explorer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 340px));
    gap: 10px;
}

.folder-card {
    position: relative;
    display: grid;
    align-content: start;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 0;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent),
        rgba(255, 255, 255, .025);
}

.folder-card-main {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 7px;
    color: var(--text);
    text-align: left;
    border-radius: 8px;
}

.folder-card-main:hover {
    background: rgba(101, 240, 160, .06);
}

.folder-card-main strong,
.folder-card-main small {
    display: block;
}

.folder-card-main small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 620;
}

.folder-card-main strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 820;
    line-height: 1.15;
}

.folder-icon {
    position: relative;
    width: 42px;
    height: 32px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: linear-gradient(135deg, rgba(101, 240, 160, .24), rgba(124, 183, 255, .10));
}

.folder-icon::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 7px;
    width: 18px;
    height: 7px;
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    background: rgba(101, 240, 160, .18);
}

.folder-rename-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.folder-actions {
    display: grid;
    gap: 8px;
    min-width: 0;
    align-self: start;
}

.folder-actions summary {
    min-width: 104px;
    min-height: 34px;
    padding: 6px 10px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font-size: 13px;
    font-weight: 620;
    cursor: pointer;
    list-style: none;
}

.folder-actions summary::-webkit-details-marker {
    display: none;
}

.folder-actions[open] summary {
    color: var(--green);
    border-color: var(--line-strong);
}

.folder-actions-panel {
    position: absolute;
    top: calc(100% - 8px);
    right: 10px;
    z-index: 40;
    width: min(320px, calc(100vw - 32px));
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(3, 7, 12, .28);
}

.folder-actions form {
    display: grid;
    gap: 10px;
}

.folder-actions input,
.folder-actions .button {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 13px;
}

.folder-delete-form {
    padding-top: 2px;
    border-top: 1px solid rgba(148, 163, 184, .12);
}

.compact-form {
    gap: 10px;
}

.dossier-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.dossier-form-note {
    padding: 11px 12px;
    border: 1px solid rgba(52, 211, 153, .34);
    border-radius: 8px;
    color: var(--text);
    background: rgba(52, 211, 153, .09);
    font-size: 13px;
    font-weight: 720;
    line-height: 1.35;
}

.dossier-fields-builder,
.dossier-field-create {
    gap: 14px;
}

.dossier-fields-list {
    display: grid;
    gap: 10px;
}

.dossier-field-row {
    display: grid;
    grid-template-columns:
        34px
        minmax(128px, .9fr)
        minmax(220px, 1.2fr)
        minmax(150px, .75fr)
        minmax(170px, .85fr)
        minmax(180px, .9fr);
    gap: 10px 12px;
    align-items: end;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.dossier-field-row.is-dragging {
    opacity: .62;
    border-color: rgba(101, 240, 160, .46);
    background: rgba(101, 240, 160, .075);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .22);
}

.dossier-field-drag {
    width: 30px;
    min-width: 30px;
    height: 38px;
    display: grid;
    place-content: center;
    gap: 3px;
    align-self: center;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    cursor: grab;
    touch-action: none;
}

.dossier-field-drag:active {
    cursor: grabbing;
}

.dossier-field-drag span {
    width: 14px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: currentColor;
    opacity: .82;
}

.dossier-field-key {
    align-self: center;
    display: grid;
    gap: 2px;
    min-width: 0;
}

.dossier-field-key strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 13px;
    line-height: 1.15;
}

.dossier-field-key small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.dossier-field-move {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.dossier-field-move .button {
    min-width: 0;
    min-height: 38px;
    padding: 0;
}

.dossier-field-action .button,
.dossier-field-action .dossier-field-system-badge {
    width: 100%;
}

.dossier-field-active {
    grid-column: 3 / 4;
}

.dossier-field-action {
    grid-column: 4 / 5;
}

.dossier-field-system-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(148, 163, 184, .06);
    font-size: 12px;
    font-weight: 800;
}

.dossier-field-active {
    min-height: 38px;
    padding: 0 8px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.dossier-field-options-wrap {
    grid-column: 3 / -1;
    margin-top: 0;
}

.dossier-field-options-wrap.is-hidden {
    display: none;
}

.dossier-field-options {
    min-height: 42px;
    resize: vertical;
}

[data-dossier-sort-status][data-state="loading"] {
    color: #f5b85f;
}

[data-dossier-sort-status][data-state="saved"] {
    color: var(--green);
}

[data-dossier-sort-status][data-state="error"] {
    color: var(--danger);
}

.upload-field {
    gap: 8px;
}

.upload-box {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 12px;
    min-height: 92px;
    padding: 16px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: rgba(2, 6, 23, .28);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.upload-box:hover,
.upload-box.is-dragover {
    border-color: rgba(52, 211, 153, .9);
    background: rgba(52, 211, 153, .08);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, .1);
}

.upload-box input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    display: grid;
    grid-row: span 2;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(52, 211, 153, .55);
    border-radius: 8px;
    color: #062013;
    background: linear-gradient(135deg, var(--green), #9cffc4);
    font-size: 19px;
    font-weight: 720;
    line-height: 1;
}

.upload-box strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 680;
}

.upload-box small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.upload-box--compact {
    min-height: 74px;
    padding: 12px;
}

.upload-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
}

.upload-list:empty {
    display: none;
}

.upload-file {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .035);
    font-size: 12px;
    font-weight: 620;
}

.requisite-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.field--wide {
    grid-column: 1 / -1;
}

.dossier-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.dossier-card {
    display: grid;
    gap: 6px;
    padding: 13px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.dossier-table {
    display: grid;
    gap: 10px;
}

.requisite-list {
    display: grid;
    gap: 9px;
}

.requisite-list--cards {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.requisite-row {
    display: grid;
    grid-template-columns: minmax(170px, 1.15fr) minmax(120px, .8fr) minmax(120px, .75fr) minmax(100px, .65fr) minmax(130px, .8fr) minmax(130px, .8fr) minmax(300px, 1.25fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.requisite-row strong,
.requisite-row small {
    display: block;
}

.requisite-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.requisite-row small,
.requisite-row span {
    color: var(--muted);
}

.requisite-card-view,
.requisite-row--view {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 9px;
    min-height: 112px;
    padding: 13px;
}

.requisite-card-view .requisite-main strong {
    font-size: 15px;
}

.requisite-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.requisite-meta span {
    padding: 5px 8px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .025);
    font-size: 12px;
    font-weight: 620;
}

.row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.row-actions .button {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 12px;
    white-space: nowrap;
}

.dossier-picker {
    position: relative;
}

.guide-search-field {
    position: relative;
}

.guide-suggest {
    position: absolute;
    z-index: 40;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: grid;
    gap: 6px;
    max-height: 340px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .04), transparent),
        rgba(10, 15, 22, .98);
    box-shadow: 0 18px 60px rgba(0, 0, 0, .38), 0 0 0 1px rgba(101, 240, 160, .08);
}

.guide-suggest[hidden] {
    display: none;
}

.guide-suggest-item {
    display: grid;
    gap: 3px;
    padding: 10px 11px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, .025);
    text-decoration: none;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.guide-suggest-item:hover {
    border-color: var(--line-strong);
    background: rgba(101, 240, 160, .07);
    transform: translateY(-1px);
}

.guide-suggest-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 680;
    line-height: 1.25;
}

.guide-suggest-item span,
.guide-suggest-item small,
.guide-suggest-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.guide-suggest-item small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.guide-suggest-empty {
    padding: 11px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.guide-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.guide-card--acknowledged {
    opacity: .72;
}

.guide-card--acknowledged .guide-card-main strong {
    color: var(--muted);
}

.guide-card-main {
    display: grid;
    gap: 7px;
    color: var(--text);
    text-decoration: none;
}

.guide-card-main strong {
    font-size: 16px;
    font-weight: 680;
    line-height: 1.18;
}

.guide-card-main small,
.guide-card-meta {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.guide-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.guide-card-actions:has(.guide-views-button) {
    grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr);
}

.guide-card-actions .button {
    width: 100%;
}

.guide-views-button {
    min-width: 48px;
    padding-inline: 0;
}

.guide-views-button .button-icon {
    width: 18px;
    height: 18px;
}

.guide-views-modal[hidden] {
    display: none;
}

.guide-views-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 18px;
}

.guide-views-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(2, 6, 23, .72);
}

.guide-views-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(860px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(91, 240, 153, .28);
    border-radius: 8px;
    background: rgba(13, 18, 26, .98);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .45);
}

.guide-views-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.guide-views-modal__head div {
    display: grid;
    gap: 3px;
}

.guide-views-modal__head span {
    color: var(--green);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.guide-views-modal__head strong {
    color: var(--text);
    font-size: 18px;
    line-height: 1.2;
}

.guide-views-modal__body {
    display: grid;
    gap: 14px;
    overflow: auto;
    padding: 16px;
}

.guide-views-loading,
.guide-views-summary,
.guide-views-table-wrap,
.guide-views-latest {
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.guide-views-loading {
    padding: 14px;
    color: var(--muted);
    font-weight: 700;
}

.guide-views-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
}

.guide-views-summary span,
.guide-views-latest strong {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.guide-views-summary strong {
    color: var(--text);
    font-size: 26px;
    line-height: 1;
}

.guide-views-table-wrap {
    overflow: auto;
}

.guide-views-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 660px;
}

.guide-views-table th,
.guide-views-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    text-align: left;
    vertical-align: top;
}

.guide-views-table th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.guide-views-table td {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.guide-views-table td strong,
.guide-views-table td small {
    display: block;
}

.guide-views-table td small,
.guide-views-latest small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    margin-top: 3px;
}

.guide-views-latest {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.guide-views-latest ul {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.guide-views-latest li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.guide-form {
    display: grid;
    gap: 14px;
}

.guide-editor-panel {
    position: relative;
    display: grid;
    gap: 10px;
}

.guide-fields,
.guide-upload-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr .7fr;
    gap: 10px;
}

.guide-upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-upload-grid .upload-box {
    min-height: 72px;
    padding: 11px;
}

.guide-upload-grid .upload-icon {
    width: 34px;
    height: 34px;
    font-size: 17px;
}

.guide-upload-grid .upload-box strong {
    font-size: 12px;
}

.guide-upload-grid .upload-box small {
    font-size: 11px;
}

.guide-composer {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 55%),
        rgba(255, 255, 255, .018);
}

.guide-composer-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.guide-composer-title h2 {
    margin: 0;
    font-size: 16px;
}

.guide-composer-title span,
.editor-hint,
.panel-note {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.panel-note {
    margin: -4px 0 2px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 7px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .22);
}

.editor-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 0 6px 0 0;
    border: 0;
    border-right: 1px solid rgba(148, 163, 184, .14);
    border-radius: 0;
    background: transparent;
}

.editor-toolbar-group > span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 9px;
    font-weight: 780;
    line-height: 1;
    text-transform: uppercase;
}

.editor-toolbar-group--accent {
    padding-left: 2px;
    border-color: rgba(101, 240, 160, .22);
    background: transparent;
}

.editor-toolbar-group--end {
    margin-left: auto;
    padding-right: 0;
    border-right: 0;
}

.editor-toolbar button {
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(15, 23, 42, .45);
    color: var(--text);
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.editor-toolbar__media {
    border-color: rgba(101, 240, 160, .36) !important;
    background: rgba(101, 240, 160, .10) !important;
    color: var(--green) !important;
}

.editor-toolbar button:disabled {
    cursor: progress;
    opacity: .6;
}

.guide-inline-upload[hidden] {
    display: none;
}

.guide-inline-upload {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    width: fit-content;
    max-width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font-size: 12px;
    font-weight: 700;
}

.guide-inline-upload[data-type="loading"] {
    border-color: rgba(101, 240, 160, .32);
    color: var(--green);
}

.guide-inline-upload[data-type="success"] {
    border-color: rgba(101, 240, 160, .42);
    color: var(--green);
    background: rgba(101, 240, 160, .08);
}

.guide-inline-upload[data-type="error"] {
    border-color: rgba(248, 113, 113, .45);
    color: var(--danger);
    background: rgba(248, 113, 113, .08);
}

.guide-editor-tabs {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 3px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .24);
}

.guide-editor-tabs button {
    min-height: 30px;
    padding: 5px 12px;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 760;
    cursor: pointer;
}

.guide-editor-tabs button.is-active {
    color: #07130d;
    background: var(--green);
}

.guide-image-toolbar {
    position: absolute;
    z-index: 28;
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: calc(100% - 16px);
    padding: 5px;
    border: 1px solid rgba(101, 240, 160, .28);
    border-radius: 8px;
    background: rgba(6, 11, 18, .96);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .32);
}

.guide-image-toolbar[hidden] {
    display: none;
}

.guide-image-toolbar span {
    padding: 0 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 780;
    text-transform: uppercase;
    white-space: nowrap;
}

.guide-image-toolbar button {
    min-height: 26px;
    padding: 4px 7px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 6px;
    color: var(--text);
    background: rgba(255, 255, 255, .045);
    font: inherit;
    font-size: 11px;
    font-weight: 740;
    cursor: pointer;
}

.guide-image-toolbar button:hover {
    color: var(--green);
    border-color: rgba(101, 240, 160, .42);
    background: rgba(101, 240, 160, .08);
}

.selection-toolbar {
    position: absolute;
    z-index: 32;
    display: flex;
    align-items: center;
    max-width: min(560px, calc(100% - 16px));
    overflow-x: auto;
    gap: 5px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(10, 15, 22, .96);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .32);
}

.selection-toolbar[hidden] {
    display: none;
}

.selection-toolbar button {
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 7px;
    color: var(--text);
    background: rgba(255, 255, 255, .045);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.selection-toolbar button:hover,
.editor-toolbar button:hover {
    border-color: var(--line-strong);
    color: var(--green);
    background: rgba(101, 240, 160, .08);
}

.guide-editor {
    position: relative;
    min-height: 440px;
    max-height: 62vh;
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    outline: none;
    background: rgba(2, 6, 23, .38);
    color: var(--text);
    line-height: 1.65;
}

.guide-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
    pointer-events: none;
}

.guide-editor,
.guide-content,
.guide-editor *:not(a),
.guide-content *:not(a) {
    color: var(--text) !important;
}

.guide-editor a,
.guide-content a {
    color: var(--green) !important;
}

.guide-text-accent {
    color: var(--green) !important;
    font-weight: 750;
}

.guide-editor:focus {
    border-color: rgba(52, 211, 153, .85);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, .16);
}

.guide-editor h2,
.guide-content h2 {
    margin: 18px 0 8px;
    font-size: 20px;
}

.guide-editor h3,
.guide-content h3 {
    margin: 16px 0 8px;
    font-size: 16px;
}

.guide-editor p,
.guide-content p {
    margin: 0 0 12px;
}

.guide-editor blockquote,
.guide-content blockquote {
    margin: 14px 0;
    padding: 10px 12px;
    border-left: 3px solid var(--accent);
    color: var(--muted);
    background: rgba(52, 211, 153, .08);
}

.guide-checklist {
    display: grid;
    gap: 8px;
    margin: 14px 0;
    padding: 0;
    list-style: none;
}

.guide-checklist li {
    position: relative;
    padding: 9px 10px 9px 36px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.guide-checklist li::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 12px;
    width: 13px;
    height: 13px;
    border: 1px solid rgba(101, 240, 160, .75);
    border-radius: 4px;
    background: rgba(101, 240, 160, .12);
}

.guide-callout {
    display: grid;
    gap: 6px;
    margin: 14px 0;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
}

.guide-callout strong {
    font-size: 13px;
    font-weight: 750;
}

.guide-callout p {
    margin: 0;
}

.guide-callout--note {
    border-color: rgba(101, 240, 160, .35);
    background: rgba(101, 240, 160, .08);
}

.guide-callout--warning {
    border-color: rgba(248, 113, 113, .38);
    background: rgba(248, 113, 113, .08);
}

.guide-table {
    width: 100%;
    margin: 14px 0;
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.guide-table th,
.guide-table td {
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    text-align: left;
    vertical-align: top;
}

.guide-table th {
    color: var(--green);
    background: rgba(101, 240, 160, .08);
    font-size: 12px;
    text-transform: uppercase;
}

.guide-divider {
    height: 1px;
    margin: 18px 0;
    border: 0;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.guide-editor figure,
.guide-content figure {
    margin: 14px 0;
}

.guide-media-inline {
    position: relative;
    display: grid;
    justify-items: start;
    gap: 6px;
    width: min(100%, 820px);
    max-width: 100%;
    min-width: min(180px, 100%);
}

.guide-media-inline figcaption {
    display: none;
}

.guide-editor img,
.guide-content img,
.guide-editor video,
.guide-content video {
    max-width: 100%;
    height: auto;
    max-height: min(560px, 64vh);
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: block;
}

.guide-media-inline img,
.guide-media-inline video {
    width: 100%;
    max-width: 100%;
}

.guide-editor .guide-media-inline.is-selected {
    outline: 2px solid rgba(101, 240, 160, .82);
    outline-offset: 4px;
    border-radius: 8px;
}

.guide-image-resize-handle {
    position: absolute;
    right: -8px;
    bottom: 20px;
    z-index: 4;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(2, 6, 23, .9);
    border-radius: 6px;
    background: var(--green);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .28);
    cursor: nwse-resize;
}

.guide-image-resize-handle::before {
    content: "";
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 6px;
    height: 6px;
    border-right: 2px solid rgba(2, 6, 23, .75);
    border-bottom: 2px solid rgba(2, 6, 23, .75);
}

.guide-preview {
    min-height: 440px;
    max-height: 62vh;
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: rgba(2, 6, 23, .30);
}

.guide-preview[hidden] {
    display: none;
}

.guide-preview-head {
    display: grid;
    gap: 5px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.guide-preview-head small,
.guide-preview-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.guide-preview-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 24px;
    line-height: 1.15;
}

.guide-reader {
    max-width: 980px;
}

.guide-content {
    font-size: 15px;
    line-height: 1.7;
}

.guide-acknowledge {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, .14);
}

.guide-acknowledged-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid rgba(101, 240, 160, .34);
    border-radius: 8px;
    color: var(--green);
    background: rgba(101, 240, 160, .08);
    font-size: 13px;
    font-weight: 800;
}

.guide-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.guide-media-tile {
    display: grid;
    gap: 6px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, .025);
}

.guide-media-tile img,
.guide-media-tile video {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    background: rgba(2, 6, 23, .4);
}

.guide-media-tile span,
.guide-media-tile a {
    display: none;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guide-media-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    min-width: 0;
}

.guide-media-actions .button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-self: stretch;
    min-height: 28px;
    padding: 5px 4px;
    font-size: 11px;
    white-space: nowrap;
    transform: none;
}

.guide-media-actions .button:hover {
    transform: none;
}

.guide-save {
    justify-self: end;
    min-width: 240px;
}

.dossier-search-results {
    position: absolute;
    z-index: 6;
    inset: calc(100% + 6px) 0 auto;
    display: grid;
    gap: 4px;
    max-height: 260px;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.dossier-search-results[hidden] {
    display: none;
}

.dossier-search-results button {
    display: grid;
    gap: 2px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 8px;
    color: var(--text);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.dossier-search-results button:hover {
    border-color: var(--line-strong);
    background: rgba(101, 240, 160, .08);
}

.dossier-search-results small {
    color: var(--muted);
}

.dossier-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(120px, .8fr) minmax(140px, .9fr) minmax(120px, .6fr);
    gap: 14px;
    align-items: center;
    padding: 11px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, .025);
}

.dossier-row--selectable {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 0;
}

.dossier-row-link {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(120px, .8fr) minmax(140px, .9fr) minmax(120px, .6fr);
    gap: 14px;
    align-items: center;
    padding: 11px;
    color: var(--text);
}

.bulk-check {
    height: 100%;
    display: grid;
    place-items: center;
    border-right: 1px solid rgba(148, 163, 184, .14);
}

.bulk-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    display: grid;
    place-content: center;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(101, 240, 160, .30);
    border-radius: 6px;
    background: rgba(2, 6, 23, .54);
    accent-color: var(--green);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.bulk-check input::before {
    content: "";
    width: 12px;
    height: 12px;
    clip-path: polygon(14% 53%, 0 68%, 40% 100%, 100% 16%, 83% 0, 35% 67%);
    background: #062014;
    transform: scale(0);
    transition: transform .12s ease;
}

.bulk-check input:checked {
    border-color: rgba(101, 240, 160, .78);
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(101, 240, 160, .10);
}

.bulk-check input:checked::before {
    transform: scale(1);
}

.bulk-check input:focus-visible {
    outline: 2px solid rgba(101, 240, 160, .42);
    outline-offset: 2px;
}

.bulk-delete-button {
    width: min(190px, 100%);
    min-height: 34px;
}

.dossier-row strong,
.dossier-row small {
    display: block;
}

.dossier-row small,
.media-badges small {
    color: var(--muted);
}

.media-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.media-badges small {
    padding: 5px 8px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
}

.dossier-view {
    display: grid;
    gap: 14px;
}

.dossier-profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px;
    gap: 18px;
    align-items: center;
}

.dossier-profile h2 {
    margin: 0 0 10px;
    font-size: 24px;
    line-height: 1.15;
}

.dossier-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dossier-profile-meta span {
    padding: 6px 9px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font-size: 12px;
    font-weight: 650;
}

.dossier-profile-photo {
    display: block;
    overflow: hidden;
    width: 160px;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(2, 6, 23, .35);
}

.dossier-profile-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.detail-notes {
    display: grid;
    gap: 10px;
}

.detail-item {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 11px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.detail-item span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
    text-transform: uppercase;
}

.detail-item strong {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.35;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.photo-tile {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(4, 9, 14, .35);
}

.photo-tile img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.photo-tile-actions {
    position: absolute;
    inset: auto 8px 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.photo-tile-actions a {
    min-width: 0;
    padding: 7px 8px;
    border-radius: 6px;
    color: #06100b;
    background: rgba(154, 255, 192, .92);
    font-size: 12px;
    font-weight: 650;
    text-align: center;
}

.video-gallery {
    display: grid;
    gap: 14px;
}

.video-card {
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.video-card video {
    width: 100%;
    border-radius: 6px;
    background: #000;
}

.video-card strong {
    display: block;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.access-empty {
    display: grid;
    gap: 12px;
    max-width: 680px;
}

.access-empty .button {
    width: min(220px, 100%);
}

.access-blocked {
    width: min(520px, 100%);
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 42%),
        var(--panel);
    box-shadow: var(--shadow);
    text-align: center;
}

.access-blocked h1,
.access-blocked p {
    margin: 0;
}

.access-blocked p:not(.eyebrow) {
    color: var(--muted);
}

.access-blocked-logout {
    width: min(220px, 100%);
    margin-top: 8px;
}

.withdraw-head {
    display: grid;
    grid-template-columns: minmax(180px, .72fr) minmax(0, 2.7fr);
    gap: 14px;
    align-items: center;
    overflow: hidden;
    padding: 14px 16px;
}

.withdraw-head h1 {
    margin: 0;
    font-size: clamp(19px, 1.35vw, 22px);
    line-height: 1.08;
}

.withdraw-head__title {
    display: grid;
    align-content: center;
    gap: 7px;
    min-width: 0;
}

.withdraw-head__title > span,
.withdraw-balance-primary > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.withdraw-balance-primary {
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .12), rgba(33, 230, 193, .035)),
        rgba(2, 6, 23, .26);
    border-color: rgba(101, 240, 160, .28) !important;
}

.withdraw-balance-primary strong {
    color: var(--green);
    font-size: clamp(17px, 1.45vw, 22px) !important;
    font-weight: 820;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.withdraw-metrics {
    display: grid;
    grid-template-columns: minmax(210px, 1.45fr) repeat(4, minmax(130px, 1fr));
    gap: 8px;
    min-width: 0;
}

.withdraw-metrics div {
    display: grid;
    align-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 68px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .24);
}

.withdraw-metrics span,
.withdraw-table > span,
.withdraw-table small,
.withdraw-wallet small,
.withdraw-disabled-note {
    color: var(--muted);
}

.withdraw-metrics span {
    display: block;
    min-width: 0;
    font-size: clamp(9px, .62vw, 10px);
    font-weight: 750;
    letter-spacing: .02em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.withdraw-metrics strong {
    display: block;
    min-width: 0;
    color: var(--text);
    font-size: clamp(12px, .78vw, 14px);
    font-weight: 760;
    line-height: 1.14;
    overflow-wrap: anywhere;
}

.withdraw-metrics .is-danger strong {
    color: var(--danger);
}

.withdraw-warning {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(255, 134, 125, .28);
    border-radius: 8px;
    background: rgba(255, 134, 125, .08);
}

.withdraw-warning strong,
.withdraw-warning span {
    display: block;
}

.withdraw-warning strong {
    color: var(--danger);
}

.withdraw-warning span {
    color: var(--muted);
}

.withdraw-warning .button {
    width: auto;
    min-width: 150px;
    justify-self: end;
}

.withdraw-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 16px;
    align-items: start;
}

.withdraw-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, .34fr);
    gap: 12px;
}

.withdraw-field--address,
.withdraw-field--comment,
.withdraw-disabled-note,
.withdraw-actions {
    grid-column: 1 / -1;
}

.withdraw-field--amount {
    grid-column: 1;
}

.withdraw-quick {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    align-self: end;
    grid-column: 2;
}

.withdraw-quick button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(101, 240, 160, .08);
    color: var(--green);
    font-weight: 680;
    cursor: pointer;
}

.withdraw-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.withdraw-wallets {
    display: grid;
    gap: 12px;
}

.withdraw-wallet-list {
    display: grid;
    gap: 8px;
}

.withdraw-wallet-form {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, .14);
}

.withdraw-wallet {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.withdraw-wallet strong,
.withdraw-wallet small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.withdraw-wallet .button {
    min-height: 34px;
    padding: 7px 10px;
}

.withdraw-admin-list {
    display: grid;
    gap: 9px;
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.admin-kpi-grid--withdrawals {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-kpi-grid--wide {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.admin-kpi-card {
    min-width: 0;
    min-height: 76px;
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.admin-kpi-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-kpi-card strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 17px;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-kpi-card.is-danger strong {
    color: var(--danger);
}

.withdraw-admin-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.withdraw-admin-column {
    display: grid;
    gap: 14px;
    padding: 14px;
}

.withdraw-admin-column__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.withdraw-admin-column__head h2 {
    margin: 0 0 3px;
    font-size: 19px;
    line-height: 1.15;
}

.withdraw-admin-column__head span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.withdraw-admin-column__head b {
    min-width: 38px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 11px;
    border: 1px solid rgba(101, 240, 160, .24);
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .075);
    font-size: 14px;
    font-weight: 850;
}

.withdraw-admin-subsection {
    display: grid;
    gap: 10px;
}

.withdraw-admin-subsection + .withdraw-admin-subsection {
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, .10);
}

.withdraw-admin-subtitle {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.withdraw-admin-subtitle h3 {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 820;
}

.withdraw-admin-subtitle span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 760;
}

.withdraw-admin-card {
    display: grid;
    grid-template-columns: minmax(130px, .55fr) minmax(170px, .7fr) minmax(0, 1.25fr) minmax(330px, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.withdraw-admin-card--polished {
    grid-template-columns: minmax(150px, .6fr) minmax(180px, .75fr) minmax(0, 1.25fr) minmax(350px, 1.05fr);
    padding: 10px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .035), transparent 60%),
        rgba(255, 255, 255, .025);
}

.withdraw-admin-main,
.withdraw-admin-user,
.withdraw-admin-wallet,
.withdraw-admin-actions {
    min-width: 0;
}

.withdraw-admin-main strong,
.withdraw-admin-main small,
.withdraw-admin-main span,
.withdraw-admin-user span,
.withdraw-admin-user small,
.withdraw-admin-wallet span,
.withdraw-admin-wallet small {
    display: block;
}

.withdraw-admin-main small,
.withdraw-admin-main span,
.withdraw-admin-user small,
.withdraw-admin-wallet span,
.withdraw-admin-wallet small,
.withdraw-admin-status span {
    color: var(--muted);
}

.withdraw-admin-main > span,
.withdraw-admin-status span {
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.withdraw-admin-user {
    display: flex;
    align-items: center;
    gap: 9px;
}

.withdraw-admin-wallet code {
    display: block;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 12px;
}

.withdraw-admin-board .withdraw-admin-card,
.withdraw-admin-board .withdraw-admin-card--polished,
.withdraw-admin-board .withdraw-admin-card--frozen {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
}

.withdraw-admin-board .withdraw-admin-user .user-profile-avatar,
.withdraw-admin-board .withdraw-admin-user .avatar-placeholder {
    width: 34px;
    height: 34px;
}

.withdraw-admin-board .withdraw-admin-main,
.withdraw-admin-board .withdraw-admin-wallet {
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(148, 163, 184, .09);
}

.withdraw-admin-board .withdraw-admin-wallet small {
    overflow-wrap: anywhere;
}

.withdraw-admin-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 10px;
    align-items: end;
    max-width: 100%;
}

.withdraw-admin-status {
    display: grid;
    gap: 8px;
}

.withdraw-admin-status select,
.withdraw-admin-status .custom-select__button,
.withdraw-admin-actions > .button {
    min-height: 42px;
    height: 42px;
    padding-block: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 780;
}

.withdraw-admin-status .custom-select__value {
    text-transform: uppercase;
}

.withdraw-admin-actions > .button {
    width: 100%;
}

.withdraw-admin-card--frozen {
    grid-template-columns: minmax(140px, .5fr) minmax(190px, .65fr) minmax(160px, .75fr) minmax(520px, 1.6fr);
}

.withdraw-admin-actions--frozen {
    grid-template-columns: minmax(120px, .75fr) minmax(160px, 1fr) 112px 112px;
    align-items: end;
}

.withdraw-admin-board .withdraw-admin-actions {
    grid-template-columns: minmax(0, 1fr) 126px;
}

.withdraw-admin-board .withdraw-admin-actions--frozen {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.withdraw-admin-actions--frozen textarea,
.withdraw-admin-actions--frozen input {
    min-height: 42px;
    border-radius: 8px;
    font-size: 13px;
}

.withdraw-admin-actions--frozen .button {
    min-width: 0;
    padding-inline: 10px;
}

.withdraw-admin-board .withdraw-admin-actions--frozen .button {
    min-height: 42px;
}

.withdraw-admin-actions--readonly {
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
}

.withdraw-freeze-summary {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(33, 230, 193, .22);
    border-radius: 8px;
    background: rgba(33, 230, 193, .07);
}

.withdraw-freeze-summary strong {
    color: var(--accent);
}

.withdraw-freeze-summary span {
    color: var(--muted);
    font-size: 13px;
}

.withdraw-frozen-list {
    display: grid;
    gap: 8px;
}

.withdraw-frozen-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 110px 150px minmax(180px, .9fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .025);
}

.withdraw-frozen-row strong,
.withdraw-frozen-row small {
    display: block;
}

.withdraw-frozen-row span,
.withdraw-frozen-row small {
    color: var(--muted);
}

.admin-payout-page {
    gap: 12px;
}

.admin-payout-page .cabinet-hero--compact h1 {
    font-size: 22px;
}

.admin-payout-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-payout-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}

.admin-payout-jump a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 760;
    text-decoration: none;
    background: rgba(15, 23, 42, .32);
}

.admin-payout-jump a:hover {
    border-color: rgba(101, 240, 160, .42);
    color: var(--accent);
}

.admin-payout-kpi .admin-kpi-card {
    min-height: 68px;
}

.admin-payout-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.admin-payout-panel .panel-title {
    align-items: center;
    margin: 0;
}

.admin-payout-panel .panel-title h2 {
    font-size: 16px;
    line-height: 1.15;
}

.admin-payout-panel .panel-title span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 720;
}

.admin-payout-table {
    display: grid;
    gap: 7px;
}

.admin-payout-head,
.admin-payout-row {
    display: grid;
    grid-template-columns: minmax(130px, .75fr) minmax(160px, .9fr) minmax(220px, 1.35fr) minmax(260px, 1fr);
    gap: 10px;
    align-items: center;
}

.admin-payout-head {
    min-height: 28px;
    padding: 0 10px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-payout-row {
    min-height: 72px;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .024), transparent),
        rgba(2, 6, 23, .14);
}

.admin-payout-row--frozen {
    grid-template-columns: minmax(130px, .7fr) minmax(160px, .85fr) minmax(220px, 1.15fr) minmax(360px, 1.45fr);
}

.admin-payout-amount,
.admin-payout-user,
.admin-payout-wallet,
.admin-payout-action {
    min-width: 0;
}

.admin-payout-amount strong,
.admin-payout-amount small,
.admin-payout-user span,
.admin-payout-user small,
.admin-payout-wallet span,
.admin-payout-wallet code,
.admin-payout-wallet small {
    display: block;
}

.admin-payout-amount strong {
    color: var(--text);
    font-size: 16px;
    line-height: 1.2;
}

.admin-payout-amount__label {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 820;
    letter-spacing: 0;
    text-transform: uppercase;
}

.admin-payout-money {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin: 7px 0 5px;
}

.admin-payout-money div {
    min-width: 0;
    padding: 5px 6px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 7px;
    background: rgba(15, 23, 42, .24);
}

.admin-payout-money dt,
.admin-payout-money dd {
    margin: 0;
}

.admin-payout-money dt {
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-payout-money dd {
    overflow: hidden;
    color: var(--text);
    font-size: 11px;
    font-weight: 780;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-payout-money .is-fee dd {
    color: var(--danger);
}

.admin-payout-amount small,
.admin-payout-user small,
.admin-payout-wallet span,
.admin-payout-wallet small,
.admin-payout-action--readonly small {
    color: var(--muted);
    font-size: 11px;
}

.admin-payout-user {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-payout-user .user-profile-avatar,
.admin-payout-user .avatar-placeholder {
    width: 30px;
    height: 30px;
    min-width: 30px;
}

.admin-payout-user > span {
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-payout-wallet code {
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-payout-wallet small {
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-payout-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 7px;
    align-items: center;
}

.admin-payout-action select,
.admin-payout-action input,
.admin-payout-action .custom-select__button,
.admin-payout-action .button {
    min-height: 34px;
    height: 34px;
    padding: 7px 9px;
    border-radius: 8px;
    font-size: 12px;
}

.admin-payout-action .button {
    width: 100%;
    min-width: 0;
}

.admin-payout-action--auto {
    grid-template-columns: minmax(0, 1fr);
}

.admin-payout-action--auto.is-submitting select {
    opacity: .68;
    cursor: wait;
}

.admin-payout-action--frozen {
    grid-template-columns: 92px minmax(90px, 1fr) 92px 92px;
}

.admin-payout-action--readonly {
    grid-template-columns: minmax(0, 1fr) auto;
}

.admin-payout-archive-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.admin-payout-archive-grid .admin-payout-archive-row {
    grid-template-columns: minmax(150px, .9fr) minmax(132px, .75fr);
}

.admin-payout-archive-grid .admin-payout-archive-wallet {
    grid-column: 1 / -1;
}

.admin-payout-archive-grid .admin-payout-archive-row--frozen {
    grid-template-columns: minmax(140px, .72fr) minmax(150px, .78fr);
}

.admin-payout-archive-grid .admin-payout-archive-row--frozen .admin-payout-archive-wallet {
    grid-column: 1 / -1;
}

.admin-payout-table--archive {
    max-height: 430px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-gutter: stable;
}

.admin-payout-table--archive .admin-payout-head {
    display: none;
}

.admin-payout-archive-row {
    display: grid;
    grid-template-columns: minmax(150px, .78fr) minmax(132px, .72fr) minmax(180px, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .024), transparent),
        rgba(2, 6, 23, .14);
}

.admin-payout-archive-row--frozen {
    grid-template-columns: minmax(118px, .65fr) minmax(138px, .75fr) minmax(190px, 1.2fr);
}

.admin-payout-archive-money,
.admin-payout-archive-wallet,
.admin-payout-archive-meta {
    min-width: 0;
}

.admin-payout-archive-money span,
.admin-payout-archive-money strong,
.admin-payout-archive-money small,
.admin-payout-archive-wallet span,
.admin-payout-archive-wallet code,
.admin-payout-archive-wallet small {
    display: block;
}

.admin-payout-archive-money span,
.admin-payout-archive-wallet span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 820;
    letter-spacing: 0;
    text-transform: uppercase;
}

.admin-payout-archive-money strong {
    margin-top: 2px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.2;
}

.admin-payout-archive-money .admin-payout-archive-meta {
    margin-top: 8px;
}

.admin-payout-archive-money small,
.admin-payout-archive-wallet small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
}

.admin-payout-archive-wallet code {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 12px;
    line-height: 1.25;
}

.admin-payout-archive-wallet small {
    overflow-wrap: anywhere;
}

.admin-payout-archive-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.admin-payout-archive-meta div {
    min-width: 0;
    padding: 5px 6px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 7px;
    background: rgba(15, 23, 42, .22);
}

.admin-payout-archive-meta dt,
.admin-payout-archive-meta dd {
    margin: 0;
}

.admin-payout-archive-meta dt {
    overflow: hidden;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-payout-archive-meta dd {
    color: var(--text);
    font-size: 10px;
    font-weight: 780;
    line-height: 1.15;
    overflow-wrap: anywhere;
    white-space: nowrap;
}

.admin-payout-archive-meta .is-fee dd {
    color: var(--danger);
}

.admin-payout-pager {
    justify-content: flex-end;
    margin-top: 2px;
}

.tools-page {
    display: grid;
    gap: 16px;
}

.tools-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.tools-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
}

.tools-tabs a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(15, 23, 42, .3);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.tools-tabs a.is-active {
    color: var(--text);
    border-color: rgba(101, 240, 160, .34);
    background: rgba(101, 240, 160, .1);
}

.tools-admin-grid {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.tools-user-search,
.tools-email-create,
.tools-email-edit {
    display: grid;
    gap: 12px;
}

.tools-user-search {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.tools-user-list {
    max-height: 360px;
    display: grid;
    gap: 6px;
    overflow: auto;
}

.tools-user-list a {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
    text-decoration: none;
}

.tools-user-list a.is-active {
    border-color: rgba(101, 240, 160, .38);
    background: rgba(101, 240, 160, .1);
}

.tools-user-list small {
    color: var(--muted);
}

.tools-email-list {
    display: grid;
    gap: 8px;
}

.tools-email-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
}

.tools-email-row.is-used {
    opacity: .68;
}

.tools-email-row.is-used .tools-email-view strong,
.tools-email-row.is-used .tools-email-edit input {
    text-decoration: line-through;
}

.tools-email-edit {
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    align-items: end;
}

.tools-email-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tools-email-view {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
    gap: 12px;
}

.tools-email-view div {
    display: grid;
    gap: 4px;
}

.tools-email-view span,
.tools-user-search label span,
.tools-email-create label span,
.tools-email-edit label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.tools-email-view strong {
    overflow-wrap: anywhere;
}

.tools-used-check {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, .04);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.tools-used-check input {
    width: 16px;
    height: 16px;
    accent-color: #65f0a0;
}

body[data-theme="light"] .tools-tabs a,
body[data-theme="light"] .tools-user-list a,
body[data-theme="light"] .tools-email-row,
body[data-theme="light"] .tools-used-check {
    background: rgba(255, 255, 255, .72);
}

@media (max-width: 980px) {
    .tools-admin-grid,
    .tools-email-row,
    .tools-email-edit,
    .tools-email-view {
        grid-template-columns: 1fr;
    }

    .tools-email-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .tools-user-search {
        grid-template-columns: 1fr;
    }
}
/* Mobile chat search icon visibility. */

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-top-panel {
    align-self: start;
}

.admin-top-list {
    display: grid;
    gap: 8px;
}

.admin-top-row {
    display: grid;
    grid-template-columns: 34px 38px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 9px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .022);
}

.admin-top-row > b {
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
}

.admin-top-row span {
    min-width: 0;
}

.admin-top-row span strong,
.admin-top-row span small,
.admin-top-row > small {
    display: block;
}

.admin-top-row span small,
.admin-top-row > small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.admin-top-row > small {
    grid-column: 3 / -1;
}

.admin-top-value {
    color: var(--text);
    font-size: 14px;
    white-space: nowrap;
}

.withdraw-table {
    display: grid;
    grid-template-columns: minmax(110px, .65fr) 80px minmax(120px, 1fr) 90px minmax(140px, .8fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
}

.withdraw-table > * {
    min-width: 0;
    padding: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, .10);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.withdraw-table > span:nth-child(-n + 5) {
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
    font-size: 11px;
    font-weight: 720;
    text-transform: uppercase;
}

.withdraw-info-modal[hidden] {
    display: none;
}

.withdraw-info-modal {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
}

.withdraw-info-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 12, .76);
    backdrop-filter: blur(8px);
}

.withdraw-info-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.withdraw-info-modal__dialog .panel-title {
    align-items: center;
}

.withdraw-info-modal__dialog .panel-title .button {
    width: auto;
    min-width: 92px;
    justify-self: end;
}

.withdraw-info-modal__dialog p {
    margin: 0;
    color: var(--muted);
}

.balance-page {
    gap: 12px;
    align-content: start;
}

.balance-command {
    display: grid;
    grid-template-columns: minmax(180px, .5fr) minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding-bottom: 0;
}

.balance-command__title {
    display: grid;
    gap: 5px;
}

.balance-command__title h1 {
    margin: 0;
    font-size: 22px !important;
    line-height: 1.05;
}

.balance-command__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.balance-command__actions .button {
    width: auto;
    min-width: 138px;
}

.balance-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    width: 100%;
}

.balance-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    min-width: 92px;
    padding: 7px 12px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(2, 6, 23, .18);
    color: var(--muted);
    font-size: 12px !important;
    font-weight: 730;
    text-decoration: none;
}

.balance-tabs a.is-active {
    border-color: rgba(101, 240, 160, .36);
    background:
        linear-gradient(180deg, rgba(101, 240, 160, .16), rgba(101, 240, 160, .08));
    color: var(--text);
}

.balance-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
    gap: 12px;
    align-items: stretch;
}

.balance-account {
    display: grid;
    gap: 14px;
    padding: 16px 18px;
    border-color: rgba(101, 240, 160, .24);
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .10), rgba(56, 189, 248, .035)),
        rgba(2, 6, 23, .20);
}

.balance-account__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.balance-account__head h2 {
    margin: 6px 0 0;
    color: var(--text);
    font-size: clamp(22px, 2vw, 28px);
    line-height: 1.05;
}

.balance-account__head > b {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(101, 240, 160, .10);
    color: var(--green);
    font-size: 11px;
    letter-spacing: .08em;
}

.balance-account__bar {
    display: flex;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, .14);
}

.balance-account__bar i {
    display: block;
    flex: 0 0 var(--value);
    height: 100%;
}

.balance-account__bar i:nth-child(1) {
    background: var(--green);
}

.balance-account__bar i:nth-child(2) {
    background: #38bdf8;
}

.balance-account__bar i:nth-child(3) {
    background: var(--danger);
}

.balance-account__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.balance-account__grid span {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 730;
}

.balance-account__grid b {
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.balance-overview {
    display: grid;
    grid-template-columns: minmax(320px, .86fr) minmax(0, 1.4fr);
    gap: 14px;
    align-items: stretch;
}

.balance-overview--single {
    grid-template-columns: minmax(320px, .72fr) minmax(0, 1fr);
}

.balance-card {
    min-height: 210px;
    display: grid;
    align-content: space-between;
    gap: 12px;
    overflow: hidden;
    padding: 18px 20px;
    border-color: rgba(101, 240, 160, .30);
    background:
        radial-gradient(circle at 18% 16%, rgba(101, 240, 160, .30), transparent 34%),
        linear-gradient(135deg, rgba(5, 20, 30, .98), rgba(4, 10, 20, .96) 58%, rgba(8, 48, 42, .86)),
        var(--panel-strong);
}

.balance-card--premium {
    box-shadow: 0 18px 60px rgba(16, 185, 129, .10);
}

.balance-card__top,
.balance-card__meta,
.balance-card__legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.balance-card__top span,
.balance-card__meta span,
.balance-card__legend span {
    color: rgba(226, 232, 240, .78);
    font-size: 11px;
    font-weight: 760;
    text-transform: uppercase;
}

.balance-card__top b {
    color: var(--green);
    font-size: 13px;
    letter-spacing: .10em;
}

.balance-card > strong {
    color: #f8fafc;
    font-size: clamp(22px, 2.2vw, 28px);
    line-height: 1;
    overflow-wrap: anywhere;
}

.balance-action-stack {
    display: grid;
    gap: 8px;
}

.balance-action {
    display: grid;
    gap: 8px;
    align-content: center;
    min-height: 62px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent),
        rgba(2, 6, 23, .22);
    color: var(--text);
    text-decoration: none;
}

.balance-action span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 780;
    text-transform: uppercase;
}

.balance-action strong {
    color: var(--text);
    font-size: 16px;
    line-height: 1.1;
}

.balance-action--primary {
    border-color: rgba(101, 240, 160, .32);
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .18), rgba(33, 230, 193, .06)),
        rgba(2, 6, 23, .24);
}

.balance-action--primary strong {
    color: var(--green);
}

.balance-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.balance-summary-strip article {
    display: grid;
    gap: 5px;
    min-height: 92px;
    align-content: center;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .028), transparent),
        rgba(2, 6, 23, .18);
}

.balance-summary-strip span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 780;
    text-transform: uppercase;
}

.balance-summary-strip strong {
    color: var(--text);
    font-size: 15px;
}

.balance-summary-strip small {
    color: var(--muted);
}

.balance-summary-strip .is-danger strong {
    color: var(--danger);
}

.balance-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.balance-feed {
    display: grid;
    gap: 10px;
}

.balance-feed .panel-title {
    margin-bottom: 2px;
}

.balance-feed .panel-title .button {
    width: auto;
    min-height: 34px;
    min-width: 104px;
    padding: 7px 10px;
}

.balance-feed-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 11px 0;
    border-top: 1px solid rgba(148, 163, 184, .12);
}

.balance-feed-row strong,
.balance-feed-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.balance-feed-row small {
    margin-top: 4px;
    color: var(--muted);
}

.balance-card__bar {
    display: flex;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
}

.balance-card__bar i {
    display: block;
    width: var(--value);
    min-width: 0;
    height: 100%;
    flex: 0 0 var(--value);
}

.balance-card__bar i:nth-child(1) {
    background: var(--green);
}

.balance-card__bar i:nth-child(2) {
    background: #38bdf8;
}

.balance-card__bar i:nth-child(3) {
    background: var(--danger);
}

.balance-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

a.balance-kpi {
    color: inherit;
    text-decoration: none;
}

.balance-kpi {
    display: grid;
    align-content: center;
    gap: 6px;
    min-height: 96px;
    padding: 13px;
}

.balance-kpi span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.balance-kpi strong {
    color: var(--text);
    font-size: clamp(14px, 1vw, 16px);
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.balance-kpi small {
    color: var(--muted);
    line-height: 1.25;
}

.balance-kpi--limit {
    border-color: rgba(101, 240, 160, .28);
}

.balance-kpi--limit strong {
    color: var(--green);
}

.balance-kpi.is-danger {
    border-color: rgba(255, 134, 125, .28);
}

.balance-kpi.is-danger strong {
    color: var(--danger);
}

.balance-alert {
    border-color: rgba(245, 158, 11, .30);
    background:
        linear-gradient(90deg, rgba(245, 158, 11, .10), rgba(255, 134, 125, .08)),
        rgba(2, 6, 23, .18);
}

.balance-workspace,
.balance-history-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    gap: 14px;
    align-items: start;
}

.balance-workspace--request {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.balance-workspace--wallets {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
}

.balance-request,
.balance-wallets,
.balance-history,
.balance-frozen,
.balance-side {
    display: grid;
    gap: 14px;
}

.balance-side {
    align-content: start;
}

.balance-side-list {
    display: grid;
    gap: 8px;
}

.balance-side-list span {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, .12);
    color: var(--muted);
}

.balance-side-list b {
    color: var(--text);
    text-align: right;
}

.balance-request-form {
    grid-template-columns: minmax(0, 1fr) minmax(180px, .42fr);
}

.balance-field--amount {
    grid-column: 1;
}

.balance-field--wide {
    grid-column: 1 / -1;
}

.balance-quick {
    grid-column: 2;
}

.balance-quick button {
    min-height: 44px;
    background:
        linear-gradient(180deg, rgba(101, 240, 160, .14), rgba(101, 240, 160, .06));
}

.balance-wallet-list,
.balance-frozen-list {
    max-height: 360px;
    overflow: auto;
    padding-right: 2px;
}

.balance-wallet-list--page,
.balance-frozen-list--page {
    max-height: none;
}

.balance-wallet {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent),
        rgba(2, 6, 23, .20);
}

.balance-wallet-form {
    gap: 9px;
}

.balance-latest-request {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(101, 240, 160, .22);
    border-radius: 8px;
    background: rgba(101, 240, 160, .06);
}

.balance-latest-request span,
.balance-latest-request small {
    color: var(--muted);
}

.balance-latest-request span {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 760;
    text-transform: uppercase;
}

.balance-latest-request strong {
    color: var(--text);
    font-size: 15px;
}

.withdraw-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    gap: 14px;
    align-items: start;
}

.withdraw-terminal {
    display: grid;
    gap: 13px;
    padding: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 14% 10%, rgba(101, 240, 160, .12), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent),
        var(--panel);
}

.withdraw-terminal__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.withdraw-terminal__head h2,
.withdraw-readiness h2 {
    margin: 0;
}

.withdraw-terminal__head > strong {
    color: var(--green);
    font-size: 15px;
    white-space: nowrap;
}

.withdraw-terminal-form {
    display: grid;
    gap: 13px;
}

.withdraw-amount {
    position: relative;
    display: grid;
    gap: 8px;
}

.withdraw-amount span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 780;
    text-transform: uppercase;
}

.withdraw-amount input {
    width: 100%;
    min-height: 58px;
    padding: 10px 64px 10px 12px;
    border: 1px solid rgba(101, 240, 160, .24);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .10), rgba(2, 6, 23, .22)),
        rgba(2, 6, 23, .34);
    color: var(--text);
    font-size: 22px !important;
    font-weight: 760;
    line-height: 1;
    appearance: textfield;
    -moz-appearance: textfield;
}

.withdraw-amount input::-webkit-outer-spin-button,
.withdraw-amount input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.withdraw-amount b {
    position: absolute;
    right: 13px;
    bottom: 17px;
    color: var(--green);
    font-size: 12px;
    letter-spacing: .08em;
}

.withdraw-quick--terminal {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.withdraw-quick--terminal button {
    min-height: 40px;
}

.withdraw-recipient-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, .34fr);
    gap: 12px;
}

.withdraw-submit {
    min-height: 44px;
}

.withdraw-rail {
    display: grid;
    gap: 14px;
}

.withdraw-readiness,
.withdraw-rail-card {
    display: grid;
    gap: 14px;
}

.withdraw-readiness__meter {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, .14);
}

.withdraw-readiness__meter i {
    display: block;
    width: var(--value);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green), #86efac);
}

.withdraw-rail-card .panel-title {
    margin-bottom: 0;
}

.withdraw-rail-card .panel-title .button {
    width: auto;
    min-width: 94px;
    min-height: 34px;
    padding: 7px 10px;
}

.wallets-layout,
.history-layout,
.frozen-layout {
    display: grid;
    gap: 14px;
}

.wallets-layout {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
    align-items: start;
}

.wallets-main {
    display: grid;
    gap: 14px;
}

.wallets-hero,
.history-stats,
.frozen-hero {
    border: 1px solid rgba(101, 240, 160, .24);
    border-radius: 8px;
    background:
        radial-gradient(circle at 14% 10%, rgba(101, 240, 160, .13), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent),
        var(--panel);
}

.wallets-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 15px 16px;
}

.wallets-hero h2,
.wallet-create-panel h2,
.frozen-hero h2 {
    margin: 0;
}

.wallets-hero > strong {
    color: var(--green);
    font-size: 24px;
    line-height: 1;
}

.wallet-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.wallet-vault-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    min-height: 132px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(56, 189, 248, .08), rgba(101, 240, 160, .06)),
        rgba(2, 6, 23, .22);
}

.wallet-vault-card > span {
    grid-column: 1 / -1;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(101, 240, 160, .10);
    color: var(--green);
    font-size: 11px;
    font-weight: 780;
}

.wallet-vault-card strong,
.wallet-vault-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-vault-card small {
    margin-top: 6px;
    color: var(--muted);
}

.wallet-vault-card form {
    align-self: end;
}

.wallet-vault-card .button {
    min-height: 34px;
    padding: 7px 10px;
}

.wallet-create-panel {
    display: grid;
    gap: 14px;
    align-content: start;
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
}

.history-stats article {
    display: grid;
    gap: 6px;
    min-height: 82px;
    align-content: center;
    padding: 13px;
    background: rgba(2, 6, 23, .16);
}

.history-stats span,
.frozen-hero > span:not(.eyebrow) {
    color: var(--muted);
}

.history-stats span {
    font-size: 10px;
    font-weight: 780;
    text-transform: uppercase;
}

.history-stats strong {
    color: var(--text);
    font-size: clamp(15px, 1.2vw, 18px);
}

.history-timeline,
.frozen-ledger {
    display: grid;
    gap: 10px;
}

.history-row,
.frozen-row {
    display: grid;
    grid-template-columns: minmax(160px, .45fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .026), transparent),
        rgba(2, 6, 23, .18);
}

.history-row strong,
.history-row small,
.history-row span,
.frozen-row strong,
.frozen-row small,
.frozen-row span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-row small,
.history-row span,
.frozen-row small,
.frozen-row span {
    color: var(--muted);
}

.frozen-hero {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.frozen-hero > strong {
    color: #38bdf8;
    font-size: clamp(22px, 2.2vw, 28px);
    line-height: 1;
}

.frozen-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.frozen-row small:last-child {
    grid-column: 1 / -1;
}

.empty-state-card {
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px dashed rgba(148, 163, 184, .26);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(2, 6, 23, .14);
}

.empty-state-card strong {
    color: var(--text);
}

.work-profile-page {
    gap: 12px;
}

.work-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px;
    align-items: center;
}

.work-head h1 {
    margin: 0;
    font-size: 22px;
}

.work-rank-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--rank-color) 55%, transparent);
    border-radius: 999px;
    color: var(--rank-color);
    background: color-mix(in srgb, var(--rank-color) 12%, transparent);
    font-size: 12px;
    font-weight: 780;
}

.work-rank-icon,
.work-score-icon,
.work-metric-icon,
.work-income-icon {
    width: 16px;
    height: 16px;
    background: currentColor;
}

.work-performance-panel {
    gap: 12px;
}

.work-performance-main {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.work-score {
    display: grid;
    gap: 3px;
    place-items: center;
    min-height: 104px;
    padding: 12px;
    border: 1px solid rgba(101, 240, 160, .25);
    border-radius: 8px;
    color: var(--green);
    background: rgba(101, 240, 160, .08);
}

.work-score span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(101, 240, 160, .12);
}

.work-score strong {
    color: var(--text);
    font-size: 24px;
    line-height: 1;
}

.work-score small,
.work-progress-line span,
.work-progress-line b {
    color: var(--muted);
    font-size: 11px;
    font-weight: 780;
}

.work-progress {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .14);
}

.work-progress .panel-title {
    margin: 0;
}

.work-progress-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.work-progress-line b {
    color: var(--green);
    white-space: nowrap;
}

.work-progress-bar {
    display: block;
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, .16);
}

.work-progress-bar::before {
    content: "";
    display: block;
    width: var(--value);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green), #38bdf8);
}

.work-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.work-metric-card {
    min-width: 0;
    min-height: 82px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .14);
}

.work-metric-card__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #93c5fd;
    background: rgba(147, 197, 253, .10);
}

.work-metric-card.is-good .work-metric-card__icon {
    color: var(--green);
    background: rgba(101, 240, 160, .10);
}

.work-metric-card.is-money .work-metric-card__icon {
    color: #facc15;
    background: rgba(250, 204, 21, .10);
}

.work-metric-card.is-warn .work-metric-card__icon {
    color: #fb7185;
    background: rgba(251, 113, 133, .11);
}

.work-metric-card__body {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.work-metric-card small,
.work-metric-card em {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
    font-weight: 780;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-metric-card small {
    text-transform: uppercase;
}

.work-metric-card strong {
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-income-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.work-income-card {
    display: grid;
    gap: 4px;
    min-height: 86px;
    align-content: center;
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .18);
}

.work-income-icon {
    color: var(--green);
}

.work-income-card.is-primary {
    border-color: rgba(101, 240, 160, .28);
    background: linear-gradient(135deg, rgba(101, 240, 160, .12), rgba(2, 6, 23, .16));
}

.work-income-card span,
.work-rate-card span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 780;
    text-transform: uppercase;
}

.work-income-card strong {
    color: var(--text);
    font-size: 15px;
}

.work-income-card small,
.work-rate-card small {
    color: var(--muted);
}

.work-layout,
.admin-work-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 14px;
    align-items: start;
}

.work-layout--rates-only {
    grid-template-columns: minmax(0, 1fr);
}

.admin-work-grid {
    grid-template-columns: minmax(0, 1fr);
}

.admin-work-grid--dashboard {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    grid-template-areas:
        "people rates"
        "ranks ranks";
}

.admin-work-people {
    grid-area: people;
}

.admin-work-rates {
    grid-area: rates;
}

.admin-work-ranks {
    grid-area: ranks;
}

.work-rate-list,
.work-rank-list,
.admin-work-list,
.admin-work-panel,
.work-rates-panel,
.work-ranks-panel {
    display: grid;
    gap: 10px;
}

.admin-work-user-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    margin-bottom: 10px;
}

.admin-work-user-search .button {
    min-height: 38px;
    width: auto;
    min-width: 88px;
}

.admin-work-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(101, 240, 160, .22);
    border-radius: 8px;
    background: rgba(101, 240, 160, .06);
}

.admin-work-selected--card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.admin-work-selected--card img,
.admin-work-selected--card .user-profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.admin-work-selected--card small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.admin-work-selected span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 780;
    text-transform: uppercase;
}

.admin-work-selected strong {
    color: var(--green);
    font-size: 13px;
}

.admin-work-user-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.admin-work-user-results a,
.admin-work-user-results span {
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: 7px 9px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 7px;
    background: rgba(2, 6, 23, .18);
    color: var(--text);
    font-size: 12px;
    font-weight: 720;
    text-decoration: none;
}

.admin-work-user-results a.is-active,
.admin-work-user-results a:hover {
    border-color: rgba(101, 240, 160, .34);
    background: rgba(101, 240, 160, .10);
    color: var(--green);
}

.admin-work-user-results span {
    color: var(--muted);
}

.admin-work-form.is-disabled {
    opacity: .58;
}

.work-rate-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    min-height: 50px;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .16);
}

.work-rate-card strong,
.work-rate-card small {
    display: block;
}

.work-rate-card b {
    color: var(--green);
    font-size: 13px;
    white-space: nowrap;
}

.work-rate-card em {
    color: var(--muted);
    font-style: normal;
    font-size: 11px;
    white-space: nowrap;
}

.admin-work-form,
.admin-work-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(90px, .7fr) 90px 120px 76px;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    background: rgba(2, 6, 23, .14);
}

.admin-work-form textarea,
.admin-work-row textarea {
    grid-column: 1 / -1;
}

.admin-work-form .button,
.admin-work-row .button {
    min-height: 34px;
    padding: 7px 10px;
}

.admin-work-form--rank,
.admin-work-row--rank {
    grid-template-columns: minmax(180px, 1fr) minmax(110px, .42fr) 58px 76px minmax(96px, .34fr) minmax(118px, .42fr);
    align-items: center;
}

.admin-work-form--rank .button {
    grid-column: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-inline: 8px;
    white-space: normal;
}

.admin-work-row--rank .admin-work-check {
    grid-column: auto;
    align-self: center;
    min-height: 34px;
    padding-left: 2px;
}

.admin-work-row--rank .button {
    width: 100%;
    min-width: 0;
    padding: 7px 8px;
    font-size: 12px;
}

.admin-work-row--rank .button--secondary {
    grid-column: auto;
    min-width: 0;
}

.admin-work-row--rank .button--ghost {
    grid-column: auto;
    min-width: 0;
}

.admin-work-form--rank input[type="color"],
.admin-work-row--rank input[type="color"] {
    width: 54px;
    min-width: 54px;
    height: 34px;
    padding: 4px;
}

.admin-work-check {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
}

.admin-rate-table {
    display: grid;
    gap: 8px;
}

.admin-rate-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 136px 112px 96px auto;
    gap: 10px;
    align-items: center;
    min-height: 72px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 8px;
    background: rgba(2, 6, 23, .16);
}

.admin-rate-row.is-muted {
    opacity: .68;
}

.admin-rate-row strong,
.admin-rate-row small {
    display: block;
}

.admin-rate-row strong {
    color: var(--text);
    font-size: 14px;
    line-height: 1.25;
}

.admin-rate-row small,
.admin-rate-row p,
.admin-rate-row em {
    color: var(--muted);
    font-style: normal;
    font-size: 12px;
}

.admin-rate-row p {
    margin: 5px 0 0;
    line-height: 1.35;
}

.admin-rate-row > span {
    color: var(--green);
    font-size: 14px;
    font-weight: 820;
    white-space: nowrap;
}

.admin-rate-row > b {
    display: inline-flex;
    justify-content: center;
    min-height: 28px;
    padding: 6px 9px;
    border: 1px solid rgba(101, 240, 160, .25);
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .08);
    font-size: 11px;
    font-weight: 760;
    white-space: nowrap;
}

.admin-rate-row.is-muted > b {
    border-color: rgba(148, 163, 184, .20);
    color: var(--muted);
    background: rgba(148, 163, 184, .06);
}

.admin-rate-actions {
    display: grid;
    grid-template-columns: minmax(120px, auto) minmax(92px, auto);
    gap: 8px;
    align-items: center;
}

.admin-rate-actions form {
    display: contents;
}

.admin-rate-actions .button {
    min-height: 34px;
    padding: 7px 10px;
    white-space: nowrap;
}

.work-admin-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 14px;
    align-items: start;
}

.work-rate-editor,
.work-danger-panel {
    gap: 14px;
}

.work-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.work-editor-actions .button {
    min-width: 150px;
}

.work-danger-panel {
    border-color: rgba(255, 134, 125, .24);
}

.switch-line {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}

.switch-line--compact {
    min-height: 36px;
    padding: 6px 8px;
    gap: 8px;
    font-size: 12px;
}

.switch-line input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.switch-line__control {
    position: relative;
    width: 38px;
    min-width: 38px;
    height: 22px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 999px;
    background: rgba(15, 23, 42, .58);
    box-shadow: inset 0 0 0 1px rgba(2, 6, 23, .22);
    transition: border-color .16s ease, background .16s ease;
}

.switch-line__control::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .92);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
    transition: transform .16s ease, background .16s ease;
}

.switch-line input:checked + .switch-line__control {
    border-color: rgba(101, 240, 160, .48);
    background: rgba(101, 240, 160, .16);
}

.switch-line input:checked + .switch-line__control::after {
    transform: translateX(16px);
    background: var(--green);
}

.switch-line input:focus-visible + .switch-line__control {
    outline: 2px solid rgba(101, 240, 160, .48);
    outline-offset: 2px;
}

.switch-line__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-profile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: -2px 0 10px;
}

.work-profile-tabs a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    font-size: 11px;
    font-weight: 820;
    text-decoration: none;
}

.work-profile-tabs a:hover,
.work-profile-tabs a.is-active {
    border-color: rgba(101, 240, 160, .40);
    color: var(--green);
    background: rgba(101, 240, 160, .10);
}

.work-page-panel {
    gap: 10px;
}

.work-user-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 8px;
    align-items: end;
}

.work-user-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.work-user-item {
    min-width: 0;
    min-height: 54px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    color: var(--text);
    background: rgba(2, 6, 23, .15);
    text-decoration: none;
}

.work-user-item:hover,
.work-user-item.is-active {
    border-color: rgba(101, 240, 160, .36);
    background: rgba(101, 240, 160, .08);
}

.work-user-item img,
.work-user-item .user-profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
}

.work-user-item strong,
.work-user-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-user-item strong {
    color: var(--green);
    font-size: 12px;
    line-height: 1.2;
}

.work-user-item small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
}

.work-user-item b {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.work-rates-table,
.work-ranks-table {
    display: grid;
    gap: 8px;
}

.work-rate-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 138px 106px 100px minmax(210px, auto);
    gap: 10px;
    align-items: center;
    min-height: 66px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background: rgba(2, 6, 23, .15);
}

.work-rate-row.is-muted {
    opacity: .68;
}

.work-rate-main strong,
.work-rate-main small {
    display: block;
}

.work-rate-main strong {
    color: var(--text);
    font-size: 14px;
    line-height: 1.25;
}

.work-rate-main small,
.work-rate-row > span,
.work-rate-row p {
    color: var(--muted);
    font-size: 12px;
}

.work-rate-money {
    color: var(--green) !important;
    font-size: 14px !important;
    font-weight: 850;
    white-space: nowrap;
}

.work-rate-row > b {
    display: inline-flex;
    justify-content: center;
    min-height: 28px;
    padding: 6px 9px;
    border: 1px solid rgba(101, 240, 160, .25);
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .08);
    font-size: 11px;
    font-weight: 780;
    white-space: nowrap;
}

.work-rate-actions {
    display: grid;
    grid-template-columns: minmax(118px, 1fr) minmax(92px, .8fr);
    gap: 8px;
}

.work-rate-actions form {
    display: contents;
}

.work-rate-actions .button {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 7px 9px;
    white-space: nowrap;
}

.work-rate-row p {
    grid-column: 1 / -1;
    margin: -2px 0 0;
    line-height: 1.35;
}

.work-rank-create {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 140px 80px 110px 120px;
    gap: 10px;
    align-items: end;
}

.work-rank-row {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 120px 72px 100px 110px 112px 96px;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    background: rgba(2, 6, 23, .14);
}

.work-rank-row .button,
.work-rank-create .button {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 7px 8px;
}

.work-rank-row input[type="color"],
.work-rank-create input[type="color"] {
    width: 58px;
    min-width: 58px;
    height: 36px;
    padding: 4px;
}

.balance-table {
    grid-template-columns: minmax(120px, .75fr) 82px minmax(120px, 1fr) 112px minmax(140px, .8fr);
}

.balance-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 760;
    white-space: nowrap;
}

.balance-status.is-new {
    border-color: rgba(56, 189, 248, .30);
    color: #38bdf8;
    background: rgba(56, 189, 248, .08);
}

.balance-status.is-processing {
    border-color: rgba(245, 158, 11, .34);
    color: #f59e0b;
    background: rgba(245, 158, 11, .08);
}

.balance-status.is-paid {
    border-color: rgba(101, 240, 160, .34);
    color: var(--green);
    background: rgba(101, 240, 160, .08);
}

.balance-status.is-rejected {
    border-color: rgba(255, 134, 125, .34);
    color: var(--danger);
    background: rgba(255, 134, 125, .08);
}

.balance-freeze-summary {
    background:
        linear-gradient(135deg, rgba(56, 189, 248, .10), rgba(101, 240, 160, .05)),
        rgba(2, 6, 23, .18);
}

.balance-frozen-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
}

.balance-frozen-row > small {
    grid-column: 1 / -1;
}

.button:disabled,
button:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.balance-page--unified {
    gap: 12px;
    padding-top: 4px;
}

.balance-command--unified {
    grid-template-columns: 1fr;
    padding: 0;
}

.balance-page--unified .balance-command__title h1 {
    font-size: 22px !important;
    line-height: 1.08;
}

.balance-unified-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.balance-summary-card {
    display: grid;
    align-content: center;
    gap: 4px;
    min-height: 82px;
    padding: 11px 12px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .018), transparent),
        rgba(2, 6, 23, .12);
}

.balance-summary-card--primary {
    border-color: rgba(101, 240, 160, .22);
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .08), rgba(56, 189, 248, .026)),
        rgba(2, 6, 23, .14);
}

.balance-summary-card span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 780;
    text-transform: uppercase;
}

.balance-summary-card strong {
    color: var(--text);
    font-size: 15px;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.balance-summary-card--primary strong {
    color: var(--green);
}

.balance-summary-card small {
    color: var(--muted);
    font-size: 11px;
}

.withdraw-live-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    min-height: 22px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 720;
    line-height: 1.35;
}

.withdraw-live-summary span,
.withdraw-live-summary small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.withdraw-live-summary small {
    color: var(--green);
    font-size: 12px;
    font-weight: 780;
}

.withdraw-live-summary small:empty {
    display: none;
}

.balance-unified-grid {
    display: grid;
    grid-template-columns: minmax(560px, 1fr) minmax(300px, 390px);
    gap: 12px;
    align-items: start;
}

.balance-unified-side {
    display: grid;
    gap: 12px;
    align-content: start;
}

.balance-withdraw-card {
    padding: 14px;
    overflow: visible;
}

.balance-withdraw-card .withdraw-terminal__head h2,
.balance-page--unified .panel-title h2,
.balance-page--unified .withdraw-readiness h2 {
    font-size: 16px;
    line-height: 1.15;
}

.balance-page--unified .withdraw-terminal__head {
    align-items: start;
}

.balance-page--unified .withdraw-terminal__head > strong {
    max-width: 240px;
    color: var(--green);
    font-size: 13px;
    line-height: 1.25;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
}

.balance-withdraw-form {
    gap: 12px;
}

.balance-amount-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
    gap: 10px;
    align-items: end;
}

.balance-page--unified .balance-amount-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
}

.balance-amount-row--stacked {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
}

.balance-page--unified .withdraw-amount input {
    min-height: 48px;
    padding: 9px 58px 9px 12px;
    font-size: 18px !important;
}

.balance-page--unified .withdraw-amount b {
    right: 12px;
    bottom: 14px;
    font-size: 11px;
}

.balance-page--unified .withdraw-quick--terminal {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: min(100%, 310px);
    justify-self: end;
}

.balance-page--unified .balance-quick--separate {
    grid-column: 1 / -1 !important;
    margin-top: -4px;
    justify-self: end;
}

.balance-page--unified .withdraw-quick--terminal button {
    min-height: 38px;
    padding: 7px 8px;
    font-size: 12px;
}

.balance-recipient-grid {
    grid-template-columns: minmax(180px, .85fr) 124px minmax(240px, 1fr);
    gap: 10px;
}

.balance-form-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
    gap: 10px;
    align-items: end;
}

.balance-submit-box {
    display: grid;
    gap: 8px;
}

.balance-page--unified .withdraw-submit {
    min-height: 42px;
}

.balance-page--unified .withdraw-disabled-note {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
}

.balance-page--unified .withdraw-readiness,
.balance-wallets-card {
    display: grid;
    gap: 11px;
}

.balance-page--unified .balance-side-list {
    gap: 0;
}

.balance-page--unified .balance-side-list span {
    padding: 8px 0;
    font-size: 12px;
}

.balance-wallet-compact-list {
    display: grid;
    gap: 7px;
}

.balance-wallet-compact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 8px;
    background: rgba(2, 6, 23, .14);
}

.balance-wallet-compact strong,
.balance-wallet-compact small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.balance-wallet-compact strong {
    font-size: 13px;
}

.balance-wallet-compact small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.balance-wallet-compact .button {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 11px;
}

.balance-wallet-form--compact {
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, .12);
}

.balance-wallet-add {
    display: grid;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, .10);
}

.balance-wallet-add summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(101, 240, 160, .24);
    border-radius: 8px;
    background: rgba(101, 240, 160, .08);
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.balance-wallet-add summary::-webkit-details-marker {
    display: none;
}

.balance-wallet-add[open] summary {
    background: rgba(101, 240, 160, .12);
}

.balance-wallet-form__row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 8px;
}

.balance-unified-lower {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr);
    gap: 12px;
    align-items: start;
}

.balance-page--unified .balance-history,
.balance-page--unified .balance-frozen {
    display: grid;
    gap: 11px;
}

.balance-history-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.balance-history-stats article {
    min-height: 64px;
    padding: 10px 11px;
}

.balance-history-stats strong {
    font-size: 14px;
}

.balance-history-list,
.balance-page--unified .balance-frozen-list {
    max-height: 380px;
    overflow: auto;
    padding-right: 2px;
}

.balance-page--unified .history-row,
.balance-page--unified .frozen-row {
    padding: 10px 11px;
    gap: 9px;
}

.balance-page--unified .history-row strong,
.balance-page--unified .frozen-row strong {
    font-size: 13px;
}

.balance-page--unified .history-row small,
.balance-page--unified .history-row span,
.balance-page--unified .frozen-row small,
.balance-page--unified .frozen-row span {
    font-size: 11px;
}
/* Desktop-only build: viewport overrides removed. */
/* Desktop-only build: legacy viewport overrides removed. */
/* Compact work-profile admin lists. */
.work-page-panel .panel-title {
    margin-bottom: 6px;
}

/* Email tools: compact workspace hierarchy and denser rows. */
.content:has(.tools-page) {
    padding-top: 34px;
    padding-bottom: 44px;
}

.tools-page {
    gap: 14px;
}

.tools-head--emails {
    min-height: 34px;
    padding: 0 2px 4px;
    align-items: center;
}

.tools-head--emails h1 {
    margin-top: 4px;
    letter-spacing: -.02em;
}

.tools-admin-grid {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 12px;
}

.tools-user-panel,
.tools-email-create,
.tools-email-panel {
    padding: 12px;
}

.tools-user-panel {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.tools-user-panel .panel-title,
.tools-email-create .panel-title,
.tools-email-panel .panel-title {
    margin-bottom: 10px;
}

.tools-user-list {
    max-height: 220px;
    gap: 4px;
    padding: 4px 4px 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .34) transparent;
}

.tools-user-list::-webkit-scrollbar {
    width: 6px;
}

.tools-user-list::-webkit-scrollbar-track {
    background: transparent;
}

.tools-user-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, .34);
}

.tools-user-list a {
    min-height: 58px;
    padding: 9px 11px;
    border-radius: 7px;
    align-content: center;
}

.tools-user-list a strong {
    font-size: 14px;
    line-height: 1.15;
}

.tools-user-list a small {
    font-size: 11px;
    line-height: 1.15;
}

.tools-email-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
    border-radius: 7px;
}

.tools-email-edit {
    gap: 8px;
}

.tools-email-edit input,
.tools-email-create input {
    min-height: 36px;
}

.tools-email-actions {
    gap: 6px;
}

.tools-email-actions .button,
.tools-email-create > .button,
.tools-email-edit > .button {
    min-height: 36px;
    white-space: nowrap;
}

.tools-email-view {
    gap: 8px 18px;
}

.tools-email-view span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.tools-email-view strong {
    font-size: 13px;
}

.tools-email-secret__control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tools-email-secret__control input {
    min-width: 0;
    width: min(260px, 100%);
    min-height: 34px;
    padding: 6px 9px;
    color: var(--text);
    background: rgba(15, 23, 42, .24);
}

.tools-email-secret__control .button {
    min-height: 34px;
    padding: 6px 9px;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .tools-admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1280px) {
    .cabinet-shell:has(.tools-page) {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 14px;
    }

    .tools-page,
    .tools-admin-grid,
    .tools-user-panel,
    .tools-email-create,
    .tools-email-panel {
        min-width: 0;
    }
}

@media (max-width: 1100px) {
    .tools-admin-grid {
        grid-template-columns: 1fr;
    }

    .cabinet-shell:has(.tools-page) {
        grid-template-columns: 1fr;
    }

    .cabinet-shell:has(.tools-page) > .cabinet-nav,
    .cabinet-shell:has(.tools-page) > .cabinet-main {
        grid-column: 1;
    }

    .cabinet-shell:has(.tools-page) > .cabinet-nav {
        position: relative;
        top: auto;
        min-height: auto;
    }
}

/* Temporary background pass: replace the grid with a quieter ambient surface. */
body::before {
    background:
        radial-gradient(720px 420px at 12% 8%, rgba(101, 240, 160, .075), transparent 68%),
        radial-gradient(620px 360px at 92% 18%, rgba(101, 240, 160, .040), transparent 70%),
        linear-gradient(135deg, rgba(255, 255, 255, .018), transparent 42%, rgba(101, 240, 160, .022));
    background-size: auto;
    background-position: center;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .86), transparent 88%);
    animation: none;
}

.admin-server-page .server-actions-panel {
    gap: 18px;
}

.admin-server-page .server-actions-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .8fr);
    gap: 18px;
    align-items: stretch;
}

.admin-server-page .server-actions-main,
.admin-server-page .server-actions-danger {
    display: grid !important;
    grid-template-rows: auto 1fr;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .026);
}

.admin-server-page .server-actions-danger {
    border-color: rgba(248, 113, 113, .24);
    background: rgba(127, 29, 29, .075);
}

.admin-server-page .server-actions-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.admin-server-page .server-actions-group-head h3 {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.admin-server-page .server-actions-group-head span {
    max-width: 360px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
    text-align: right;
}

.admin-server-page .server-actions-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    align-content: start;
}

.admin-server-page .server-actions-danger .server-actions-row {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.admin-server-page .server-actions-row form,
.admin-server-page .server-actions-row .button,
.admin-server-page .server-actions-row button {
    width: 100%;
    min-width: 0 !important;
    max-width: none;
}

.admin-server-page .server-actions-row .button {
    min-height: 46px;
    padding-inline: 16px;
    white-space: normal;
}

.work-page-panel .panel-title h2 {
    font-size: 13px;
}

.work-page-panel .panel-title span,
.work-page-panel .field > span {
    font-size: 10px;
}

.work-page-panel input,
.work-page-panel .button {
    min-height: 34px;
    font-size: 12px;
}

.work-user-list {
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    gap: 8px;
}

.work-user-item {
    min-height: 54px;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
}

.work-user-item img,
.work-user-item .user-profile-avatar {
    width: 36px;
    height: 36px;
}

.work-user-item strong {
    font-size: 12px;
    line-height: 1.15;
}

.work-user-item small {
    font-size: 10.5px;
}

.work-user-item b {
    font-size: 10.5px;
}

.work-user-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

/* Admin chat monitor polish. */
.admin-chat-monitor-page {
    gap: 14px;
}

.admin-chat-monitor-page .admin-chat-monitor-hero {
    min-height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-color: rgba(101, 240, 160, .18);
    background:
        linear-gradient(135deg, rgba(101, 240, 160, .055), rgba(255, 255, 255, .018) 48%, rgba(59, 130, 246, .035)),
        var(--panel);
}

.admin-chat-monitor-page .admin-chat-monitor-hero > div {
    gap: 5px;
}

.admin-chat-monitor-page .admin-chat-monitor-hero .eyebrow {
    margin: 0;
}

.admin-chat-monitor-page .admin-chat-monitor-hero h1 {
    font-size: 20px;
    line-height: 1.05;
}

.admin-chat-monitor-page .admin-chat-monitor-hero .hero-meta {
    gap: 6px;
    margin-top: 0;
}

.admin-chat-monitor-page .admin-chat-monitor-hero .hero-meta > span {
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    line-height: 1;
}

.admin-chat-monitor-page .admin-chat-monitor-hero .hero-action {
    min-width: 0;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.admin-chat-monitor-page .admin-subnav {
    margin-bottom: 0;
}

.admin-chat-monitor-page .chat-layout {
    grid-template-columns: minmax(360px, 390px) minmax(0, 1fr);
    gap: 14px;
    --chat-workspace-height: clamp(600px, calc(100svh - 258px), 790px);
}

.admin-chat-monitor-page .chat-threads {
    gap: 8px;
}

.admin-chat-monitor-page .chat-threads-title {
    padding-bottom: 4px;
}

.admin-chat-monitor-page .chat-threads-title__label h2 {
    font-size: 16px;
}

.admin-chat-monitor-page .chat-search {
    gap: 5px;
}

.admin-chat-monitor-page .chat-search span {
    font-size: 10px;
}

.admin-chat-monitor-page .chat-monitor-scroll-row {
    min-width: 0;
}

.admin-chat-monitor-page .chat-monitor-filter-toggle {
    width: 100%;
    justify-content: center;
    border-radius: 8px;
}

.admin-chat-monitor-page .chat-monitor-advanced {
    border-radius: 8px;
}

.admin-chat-monitor-page .chat-monitor-type-chips,
.admin-chat-monitor-page .chat-monitor-risk-chips {
    padding-bottom: 2px;
}

.admin-chat-monitor-page .chat-monitor-type-chips button,
.admin-chat-monitor-page .chat-monitor-risk-chips button {
    min-height: 28px;
    max-width: 150px;
    padding: 5px 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-monitor-page .chat-thread-list {
    align-content: start;
    gap: 6px;
}

.admin-chat-monitor-page .chat-thread-list a {
    position: relative;
    min-width: 0;
    min-height: 98px;
    grid-template-columns: 48px minmax(0, 1fr) 44px;
    align-items: start;
    gap: 8px;
    padding: 12px;
    border-radius: 9px;
}

.admin-chat-monitor-page .chat-thread-list a::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 0;
    width: 3px;
    border-radius: 0 999px 999px 0;
    background: transparent;
}

.admin-chat-monitor-page .chat-thread-list a.is-active {
    border-color: rgba(101, 240, 160, .34);
    background: rgba(101, 240, 160, .075);
}

.admin-chat-monitor-page .chat-thread-list a.is-active::before {
    background: var(--green);
}

.admin-chat-monitor-page .chat-thread-list.is-filtered a {
    min-height: 92px;
}

.admin-chat-monitor-page .chat-thread-list.is-single-result a:not(.is-search-hidden) {
    min-height: 92px;
    border-color: rgba(101, 240, 160, .30);
    background: rgba(101, 240, 160, .055);
}

.admin-chat-monitor-page .chat-thread-list__meta {
    min-width: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, auto);
    gap: 6px;
    overflow: hidden;
}

.admin-chat-monitor-page .chat-thread-list strong {
    max-width: 100%;
    font-size: 13px;
    line-height: 1.16;
}

.admin-chat-monitor-page .chat-monitor-thread-badges {
    flex-wrap: nowrap;
    overflow: hidden;
    margin-top: 0;
}

.admin-chat-monitor-page .chat-monitor-type-badge {
    flex: 0 1 auto;
    max-width: 86px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-monitor-page .chat-monitor-type-badge--blocked,
.admin-chat-monitor-page .chat-monitor-type-badge--risk {
    color: #fecaca;
    border-color: rgba(248, 113, 113, .44);
    background: rgba(127, 29, 29, .20);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, .08);
}

.admin-chat-monitor-page .chat-thread-preview span {
    display: -webkit-box;
    max-height: none;
    overflow: hidden;
    line-height: 1.3;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.admin-chat-monitor-page .chat-thread-actions {
    width: 44px;
    min-width: 0;
    align-self: start;
}

.admin-chat-monitor-page .chat-thread-actions time {
    max-width: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
}

.admin-chat-monitor-page .chat-monitor-inspector {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 12px 14px 13px;
}

.admin-chat-monitor-page .chat-monitor-inspector__main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
}

.admin-chat-monitor-page .chat-monitor-inspector__title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-chat-monitor-page .chat-monitor-inspector__title strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-monitor-page .chat-monitor-inspector__main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-monitor-page .chat-monitor-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    min-width: 0;
}

.admin-chat-monitor-page .chat-monitor-summary span {
    min-width: 0;
    display: grid;
    gap: 2px;
    padding: 7px 8px;
    border: 1px solid rgba(148, 163, 184, .13);
    border-radius: 8px;
    background: rgba(255, 255, 255, .022);
}

.admin-chat-monitor-page .chat-monitor-summary b,
.admin-chat-monitor-page .chat-monitor-summary small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-monitor-page .chat-monitor-summary b {
    color: var(--text);
    font-size: 12px;
    font-weight: 950;
    line-height: 1;
}

.admin-chat-monitor-page .chat-monitor-summary small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
}

.admin-chat-monitor-page .chat-monitor-summary .is-ok b {
    color: var(--green);
}

.admin-chat-monitor-page .chat-monitor-summary .is-danger {
    border-color: rgba(248, 113, 113, .26);
    background: rgba(127, 29, 29, .12);
}

.admin-chat-monitor-page .chat-monitor-summary .is-danger b {
    color: #fca5a5;
}

.admin-chat-monitor-page .chat-monitor-inspector__action {
    align-self: start;
    justify-content: flex-end;
    padding-top: 2px;
}

.admin-chat-monitor-page .chat-monitor-inspector__action .button {
    width: auto;
    min-width: 0;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
}

.admin-chat-monitor-page .chat-view-tabs--monitor {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 8px 14px;
    background: rgba(13, 18, 24, .96);
    backdrop-filter: blur(14px);
}

.admin-chat-monitor-page .chat-view-tabs--monitor button {
    min-width: 0;
    min-height: 34px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-message-search {
    min-height: 58px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-feed {
    padding-top: 18px;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-message--system .chat-system-event {
    max-width: min(420px, 82%);
}

.admin-chat-monitor-page .chat-audit-head {
    padding: 12px 16px 10px;
}

.admin-chat-monitor-page .chat-audit-filters {
    padding: 9px 16px;
}

.admin-chat-monitor-page .chat-audit-list {
    padding: 14px 16px 18px 34px;
}

.admin-chat-monitor-page .chat-monitor-member-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: min-content;
    gap: 7px;
    align-content: start;
    align-items: start;
    padding: 12px 16px 18px;
}

.admin-chat-monitor-page .chat-monitor-member-card {
    display: grid;
    grid-template-columns: 38px minmax(130px, 1.15fr) minmax(120px, .75fr) minmax(180px, 1fr);
    gap: 10px;
    align-self: start;
    align-items: center;
    min-height: 58px;
    padding: 9px 11px;
}

.admin-chat-monitor-page .chat-monitor-member-card .chat-invite-avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
}

.admin-chat-monitor-page .chat-monitor-member-card__identity,
.admin-chat-monitor-page .chat-monitor-member-card__meta {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.admin-chat-monitor-page .chat-monitor-member-card__identity strong,
.admin-chat-monitor-page .chat-monitor-member-card__identity small,
.admin-chat-monitor-page .chat-monitor-member-card__role,
.admin-chat-monitor-page .chat-monitor-member-card__meta b,
.admin-chat-monitor-page .chat-monitor-member-card__meta small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-chat-monitor-page .chat-monitor-member-card__role {
    width: max-content;
    max-width: 100%;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid rgba(101, 240, 160, .20);
    border-radius: 999px;
    color: var(--green);
    background: rgba(101, 240, 160, .07);
    font-size: 10px;
    font-weight: 900;
}

.admin-chat-monitor-page .chat-monitor-member-card__meta {
    justify-items: end;
    text-align: right;
}

.admin-chat-monitor-page .chat-monitor-member-card__meta b {
    color: var(--text);
    font-size: 11px;
    font-weight: 850;
}

.admin-chat-monitor-page .chat-monitor-member-card__meta small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
}

/* Admin navigation lives in the sidebar while browsing /admin. */
.admin-subnav,
.admin-chat-monitor-page .admin-subnav,
.admin-tools-page .admin-subnav {
    display: none !important;
}

.cabinet-links--admin-mode {
    gap: 3px;
}

.cabinet-links {
    gap: 3px;
}

.cabinet-links--primary {
    gap: 3px;
}

.cabinet-links a,
.nav-admin-trigger {
    min-height: 38px;
    padding: 7px 8px;
    gap: 8px;
    font-size: 12px;
    font-weight: 620;
}

.cabinet-links a.is-active {
    min-height: 38px;
}

.nav-icon {
    width: 25px;
    height: 25px;
}

.nav-icon .local-icon {
    width: 14px;
    height: 14px;
}

.cabinet-links .nav-label,
.nav-admin-trigger .nav-label {
    font-size: 12px;
    font-weight: 620;
    line-height: 1.1;
    letter-spacing: 0;
}

.nav-submenu a {
    min-height: 31px;
    font-size: 11px;
}

.cabinet-links a.nav-link--vault {
    color: #dbeafe;
    border-color: rgba(96, 165, 250, .18);
    background:
        linear-gradient(135deg, rgba(96, 165, 250, .12), rgba(168, 85, 247, .055)),
        rgba(10, 14, 24, .38);
}

.cabinet-links a.nav-link--vault .nav-icon {
    color: #93c5fd;
    background:
        linear-gradient(135deg, rgba(96, 165, 250, .22), rgba(168, 85, 247, .12)),
        rgba(15, 23, 42, .68);
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, .20);
}

.cabinet-links a.nav-link--vault:hover,
.cabinet-links a.nav-link--vault.is-active {
    color: #f8fbff;
    border-color: rgba(147, 197, 253, .42);
    background:
        linear-gradient(135deg, rgba(96, 165, 250, .18), rgba(168, 85, 247, .10)),
        rgba(15, 23, 42, .72);
}

.cabinet-links a.nav-link--vault.is-active::before {
    background: #93c5fd;
    box-shadow: 0 0 16px rgba(147, 197, 253, .42);
}

.cabinet-links a.nav-link--vault:hover .nav-icon,
.cabinet-links a.nav-link--vault.is-active .nav-icon {
    color: #bfdbfe;
    background:
        linear-gradient(135deg, rgba(96, 165, 250, .32), rgba(168, 85, 247, .16)),
        rgba(15, 23, 42, .86);
}

.cabinet-nav--admin-mode .cabinet-links a {
    gap: 8px;
    min-height: 39px;
    padding: 7px 8px;
    color: #aeb8c4;
    font-size: 12px;
    font-weight: 620;
}

.cabinet-nav--admin-mode .nav-label {
    color: inherit;
    font-family: inherit;
    font-size: 12px;
    font-weight: 620;
    line-height: 1.1;
    letter-spacing: 0;
    text-shadow: none;
}

.cabinet-nav--admin-mode .cabinet-links a:hover,
.cabinet-nav--admin-mode .cabinet-links a.is-active {
    color: #dce6de;
    border-color: rgba(101, 240, 160, .14);
    background: rgba(101, 240, 160, .045);
}

.cabinet-nav--admin-mode .cabinet-links a.is-active::before {
    top: 10px;
    bottom: 10px;
    box-shadow: none;
}

.cabinet-nav--admin-mode .nav-icon {
    width: 26px;
    height: 26px;
    color: #68dfa0;
    background: rgba(101, 240, 160, .045);
}

.cabinet-nav--admin-mode .nav-icon .local-icon {
    width: 14px;
    height: 14px;
}

.cabinet-nav--admin-mode .cabinet-links a:hover .nav-icon,
.cabinet-nav--admin-mode .cabinet-links a.is-active .nav-icon {
    color: var(--green);
    background: rgba(101, 240, 160, .09);
}

.cabinet-main[class*="admin-"] > .cabinet-hero--compact,
.admin-chat-monitor-page .admin-chat-monitor-hero {
    min-height: auto;
    padding: 14px 16px;
    gap: 12px;
}

.cabinet-main[class*="admin-"] > .cabinet-hero--compact h1,
.admin-chat-monitor-page .admin-chat-monitor-hero h1 {
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.05;
}

.cabinet-main[class*="admin-"] > .cabinet-hero--compact .eyebrow,
.admin-chat-monitor-page .admin-chat-monitor-hero .eyebrow {
    margin-bottom: 4px;
}

.admin-api-page .cabinet-hero .hero-action,
.admin-chat-monitor-page .admin-chat-monitor-hero .hero-action {
    display: none;
}

.cabinet-nav--admin-mode .cabinet-user-card {
    padding: 10px;
}

.cabinet-nav--admin-mode .cabinet-user-card--admin {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 10px;
}

.cabinet-nav--admin-mode .cabinet-balance {
    padding: 9px 10px;
}

.cabinet-nav--admin-mode .cabinet-balance strong {
    font-size: 17px;
}

.cabinet-nav--admin-mode .cabinet-links--utility {
    padding-top: 10px;
}

.cabinet-nav--admin-mode .cabinet-logout .button {
    min-height: 38px;
    font-size: 12px;
}

.admin-users-page .users-panel {
    gap: 10px;
}

.admin-users-page .user-account-list {
    gap: 6px;
}

.admin-users-page .user-account-card {
    border-color: rgba(148, 163, 184, .13);
    background: rgba(255, 255, 255, .018);
}

.admin-users-page .user-account-row {
    grid-template-columns: minmax(0, 1fr) 150px 130px 88px;
    gap: 8px;
    padding: 7px 8px;
}

.admin-users-page .user-account-actions {
    display: grid;
    grid-template-columns: repeat(2, 38px);
    gap: 6px;
    justify-content: end;
    min-width: 0;
}

.admin-users-page .user-account-actions form {
    min-width: 0;
}

.admin-users-page .user-account-actions:not(:has(form)) {
    grid-template-columns: 38px;
}

.admin-users-page .user-profile-head {
    gap: 8px;
}

.admin-users-page .user-profile-head .user-profile-avatar,
.admin-users-page .user-profile-head .avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 7px;
}

.admin-users-page .user-profile-head strong {
    font-size: 12.5px;
    font-weight: 720;
    line-height: 1.15;
}

.admin-users-page .user-profile-head small {
    font-size: 10.5px;
    font-weight: 620;
}

.admin-users-page .user-account-pill,
.admin-users-page .user-account-balance,
.admin-users-page .user-account-row .button {
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 720;
    width: 100%;
}

.admin-users-page .user-account-icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    min-width: 38px;
    padding: 0;
}

.admin-users-page .user-account-action-icon {
    width: 16px;
    height: 16px;
}

.admin-users-page .users-search {
    gap: 8px;
    margin-bottom: 10px;
}

.admin-users-page .users-search input,
.admin-users-page .users-search .button {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
}

/* Final polish for the admin chat monitor detail view. */
.admin-chat-monitor-page .chat-panel--monitor {
    display: flex;
    flex-direction: column;
}

.admin-chat-monitor-page .chat-monitor-inspector {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    align-items: start;
    gap: 14px;
    padding: 16px 18px;
}

.admin-chat-monitor-page .chat-monitor-inspector__main {
    gap: 9px;
}

.admin-chat-monitor-page .chat-monitor-inspector__title {
    min-height: 30px;
}

.admin-chat-monitor-page .chat-monitor-inspector__main small {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.admin-chat-monitor-page .chat-monitor-summary {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 8px;
}

.admin-chat-monitor-page .chat-monitor-summary span {
    min-height: 52px;
    padding: 8px 10px;
    align-content: center;
}

.admin-chat-monitor-page .chat-monitor-summary b,
.admin-chat-monitor-page .chat-monitor-summary small {
    white-space: normal;
}

.admin-chat-monitor-page .chat-monitor-inspector__action {
    align-self: start;
    padding-top: 2px;
}

.admin-chat-monitor-page .chat-monitor-inspector__action .button {
    min-height: 38px;
    padding: 8px 15px;
    border-radius: 999px;
    font-size: 12px;
}

.admin-chat-monitor-page .chat-view-tabs--monitor {
    position: relative;
    top: auto;
    z-index: auto;
    flex: 0 0 auto;
    padding: 12px 16px;
    border-top: 1px solid rgba(148, 163, 184, .08);
}

.admin-chat-monitor-page .chat-view-tabs--monitor button {
    min-height: 42px;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-message-search {
    flex: 0 0 auto;
    min-height: 70px;
    padding: 13px 16px;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-feed {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-content: stretch;
    gap: 10px;
    padding: 20px 22px;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-message,
.admin-chat-monitor-page .chat-panel--monitor .chat-message.is-own {
    width: fit-content;
    max-width: min(760px, calc(100% - 12px));
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-self: flex-start;
    gap: 10px;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-message.is-own .chat-avatar,
.admin-chat-monitor-page .chat-panel--monitor .chat-message.is-own .chat-bubble {
    grid-row: auto;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-message.is-own .chat-avatar {
    grid-column: 1;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-message.is-own .chat-bubble {
    grid-column: 2;
    justify-self: start;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-bubble,
.admin-chat-monitor-page .chat-panel--monitor .chat-message.is-own .chat-bubble,
.admin-chat-monitor-page .chat-panel--monitor .chat-message:not(.is-own) .chat-bubble {
    width: auto;
    min-width: min(300px, 100%);
    max-width: 100%;
    display: block;
    justify-self: start;
    padding: 12px 14px;
    border-radius: 8px;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-bubble p {
    grid-column: auto;
    margin: 0;
    padding-top: 0;
    text-align: left;
    line-height: 1.45;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-reply-ref,
.admin-chat-monitor-page .chat-panel--monitor .chat-attachment {
    grid-column: auto;
    margin-top: 8px;
}

.admin-chat-monitor-page .chat-panel--monitor .chat-attachment {
    max-width: min(360px, 100%);
}

.admin-chat-monitor-page .chat-panel--monitor .chat-attachment img {
    max-width: 100%;
    height: auto;
}

/* Chat typography polish: keep the chat dense and readable on desktop. */

.cabinet-shell:has(.chat-layout) .cabinet-links a,
    .cabinet-shell:has(.chat-layout) .nav-admin-trigger {
        font-size: 11.5px;
        font-weight: 720;
    }

    .cabinet-shell:has(.chat-layout) .cabinet-balance strong {
        font-size: 13px;
    }

    .cabinet-hero:has(+ .chat-layout) h1 {
        font-size: 17px;
    }

    .cabinet-hero:has(+ .chat-layout) .hero-meta span,
    .cabinet-hero:has(+ .chat-layout) .hero-meta button {
        font-size: 10px;
        font-weight: 720;
    }

    .chat-threads-title__label h2,
    .chat-threads-title__label strong,
    .chat-monitor-tabs button,
    .chat-message-search__head strong {
        font-size: 12px;
    }

    .chat-thread-list strong {
        font-size: 12.5px;
        line-height: 1.15;
    }

    .chat-thread-preview,
    .chat-thread-list small,
    .chat-thread-list__meta,
    .chat-thread-actions time {
        font-size: 11px;
        line-height: 1.2;
    }

    .chat-meta {
        font-size: 10px;
    }

    .chat-text-editor,
    .chat-input-shadow {
        font-size: 12.5px;
    }

/* Chat header: stable desktop layout for encrypted and regular threads. */
.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) {
    min-height: 76px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-thread-heading {
    min-width: 0;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-thread-heading__body {
    min-width: 0;
    display: grid;
    gap: 4px;
    align-content: center;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-thread-avatar--hero {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    font-size: 17px;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-thread-avatar--hero.chat-thread-avatar--direct {
    border-radius: 50%;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) h1 {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .hero-meta {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-thread-meta-title {
    max-width: min(520px, 52vw);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 0;
    padding: 0;
    border: 0;
    color: var(--text);
    background: transparent;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.08;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-encrypted-badge {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-grid;
    place-items: center;
    align-self: center;
    margin-top: 0;
    border: 0;
    border-radius: 0;
    color: var(--green);
    background: transparent;
    box-shadow: none;
    opacity: 1;
    overflow: visible;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-encrypted-badge__svg {
    width: 22px;
    height: 22px;
    display: block;
    margin: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 1 !important;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-encrypted-badge {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
        margin-top: 1px;
    }

    .cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-encrypted-badge__svg {
        width: 22px !important;
        height: 22px !important;
    }

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-encryption-lock-now {
    display: flex;
    margin: 0;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-hero-actions .hero-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-hero-actions .hero-action .local-icon {
    flex: 0 0 auto;
}

.cabinet-main:not(.admin-chat-monitor-page) > .cabinet-hero:has(+ .chat-layout) .chat-settings-button {
    width: 38px;
    min-width: 38px;
    padding: 0;
}

.chat-thread-edit-form {
    grid-template-columns: 1fr !important;
    align-items: stretch;
}

.chat-thread-edit-form .chat-thread-edit-grid {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) minmax(230px, 280px);
    gap: 12px;
    align-items: center;
}

.chat-thread-edit-form .chat-avatar-picker {
    min-width: 0;
}

.chat-thread-edit-form .chat-avatar-picker .button {
    width: 100%;
    min-width: 0;
    white-space: normal;
}

.chat-thread-edit-form .chat-avatar-picker small {
    max-width: 100%;
}

.chat-thread-edit-form > .button[type="submit"] {
    grid-column: 1 !important;
    grid-row: auto !important;
    justify-self: end;
    width: min(420px, 100%);
    margin: 0;
}

.is-pc-only-blocked {
    overflow: hidden !important;
}

.pc-only-gate[hidden] {
    display: none !important;
}

.pc-only-gate {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--text);
    background: #050816;
}

.pc-only-gate__card {
    width: min(520px, 100%);
    display: grid;
    justify-items: start;
    gap: 14px;
    padding: 28px;
    border: 1px solid rgba(101, 240, 160, .28);
    border-radius: 12px;
    background: rgba(15, 23, 42, .94);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .44);
}

.pc-only-gate__card img {
    height: 42px;
    width: auto;
}

.pc-only-gate__card h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
}

.pc-only-gate__card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.global-call-card {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 2700;
    width: min(580px, calc(100vw - 24px));
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    color: #f8fafc;
    border: 1px solid rgba(80, 220, 145, .42);
    border-radius: 19px;
    background: rgba(8, 30, 29, .96);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .34), 0 0 0 1px rgba(80, 220, 145, .08) inset;
    backdrop-filter: blur(14px);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.global-call-card.is-dragging {
    cursor: grabbing;
    transition: none;
}

body.is-modal-open .global-call-card {
    top: max(16px, env(safe-area-inset-top));
    bottom: auto;
}

body.is-modal-open .global-call-card.is-positioned {
    bottom: auto;
}

.global-call-card[hidden],
.global-call-card__button[hidden],
.global-call-card__device[hidden] {
    display: none;
}

.global-call-card__avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    overflow: hidden;
    border: 1px solid rgba(113, 245, 168, .34);
    border-radius: 14px;
    color: #04110b;
    font-weight: 800;
    background: linear-gradient(135deg, #5ce58f, #a6ffc1);
}

.global-call-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.global-call-card__body {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.global-call-card__body strong {
    display: -webkit-box;
    overflow: hidden;
    color: #f8fafc;
    font-size: 13px;
    line-height: 1.15;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.global-call-card__body b {
    overflow: hidden;
    color: #cbd5e1;
    font-size: 11px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-call-card__body small {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    gap: 5px;
    flex-wrap: wrap;
    color: #9aa8b8;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.global-call-card__body small span {
    min-width: 0;
    white-space: normal;
}

.global-call-card__body em {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 5px;
    color: #6cffaa;
    font-style: normal;
}

.global-call-card__body em::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
}

.global-call-card__body time {
    color: #7dffb1;
    font-variant-numeric: tabular-nums;
}

.global-call-card__device {
    position: relative;
    width: min(340px, 100%);
    margin-top: 1px;
}

.global-call-card__device > button {
    width: 100%;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 0 9px;
    overflow: hidden;
    color: #dbeafe;
    border: 1px solid rgba(99, 102, 241, .22);
    border-radius: 11px;
    background: rgba(15, 23, 42, .58);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .03) inset;
    font-size: 10.5px;
    font-weight: 900;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.global-call-card__device.is-single > button,
.global-call-card__device > button:disabled {
    cursor: default;
    opacity: .82;
}

.global-call-card__device > button::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #7dfbaa;
    box-shadow: 0 0 0 3px rgba(125, 251, 170, .12);
}

.global-call-card__device > button::after {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: .75;
    transform: translateY(-2px) rotate(45deg);
}

.global-call-card__device.is-single > button::after,
.global-call-card__device > button:disabled::after {
    display: none;
}

.global-call-card__device > span {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 2;
    width: min(300px, calc(100vw - 32px));
    display: none;
    padding: 5px;
    border: 1px solid rgba(80, 220, 145, .28);
    border-radius: 12px;
    background: rgba(8, 20, 28, .98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .34);
}

.global-call-card__device.is-open > span {
    display: grid;
    gap: 3px;
}

.global-call-card__device > span button {
    width: 100%;
    min-height: 30px;
    padding: 6px 8px;
    overflow: hidden;
    color: #cbd5e1;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 10px;
    font-weight: 850;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.global-call-card__device > span button:hover,
.global-call-card__device > span button.is-active {
    color: #04110b;
    background: linear-gradient(135deg, #6ff69e, #b6ffd0);
}

.global-call-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-call-card__button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #eef6ff;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 16px;
    background: rgba(15, 23, 42, .72);
    box-shadow: none;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
}

.global-call-card__button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.global-call-card.is-active-call .global-call-card__button--accept {
    display: none;
}

.global-call-card__button--accept {
    color: #04110b;
    border-color: rgba(113, 245, 168, .72);
    background: linear-gradient(135deg, #5ce58f, #97ffc0);
}

.global-call-card__button--end,
.global-call-card__button--mute.is-muted {
    color: #ffd7d7;
    border-color: rgba(248, 113, 113, .48);
    background: rgba(127, 29, 29, .46);
}

.global-call-card__button--end svg {
    transform: rotate(132deg);
}

.global-call-card.is-ringing .global-call-card__avatar {
    animation: chat-call-pulse 1.15s ease-in-out infinite;
}

body[data-theme="light"] .global-call-card {
    color: #111827;
    border-color: rgba(16, 185, 129, .24);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 18px 52px rgba(15, 23, 42, .18);
}

body[data-theme="light"] .global-call-card__body strong {
    color: #111827;
}

body[data-theme="light"] .global-call-card__body b,
body[data-theme="light"] .global-call-card__body small {
    color: #526173;
}

body[data-theme="light"] .global-call-card__button {
    color: #334155;
    border-color: rgba(148, 163, 184, .32);
    background: #f8fafc;
}

body[data-theme="light"] .global-call-card__device,
body[data-theme="light"] .global-call-card__device > button {
    color: #334155;
}

body[data-theme="light"] .global-call-card__device > button {
    border-color: rgba(148, 163, 184, .3);
    background: #f8fafc;
}

body[data-theme="light"] .global-call-card__device > span {
    border-color: rgba(148, 163, 184, .26);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .16);
}

body[data-theme="light"] .global-call-card__device > span button {
    color: #475569;
}

body[data-theme="light"] .global-call-card__button--accept {
    color: #052e16;
    border-color: rgba(16, 185, 129, .28);
    background: #86efac;
}

body[data-theme="light"] .global-call-card__button--end,
body[data-theme="light"] .global-call-card__button--mute.is-muted {
    color: #b42318;
    border-color: rgba(248, 113, 113, .34);
    background: #fff1f0;
}

@media (max-width: 760px) {
    .global-call-card {
        right: 10px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        left: 10px;
        width: auto;
        grid-template-columns: 34px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 7px;
        border-radius: 15px;
    }

    body.is-modal-open .global-call-card {
        top: calc(10px + env(safe-area-inset-top));
        bottom: auto;
    }

    .global-call-card__avatar {
        width: 34px;
        height: 34px;
        border-radius: 11px;
    }

    .global-call-card__body strong {
        font-size: 11px;
    }

    .global-call-card__body b,
    .global-call-card__body small {
        font-size: 9px;
    }

    .global-call-card__device {
        width: min(210px, 100%);
    }

    .global-call-card__device > button {
        height: 26px;
        font-size: 9px;
    }

    .global-call-card__actions {
        gap: 6px;
    }

    .global-call-card__button {
        width: 36px;
        height: 36px;
        border-radius: 13px;
    }

    .global-call-card__button svg {
        width: 18px;
        height: 18px;
    }
}
