/* Desktop-only presentation skin. Existing IDs, row factory and event owners stay unchanged.
   Theme activation shares the existing per-account composer choice.
   Contact artwork windows use the measured source bands (972 x 1619); nth-child cycles forever.
   Decoration never intercepts actions. The default theme has no matching selectors. */
@media (min-width: 721px) {
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar {
    padding: 9px 10px 18px;
    gap: 9px;
    background: linear-gradient(180deg, rgba(2,5,24,.85), rgba(10,10,43,.93)), url("assets/composer/wallpaper-extension.png") center top / 680px auto repeat-y;
    border-right-color: #263253;
    scrollbar-color: #45416a #05091f;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar-section {
    gap: 5px;
    flex-shrink: 0;
    min-width: 0;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar-section-head {
    position: relative;
    min-height: 44px;
    gap: 6px;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar-section-head h2 {
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    min-width: 0;
    max-width: calc(100% - var(--neon-head-actions) - 6px);
    margin: 0;
    padding: 5px 6px 7px 10px;
    font: 800 calc(19px * var(--sidebar-elements-scale))/1.15 system-ui, sans-serif;
    /* Keep the complete label beside its original actions at narrow/high-scale sizes. */
    font-size: min(calc(19px * var(--sidebar-elements-scale)), calc((100cqw - var(--neon-head-actions) - 28px) / var(--neon-heading-units)));
    letter-spacing: .025em;
    white-space: nowrap;
    background: linear-gradient(90deg, #d8faff, #fff 45%, #e9d0ff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 7px #146ad980, 0 0 11px #6720a670;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar-section-head:has(h2) {
    container-type: inline-size;
    --neon-head-actions: calc(43px * var(--sidebar-elements-scale));
    --neon-heading-units: 9.4;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar-section-head:has(#create-group-button) {
    --neon-head-actions: calc(129px * var(--sidebar-elements-scale) + 16px);
    --neon-heading-units: 6.4;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar-section-head:has(#contact-search-button) {
    --neon-head-actions: calc(86px * var(--sidebar-elements-scale) + 8px);
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar-section-head:has(h2)::before {
    content: "";
    position: absolute;
    pointer-events: none;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(calc(100% - var(--neon-head-actions) - 12px), calc(300px * var(--sidebar-elements-scale)));
    background: url("assets/sidebar/section-heading.svg") left center / 100% 100% no-repeat;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar-section-head:has(h2)::after {
    content: "";
    position: absolute;
    left: calc(14px * var(--sidebar-elements-scale));
    bottom: 14.634%;
    width: calc(54px * var(--sidebar-elements-scale));
    height: 1.3px;
    background: #53eaff;
    box-shadow: 0 0 4px #00bfff99;
    pointer-events: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar-section-head h2::before,
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar-section-head h2::after {
    content: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar-section-actions {
    gap: 8px;
    flex-shrink: 0;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar :is(.icon-button, .section-toggle) {
    position: relative;
    width: calc(43px * var(--sidebar-elements-scale));
    height: calc(43px * var(--sidebar-elements-scale));
    min-width: calc(43px * var(--sidebar-elements-scale));
    border-radius: 50%;
    padding: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #a0eaff;
    border: 1px solid #24a7d6;
    background: radial-gradient(circle at 35% 15%, #123359, #030b24 68%);
    box-shadow: inset 0 1px 2px #86dfff, 0 0 8px #0072b84d;
    animation: none;
    transform: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar :is(.icon-button, .section-toggle)::before,
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar :is(.icon-button, .section-toggle)::after {
    pointer-events: none;
    animation: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar :is(.icon-button, .section-toggle) svg {
    width: 25px;
    height: 25px;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar :is(#create-group-button, #contact-search-button) {
    border-color: #be46f3;
    color: #f5c9ff;
    background: radial-gradient(circle at 30% 20%, #49104d, #110427 72%);
    box-shadow: inset 0 1px 2px #f2bcff, 0 0 9px #d631df40;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar :is(.icon-button, .section-toggle):hover {
    filter: brightness(1.22);
    transform: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .section-toggle.is-collapsed {
    transform: rotate(-90deg);
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar :is(button, li):focus-visible {
    outline: 2px solid #b5efff;
    outline-offset: 2px;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar :is(.profile-trigger, .logout-button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 4px 12px;
    font: 800 14px/1.2 system-ui, sans-serif;
    letter-spacing: .03em;
    text-transform: uppercase;
    border: 1px solid #2bdbff;
    color: #d5f8ff;
    background: linear-gradient(110deg, #043754, #07184a);
    box-shadow: inset 0 0 0 2px #02102e, 0 0 10px #00a4f14d;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .logout-button {
    border-color: #ed5ce7;
    color: #f4a8f5;
    background: linear-gradient(110deg, #260a35, #3d0844);
    box-shadow: inset 0 0 0 2px #19041f, 0 0 10px #d824c83d;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .profile-trigger::before {
    content: "";
    width: 15px;
    height: 15px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2388edff'%3E%3Ccircle cx='10' cy='5.5' r='4'/%3E%3Cpath d='M2 19v-3a8 7 0 0 1 16 0v3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .logout-button::before {
    content: "";
    width: 15px;
    height: 15px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23ef92ef' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H3v14h5M8 10h10m-4-4 4 4-4 4'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list {
    position: relative;
    isolation: isolate;
    margin: 0;
    padding: 2px 0 calc(16px * var(--sidebar-elements-scale));
    gap: 2px;
    overflow: visible;
    scrollbar-gutter: auto;
    border: 8px solid transparent;
    border-image: url("assets/sidebar/list-frame.svg?v=20261016_200715") 20 / 8px / 0 stretch;
    border-radius: 10px;
    background: linear-gradient(120deg, #0b0c2d, #060a22 65%, #0c092b);
    box-shadow: 0 0 9px #682eaa26;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list li {
    --neon-row-tint: color-mix(in srgb, var(--item-accent-color, #6e72c9) 11%, #111a38);
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    min-height: calc(48px * var(--sidebar-elements-scale));
    padding: calc(2px * var(--sidebar-elements-scale)) calc(5px * var(--sidebar-elements-scale));
    gap: calc(8px * var(--sidebar-elements-scale));
    border-radius: 9px;
    border-color: transparent !important;
    background: linear-gradient(105deg, var(--neon-row-tint), #0b112d 68%, #110e2c) !important;
    text-shadow: none;
    font: 700 calc(15.5px * var(--sidebar-elements-scale))/1.25 system-ui, sans-serif;
    letter-spacing: 0;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list li::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(110deg, color-mix(in srgb, var(--neon-row-tint), white 3%), #0c1230);
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list li::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    border: 1px solid color-mix(in srgb, var(--item-accent-color, #6e72c9) 25%, #34264d);
    box-shadow: inset 0 1px 0 #d6c6ff14;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list li.is-clickable:hover {
    transform: none;
    filter: brightness(1.16);
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list li.is-active::after {
    border-color: #3ba8d28c;
    border-left-width: 2px;
    box-shadow: inset 0 0 8px #0e8bb314;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list li.is-active .user-name {
    text-decoration: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-avatar {
    box-sizing: border-box;
    position: relative;
    z-index: 3;
    width: calc(var(--neon-avatar-size, 45px) * var(--sidebar-elements-scale));
    height: calc(var(--neon-avatar-size, 45px) * var(--sidebar-elements-scale));
    border-width: 1.5px;
    box-shadow: 0 0 4px 1px color-mix(in srgb, var(--avatar-border) 12%, transparent);
    object-fit: cover;
    margin: calc(-5px * var(--sidebar-elements-scale)) calc(4px * var(--sidebar-elements-scale)) calc(-5px * var(--sidebar-elements-scale)) calc(10px * var(--sidebar-elements-scale));
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-main {
    min-width: 0;
    gap: 2px;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-name-row {
    gap: 5px;
    min-width: 0;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 750;
    letter-spacing: 0;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-preview-text {
    font-size: calc(13px * var(--sidebar-elements-scale));
    line-height: 1.2;
    color: #d6d9ea;
    font-weight: 400;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-preview-text.user-substatus--noncontact {
    color: #fca5a5;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-preview-time {
    font-size: calc(12px * var(--sidebar-elements-scale));
    color: #fff;
    font-weight: 600;
    background: #02051bd9;
    border-radius: 2px;
    box-shadow: 0 0 4px 2px #02051bd9;
    text-shadow: 0 1px 2px #000;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-unread {
    position: relative;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: calc(24px * var(--sidebar-elements-scale));
    height: calc(24px * var(--sidebar-elements-scale));
    min-width: 0;
    padding: 0;
    border-radius: 50%;
    font: 850 calc(13px * var(--sidebar-elements-scale))/1 system-ui, sans-serif;
    color: #02030a;
    background:
      radial-gradient(ellipse 75% 40% at 35% 15%, #fff, #ffffffbb 30%, #ffffff00 80%),
      linear-gradient(165deg, color-mix(in srgb, var(--item-accent-color) 45%, white), color-mix(in srgb, var(--item-accent-color) 50%, white) 48%, color-mix(in srgb, var(--item-accent-color) 65%, white) 73%, color-mix(in srgb, var(--item-accent-color) 82%, #010921));
    border: 1px solid color-mix(in srgb, var(--item-accent-color) 35%, white);
    box-shadow: inset 0 1px 1px #fff, inset 0 -2px 3px #00000045, 0 0 0 1px #020416, 0 0 9px 1px color-mix(in srgb, var(--item-accent-color) 70%, transparent);
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-unread::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 12px 2px color-mix(in srgb, var(--item-accent-color) 70%, transparent);
    opacity: .35;
    animation: sidebar-unread-bloom 3.8s ease-in-out infinite;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #users-list li::before,
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #direct-list li::before,
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #online-users-list li::before {
    background-image: linear-gradient(90deg, var(--neon-row-tint) 0%, color-mix(in srgb, var(--neon-row-tint) 91%, transparent) 42%, #0b112d40 76%, transparent), url("assets/sidebar/contact-wallpapers.png");
    background-size: 100% 100%, auto var(--wall-size, 1065.13%);
    background-position: 0 0, right var(--wall-y, 0%);
    background-repeat: no-repeat;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #users-list li:nth-child(10n+1),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #direct-list li:nth-child(10n+1),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #online-users-list li:nth-child(10n+1) {
    --wall-size: 1065.1316%;
    --wall-y: 0%;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #users-list li:nth-child(10n+2),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #direct-list li:nth-child(10n+2),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #online-users-list li:nth-child(10n+2) {
    --wall-size: 1093.9189%;
    --wall-y: 10.3331%;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #users-list li:nth-child(10n+3),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #direct-list li:nth-child(10n+3),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #online-users-list li:nth-child(10n+3) {
    --wall-size: 1086.5772%;
    --wall-y: 20.4082%;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #users-list li:nth-child(10n+4),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #direct-list li:nth-child(10n+4),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #online-users-list li:nth-child(10n+4) {
    --wall-size: 1079.3333%;
    --wall-y: 30.5650%;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #users-list li:nth-child(10n+5),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #direct-list li:nth-child(10n+5),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #online-users-list li:nth-child(10n+5) {
    --wall-size: 1086.5772%;
    --wall-y: 40.7483%;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #users-list li:nth-child(10n+6),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #direct-list li:nth-child(10n+6),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #online-users-list li:nth-child(10n+6) {
    --wall-size: 1079.3333%;
    --wall-y: 50.9190%;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #users-list li:nth-child(10n+7),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #direct-list li:nth-child(10n+7),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #online-users-list li:nth-child(10n+7) {
    --wall-size: 1086.5772%;
    --wall-y: 61.0884%;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #users-list li:nth-child(10n+8),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #direct-list li:nth-child(10n+8),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #online-users-list li:nth-child(10n+8) {
    --wall-size: 1079.3333%;
    --wall-y: 71.2730%;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #users-list li:nth-child(10n+9),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #direct-list li:nth-child(10n+9),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #online-users-list li:nth-child(10n+9) {
    --wall-size: 1079.3333%;
    --wall-y: 81.4840%;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #users-list li:nth-child(10n),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #direct-list li:nth-child(10n),
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #online-users-list li:nth-child(10n) {
    --wall-size: 595.2206%;
    --wall-y: 100%;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #users-list li .user-main {
    max-width: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-status {
    flex: 0 0 auto;
    margin-right: 3px;
    box-shadow: 0 0 4px #8791ae66;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-status.is-online {
    box-shadow: 0 0 7px #16ec6c99;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list li.direct-dialog-item {
    padding-right: calc(31px * var(--sidebar-elements-scale));
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .chat-room-requests-trigger {
    padding: 3px 6px;
    gap: 4px;
    box-shadow: 0 0 7px #f8717140;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .chat-room-requests-label {
    font-size: 10px;
    letter-spacing: 0;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .chat-room-requests-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #self-user {
    flex: 0 0 auto;
    min-height: calc(64px * var(--sidebar-elements-scale) + 24px);
    border: 0;
    border-radius: 14px;
    padding: 8px;
    background: transparent;
    box-shadow: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #self-user li {
    --neon-avatar-size: 64px;
    flex: 0 0 auto;
    min-height: calc(64px * var(--sidebar-elements-scale) + 8px);
    padding: 0 5px;
    background: transparent !important;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #self-user li::before,
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #self-user li::after {
    content: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #self-user li::before {
    content: "";
    inset: -8px;
    border-radius: 14px;
    background: url("assets/sidebar/profile-wallpaper.png") right center / cover no-repeat, #040a22;
    /* Interior uses the same normalized corner geometry as self-frame.svg. */
    clip-path: polygon(4.2% 2.3%, 94.8% 2.3%, 96.8% 4.1%, 98.2% 9%, 99.1% 16.8%, 99.5% 27.3%, 99.5% 72.7%, 99.1% 83.5%, 98.2% 91.3%, 96.7% 96%, 94.8% 97.7%, 4.2% 97.7%, .5% 79.5%, .5% 22%);
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #self-user .user-avatar {
    width: calc(64px * var(--sidebar-elements-scale));
    height: calc(64px * var(--sidebar-elements-scale));
    border-width: 2px;
    margin: 0 calc(7px * var(--sidebar-elements-scale)) 0 calc(4px * var(--sidebar-elements-scale));
    /* Thin hot edge and local bloom retain the user's color without a solid outer tube. */
    box-shadow:
      0 0 0 .65px color-mix(in srgb, var(--avatar-border) 30%, white 70%),
      0 0 2px 1.25px var(--avatar-border),
      0 0 7px 1.5px color-mix(in srgb, var(--avatar-border) 75%, transparent),
      0 0 16px 2px color-mix(in srgb, var(--avatar-border) 30%, transparent);
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #self-user .user-name {
    font-size: calc(18px * var(--sidebar-elements-scale));
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #self-user .user-tag {
    padding: 1px 5px;
    border-color: #3987fa;
    background: #0c2057;
    font-size: 9px;
    letter-spacing: 0;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar li.users-empty {
    min-height: 38px;
    padding: 9px;
    color: #b1bdd9;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar li.users-empty::before {
    background-image: none !important;
  }
}

/* Reference avatar oboyma: user-owned colors, base contacts, larger groups, largest self. */
@media (min-width: 721px) {
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list li.chat-room-item {
    --neon-avatar-size: 49px;
    min-height: calc(52px * var(--sidebar-elements-scale));
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-main::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(2px * var(--sidebar-elements-scale));
    width: calc(var(--neon-avatar-size, 45px) * .55 * var(--sidebar-elements-scale));
    background: linear-gradient(90deg, color-mix(in srgb, var(--item-accent-color), white 12%), var(--item-accent-color));
    -webkit-mask: url("assets/sidebar/avatar-cuff.svg?v=20261016_200715") center / 100% 100% no-repeat;
    mask: url("assets/sidebar/avatar-cuff.svg?v=20261016_200715") center / 100% 100% no-repeat;
    filter: drop-shadow(0 0 2px var(--item-accent-15));
    pointer-events: none;
    z-index: 1;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list li:first-child .user-main::before {
    top: calc(2px * var(--sidebar-elements-scale));
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list li:last-child .user-main::before {
    bottom: calc(2px * var(--sidebar-elements-scale));
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #self-user .user-main::before {
    content: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #self-user li::after {
    content: "";
    display: block;
    z-index: 2;
    inset: -8px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background-color: var(--item-accent-color);
    background-image: linear-gradient(90deg, transparent 0% 42%, #008eff88 72%, #a935ed 100%);
    -webkit-mask: url("assets/sidebar/self-frame.svg?v=20261016_185146") center / 100% 100% no-repeat;
    mask: url("assets/sidebar/self-frame.svg?v=20261016_185146") center / 100% 100% no-repeat;
    filter: drop-shadow(0 0 3px var(--item-accent-15));
    pointer-events: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list:not(#self-user)::after {
    content: "";
    position: absolute;
    inset: -2px;
    border: 8px solid transparent;
    border-image: url("assets/sidebar/corner-glints.svg") 20 / 8px / 0 stretch;
    pointer-events: none;
    z-index: 4;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .users-list:not(#self-user)::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(20px * var(--sidebar-elements-scale));
    background: url("assets/sidebar/list-footer.svg") center / 100% 100% no-repeat;
    pointer-events: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar :is(.icon-button, .section-toggle, .profile-trigger, .logout-button)::after {
    content: "";
    position: absolute;
    inset: -1px;
    border: 1px solid currentColor;
    border-radius: inherit;
    background: transparent;
    box-shadow: 0 0 10px 2px currentColor, inset 0 0 4px currentColor;
    opacity: .28;
    pointer-events: none;
    animation: sidebar-idle-glow 4.8s ease-in-out infinite;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar :is(.profile-trigger, .logout-button) {
    position: relative;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .sidebar-section-actions > :nth-child(2)::after {
    animation-delay: -1.6s;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .logout-button::after {
    animation-delay: -2.4s;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #profile-button::after {
    inset: -1px -95px -6px -1px;
    border: 0;
    border-radius: 0;
    background: url("assets/sidebar/profile-trail.svg") right bottom / 95px 18px no-repeat;
    box-shadow: none;
    opacity: .7;
    animation: sidebar-profile-trail 4.8s ease-in-out infinite;
  }
}
@keyframes sidebar-idle-glow {
  0%, 100% { opacity: .18; transform: scale(1); }
  50% { opacity: .48; transform: scale(1.035); }
}
@keyframes sidebar-unread-bloom {
  0%, 100% { opacity: .35; }
  50% { opacity: .85; }
}
@keyframes sidebar-profile-trail {
  0%, 100% { opacity: .55; }
  50% { opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar .user-unread::after {
    animation: none;
    opacity: .55;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar :is(.icon-button, .section-toggle, .profile-trigger, .logout-button)::after {
    animation: none;
    opacity: .25;
    transform: none;
  }
  #chat-screen:has(#message-form[data-composer-theme="neon-space"]) .sidebar #profile-button::after {
    animation: none;
    opacity: .75;
  }
}


