body.theme-style-active {
  --theme-engine-border: color-mix(in srgb, var(--theme-edge) 56%, transparent);
  --theme-engine-border-soft: color-mix(in srgb, var(--theme-edge) 24%, transparent);
  --theme-engine-accent-border: color-mix(in srgb, var(--theme-accent-strong) 48%, transparent);
  --theme-engine-text-glow: 0 0 12px color-mix(in srgb, var(--theme-glow) 64%, transparent);
  --theme-engine-panel-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--theme-accent-strong) 16%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 12px var(--theme-ui-depth) rgba(0, 0, 0, 0.32),
    0 0 24px color-mix(in srgb, var(--theme-glow) 42%, transparent);
  --theme-engine-line-art:
    linear-gradient(90deg, color-mix(in srgb, var(--theme-edge) 14%, transparent) 0 1px, transparent 1px 42px),
    linear-gradient(180deg, color-mix(in srgb, var(--theme-secondary) 10%, transparent) 0 1px, transparent 1px 42px);
  background:
    radial-gradient(circle at 14% 12%, color-mix(in srgb, var(--theme-accent-strong) 18%, transparent), transparent 30rem),
    radial-gradient(circle at 86% 78%, color-mix(in srgb, var(--theme-edge) 14%, transparent), transparent 34rem),
    linear-gradient(180deg, color-mix(in srgb, var(--theme-screen-dim) 88%, #050711), #03040a);
}

body.theme-style-active::before,
body.theme-style-active::after {
  display: none;
}

body.theme-style-active .app-shell,
body.theme-style-active .settings-overlay {
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--theme-accent-strong) 13%, transparent), transparent 30rem),
    radial-gradient(circle at 80% 22%, color-mix(in srgb, var(--theme-edge) 10%, transparent), transparent 34rem),
    linear-gradient(180deg, color-mix(in srgb, var(--theme-screen-dim) 68%, transparent), color-mix(in srgb, var(--theme-screen-dim) 86%, rgba(0, 0, 0, 0.4)));
}

body.theme-style-active .settings-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 240 !important;
}

body.theme-style-active .app-shell::before,
body.theme-style-active .settings-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--theme-fx-opacity);
  background:
    var(--theme-asset-particles),
    var(--theme-asset-overlay),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), color-mix(in srgb, var(--theme-screen-dim) 34%, rgba(0, 0, 0, 0.34))),
    var(--theme-asset-background),
    var(--theme-engine-line-art),
    radial-gradient(circle at 50% 8%, color-mix(in srgb, var(--theme-accent-strong) 16%, transparent), transparent 28rem),
    linear-gradient(120deg, transparent 0 34%, color-mix(in srgb, var(--theme-edge) 9%, transparent) 45%, transparent 56%);
  background-position: center, center, center, center, 0 0, center, center;
  background-size: cover, cover, cover, cover, auto, auto, auto;
  animation: themeTextureDrift var(--theme-ambient-speed) linear infinite;
}

body.theme-style-active .app-shell::after,
body.theme-style-active .settings-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.24)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 22%, rgba(0, 0, 0, 0.34));
}

body.theme-style-active :is(.titlebar, .workspace, .settings-shell) {
  position: relative;
  z-index: 2;
}

body.theme-style-active .titlebar {
  z-index: 60;
}

body.theme-style-active .settings-shell {
  z-index: 245 !important;
}

body.theme-style-active :is(.window-actions, .window-actions > *, #topInfoButton, #notificationCenterButton, #topSettingsButton, #topUserButton, #logoutButton, .rail-item, .settings-nav-item, .settings-close) {
  position: relative;
  z-index: 260;
  pointer-events: auto;
}

body.theme-style-active :is(.app-shell, .settings-overlay)::before,
body.theme-style-active :is(.app-shell, .settings-overlay)::after,
body.theme-style-active :is(.titlebar, .room-header, .server-switcher)::after,
body.theme-style-active :is(.main-panel, .info-panel, .channels-panel)::before {
  pointer-events: none !important;
}

body.theme-style-active .workspace {
  overflow: hidden;
}

body.theme-style-active .workspace::before,
body.theme-style-active .workspace::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: calc(var(--theme-fx-opacity) * 0.64);
  mix-blend-mode: screen;
}

body.theme-style-active .workspace::before {
  background:
    var(--theme-engine-line-art),
    radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--theme-accent-strong) 15%, transparent), transparent 24rem);
  animation: themeGridFlow 14s linear infinite;
}

body.theme-style-active .workspace::after {
  opacity: calc(var(--theme-fx-opacity) * 0.42);
  background:
    var(--theme-asset-character),
    linear-gradient(108deg, transparent 0 40%, color-mix(in srgb, var(--theme-edge) 16%, transparent) 45%, transparent 53%),
    radial-gradient(circle at 82% 74%, color-mix(in srgb, var(--theme-secondary) 18%, transparent), transparent 26rem);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: right 4% bottom -1rem, center, center;
  background-size: min(36vw, 560px) auto, auto, auto;
  animation: themeSweep 8s ease-in-out infinite;
}

body.theme-style-active .workspace > * {
  position: relative;
  z-index: 1;
}

body.theme-style-active[data-theme-ui] :is(
  .titlebar,
  .app-sidebar,
  .channels-panel,
  .main-panel,
  .info-panel,
  .settings-shell,
  .settings-nav,
  .settings-card,
  .server-switcher,
  .room-header,
  .message-form,
  .message-tools,
  .server-modal,
  .hub-panel,
  .live-card,
  .hub-live-card,
  .ai-main-card,
  .ai-preview-panel,
  .plugin-card,
  .activity-feed-item,
  .notification-center-item,
  .friend-row,
  .friend-form,
  .server-row,
  .sidebar-server-row > button:first-child,
  .theme-card,
  .theme-search,
  .theme-sort,
  .theme-favorites,
  .settings-input,
  .settings-select,
  .settings-textarea,
  .global-search
) {
  border-width: var(--theme-ui-border);
  border-style: solid;
  border-color: var(--theme-engine-border);
  border-radius: var(--theme-ui-radius);
  clip-path: var(--theme-panel-clip);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--theme-surface-strong) 88%, rgba(255, 255, 255, 0.035)), color-mix(in srgb, var(--theme-surface) 92%, rgba(0, 0, 0, 0.56))),
    var(--theme-surface);
  box-shadow: var(--theme-engine-panel-shadow);
  backdrop-filter: none;
}

body.theme-style-active[data-theme-ui] :is(
  .app-sidebar,
  .channels-panel,
  .main-panel,
  .info-panel,
  .settings-shell,
  .settings-card,
  .server-switcher,
  .room-header,
  .message-form,
  .message-tools,
  .hub-panel,
  .hub-live-card,
  .theme-card,
  .ai-main-card,
  .ai-preview-panel
) {
  position: relative;
  overflow: hidden;
}

body.theme-style-active[data-theme-ui] :is(
  .app-sidebar,
  .channels-panel,
  .main-panel,
  .info-panel,
  .settings-shell,
  .settings-card,
  .server-switcher,
  .room-header,
  .message-form,
  .message-tools,
  .hub-panel,
  .hub-live-card,
  .theme-card,
  .ai-main-card,
  .ai-preview-panel
)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: calc(var(--theme-fx-opacity) * 0.32);
  background:
    linear-gradient(112deg, transparent 0 36%, color-mix(in srgb, var(--theme-edge) 18%, transparent) 45%, transparent 54%),
    radial-gradient(circle at 18% 0, color-mix(in srgb, var(--theme-accent-strong) 12%, transparent), transparent 14rem);
}

body.theme-style-active[data-theme-ui] :is(
  .app-sidebar,
  .channels-panel,
  .main-panel,
  .info-panel,
  .settings-shell,
  .settings-card,
  .server-switcher,
  .room-header,
  .message-form,
  .message-tools,
  .hub-panel,
  .hub-live-card,
  .theme-card,
  .ai-main-card,
  .ai-preview-panel
) > * {
  position: relative;
  z-index: 1;
}

body.theme-style-active[data-theme-ui] :is(
  .titlebar,
  .room-header,
  .settings-header,
  .server-switcher,
  .message-form,
  .message-tools,
  .settings-card,
  .hub-panel,
  .hub-live-card,
  .theme-card,
  .ai-main-card,
  .ai-preview-panel
)::after {
  border-color: var(--theme-engine-accent-border);
  border-radius: inherit;
  clip-path: inherit;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--theme-edge) 24%, transparent), transparent 18%, transparent 82%, color-mix(in srgb, var(--theme-accent-strong) 22%, transparent)),
    linear-gradient(180deg, color-mix(in srgb, var(--theme-edge) 14%, transparent), transparent 18%, transparent 84%, color-mix(in srgb, var(--theme-accent-strong) 16%, transparent));
  opacity: 0.24;
}

body.theme-style-active[data-theme-ui] .message-list {
  background:
    radial-gradient(circle at 50% 0, color-mix(in srgb, var(--theme-edge) 10%, transparent), transparent 30rem),
    linear-gradient(180deg, color-mix(in srgb, var(--theme-surface) 70%, transparent), color-mix(in srgb, var(--theme-surface-strong) 78%, transparent));
  box-shadow:
    inset 0 0 0 1px var(--theme-engine-border-soft),
    inset 0 0 38px rgba(0, 0, 0, 0.22);
}

body.theme-style-active[data-theme-ui] .message-list::before {
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--theme-accent-strong) 16%, transparent) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 42%, color-mix(in srgb, var(--theme-edge) 18%, transparent) 0 1px, transparent 2px);
  background-size: 160px 160px, 240px 240px;
  opacity: calc(var(--theme-fx-opacity) * 0.58);
}

body.theme-style-active[data-theme-ui] .message-list::after,
body.theme-style-active[data-theme-ui] .message-embed::after {
  background:
    radial-gradient(circle at 52% 18%, color-mix(in srgb, var(--theme-edge) 9%, transparent), transparent 20rem),
    linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.26)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.28));
}

body.theme-style-active[data-theme-ui] .message {
  border-radius: calc(var(--theme-ui-radius) + 4px);
  background: linear-gradient(90deg, color-mix(in srgb, var(--theme-surface-soft) 86%, transparent), transparent 88%);
}

body.theme-style-active[data-theme-ui] .message-embed {
  border-color: color-mix(in srgb, var(--embed-color) 36%, var(--theme-edge));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--theme-surface-strong) 72%, rgba(0, 0, 0, 0.36)), color-mix(in srgb, var(--theme-surface) 84%, rgba(0, 0, 0, 0.64)));
}

body.theme-style-active[data-theme-ui] .message-embed::before {
  opacity: calc(var(--theme-fx-opacity) * 0.32);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--embed-color) 15%, transparent), transparent 36%),
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--theme-edge) 7%, transparent) 0 1px, transparent 1px 16px);
}

body.theme-style-active[data-theme-ui] :is(
  .invite-button,
  .send-button,
  .small-action,
  .control-button,
  .theme-preview-button,
  .message-tools button,
  .soundboard-chip,
  .hub-tab,
  .hub-platform,
  .settings-nav-item,
  .channel-button,
  .rail-item,
  .icon-button,
  .window-button
) {
  border-color: var(--theme-engine-border);
  border-radius: calc(var(--theme-ui-radius) + 2px);
  clip-path: var(--theme-button-clip);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-surface-strong) 78%, transparent), color-mix(in srgb, var(--theme-accent-strong) 16%, transparent));
  text-shadow: var(--theme-engine-text-glow);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--theme-accent-strong) 12%, transparent),
    0 0 14px color-mix(in srgb, var(--theme-glow) 32%, transparent);
}

body.theme-style-active[data-theme-ui] :is(
  .rail-item.active,
  .settings-nav-item.active,
  .channel-button.active,
  .hub-tab.active,
  .hub-platform.active,
  .theme-preview-button.selected
) {
  border-color: color-mix(in srgb, var(--theme-accent-strong) 76%, transparent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--theme-accent-strong) 34%, transparent), color-mix(in srgb, var(--theme-edge) 24%, transparent)),
    var(--theme-surface-soft);
  box-shadow:
    inset 0 0 22px color-mix(in srgb, var(--theme-edge) 22%, transparent),
    0 0 18px color-mix(in srgb, var(--theme-glow) 78%, transparent);
}

body.theme-style-active[data-theme-ui] :is(
  .rail-icon,
  .server-emblem,
  .avatar,
  .theme-card-icon,
  .notification-center-item > span,
  .plugin-card > span,
  .ai-feature-icon,
  .server-icon
) {
  border-radius: var(--theme-ui-icon-radius);
  box-shadow:
    inset 0 0 0 1px var(--theme-engine-border),
    0 0 18px color-mix(in srgb, var(--theme-glow) 56%, transparent);
}

body.theme-style-active[data-theme-ui] :is(h1, h2, h3, .room-title-row h1, .panel-heading, .section-title, .folder-title, .settings-subtitle, .theme-card-body strong, .message-meta strong) {
  font-family: var(--theme-display-font);
  color: color-mix(in srgb, var(--theme-accent-strong) 64%, #fff);
  text-shadow: var(--theme-engine-text-glow);
}

body.theme-style-active[data-theme-ui] :is(.settings-input, .settings-select, .settings-textarea, .message-form input, .global-search, .theme-search input, .theme-sort) {
  color: var(--text);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-surface-strong) 84%, rgba(0, 0, 0, 0.5)), color-mix(in srgb, var(--theme-surface) 88%, rgba(0, 0, 0, 0.46)));
}

body.theme-style-active[data-theme-ui] .theme-card-preview {
  border-color: var(--theme-engine-border);
  opacity: 1;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--theme-edge) 42%, transparent),
    0 0 18px color-mix(in srgb, var(--theme-glow) 44%, transparent);
}

body.theme-style-active[data-theme-ui="hologram"],
body.theme-style-active[data-theme-ui="celestial"] {
  --theme-engine-line-art:
    linear-gradient(90deg, color-mix(in srgb, var(--theme-edge) 22%, transparent) 0 1px, transparent 1px 38px),
    linear-gradient(180deg, color-mix(in srgb, var(--theme-accent-strong) 14%, transparent) 0 1px, transparent 1px 38px);
}

body.theme-style-active[data-theme-ui="hologram"] :is(.titlebar, .room-header, .server-switcher, .message-form, .settings-card, .hub-panel, .theme-card, .ai-main-card, .ai-preview-panel)::after {
  opacity: 0.48;
  background:
    linear-gradient(90deg, var(--theme-edge), transparent 18%, transparent 82%, var(--theme-accent-strong)),
    repeating-linear-gradient(180deg, color-mix(in srgb, var(--theme-accent-strong) 10%, transparent) 0 1px, transparent 1px 9px);
  animation: themeHoloBlink 5.2s steps(5, end) infinite;
}

body.theme-style-active[data-theme-ui="gothic"] {
  --theme-engine-line-art:
    repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 17px),
    radial-gradient(circle at 76% 18%, color-mix(in srgb, var(--theme-accent-strong) 11%, transparent), transparent 18rem);
}

body.theme-style-active[data-theme-ui="gothic"] :is(.titlebar, .app-sidebar, .channels-panel, .main-panel, .info-panel, .settings-shell, .settings-card, .server-switcher, .room-header, .message-form, .message-tools, .hub-panel, .theme-card, .ai-main-card, .ai-preview-panel) {
  background:
    repeating-linear-gradient(125deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 13px),
    linear-gradient(160deg, color-mix(in srgb, var(--theme-surface-strong) 96%, rgba(48, 10, 8, 0.26)), rgba(0, 0, 0, 0.86));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--theme-accent-strong) 18%, transparent),
    inset 0 0 42px rgba(0, 0, 0, 0.42),
    0 0 24px color-mix(in srgb, var(--theme-glow) 42%, transparent);
}

body.theme-style-active[data-theme-ui="tactical"] {
  --theme-engine-line-art:
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--theme-edge) 12%, transparent) 0 2px, transparent 2px 28px),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--theme-secondary) 8%, transparent) 0 1px, transparent 1px 28px);
}

body.theme-style-active[data-theme-ui="tactical"] :is(.titlebar, .app-sidebar, .channels-panel, .main-panel, .info-panel, .settings-shell, .settings-card, .server-switcher, .room-header, .message-form, .message-tools, .hub-panel, .theme-card, .ai-main-card, .ai-preview-panel) {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 12px),
    linear-gradient(145deg, color-mix(in srgb, var(--theme-surface-strong) 94%, rgba(54, 58, 44, 0.18)), rgba(0, 0, 0, 0.86));
}

body.theme-style-active[data-theme-ui="anime"] .message-list::after,
body.theme-style-active[data-theme-ui="celestial"] .message-list::after,
body.theme-style-active[data-theme-ui="anime"] .settings-overlay::after,
body.theme-style-active[data-theme-ui="celestial"] .settings-overlay::after {
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--theme-accent-strong) 16%, transparent) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 42%, color-mix(in srgb, var(--theme-edge) 18%, transparent) 0 1px, transparent 2px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.34));
  background-size: 160px 160px, 240px 240px, auto;
}

body.theme-style-active[data-theme-ui="liquid"] .app-shell::after,
body.theme-style-active[data-theme-ui="glass"] .app-shell::after {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.11), transparent 28%, rgba(255, 255, 255, 0.07) 52%, transparent 76%),
    radial-gradient(circle at 18% 14%, color-mix(in srgb, var(--theme-edge) 14%, transparent), transparent 24rem),
    color-mix(in srgb, var(--theme-screen-dim) 52%, transparent);
}

body.theme-style-active[data-theme-ui="ornate"] :is(.titlebar, .app-sidebar, .channels-panel, .main-panel, .info-panel, .settings-shell, .settings-card, .server-switcher, .room-header, .message-form, .message-tools, .hub-panel, .theme-card, .ai-main-card, .ai-preview-panel),
body.theme-style-active[data-theme-ui="antique"] :is(.titlebar, .app-sidebar, .channels-panel, .main-panel, .info-panel, .settings-shell, .settings-card, .server-switcher, .room-header, .message-form, .message-tools, .hub-panel, .theme-card, .ai-main-card, .ai-preview-panel) {
  background:
    repeating-linear-gradient(0deg, rgba(255, 222, 165, 0.032) 0 1px, transparent 1px 7px),
    linear-gradient(155deg, color-mix(in srgb, var(--theme-surface-strong) 90%, rgba(120, 70, 24, 0.22)), rgba(16, 8, 3, 0.88));
}

body.theme-style-active[data-theme-ui="organic"] .app-shell::after {
  background:
    radial-gradient(circle at 20% 82%, color-mix(in srgb, var(--theme-edge) 16%, transparent), transparent 18rem),
    radial-gradient(circle at 72% 24%, color-mix(in srgb, var(--theme-secondary) 11%, transparent), transparent 26rem),
    color-mix(in srgb, var(--theme-screen-dim) 56%, transparent);
}

body.theme-style-active[data-theme-ui="pixel"] :is(.titlebar, .app-sidebar, .channels-panel, .main-panel, .info-panel, .settings-shell, .settings-card, .server-switcher, .room-header, .message-form, .message-tools, .hub-panel, .theme-card, .ai-main-card, .ai-preview-panel) {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--theme-surface-strong) 92%, rgba(0, 0, 0, 0.72)), rgba(0, 0, 0, 0.84)),
    linear-gradient(90deg, color-mix(in srgb, var(--theme-edge) 10%, transparent) 0 2px, transparent 2px 24px),
    linear-gradient(180deg, color-mix(in srgb, var(--theme-secondary) 8%, transparent) 0 2px, transparent 2px 24px);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--theme-edge) 42%, transparent),
    5px 5px 0 color-mix(in srgb, var(--theme-secondary) 14%, transparent);
}

body.theme-style-active[data-theme-ui="clean"] {
  --theme-engine-text-glow: none;
}

body.theme-style-active[data-theme-ui="clean"] .app-shell::after,
body.theme-style-active[data-theme-ui="clean"] .settings-overlay::after {
  background: rgba(255, 255, 255, 0.08);
}

body.theme-style-active[data-theme-ui="clean"] :is(.titlebar, .app-sidebar, .channels-panel, .main-panel, .info-panel, .settings-shell, .settings-card, .server-switcher, .room-header, .message-form, .message-tools, .hub-panel, .theme-card, .ai-main-card, .ai-preview-panel) {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--theme-edge) 18%, transparent),
    0 10px 20px rgba(0, 0, 0, 0.18);
}

body.theme-style-active[data-graphics-quality="low"] {
  --theme-fx-opacity: 0.06;
}

body.theme-style-active[data-theme-animation="off"],
body.theme-style-active.reduce-motion {
  --theme-fx-opacity: 0;
  --theme-ambient-speed: 0s;
}

body.theme-style-active[data-theme-animation="low"] {
  --theme-fx-opacity: 0.10;
  --theme-ambient-speed: 34s;
}

body.theme-style-active[data-theme-animation="medium"] {
  --theme-fx-opacity: 0.22;
  --theme-ambient-speed: 20s;
}

body.theme-style-active[data-theme-animation="ultra"] {
  --theme-fx-opacity: 0.36;
  --theme-ambient-speed: 11s;
}

body.theme-style-active[data-theme-animation="off"] *,
body.theme-style-active[data-theme-animation="off"] *::before,
body.theme-style-active[data-theme-animation="off"] *::after {
  animation: none !important;
  transition: none !important;
}

body.theme-style-active[data-graphics-quality="low"] .workspace::before,
body.theme-style-active[data-graphics-quality="low"] .workspace::after,
body.theme-style-active[data-graphics-quality="low"] .message-list::before,
body.theme-style-active[data-graphics-quality="low"] .message-embed::before {
  animation: none;
}

body.theme-style-active.reduce-motion *,
body.theme-style-active.reduce-motion *::before,
body.theme-style-active.reduce-motion *::after {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  body.theme-style-active {
    --theme-fx-opacity: 0.04;
    --theme-ambient-speed: 0s;
  }

  body.theme-style-active *,
  body.theme-style-active *::before,
  body.theme-style-active *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

body.theme-style-active[data-theme-pack] .titlebar {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--theme-surface-strong) 88%, rgba(0, 0, 0, 0.7)), color-mix(in srgb, var(--theme-screen-dim) 58%, rgba(0, 0, 0, 0.46))),
    var(--theme-asset-header),
    linear-gradient(90deg, color-mix(in srgb, var(--theme-edge) 14%, transparent), transparent 42%, color-mix(in srgb, var(--theme-accent-strong) 10%, transparent));
  background-position: center;
  background-size: cover;
}

body.theme-style-active[data-theme-pack] :is(.app-sidebar, .settings-nav) {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--theme-surface-strong) 82%, rgba(0, 0, 0, 0.72)), color-mix(in srgb, var(--theme-screen-dim) 62%, rgba(0, 0, 0, 0.82))),
    var(--theme-asset-sidebar),
    var(--theme-surface);
  background-position: center;
  background-size: cover;
}

body.theme-style-active[data-theme-pack] .channels-panel {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--theme-surface-strong) 86%, rgba(0, 0, 0, 0.72)), color-mix(in srgb, var(--theme-screen-dim) 66%, rgba(0, 0, 0, 0.86))),
    var(--theme-asset-sidebar),
    var(--theme-surface);
  background-position: center;
  background-size: cover;
}

body.theme-style-active[data-theme-pack] :is(.room-header, .message-form, .settings-card, .server-switcher, .theme-card, .hub-panel, .ai-main-card, .ai-preview-panel)::before {
  opacity: calc(var(--theme-fx-opacity) * 0.52);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--theme-edge) 16%, transparent), transparent 30%, color-mix(in srgb, var(--theme-accent-strong) 12%, transparent)),
    var(--theme-engine-line-art);
}

body.theme-style-active[data-theme-has-character="true"] .main-panel::after,
body.theme-style-active[data-theme-has-character="true"] .settings-shell::after {
  content: "";
  position: absolute;
  right: clamp(10px, 2.8vw, 42px);
  bottom: -12px;
  width: min(28vw, 420px);
  height: min(72vh, 760px);
  pointer-events: none;
  background: var(--theme-asset-character) right bottom / contain no-repeat;
  opacity: 0.42;
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--theme-edge) 42%, transparent));
  z-index: 0;
}

body.theme-style-active[data-theme-has-character="true"] .main-panel > *,
body.theme-style-active[data-theme-has-character="true"] .settings-shell > * {
  position: relative;
  z-index: 1;
}

body.theme-style-active[data-theme] :is(.titlebar, .app-sidebar, .channels-panel, .main-panel, .info-panel, .settings-shell, .settings-card, .server-switcher, .room-header, .message-form, .message-tools, .hub-panel, .live-card, .theme-card, .ai-main-card, .ai-preview-panel, .modal-panel) {
  border-color: var(--hv-border, var(--theme-engine-border));
}

body.theme-style-active[data-theme] :is(.rail-item.active, .settings-nav-item.active, .channel-button.active, .hub-tab.active, .hub-platform.active, .server-list-item.active) {
  color: var(--hv-text, #fff);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--hv-accent, var(--theme-accent-strong)) 36%, transparent), color-mix(in srgb, var(--hv-accent-2, var(--theme-secondary)) 18%, transparent)),
    color-mix(in srgb, var(--hv-panel, var(--theme-surface)) 80%, transparent);
  border-color: var(--hv-accent, var(--theme-accent-strong));
  box-shadow: var(--hv-glow, 0 0 18px color-mix(in srgb, var(--theme-edge) 40%, transparent));
}

body.theme-style-active[data-theme] :is(button, .btn, .theme-preview-button, .primary-button) {
  border-color: var(--hv-border, var(--theme-engine-border));
}

body.theme-style-active[data-theme] :is(input, textarea, select, .settings-input, .settings-select, .settings-textarea, .message-form input, .global-search) {
  border-color: var(--hv-border, var(--theme-engine-border));
}

@keyframes themePremiumDrift {
  0% {
    transform: translate3d(0, 0, 0);
    background-position: center, center;
  }

  50% {
    transform: translate3d(0, -1.5%, 0);
    background-position: 50% 48%, 52% 50%;
  }

  100% {
    transform: translate3d(0, 0, 0);
    background-position: center, center;
  }
}
