/* Omni premium-personalization preview: no billing or entitlement lock yet. */
.nexo-personalization-heading { margin: 0 0 14px; }
.nexo-personalization-heading h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.nexo-premium-preview-badge { display: inline-flex; padding: 4px 9px; border: 1px solid #caa56d71; border-radius: 20px; background: #cda7611b; color: #ead1a1; font-size: 10px; font-weight: 750; }
.nexo-custom-profile-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px 12px; padding: 14px; border: 1px solid #ffffff1d; border-radius: 13px; background: #ffffff07; }
.nexo-custom-profile-row label { color: #cbccd3; font-size: 11px; font-weight: 650; }
.nexo-custom-profile-row select,.nexo-custom-profile-row input { width: 100%; min-width: 0; min-height: 37px; border: 1px solid #ffffff24; border-radius: 9px; background: #17181f; color: #eef0f5; padding: 8px 10px; font: inherit; font-size: 12px; }
.nexo-custom-profile-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.nexo-custom-profile-actions button,.nexo-custom-action-footer button { min-height: 33px; padding: 7px 12px; border: 1px solid #ffffff24; border-radius: 8px; background: #ffffff10; color: #e5e8ef; cursor: pointer; font-size: 11px; }
.nexo-custom-profile-actions button:hover,.nexo-custom-action-footer button:hover { background: #ffffff1d; }
.nexo-custom-profile-actions button:disabled { opacity: .45; cursor: not-allowed; }
.nexo-custom-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 18px 0; }
.nexo-custom-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px; border: 1px solid #ffffff17; border-radius: 12px; background: #ffffff05; }
.nexo-custom-field > label,.nexo-custom-range-head label { color: #d5d7de; font-size: 11px; font-weight: 700; }
.nexo-custom-field select { width: 100%; min-width: 0; min-height: 35px; padding: 7px 10px; background: #17181f; border: 1px solid #ffffff23; border-radius: 8px; color: #f2f3f6; font-size: 12px; }
.nexo-custom-field small { color: #9da5b2; font-size: 10px; line-height: 1.5; }
.nexo-custom-color-row { display: flex; align-items: center; gap: 10px; }
.nexo-custom-color-row input { flex: 0 0 48px; width: 48px; height: 36px; padding: 2px; border: 1px solid #ffffff23; border-radius: 8px; background: #111218; cursor: pointer; }
#nexoCustomAccentHex { color: #b4c5d3; font-family: monospace; font-size: 12px; }
.nexo-custom-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.nexo-custom-swatches button { width: 24px; height: 24px; padding: 0; border: 2px solid #e7ebf14a; border-radius: 50%; background: var(--swatch-color); cursor: pointer; }
.nexo-custom-swatches button[aria-pressed="true"] { border-color: white; box-shadow: 0 0 0 2px #ffffff46; }
.nexo-custom-range-head { display: flex; justify-content: space-between; gap: 8px; }
.nexo-custom-range-head output { color: #a8c7ed; font-size: 11px; }
.nexo-custom-field input[type=range] { width: 100%; margin: 4px 0; accent-color: #82ccac; cursor: pointer; }
.nexo-custom-wallpaper-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: center; gap: 10px 16px; padding: 14px; border: 1px solid #ffffff17; border-radius: 12px; background: #ffffff05; }
.nexo-custom-wallpaper-row h3 { margin: 0 0 5px; font-size: 13px; }
.nexo-custom-wallpaper-row .settings-description { margin: 0; }
.nexo-custom-wallpaper-preview { position: relative; display: grid; place-items: center; min-width: 0; aspect-ratio: 16 / 9; border: 1px solid #ffffff25; border-radius: 10px; background: radial-gradient(ellipse at 22% 20%, #566e7d55, transparent 48%),linear-gradient(135deg,#0e151f,#283342); background-position: center; background-size: cover; overflow: hidden; }
.nexo-custom-wallpaper-preview span { padding: 10px 16px; background: #0a0d13ab; border-radius: 8px; color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .2em; text-shadow: 0 1px 4px #000; }
.nexo-custom-action-footer { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 3px; }
#nexoCustomStatus { color: #a7d1bd; font-size: 11px; line-height: 1.5; }
#nexoCustomStatus.is-error { color: #eda0a2; }
@media(max-width:640px) {
  .nexo-custom-grid { grid-template-columns: minmax(0,1fr); }
  .nexo-custom-wallpaper-row { grid-template-columns: minmax(0,1fr); }
  .nexo-custom-profile-row { grid-template-columns: minmax(0,1fr); }
}

/* Only activate theme changes after a user changes a visual preference. */
html[data-nexo-personalized="1"] {
  --nexo-custom-accent: #69c995;
  --nexo-surface-rgb: 21,24,31;
  --nexo-panel-alpha: .62;
  --nexo-ui-factor: 1;
  --nexo-wallpaper-image: none;
}
html[data-nexo-personalized="1"] .app-shell {
  /* The shell itself stays transparent; each panel controls its own opacity.
     Otherwise a 90%-transparent panel would be layered over a second tint. */
  background: transparent !important;
  --green: var(--nexo-custom-accent);
}
html[data-nexo-personalized="1"] .app-shell .global-navigation,
html[data-nexo-personalized="1"] .app-shell .server-rail,
html[data-nexo-personalized="1"] .app-shell .channel-sidebar,
html[data-nexo-personalized="1"] .app-shell .chat-column,
html[data-nexo-personalized="1"] .app-shell .member-sidebar,
html[data-nexo-personalized="1"] .app-shell .user-panel:not(.mini-central),
html[data-nexo-personalized="1"] .app-shell .chat-topbar {
  background: var(--nexo-surface-bg) !important;
  backdrop-filter: blur(28px) saturate(135%);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
}
html[data-nexo-personalized="1"] .app-shell .channel-button.active,
html[data-nexo-personalized="1"] .app-shell .voice-channel.active,
html[data-nexo-personalized="1"] .app-shell .friends-tabs .active {
  border-color: color-mix(in srgb,var(--nexo-custom-accent) 36%, transparent);
  background: color-mix(in srgb,var(--nexo-custom-accent) 14%, transparent);
}
html[data-nexo-personalized="1"] .app-shell .channel-dot,
html[data-nexo-personalized="1"] .app-shell .live-dot,
html[data-nexo-personalized="1"] .app-shell .selected .status-dot { background-color: var(--nexo-custom-accent); }
html[data-nexo-personalized="1"] .app-shell .share-button.is-active,
html[data-nexo-personalized="1"] .app-shell .dialog-submit,
html[data-nexo-personalized="1"] .app-shell .send-button {
  border-color: color-mix(in srgb,var(--nexo-custom-accent) 66%, transparent);
  background: var(--nexo-custom-accent);
  color: #071618;
}
html[data-nexo-personalized="1"] .app-shell .channel-button,
html[data-nexo-personalized="1"] .app-shell .voice-channel { font-size: calc(12px * var(--nexo-ui-factor)); }
html[data-nexo-personalized="1"] .app-shell .message-text { font-size: calc(13px * var(--nexo-ui-factor)); }
html[data-nexo-personalized="1"] .app-shell .member-row,
html[data-nexo-personalized="1"] .app-shell .friend-row { font-size: calc(12px * var(--nexo-ui-factor)); }
html[data-nexo-personalized="1"] .app-shell .section-heading { font-size: calc(9px * var(--nexo-ui-factor)); }
html[data-nexo-personalized="1"] .app-shell .current-channel h1 { font-size: calc(15px * var(--nexo-ui-factor)); }
html[data-nexo-density="compact"] .app-shell .channel-button,
html[data-nexo-density="compact"] .app-shell .voice-channel { height: 30px; }
html[data-nexo-density="comfortable"] .app-shell .channel-button,
html[data-nexo-density="comfortable"] .app-shell .voice-channel { height: 42px; }
html[data-nexo-density="compact"] .app-shell .member-row { padding-block: 5px; }
html[data-nexo-density="comfortable"] .app-shell .member-row { padding-block: 13px; }

/* Wallpapers are stored as on-device IndexedDB blobs, never in cloud accounts. */
html[data-nexo-wallpaper="1"] body {
  background-image: linear-gradient(140deg,rgba(5,9,18,.28),rgba(8,12,21,.4)),var(--nexo-wallpaper-image) !important;
  background-size: cover !important;
  background-position: center !important;
  background-attachment: fixed !important;
}
html[data-nexo-wallpaper="1"] body::before { opacity: .14; }

/* A readable light variant for the primary shell. Dialogs stay dark-glass. */
html[data-nexo-theme="light"] {
  color-scheme: light;
  --text: #202938;
  --muted: #516178;
  --line: rgba(36,46,63,.20);
  --line-soft: rgba(35,46,63,.13);
}
html[data-nexo-theme="light"] body { background: linear-gradient(145deg,#cbd6e3,#edf1f7) !important; }
html[data-nexo-theme="light"] .app-shell { color: #1f2937; }
html[data-nexo-theme="light"] .app-shell .global-navigation,
html[data-nexo-theme="light"] .app-shell .server-rail,
html[data-nexo-theme="light"] .app-shell .channel-sidebar,
html[data-nexo-theme="light"] .app-shell .chat-column,
html[data-nexo-theme="light"] .app-shell .member-sidebar,
html[data-nexo-theme="light"] .app-shell .user-panel:not(.mini-central),
html[data-nexo-theme="light"] .app-shell .chat-topbar {
  color: #273449; border-color: #23314b22;
}
html[data-nexo-theme="light"] .app-shell .message-text,
html[data-nexo-theme="light"] .app-shell .friend-name,
html[data-nexo-theme="light"] .app-shell .community-title strong,
html[data-nexo-theme="light"] .app-shell .channel-button,
html[data-nexo-theme="light"] .app-shell .voice-channel,
html[data-nexo-theme="light"] .app-shell .current-channel h1,
html[data-nexo-theme="light"] .app-shell .user-panel:not(.mini-central) .user-copy strong {
  color: #243048;
}
html[data-nexo-theme="light"] .app-shell .composer {
  background: rgba(247,250,253,.87);border-color:#26334b2b;color:#202938;
}
html[data-nexo-theme="light"] .app-shell .composer textarea { color:#1f2937; }
html[data-nexo-theme="light"] .app-shell .channel-button.active,
html[data-nexo-theme="light"] .app-shell .voice-channel.active {
  color: #193349;
}
html[data-nexo-theme="light"] .app-shell .section-heading,
html[data-nexo-theme="light"] .app-shell .channel-hash,
html[data-nexo-theme="light"] .app-shell .community-title small {
  color:#516077;
}
html[data-nexo-theme="light"] .app-shell .user-control { color:#28364a; }
html[data-nexo-theme="light"][data-nexo-wallpaper="1"] body {
  background-image:linear-gradient(145deg,rgba(230,235,245,.08),rgba(225,233,244,.17)),var(--nexo-wallpaper-image) !important;
}
