/* ==========================================================================
   Liquid Glass theme panel
   Apple iOS18/visionOS-style refractive liquid glass: colorful blurred
   blob canvas behind, translucent saturated surfaces on top that bend
   the light of what's behind them, soft moving specular highlights.
   Every selector scoped under .theme-liquid — do not leak outward.
   ========================================================================== */

.theme-liquid {
  --lq-font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --lq-font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --lq-font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --lq-void: #090c18;
  --lq-violet: #8b5cf6;
  --lq-magenta: #ff3d9a;
  --lq-cyan: #22d3ee;
  --lq-amber: #ffb648;
  --lq-lime: #a3e635;

  --lq-glass-fill: linear-gradient(135deg, rgba(255,255,255,.30), rgba(255,255,255,.06) 45%, rgba(255,255,255,.14) 100%);
  --lq-glass-border: rgba(255,255,255,.38);
  --lq-glass-shadow: 0 10px 36px -6px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.25);
  --lq-text: #fdfeff;
  --lq-text-muted: rgba(255,255,255,.72);

  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(120% 90% at 15% 0%, #1a1040 0%, transparent 55%),
              radial-gradient(110% 90% at 90% 15%, #052a3d 0%, transparent 50%),
              radial-gradient(120% 100% at 50% 100%, #23103a 0%, transparent 60%),
              linear-gradient(180deg, var(--lq-void) 0%, #0c0f22 100%);
  color: var(--lq-text);
  font-family: var(--lq-font-body);
}

/* -------------------------------------------------------------------- */
/* Ambient blob canvas — the colorful "liquid" behind the glass          */
/* -------------------------------------------------------------------- */

.theme-liquid::before,
.theme-liquid::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .75;
  pointer-events: none;
}

.theme-liquid::before {
  top: -12%;
  left: -8%;
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  background:
    radial-gradient(circle at 30% 30%, var(--lq-magenta) 0%, transparent 60%),
    radial-gradient(circle at 70% 70%, var(--lq-violet) 0%, transparent 65%);
  animation: liquidDriftA 26s ease-in-out infinite alternate;
}

.theme-liquid::after {
  bottom: -16%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  min-width: 360px;
  min-height: 360px;
  background:
    radial-gradient(circle at 40% 40%, var(--lq-cyan) 0%, transparent 60%),
    radial-gradient(circle at 65% 60%, var(--lq-amber) 0%, transparent 65%);
  animation: liquidDriftB 32s ease-in-out infinite alternate;
}

@keyframes liquidDriftA {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(6%, 8%) scale(1.12); }
}

@keyframes liquidDriftB {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-6%, -6%) scale(1.08); }
}

/* a third small lime accent blob, cheap: box-shadow trick off a tiny node */
.theme-liquid .panel-head::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 20%;
  left: 45%;
  width: 30vw;
  height: 30vw;
  min-width: 240px;
  min-height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--lq-lime) 0%, transparent 68%);
  filter: blur(70px);
  opacity: .35;
  pointer-events: none;
  animation: liquidDriftC 38s ease-in-out infinite alternate;
}

@keyframes liquidDriftC {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-10%, 10%); }
}

@media (prefers-reduced-motion: reduce) {
  .theme-liquid::before,
  .theme-liquid::after,
  .theme-liquid .panel-head::before {
    animation: none;
  }
}

/* -------------------------------------------------------------------- */
/* Header                                                                */
/* -------------------------------------------------------------------- */

.theme-liquid .panel-head {
  position: relative;
  z-index: 1;
}

.theme-liquid .panel-head h2 {
  font-family: var(--lq-font-display);
  font-weight: 700;
  letter-spacing: -.01em;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  background: linear-gradient(100deg, #fff 20%, #d9c8ff 55%, #9ce8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 .3em;
}

.theme-liquid .panel-desc {
  color: var(--lq-text-muted);
  font-size: .95rem;
}

.theme-liquid .demo-block {
  position: relative;
  z-index: 1;
}

.theme-liquid .demo-block > h3 {
  font-family: var(--lq-font-display);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lq-text-muted);
  margin: 0 0 .75em;
}

/* -------------------------------------------------------------------- */
/* Shared glass surface — the core "liquid" material                    */
/* -------------------------------------------------------------------- */

.theme-liquid .btn,
.theme-liquid .field-input,
.theme-liquid .field-select,
.theme-liquid .liquid-toggle,
.theme-liquid .demo-card,
.theme-liquid .phone-screen,
.theme-liquid .ph-row,
.theme-liquid .ph-fab,
.theme-liquid .ph-nav,
.theme-liquid .player-widget,
.theme-liquid .player-progress {
  background: var(--lq-glass-fill);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--lq-glass-border);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.65),
    inset 0 -14px 24px -18px rgba(255,255,255,.4),
    var(--lq-glass-shadow);
}

/* moving specular sweep — the signature "flowing light" element,
   layered on every glass surface via a shared pseudo-element recipe */
.theme-liquid .btn,
.theme-liquid .demo-card,
.theme-liquid .phone-screen,
.theme-liquid .player-widget {
  position: relative;
  overflow: hidden;
}

.theme-liquid .btn::before,
.theme-liquid .demo-card::before,
.theme-liquid .phone-screen::before,
.theme-liquid .player-widget::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 46%, transparent 62%);
  mix-blend-mode: overlay;
  opacity: .8;
  transform: translateX(-30%);
  animation: liquidSheen 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes liquidSheen {
  0%, 100% { transform: translateX(-35%) translateY(-8%); }
  50%      { transform: translateX(20%) translateY(8%); }
}

@media (prefers-reduced-motion: reduce) {
  .theme-liquid .btn::before,
  .theme-liquid .demo-card::before,
  .theme-liquid .phone-screen::before,
  .theme-liquid .player-widget::before {
    animation: none;
  }
}

.theme-liquid :focus-visible {
  outline: 2px solid #eafcff;
  outline-offset: 3px;
  border-radius: 10px;
}

/* -------------------------------------------------------------------- */
/* Buttons                                                               */
/* -------------------------------------------------------------------- */

.theme-liquid .demo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  align-items: center;
}

.theme-liquid .btn {
  font-family: var(--lq-font-body);
  font-size: .92rem;
  font-weight: 600;
  color: var(--lq-text);
  border-radius: 999px;
  padding: .7rem 1.4rem;
  min-height: 44px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}

.theme-liquid .btn:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.7),
    inset 0 -14px 24px -18px rgba(255,255,255,.5),
    0 16px 40px -8px rgba(0,0,0,.5);
}

.theme-liquid .btn:active {
  transform: translateY(0);
}

.theme-liquid .btn-primary {
  background:
    linear-gradient(135deg, rgba(139,92,246,.55), rgba(34,211,238,.35) 60%, rgba(255,255,255,.12) 100%),
    var(--lq-glass-fill);
  border-color: rgba(210, 235, 255, .55);
}

.theme-liquid .btn-outline {
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.03));
  color: var(--lq-text);
}

.theme-liquid .btn-icon {
  padding: 0;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 50%;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-liquid .btn-disabled,
.theme-liquid .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  filter: saturate(.6);
}

.theme-liquid .btn-disabled::before {
  animation: none;
}

.theme-liquid .btn-danger {
  background:
    linear-gradient(135deg, rgba(255,90,110,.55), rgba(255,61,154,.3) 60%, rgba(255,255,255,.1) 100%),
    var(--lq-glass-fill);
  border-color: rgba(255,205,215,.5);
}

/* -------------------------------------------------------------------- */
/* Form                                                                  */
/* -------------------------------------------------------------------- */

.theme-liquid .demo-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 380px;
}

.theme-liquid .field {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.theme-liquid .field-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--lq-text-muted);
}

.theme-liquid .field-input,
.theme-liquid .field-select {
  appearance: none;
  border-radius: 16px;
  padding: .75rem 1rem;
  font-size: .95rem;
  font-family: var(--lq-font-body);
  color: var(--lq-text);
  min-height: 44px;
}

.theme-liquid .field-input::placeholder {
  color: rgba(255,255,255,.55);
}

.theme-liquid .field-select {
  background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,.8) 50%),
                     linear-gradient(135deg, rgba(255,255,255,.8) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 15px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}

.theme-liquid .field-select option {
  background: #1a1c2e;
  color: #fff;
}

.theme-liquid .field-input:focus,
.theme-liquid .field-select:focus {
  outline: none;
  border-color: rgba(255,255,255,.75);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.65),
    0 0 0 3px rgba(139,92,246,.35);
}

.theme-liquid .field-toggle-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.theme-liquid .liquid-toggle {
  position: relative;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(139,92,246,.6), rgba(34,211,238,.4));
}

.theme-liquid .liquid-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.theme-liquid .liquid-toggle-knob {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #e9e9f5 70%);
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: right .2s ease;
}

.theme-liquid .field-submit {
  align-self: flex-start;
  margin-top: .3rem;
}

/* -------------------------------------------------------------------- */
/* Card                                                                  */
/* -------------------------------------------------------------------- */

.theme-liquid .demo-card {
  border-radius: 28px;
  padding: 1.6rem;
  max-width: 380px;
}

.theme-liquid .card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(34,211,238,.45), rgba(139,92,246,.35));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.6);
  margin-bottom: .9rem;
}

.theme-liquid .card-title {
  font-family: var(--lq-font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 .4rem;
}

.theme-liquid .card-desc {
  font-size: .88rem;
  line-height: 1.6;
  color: var(--lq-text-muted);
  margin: 0 0 1rem;
}

.theme-liquid .card-action {
  color: #cdeeff;
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(205,238,255,.4);
  padding-bottom: 2px;
  transition: border-color .18s ease;
}

.theme-liquid .card-action:hover {
  border-color: rgba(205,238,255,.9);
}

/* -------------------------------------------------------------------- */
/* Phone mock — only .phone-screen contents, chrome is shared shell     */
/* -------------------------------------------------------------------- */

.theme-liquid .phone-screen {
  padding: 1.1rem .9rem 5.4rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  border-radius: 34px;
  background:
    radial-gradient(120% 60% at 20% 0%, rgba(139,92,246,.35), transparent 60%),
    radial-gradient(120% 60% at 90% 100%, rgba(34,211,238,.3), transparent 60%),
    var(--lq-glass-fill);
}

.theme-liquid .ph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .2rem .2rem .3rem;
}

.theme-liquid .ph-title {
  font-family: var(--lq-font-display);
  font-weight: 700;
  font-size: 1.02rem;
}

.theme-liquid .ph-header-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.3);
}

.theme-liquid .ph-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.theme-liquid .ph-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  border-radius: 18px;
  padding: .65rem .75rem;
}

.theme-liquid .ph-row-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  background: linear-gradient(135deg, rgba(255,182,72,.4), rgba(255,61,154,.3));
}

.theme-liquid .ph-row-text {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}

.theme-liquid .ph-row-title {
  font-size: .82rem;
  font-weight: 600;
  color: var(--lq-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-liquid .ph-row-sub {
  font-size: .72rem;
  color: var(--lq-text-muted);
  font-family: var(--lq-font-mono);
}

.theme-liquid .ph-fab {
  position: absolute;
  right: 1.1rem;
  bottom: 4.6rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--lq-glass-border);
  background: linear-gradient(135deg, rgba(163,230,53,.55), rgba(34,211,238,.4));
  color: #08210f;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.7), 0 10px 24px -6px rgba(0,0,0,.5);
}

.theme-liquid .ph-nav {
  position: absolute;
  left: .9rem;
  right: .9rem;
  bottom: 1rem;
  height: 58px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.theme-liquid .ph-nav-item {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.05rem;
  opacity: .6;
}

.theme-liquid .ph-nav-active {
  opacity: 1;
  background: linear-gradient(135deg, rgba(139,92,246,.55), rgba(34,211,238,.4));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.7);
}

/* -------------------------------------------------------------------- */
/* Usage widget — liquid music player                                   */
/* -------------------------------------------------------------------- */

.theme-liquid .demo-usage {
  display: flex;
  justify-content: flex-start;
}

.theme-liquid .player-widget {
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  border-radius: 30px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  background:
    radial-gradient(120% 70% at 30% 0%, rgba(255,61,154,.35), transparent 60%),
    radial-gradient(120% 70% at 90% 100%, rgba(34,211,238,.35), transparent 60%),
    var(--lq-glass-fill);
}

.theme-liquid .player-art {
  width: 96px;
  height: 96px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  margin-bottom: .5rem;
  background: linear-gradient(150deg, var(--lq-violet), var(--lq-cyan) 60%, var(--lq-lime));
  box-shadow: inset 0 2px 3px rgba(255,255,255,.5), 0 14px 30px -10px rgba(0,0,0,.55);
}

.theme-liquid .player-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  margin-bottom: .8rem;
  text-align: center;
}

.theme-liquid .player-track {
  font-family: var(--lq-font-display);
  font-weight: 700;
  font-size: 1rem;
}

.theme-liquid .player-artist {
  font-size: .8rem;
  color: var(--lq-text-muted);
}

.theme-liquid .player-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  padding: 0;
}

.theme-liquid .player-progress-fill {
  width: 38%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lq-violet), var(--lq-cyan));
  box-shadow: 0 0 10px rgba(34,211,238,.7);
}

.theme-liquid .player-time {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-family: var(--lq-font-mono);
  font-size: .68rem;
  color: var(--lq-text-muted);
  margin: .35rem 0 1rem;
}

.theme-liquid .player-controls {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.theme-liquid .player-btn {
  font-size: .9rem;
}

.theme-liquid .player-btn-main {
  width: 56px;
  height: 56px;
  min-height: 56px;
  font-size: 1.15rem;
  background: linear-gradient(135deg, rgba(139,92,246,.6), rgba(34,211,238,.4));
}

/* -------------------------------------------------------------------- */
/* Secondary button (used by the Loading demo trigger)                  */
/* -------------------------------------------------------------------- */

.theme-liquid .btn-secondary {
  background:
    linear-gradient(135deg, rgba(34,211,238,.35), rgba(163,230,53,.22) 60%, rgba(255,255,255,.1) 100%),
    var(--lq-glass-fill);
  border-color: rgba(210,255,240,.5);
}

/* -------------------------------------------------------------------- */
/* Alert dialog — glass modal that condenses out of the liquid canvas   */
/* -------------------------------------------------------------------- */

.theme-liquid .theme-alert-backdrop {
  background: radial-gradient(120% 100% at 50% 0%, rgba(30,12,60,.55), rgba(4,6,16,.78));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.theme-liquid .theme-alert-box {
  position: relative;
  width: min(360px, 88vw);
  box-sizing: border-box;
  padding: 1.8rem 1.6rem 1.6rem;
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(120% 70% at 30% 0%, rgba(255,61,154,.32), transparent 60%),
    radial-gradient(120% 70% at 90% 100%, rgba(34,211,238,.32), transparent 60%),
    var(--lq-glass-fill);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--lq-glass-border);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.65),
    inset 0 -14px 24px -18px rgba(255,255,255,.4),
    0 24px 60px -12px rgba(0,0,0,.6);
  overflow: hidden;
  animation: liquidAlertPop .32s cubic-bezier(.2,1,.3,1);
}

.theme-liquid .theme-alert-box::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.5) 46%, transparent 62%);
  mix-blend-mode: overlay;
  opacity: .8;
  transform: translateX(-30%) translateY(-8%);
  animation: liquidSheen 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes liquidAlertPop {
  0%   { opacity: 0; transform: scale(.9) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.theme-liquid .alert-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,182,72,.5), rgba(255,61,154,.35));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.6);
}

.theme-liquid .alert-title {
  font-family: var(--lq-font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 .5rem;
  color: var(--lq-text);
}

.theme-liquid .alert-desc {
  font-size: .86rem;
  line-height: 1.6;
  color: var(--lq-text-muted);
  margin: 0 0 1.4rem;
}

.theme-liquid .alert-actions {
  display: flex;
  gap: .7rem;
  justify-content: center;
}

.theme-liquid .alert-actions .btn {
  flex: 1;
  padding-left: .8rem;
  padding-right: .8rem;
}

@media (prefers-reduced-motion: reduce) {
  .theme-liquid .theme-alert-box {
    animation: none;
  }
  .theme-liquid .theme-alert-box::before {
    animation: none;
  }
}

/* -------------------------------------------------------------------- */
/* Loading — spinner + skeleton + result, all liquid-glass material     */
/* -------------------------------------------------------------------- */

.theme-liquid .demo-loading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.theme-liquid .loading-panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  box-sizing: border-box;
  min-height: 108px;
  border-radius: 24px;
  padding: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lq-glass-fill);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--lq-glass-border);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.65),
    inset 0 -14px 24px -18px rgba(255,255,255,.4),
    var(--lq-glass-shadow);
}

/* spinner — glowing refractive ring, hidden unless state=loading */
.theme-liquid .loading-spinner {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.theme-liquid .loading-panel[data-state="loading"] .loading-spinner {
  display: block;
  background: conic-gradient(from 0deg,
    var(--lq-violet) 0deg,
    var(--lq-cyan) 120deg,
    var(--lq-lime) 220deg,
    transparent 320deg,
    transparent 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
  filter: drop-shadow(0 0 10px rgba(139,92,246,.6)) drop-shadow(0 0 6px rgba(34,211,238,.5));
  animation: liquidSpin .9s linear infinite;
}

@keyframes liquidSpin {
  to { transform: rotate(360deg); }
}

/* skeleton — idle placeholder, dimmed while loading, gone when done */
.theme-liquid .loading-skeleton {
  display: none;
  flex-direction: column;
  gap: .6rem;
  width: 100%;
}

.theme-liquid .loading-panel[data-state="idle"] .loading-skeleton,
.theme-liquid .loading-panel[data-state="loading"] .loading-skeleton {
  display: flex;
}

.theme-liquid .loading-panel[data-state="loading"] .loading-skeleton {
  opacity: .45;
}

.theme-liquid .skel-line {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(100deg,
    rgba(255,255,255,.14) 20%,
    rgba(255,255,255,.4) 42%,
    rgba(255,255,255,.14) 64%);
  background-size: 220% 100%;
  animation: liquidShimmer 1.6s ease-in-out infinite;
}

.theme-liquid .skel-w1 { width: 88%; }
.theme-liquid .skel-w2 { width: 62%; }
.theme-liquid .skel-w3 { width: 74%; }

@keyframes liquidShimmer {
  0%   { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

/* result — revealed only when state=done, must beat the [hidden] attribute */
.theme-liquid .loading-result {
  width: 100%;
  text-align: center;
}

.theme-liquid .loading-result p {
  margin: 0;
  font-size: .9rem;
  font-weight: 600;
  color: var(--lq-text);
}

.theme-liquid .loading-panel[data-state="done"] .loading-spinner,
.theme-liquid .loading-panel[data-state="done"] .loading-skeleton {
  display: none;
}

.theme-liquid .loading-panel[data-state="done"] .loading-result[hidden] {
  display: block;
  animation: liquidResultIn .3s ease-out;
}

@keyframes liquidResultIn {
  0%   { opacity: 0; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .theme-liquid .loading-spinner,
  .theme-liquid .skel-line,
  .theme-liquid .loading-result[hidden] {
    animation: none;
  }
}

/* -------------------------------------------------------------------- */
/* Narrow viewport safety (~375px)                                      */
/* -------------------------------------------------------------------- */

@media (max-width: 420px) {
  .theme-liquid .demo-form,
  .theme-liquid .demo-card,
  .theme-liquid .player-widget,
  .theme-liquid .loading-panel {
    max-width: 100%;
  }

  .theme-liquid .demo-buttons {
    gap: .5rem;
  }

  .theme-liquid .btn {
    padding: .65rem 1.1rem;
    font-size: .85rem;
  }

  .theme-liquid .theme-alert-box {
    width: min(320px, 90vw);
    padding: 1.5rem 1.2rem 1.3rem;
  }

  .theme-liquid .alert-actions {
    flex-direction: column;
  }
}
