/* ═══════════════════════════════════════════════════════════
   CIPHERX — Polish Layer
   Loaded AFTER cipherx.css / panel-extras.css / home.css.
   Adds smoother motion, ripple feedback, focus rings,
   entry animations, cleaner scrollbars, and the sound chip.
═══════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────
   Maximum-protection banner (replaces the level picker grid)
────────────────────────────────────────────────────────── */
.cx-max-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0 0 0;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background:
    linear-gradient(135deg,
      rgba(34, 211, 238, 0.10) 0%,
      rgba(180, 140, 255, 0.10) 50%,
      rgba(34, 211, 238, 0.10) 100%);
  border: 1px solid rgba(34, 211, 238, 0.30);
  box-shadow:
    0 14px 40px -16px rgba(34, 211, 238, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 1px 0 rgba(255, 255, 255, 0.07) inset;
  overflow: hidden;
  isolation: isolate;
  animation: cx-max-banner-in 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  transition: transform 0.25s var(--cx-ease, ease), box-shadow 0.25s var(--cx-ease, ease);
}
.cx-max-banner:hover {
  transform: translateY(-1px);
  box-shadow:
    0 18px 46px -16px rgba(34, 211, 238, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 1px 0 rgba(255, 255, 255, 0.10) inset;
}
.cx-max-banner.is-disabled { opacity: 0.7; filter: saturate(0.7); }
.cx-max-banner-glow {
  position: absolute;
  inset: -40% -10% auto auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(closest-side, rgba(34, 211, 238, 0.32), transparent 70%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}
.cx-max-banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(180, 140, 255, 0.22));
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: #22d3ee;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}
.cx-max-banner-body {
  flex: 1;
  min-width: 0;
}
.cx-max-banner-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  background: linear-gradient(135deg, #ffffff 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.cx-max-banner-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.18);
  color: #22d3ee;
  border: 1px solid rgba(34, 211, 238, 0.45);
  -webkit-text-fill-color: #22d3ee;
}
.cx-max-banner-desc {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: rgba(230, 248, 251, 0.72);
  line-height: 1.45;
}
.cx-max-banner-cost {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  padding-left: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  text-align: right;
}
.cx-max-banner-cost strong {
  font-size: 1.7rem;
  line-height: 1;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.cx-max-banner-cost .cx-muted {
  font-size: 0.72rem;
  margin-top: 0.2rem;
  letter-spacing: 0.02em;
}
.cx-max-banner-shimmer {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  animation: cx-max-banner-shimmer 4.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes cx-max-banner-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cx-max-banner-shimmer {
  0%   { left: -40%; }
  60%  { left: 110%; }
  100% { left: 110%; }
}
@media (max-width: 640px) {
  .cx-max-banner { flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 0.9rem 1rem; }
  .cx-max-banner-cost { padding-left: 0; border-left: none; align-items: flex-start; text-align: left; width: 100%; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 0.6rem; flex-direction: row; gap: 0.5rem; align-items: baseline; }
}

/* ──────────────────────────────────────────────────────────
   Top-center notification (Maximum protection · 1 credit)
────────────────────────────────────────────────────────── */
.cx-top-notice {
  display: flex;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
  padding: 0;
  pointer-events: none;
  animation: cx-notice-in 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.cx-top-notice-inner {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(34, 211, 238, 0.10) 0%,
    rgba(180, 140, 255, 0.10) 50%,
    rgba(34, 211, 238, 0.10) 100%
  );
  border: 1px solid rgba(34, 211, 238, 0.28);
  color: #e6f8fb;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    0 8px 28px -10px rgba(34, 211, 238, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
  overflow: hidden;
  pointer-events: auto;
  transition: transform 0.25s var(--cx-ease, ease), box-shadow 0.25s var(--cx-ease, ease);
}
.cx-top-notice-inner:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 34px -10px rgba(34, 211, 238, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 1px 0 rgba(255, 255, 255, 0.10) inset;
}
.cx-top-notice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(180, 140, 255, 0.22));
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: #22d3ee;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
}
.cx-top-notice-text {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}
.cx-top-notice-text strong {
  background: linear-gradient(135deg, #ffffff 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.cx-top-notice-sep {
  opacity: 0.45;
  font-weight: 700;
}
.cx-top-notice-shimmer {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.10) 50%,
    transparent 100%
  );
  animation: cx-notice-shimmer 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes cx-notice-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cx-notice-shimmer {
  0%   { left: -40%; }
  60%  { left: 110%; }
  100% { left: 110%; }
}
@media (max-width: 540px) {
  .cx-top-notice-inner {
    font-size: 0.78rem;
    padding: 0.5rem 0.85rem;
    gap: 0.45rem;
  }
  .cx-top-notice-text { white-space: normal; text-align: center; }
}

/* ──────────────────────────────────────────────────────────
   Motion tokens (overrides — keeps easings consistent)
────────────────────────────────────────────────────────── */
:root {
  --cx-ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
  --cx-ease-spring:cubic-bezier(0.34, 1.56, 0.64, 1);
  --cx-trans:      0.22s var(--cx-ease);
  --cx-trans-slow: 0.38s var(--cx-ease);
}

/* reduced-motion users get near-zero durations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ──────────────────────────────────────────────────────────
   Global focus-visible ring — accessible, consistent.
────────────────────────────────────────────────────────── */
:focus { outline: none; }
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
.cx-btn:focus-visible,
.hm-btn:focus-visible,
.cx-nav-btn:focus-visible,
.cx-level-card:focus-visible,
.cx-file-upload:focus-visible {
  outline: 2px solid var(--cx-accent, #22d3ee);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.22);
}

/* ──────────────────────────────────────────────────────────
   Buttons — smoother press + hover + ripple
────────────────────────────────────────────────────────── */
.cx-btn,
.hm-btn,
.cx-nav-btn,
.cx-discord-btn,
.cx-sound-chip {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  will-change: transform, box-shadow, background-color;
  transition:
    transform 0.18s var(--cx-ease-spring),
    background-color var(--cx-trans),
    border-color var(--cx-trans),
    color var(--cx-trans),
    box-shadow var(--cx-trans),
    filter var(--cx-trans);
}

.cx-btn::after,
.hm-btn::after,
.cx-nav-btn::after,
.cx-discord-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at var(--cx-rx, 50%) var(--cx-ry, 50%),
              rgba(255, 255, 255, 0.35) 0%,
              rgba(255, 255, 255, 0) 55%);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
  transition: opacity 0.4s var(--cx-ease), transform 0.55s var(--cx-ease);
}

.cx-btn.is-rippling::after,
.hm-btn.is-rippling::after,
.cx-nav-btn.is-rippling::after,
.cx-discord-btn.is-rippling::after {
  opacity: 1;
  transform: scale(1.6);
}

.cx-btn:active,
.hm-btn:active,
.cx-nav-btn:active,
.cx-discord-btn:active {
  transform: translateY(0.5px) scale(0.985);
  transition-duration: 0.08s;
}

/* Subtle primary-button sheen */
.cx-btn-primary {
  background-size: 200% 200%;
  background-position: 0% 50%;
  transition:
    background-position 0.6s var(--cx-ease),
    transform 0.18s var(--cx-ease-spring),
    box-shadow var(--cx-trans),
    filter var(--cx-trans);
}
.cx-btn-primary:hover { background-position: 100% 50%; }

/* ──────────────────────────────────────────────────────────
   Sidebar nav — smooth active-pill glide
────────────────────────────────────────────────────────── */
.cx-sidebar-nav .cx-nav-btn {
  transition:
    background var(--cx-trans),
    color var(--cx-trans),
    padding-left 0.18s var(--cx-ease-spring),
    transform 0.18s var(--cx-ease-spring);
}
.cx-sidebar-nav .cx-nav-btn:hover { padding-left: 1rem; }
.cx-sidebar-nav .cx-nav-btn.is-active { padding-left: 1rem; }
.cx-sidebar-nav .cx-nav-btn.is-active::before {
  animation: cx-sidebar-glow 2.4s ease-in-out infinite alternate;
}
@keyframes cx-sidebar-glow {
  from { box-shadow: 0 0 6px var(--cx-brand-glow); opacity: 0.8; }
  to   { box-shadow: 0 0 14px var(--cx-brand-glow), 0 0 22px rgba(34, 211, 238, 0.22); opacity: 1; }
}

/* Sidebar brand gentle float */
.cx-sidebar-brand:hover .cx-sidebar-logo {
  transform: rotate(-4deg) scale(1.06);
}
.cx-sidebar-logo {
  transition: transform 0.35s var(--cx-ease-spring), box-shadow var(--cx-trans);
}

/* ──────────────────────────────────────────────────────────
   Panel section entry — subtle fade-up
────────────────────────────────────────────────────────── */
.cx-section.is-active > * {
  animation: cx-fade-up 0.45s var(--cx-ease) backwards;
}
.cx-section.is-active > *:nth-child(1) { animation-delay: 0.02s; }
.cx-section.is-active > *:nth-child(2) { animation-delay: 0.07s; }
.cx-section.is-active > *:nth-child(3) { animation-delay: 0.12s; }
.cx-section.is-active > *:nth-child(4) { animation-delay: 0.17s; }
@keyframes cx-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ──────────────────────────────────────────────────────────
   Panel blocks — refined hover lift
────────────────────────────────────────────────────────── */
.cx-panel-block {
  transition:
    border-color var(--cx-trans),
    box-shadow var(--cx-trans),
    transform 0.25s var(--cx-ease);
}
.cx-panel-block:hover {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--cx-border-mid);
  transform: translateY(-1px);
}

.cx-panel-block::before {
  opacity: 0;
  transition: opacity 0.45s var(--cx-ease);
}
.cx-panel-block:hover::before { opacity: 1; }

/* ──────────────────────────────────────────────────────────
   Stat cards — smoother lift + gradient edge on hover
────────────────────────────────────────────────────────── */
.cx-stat { transition:
  border-color var(--cx-trans),
  box-shadow var(--cx-trans),
  transform 0.25s var(--cx-ease-spring),
  background var(--cx-trans);
}
.cx-stat:hover { transform: translateY(-3px) scale(1.005); }

/* Counter pulse when number changes (JS can toggle .is-bumped) */
.cx-stat strong.is-bumped,
.cx-credit-hero-value > span.is-bumped,
#credit-chip-amount.is-bumped {
  animation: cx-num-bump 0.45s var(--cx-ease-spring);
}
@keyframes cx-num-bump {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.12); filter: drop-shadow(0 0 14px var(--cx-brand-glow)); }
  100% { transform: scale(1); }
}

/* ──────────────────────────────────────────────────────────
   Level cards — richer selection feel
────────────────────────────────────────────────────────── */
.cx-level-card {
  transition:
    border-color var(--cx-trans),
    background var(--cx-trans),
    transform 0.22s var(--cx-ease-spring),
    box-shadow var(--cx-trans);
}
.cx-level-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.35); }
.cx-level-card.is-selected {
  transform: translateY(-2px);
  animation: cx-level-pop 0.35s var(--cx-ease-spring);
}
@keyframes cx-level-pop {
  0%   { transform: translateY(0) scale(0.98); }
  55%  { transform: translateY(-3px) scale(1.015); }
  100% { transform: translateY(-2px) scale(1); }
}

/* ──────────────────────────────────────────────────────────
   Inputs — cleaner focus ring everywhere
────────────────────────────────────────────────────────── */
.cx-panel-block input:focus,
.cx-panel-block select:focus,
.cx-panel-block textarea:focus,
.cx-settings-field input:focus,
.cx-settings-field textarea:focus,
.cx-redeem-wrap input:focus,
.cx-field-inline input:focus,
.cx-level-cost-item input:focus,
.cx-grant-panel input:focus,
.cx-row-search input:focus,
.cx-encrypt-area textarea:focus,
.cx-login-card input:focus,
.cx-field input:focus {
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.28),
    0 4px 18px rgba(99, 102, 241, 0.14);
}

/* input "caret breathing" is a nice detail on empty fields */
input::placeholder, textarea::placeholder {
  transition: opacity var(--cx-trans);
}
input:focus::placeholder, textarea:focus::placeholder { opacity: 0.3 !important; }

/* ──────────────────────────────────────────────────────────
   Credit chip — glowing pulse when active
────────────────────────────────────────────────────────── */
.cx-credit-chip {
  transition: border-color var(--cx-trans), transform 0.22s var(--cx-ease-spring), box-shadow var(--cx-trans);
}
.cx-credit-chip:hover { transform: translateY(-1px); }

/* ──────────────────────────────────────────────────────────
   Topbar — denser shadow when scrolled (works with sticky)
────────────────────────────────────────────────────────── */
.cx-topbar {
  transition: box-shadow var(--cx-trans), background var(--cx-trans);
}
.cx-topbar.is-scrolled {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.42);
}

/* ──────────────────────────────────────────────────────────
   Ledger / user card rows — staggered hover cue
────────────────────────────────────────────────────────── */
.cx-ledger-row,
.cx-user-card,
.cx-login-row {
  transition: border-color var(--cx-trans), transform 0.2s var(--cx-ease), background var(--cx-trans);
}
.cx-ledger-row:hover,
.cx-user-card:hover,
.cx-login-row:hover {
  transform: translateX(2px);
}

/* ──────────────────────────────────────────────────────────
   Tables — polished sticky head + smoother row hover
────────────────────────────────────────────────────────── */
.cx-panel-block tbody tr {
  transition: background var(--cx-trans), box-shadow var(--cx-trans);
}
.cx-panel-block tbody tr:hover {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.08), rgba(34, 211, 238, 0.03));
  box-shadow: inset 3px 0 0 var(--cx-accent);
}

/* ──────────────────────────────────────────────────────────
   Scrollbar — slim, gradient thumb
────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cx-brand-dark), var(--cx-accent-2));
  border-radius: 999px;
  border: 2px solid rgba(10, 10, 21, 0.8);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--cx-brand), var(--cx-accent));
  background-clip: padding-box;
}

/* ──────────────────────────────────────────────────────────
   Home page polish (hm-*)
────────────────────────────────────────────────────────── */
.hm-feature-card,
.hm-pricing-card {
  transition:
    transform 0.25s var(--cx-ease-spring),
    box-shadow var(--cx-trans),
    border-color var(--cx-trans),
    background var(--cx-trans);
}
.hm-feature-card:hover,
.hm-pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 50px rgba(10, 15, 40, 0.18);
}

.hm-nav-link {
  position: relative;
  transition: color var(--cx-trans), background var(--cx-trans);
}
.hm-nav-link::after {
  content: '';
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 4px;
  height: 2px;
  background: linear-gradient(90deg, #38bdf8, #6366f1);
  border-radius: 2px;
  opacity: 0;
  transition: left 0.25s var(--cx-ease), right 0.25s var(--cx-ease), opacity 0.2s var(--cx-ease);
}
.hm-nav-link:hover::after { left: 20%; right: 20%; opacity: 1; }

.hm-btn {
  position: relative;
  overflow: hidden;
}
.hm-btn-solid,
.hm-btn-outline,
.hm-btn-outline-white,
.hm-btn-discord {
  transition:
    transform 0.18s var(--cx-ease-spring),
    background 0.25s var(--cx-ease),
    border-color var(--cx-trans),
    color var(--cx-trans),
    box-shadow var(--cx-trans);
}
.hm-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 60, 0.16); }
.hm-btn:active { transform: translateY(0) scale(0.98); }

.hm-logo-icon {
  transition: transform 0.4s var(--cx-ease-spring), filter var(--cx-trans);
}
.hm-logo:hover .hm-logo-icon {
  transform: rotate(-8deg) scale(1.06);
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.55));
}

/* ──────────────────────────────────────────────────────────
   Login card — gentle idle "breathing"
────────────────────────────────────────────────────────── */
.cx-login-card {
  animation:
    cx-appear 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    cx-login-breathe 6s ease-in-out infinite alternate 0.9s;
}
@keyframes cx-login-breathe {
  from { box-shadow: var(--cx-shadow), 0 0 22px rgba(99, 102, 241, 0.20); }
  to   { box-shadow: var(--cx-shadow), 0 0 38px rgba(99, 102, 241, 0.32); }
}

.cx-brand-icon {
  animation: cx-brand-float 4.5s ease-in-out infinite alternate;
}
@keyframes cx-brand-float {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(-4px) rotate(-2deg); }
}

/* ──────────────────────────────────────────────────────────
   Sound-toggle floating chip (panel only)
────────────────────────────────────────────────────────── */
.cx-sound-chip {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--cx-border-mid);
  background: var(--cx-glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--cx-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: var(--cx-shadow);
  transition:
    transform 0.25s var(--cx-ease-spring),
    background var(--cx-trans),
    border-color var(--cx-trans),
    color var(--cx-trans),
    box-shadow var(--cx-trans);
}
.cx-sound-chip:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: var(--cx-accent);
  color: var(--cx-accent);
  box-shadow: 0 12px 32px rgba(34, 211, 238, 0.25);
}
.cx-sound-chip:active { transform: scale(0.95); }
.cx-sound-chip.is-off {
  color: var(--cx-text-dim);
  opacity: 0.72;
}
.cx-sound-chip.is-off:hover {
  color: var(--cx-danger);
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 10px 28px rgba(248, 113, 113, 0.25);
}

/* ──────────────────────────────────────────────────────────
   Toast polish
────────────────────────────────────────────────────────── */
.cx-toast {
  transform-origin: right bottom;
  transition: transform 0.25s var(--cx-ease-spring), opacity 0.2s var(--cx-ease);
}
.cx-toast:hover { transform: translateX(-3px) scale(1.015); }

/* ──────────────────────────────────────────────────────────
   Loader shimmer — use for any element with .cx-shimmer
────────────────────────────────────────────────────────── */
.cx-shimmer {
  position: relative;
  overflow: hidden;
  color: transparent !important;
}
.cx-shimmer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    rgba(148, 163, 255, 0.06) 0%,
    rgba(148, 163, 255, 0.16) 45%,
    rgba(148, 163, 255, 0.06) 90%);
  background-size: 220% 100%;
  animation: cx-shimmer-move 1.25s linear infinite;
}
@keyframes cx-shimmer-move {
  from { background-position: 220% 0; }
  to   { background-position: -120% 0; }
}

/* ──────────────────────────────────────────────────────────
   File-upload — highlight state cleaner, dragover support
────────────────────────────────────────────────────────── */
.cx-file-upload.is-drag {
  border-color: var(--cx-accent);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(99, 102, 241, 0.08));
  transform: scale(1.005);
}

/* ──────────────────────────────────────────────────────────
   Mobile polish
────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .cx-sound-chip {
    right: 0.75rem;
    bottom: 0.75rem;
    width: 36px;
    height: 36px;
  }
  .cx-toast-area {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }
}

/* ═════════════════════════════════════════════════════════════════════
   PANEL REDESIGN NEUTRALIZER — runs last to kill any glows / gradients
   / shimmers from earlier rules in this file. Scope: panel pages only.
   The full panel redesign tokens + components live at the end of
   panel-extras.css; this section just makes sure cx-polish.css's own
   abstract effects don't sneak through the cascade.
   ═════════════════════════════════════════════════════════════════════ */

/* Kill cursor-following radial gradient on .cx-panel-block */
body.cx-page-panel .cx-panel-block::before,
body.cx-page-panel .cx-panel-block::after {
  content: none !important;
  display: none !important;
  background: none !important;
  animation: none !important;
}

/* Sidebar nav: remove the animated glow strip on active state */
body.cx-page-panel .cx-sidebar-nav .cx-nav-btn::before,
body.cx-page-panel .cx-sidebar-nav .cx-nav-btn::after {
  content: none !important;
  display: none !important;
  animation: none !important;
  background: none !important;
}
body.cx-page-panel .cx-sidebar-nav .cx-nav-btn:hover,
body.cx-page-panel .cx-sidebar-nav .cx-nav-btn.is-active {
  padding-left: 12px !important;
}

/* Max-banner: strip the cyan + purple gradients, glows, gradient text */
body.cx-page-panel .cx-max-banner {
  background: var(--pp-surface, #111113) !important;
  background-image: none !important;
  border: 1px solid var(--pp-border, #1f2024) !important;
  box-shadow: none !important;
  animation: none !important;
}
body.cx-page-panel .cx-max-banner:hover {
  transform: none !important;
  box-shadow: none !important;
}
body.cx-page-panel .cx-max-banner-glow,
body.cx-page-panel .cx-max-banner-shimmer { display: none !important; }
body.cx-page-panel .cx-max-banner-icon {
  background: var(--pp-blue-soft, rgba(59,130,246,0.10)) !important;
  background-image: none !important;
  border: 1px solid transparent !important;
  color: var(--pp-blue, #3b82f6) !important;
  box-shadow: none !important;
}
body.cx-page-panel .cx-max-banner-title {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: var(--pp-text, #f4f5f7) !important;
  color: var(--pp-text, #f4f5f7) !important;
}

/* Brand / hero gradient text → flat white */
body.cx-page-panel .cx-brand,
body.cx-page-panel .cx-credit-hero-value > span:first-child,
body.cx-page-panel #dash-credits-big {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: var(--pp-text, #f4f5f7) !important;
  color: var(--pp-text, #f4f5f7) !important;
}

/* Table row hover: remove the indigo→cyan gradient */
body.cx-page-panel .cx-panel-block tbody tr:hover,
body.cx-page-panel tbody tr:hover {
  background: rgba(255, 255, 255, 0.025) !important;
  background-image: none !important;
}
body.cx-page-panel .cx-panel-block tbody tr:hover td {
  background: transparent !important;
}

/* Scrollbar thumb: re-apply the gray panel scrollbar */
body.cx-page-panel ::-webkit-scrollbar-thumb {
  background: var(--pp-border-2, #292a2e) !important;
  background-image: none !important;
}
body.cx-page-panel ::-webkit-scrollbar-thumb:hover {
  background: var(--pp-border-3, #34353a) !important;
}

/* Glass / strong-glass backgrounds → flat surface */
body.cx-page-panel [class*="glass"] {
  background: var(--pp-surface, #111113) !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Disable any remaining hue/animation effects */
body.cx-page-panel [class*="shimmer"],
body.cx-page-panel [class*="-glow"] {
  animation: none !important;
  background: none !important;
  display: none !important;
}

/* Kill any leftover sidebar background image (cipherx.css gradient) */
body.cx-page-panel .cx-sidebar,
body.cx-page-panel .cx-main,
body.cx-page-panel .cx-topbar {
  background-image: none !important;
}

/* Ensure focus rings throughout use the new blue */
body.cx-page-panel *:focus-visible {
  outline: 2px solid var(--pp-blue, #3b82f6) !important;
  outline-offset: 2px !important;
}
body.cx-page-panel input:focus,
body.cx-page-panel textarea:focus,
body.cx-page-panel select:focus,
body.cx-page-panel .cx-btn:focus-visible {
  outline: none !important;
}

/* ─── Subscription Info modal + strong notice variant ─────────────── */
.cx-top-notice--strong .cx-top-notice-inner {
  border: 1px solid rgba(124, 92, 255, 0.45);
  background: linear-gradient(95deg, rgba(124, 92, 255, 0.16), rgba(76, 201, 240, 0.10));
  box-shadow: 0 8px 36px -10px rgba(124, 92, 255, 0.45);
}
.cx-top-notice-info {
  margin-left: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(124, 92, 255, 0.55);
  background: rgba(124, 92, 255, 0.18);
  color: #efeaff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.cx-top-notice-info:hover {
  background: rgba(124, 92, 255, 0.32);
  transform: translateY(-1px);
}

.cx-modal {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.cx-modal[hidden] { display: none; }
.cx-modal-scrim {
  position: absolute; inset: 0;
  background: rgba(8, 9, 14, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cx-modal-card {
  position: relative; z-index: 1;
  width: min(640px, 96vw);
  max-height: 90vh; overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(124, 92, 255, 0.32);
  background: linear-gradient(160deg, #14151f 0%, #0f1018 100%);
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  padding: 1.5rem 1.5rem 1.5rem;
}
.cx-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.cx-modal-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7c5cff;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.cx-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}
.cx-modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d4d6e3;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.cx-modal-close:hover { background: rgba(255, 255, 255, 0.12); }

.cx-sub-info-balance {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(124, 92, 255, 0.28);
  background: rgba(124, 92, 255, 0.08);
  margin-bottom: 1rem;
}
.cx-sub-info-balance-value {
  font-size: 1.5rem; font-weight: 800; color: #ffffff; margin-top: 0.15rem;
}
.cx-sub-info-balance-value span { font-size: 0.85rem; color: #a8adc1; font-weight: 500; }
.cx-sub-info-k {
  font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: #8a8fa3; font-weight: 600;
}
.cx-sub-info-v {
  margin-top: 0.15rem; color: #ffffff; font-weight: 700; font-size: 0.95rem;
}
.cx-sub-info-list {
  display: grid; gap: 0.85rem; margin-bottom: 1rem;
}
.cx-sub-info-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
.cx-sub-info-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.85rem;
}
.cx-sub-info-card-title {
  font-weight: 700; color: #ffffff; font-size: 1rem;
}
.cx-sub-info-card-pill {
  font-size: 0.78rem; font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.2);
  color: #c9bbff;
  border: 1px solid rgba(124, 92, 255, 0.4);
}
.cx-sub-info-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem 1rem;
}
.cx-sub-info-explain {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1rem;
  font-size: 0.92rem;
}
@media (max-width: 540px) {
  .cx-sub-info-grid { grid-template-columns: 1fr; }
}

/* Accent pill variant on encryption banner */
.cx-max-banner-pill--accent {
  background: linear-gradient(95deg, rgba(124,92,255,0.85), rgba(76,201,240,0.85)) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* ─── Subscription preset cards (admin → assign subscription) ─── */
.cx-preset-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
  margin: 0 0 1.2rem 0;
}
.cx-preset-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  text-align: left;
  color: #d4d6e3;
  transition: all 0.16s ease;
  font-family: inherit;
}
.cx-preset-card:hover {
  border-color: rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.06);
}
.cx-preset-card.is-on {
  border-color: rgba(124, 92, 255, 0.7);
  background: rgba(124, 92, 255, 0.14);
  box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.18) inset;
}
.cx-preset-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.3rem;
}
.cx-preset-name {
  font-weight: 700; color: #ffffff; font-size: 0.95rem;
}
.cx-preset-price {
  color: #c9bbff; font-weight: 700; font-size: 0.92rem;
}
.cx-preset-card-meta {
  font-size: 0.78rem; color: #a8adc1; line-height: 1.4;
}
.cx-preset-card--custom {
  border-style: dashed;
}

/* Lock the input fields visually when a preset is active. */
.cx-settings-grid.is-locked input[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
}
