/* ═══════════════════════════════════════════
   NGAWI AI — STYLE.CSS
   Pixel Glass Edition
═══════════════════════════════════════════ */

/* ── VARIABLES ── */
:root {
  --bg: #050505; /* pure deep obsidian */
  --bg2: #0f111a; /* deep navy for panels */
  --surf: rgba(255, 255, 255, 0.04);
  --surf2: rgba(255, 255, 255, 0.06);
  --glass: rgba(15, 17, 26, 0.6);
  --glass2: rgba(255, 255, 255, 0.02);
  --glass-border: rgba(99, 102, 241, 0.15);
  --glass-shine: rgba(255, 255, 255, 0.08);
  --text: #f0f2f5; /* clean crisp white */
  --text2: rgba(240, 242, 245, 0.7);
  --accent: #6366f1; /* vibrant indigo */
  --accent2: #06b6d4; /* electric cyan */
  --accent3: #ec4899; /* hot pink / magenta */
  --accent-dim: rgba(99, 102, 241, 0.12);
  --user-bubble: linear-gradient(
    135deg,
    #4f46e5,
    #7c3aed
  ); /* premium violet gradient */
  --border: rgba(99, 102, 241, 0.1);
  --error: #ff4d4d;
  --success: #00ff9d;
  --glow: rgba(99, 102, 241, 0.3);
  --glow2: rgba(6, 182, 212, 0.2);
  --music-grad: linear-gradient(135deg, #6366f1, #06b6d4);
  --music-glow: rgba(99, 102, 241, 0.25);
  --header-h: 62px;
}

/* ── LIGHT MODE — Pristine Glass ── */
[data-theme="light"] {
  --bg: #fdfdff;
  --bg2: #f4f7ff;
  --surf: rgba(255, 255, 255, 0.7);
  --surf2: rgba(255, 255, 255, 0.9);
  --glass: rgba(255, 255, 255, 0.8);
  --glass2: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(79, 70, 229, 0.15);
  --glass-shine: rgba(255, 255, 255, 0.95);
  --text: #0f172a;
  --text2: rgba(15, 23, 42, 0.7);
  --accent: #4f46e5;
  --accent2: #0891b2;
  --accent3: #db2777;
  --accent-dim: rgba(79, 70, 229, 0.08);
  --user-bubble: linear-gradient(135deg, #4f46e5, #3b82f6);
  --border: rgba(79, 70, 229, 0.1);
  --error: #dc2626;
  --success: #059669;
  --glow: rgba(79, 70, 229, 0.2);
  --glow2: rgba(8, 145, 178, 0.15);
  --music-glow: rgba(79, 70, 229, 0.2);
}

/* ── RESET ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  height: 100%;
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Poppins", sans-serif;
  position: relative;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none !important;
  width: 0;
  height: 0;
}
input[type="password"]::-webkit-contacts-auto-fill-button,
input[type="password"]::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
  height: 0;
  width: 0;
  margin: 0;
}

/* ═══════════════════════════════════════════
   BACKGROUND
═══════════════════════════════════════════ */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.bg-orb-1 {
  width: min(500px, 80vw);
  height: min(500px, 80vw);
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.25;
  top: -100px;
  left: -100px;
  animation: orbFloat 12s ease-in-out infinite;
}
.bg-orb-2 {
  width: min(400px, 70vw);
  height: min(400px, 70vw);
  background: radial-gradient(circle, var(--accent2) 0%, transparent 70%);
  opacity: 0.18;
  top: 50%;
  right: -150px;
  animation: orbFloat 12s ease-in-out infinite -4s;
}
.bg-orb-3 {
  width: min(350px, 60vw);
  height: min(350px, 60vw);
  background: radial-gradient(circle, var(--accent3) 0%, transparent 70%);
  opacity: 0.15;
  bottom: -80px;
  left: 30%;
  animation: orbFloat 12s ease-in-out infinite -8s;
}
.bg-orb-4 {
  width: min(300px, 55vw);
  height: min(300px, 55vw);
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.12;
  top: 30%;
  left: 60%;
  animation: orbFloat 15s ease-in-out infinite -6s;
}
@keyframes orbFloat {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -25px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(167, 139, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}
[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(rgba(109, 40, 217, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 40, 217, 0.06) 1px, transparent 1px);
}
.bg-scanlines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.012) 3px,
    rgba(0, 0, 0, 0.012) 4px
  );
}

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
header {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow:
    0 1px 0 var(--glass-shine),
    0 4px 24px var(--glow),
    0 8px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  min-height: var(--header-h);
  flex-shrink: 0;
}

/* Tablet+Desktop: true centered mini player (grid layout) */
@media (min-width: 601px) {
  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    position: relative;
  }
  #headerMusicMini {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    margin: 0;
  }
}
header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--glass-shine) 50%,
    transparent
  );
  z-index: 2;
}
header::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent2) 33%,
    var(--accent3) 66%,
    var(--accent) 100%
  );
  background-size: 200% 100%;
  box-shadow:
    0 0 12px var(--glow),
    0 0 24px var(--glow2);
  animation: navGlowShift 4s linear infinite;
  z-index: 2;
}
@keyframes navGlowShift {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 200% 0%;
  }
}

.logo-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 6px 14px 6px 8px;
  box-shadow:
    0 2px 12px var(--glow),
    inset 0 1px 0 var(--glass-shine);
  cursor: pointer;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.25s;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.logo-pill:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px var(--glow);
}
.logo-dot {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    var(--accent3),
    var(--accent),
    var(--accent2)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  color: #fff;
  box-shadow:
    0 0 14px var(--glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: pixelGlow 2s ease-in-out infinite;
  position: relative;
  flex-shrink: 0;
}
.logo-dot::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
@keyframes pixelGlow {
  0%,
  100% {
    box-shadow:
      0 0 10px var(--glow),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow:
      0 0 24px var(--glow),
      0 0 44px var(--glow2),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
}
.logo-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.logo-text {
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px var(--glow));
  white-space: nowrap;
  transition: all 0.3s ease;
}

/* ── Header music mini — NO beat animation ── */
.header-music-mini {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 5px 12px;
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 var(--glass-shine);
  max-width: 150px;
  overflow: hidden;
  animation: fadeUp 0.3s ease;
  position: relative;
  z-index: 1;
}
.header-music-mini.visible {
  display: flex;
}
.mini-song-name {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  max-width: 100px;
}
/* Static bars — absolutely NO animation/denyut */
.mini-vis-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  flex-shrink: 0;
}
.mini-vis-bar {
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(to top, var(--accent3), var(--accent));
  transform-origin: bottom;
}
.mini-vis-bar:nth-child(1) {
  height: 6px;
}
.mini-vis-bar:nth-child(2) {
  height: 11px;
}
.mini-vis-bar:nth-child(3) {
  height: 7px;
}

/* Beat animation (only when playing) */
.header-music-mini.playing .mini-vis-bar {
  animation: miniBeat 0.75s ease-in-out infinite;
}
.header-music-mini.playing .mini-vis-bar:nth-child(2) {
  animation-duration: 0.62s;
}
.header-music-mini.playing .mini-vis-bar:nth-child(3) {
  animation-duration: 0.84s;
}
@keyframes miniBeat {
  0% {
    transform: scaleY(0.55);
    opacity: 0.65;
  }
  40% {
    transform: scaleY(1.15);
    opacity: 1;
  }
  100% {
    transform: scaleY(0.7);
    opacity: 0.8;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
  z-index: 1;
}
.ai-presence-chip {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  user-select: none;
  transition: all 0.18s ease;
}
.ai-presence-chip.ready {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.45);
}
.ai-presence-chip.thinking {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.45);
}
.ai-presence-chip.typing {
  color: #67e8f9;
  border-color: rgba(103, 232, 249, 0.45);
}
.desktop-only {
  display: flex;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
  box-shadow: inset 0 1px 0 var(--glass-shine);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.icon-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.15),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.2s;
}
.icon-btn:hover::after {
  opacity: 1;
}
.icon-btn:hover {
  background: var(--surf2);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow:
    0 0 14px var(--glow),
    inset 0 1px 0 var(--glass-shine);
  transform: translateY(-2px) scale(1.05);
}
.icon-btn:active {
  transform: scale(0.95);
}
.icon-btn .material-symbols-rounded {
  font-size: 19px;
  position: relative;
  z-index: 1;
}
.icon-btn.music-active {
  color: var(--accent3);
  border-color: var(--accent3);
  box-shadow:
    0 0 14px var(--music-glow),
    inset 0 1px 0 var(--glass-shine);
}
#profileTrigger img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 0 12px var(--glow);
  transition: transform 0.2s;
}
#profileTrigger img:hover {
  transform: scale(1.1);
}

/* ═══════════════════════════════════════════
   CHAT BOX
═══════════════════════════════════════════ */
#chatBox {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px calc(180px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
  position: relative;
  z-index: 1;
}
#chatBox.welcome-mode {
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding-bottom: calc(248px + env(safe-area-inset-bottom));
}
#chatBox.welcome-mode::-webkit-scrollbar {
  width: 0;
  display: none;
}
#chatBox::-webkit-scrollbar {
  width: 3px;
}
#chatBox::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), var(--accent2));
  border-radius: 4px;
}

/* ═══════════════════════════════════════════
   WELCOME SCREEN
═══════════════════════════════════════════ */
#welcome {
  margin: auto;
  text-align: center;
  padding: 28px 20px;
  animation: fadeUp 0.6s cubic-bezier(0.34, 1.4, 0.64, 1);
  max-width: 520px;
  width: 100%;
  align-self: center;
}
.welcome-orb-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 22px;
}
.welcome-icon {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--surf2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 3px var(--accent-dim),
    0 0 30px var(--glow);
  animation: iconPulse 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}
@keyframes iconPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px var(--accent-dim),
      0 0 30px var(--glow),
      0 0 60px rgba(103, 232, 249, 0.15);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 0 6px var(--accent-dim),
      0 0 50px var(--glow),
      0 0 90px rgba(103, 232, 249, 0.25);
    transform: scale(1.04);
  }
}
.welcome-gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pixel-corner {
  display: none;
}
#welcomeText {
  font-family: "Press Start 2P", monospace;
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 15px var(--glow));
}
.welcome-sub {
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.6;
  font-weight: 400;
}
.chips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
  box-shadow: inset 0 1px 0 var(--glass-shine);
  position: relative;
  overflow: hidden;
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  text-align: left;
}
.chip-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.chip-text {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.3;
}
.chip::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  transition: left 0.5s;
}
.chip:hover::before {
  left: 100%;
}
.chip:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 8px 20px var(--glow),
    inset 0 1px 0 var(--glass-shine);
}
.chip:hover .chip-text {
  color: var(--accent);
}
.chip:active {
  transform: translateY(0) scale(0.97);
}

/* ═══════════════════════════════════════════
   MESSAGES
═══════════════════════════════════════════ */
.msg {
  display: flex;
  gap: 10px;
  max-width: 100%;
  margin: 3px 0;
}
.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.ai {
  align-self: flex-start;
}
.msg.user {
  animation: sendBubble 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.msg.ai {
  animation: recvBubble 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
  flex-wrap: wrap;
}
@keyframes sendBubble {
  0% {
    opacity: 0;
    transform: translateX(30px) scale(0.85);
  }
  60% {
    transform: translateX(-4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
@keyframes recvBubble {
  0% {
    opacity: 0;
    transform: translateX(-20px) scale(0.9);
  }
  60% {
    transform: translateX(4px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
.ai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent3), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #fff;
  flex-shrink: 0;
  margin-top: 3px;
  box-shadow:
    0 0 12px var(--glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: avatarPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes avatarPop {
  from {
    transform: scale(0) rotate(-10deg);
  }
  to {
    transform: scale(1) rotate(0);
  }
}
.bubble {
  padding: 12px 18px;
  border-radius: 20px;
  line-height: 1.7;
  font-size: 14.5px;
  max-width: min(520px, 78vw);
  word-break: break-word;
  font-family: "Poppins", sans-serif;
  position: relative;
  overflow: hidden;
}
.user .bubble {
  background: var(--user-bubble);
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow:
    0 4px 20px var(--glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.user .bubble::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    transparent 50%
  );
  pointer-events: none;
}
.ai .bubble {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--text);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 5px;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 var(--glass-shine);
}
.bubble .inline-code {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.92em;
  line-height: 1.5;
  word-break: break-word;
}
.code-block {
  margin: 10px 0;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  background: #1e1e1e;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.code-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #252526;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.code-toolbar-dots {
  display: inline-flex;
  gap: 6px;
}
.code-toolbar-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.code-toolbar-dots span:nth-child(1) {
  background: #ff5f56;
}
.code-toolbar-dots span:nth-child(2) {
  background: #ffbd2e;
}
.code-toolbar-dots span:nth-child(3) {
  background: #27c93f;
}
.code-block-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9cdcfe;
  text-align: center;
}
.code-toolbar-spacer {
  width: 28px;
}
.code-block pre {
  margin: 0;
  padding: 12px 0;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}
.code-block code {
  display: block;
  color: #d4d4d4;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12.5px;
}
.code-line {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
}
.code-line-no {
  padding: 0 12px 0 14px;
  color: #6a9955;
  text-align: right;
  user-select: none;
  opacity: 0.85;
}
.code-line-text {
  display: block;
  padding-right: 14px;
  white-space: pre;
}
[data-theme="light"] .bubble .inline-code {
  background: rgba(79, 70, 229, 0.08);
}
[data-theme="light"] .code-block {
  background: #f3f3f3;
  border-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .code-toolbar {
  background: #e5e7eb;
  border-bottom-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .code-block-label {
  color: #1d4ed8;
}
[data-theme="light"] .code-block code {
  color: #1f2937;
}
[data-theme="light"] .code-line-no {
  color: #6b7280;
}
.typing-indicator-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  border-bottom-left-radius: 5px;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 var(--glass-shine);
  max-width: 180px;
}
.typing-label {
  font-size: 11px;
  color: var(--text2);
  font-style: italic;
  animation: typingFade 1.5s ease-in-out infinite;
}
@keyframes typingFade {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}
.typing-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  animation: pixelBounce 1.1s ease-in-out infinite;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.18s;
  background: var(--accent2);
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.36s;
  background: var(--accent3);
}
@keyframes pixelBounce {
  0%,
  60%,
  100% {
    transform: translateY(0) scaleY(1);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-8px) scaleY(0.8);
    opacity: 1;
  }
}
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--accent);
  margin-left: 3px;
  animation: blink 0.8s step-end infinite;
  vertical-align: middle;
  border-radius: 1px;
  box-shadow: 0 0 6px var(--glow);
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════
   INPUT AREA
═══════════════════════════════════════════ */
.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 38%);
  z-index: 50;
  transition: bottom 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
  flex-shrink: 0;
}
.input-wrap {
  max-width: 720px;
  margin: 0 auto;
  background: var(--glass);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 0 8px 0 16px;
  gap: 8px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 var(--glass-shine);
  transition: all 0.3s;
  position: relative;
  min-height: 54px;
}
.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow:
    0 8px 32px var(--glow),
    0 0 0 2px rgba(167, 139, 255, 0.15),
    inset 0 1px 0 var(--glass-shine);
}
.attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.attach-btn:hover {
  background: var(--surf2);
  color: var(--accent2);
}
.attach-btn .material-symbols-rounded {
  font-size: 22px;
}
.image-preview-area {
  max-width: 720px;
  margin: 0 auto 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preview-item {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 4px 12px var(--glow);
  animation: fadeUp 0.3s ease;
}
.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-remove {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: var(--error);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
/* ── Chat Sent Image ── */
.chat-image-wrap {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  width: 100%;
}
.chat-image-wrap:first-child {
  margin-top: 0;
}
.chat-sent-img {
  width: 100%;
  max-width: 280px;
  max-height: 350px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  object-fit: cover;
  transition: transform 0.2s ease;
  cursor: zoom-in;
  display: block;
}
.chat-sent-img:hover {
  transform: scale(1.01);
}
.ai .chat-image-wrap {
  justify-content: flex-start;
}

/* Jika bubble cuma isi gambar, padding harus seimbang */
.bubble:has(.chat-image-wrap) {
  padding: 10px;
}
.bubble:has(.chat-image-wrap) br {
  display: none;
}
.bubble:has(.chat-image-wrap:only-child) {
  padding: 8px;
}

/* ── Image Viewer (Lightbox) ── */
.viewer-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.viewer-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}
.viewer-close {
  position: fixed;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 5100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.viewer-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg) scale(1.1);
}
.viewer-close .material-symbols-rounded {
  font-size: 28px;
}
@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.input-ph {
  position: absolute;
  left: 60px;
  right: 66px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  color: var(--text2);
  font-size: 14.5px;
  font-family: "Poppins", sans-serif;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 2;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.input-ph.hidden {
  opacity: 0;
}
#uIn {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14.5px;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  resize: none;
  overflow-y: auto;
  max-height: 140px;
  min-height: 24px;
  line-height: 1.6;
  padding: 15px 0;
  display: block;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  position: relative;
  z-index: 3;
}
#uIn::-webkit-scrollbar {
  width: 3px;
}
#uIn::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}
#uIn::placeholder {
  color: transparent;
}
.input-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  align-self: flex-end;
  padding-bottom: 6px;
}
.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  box-shadow:
    0 4px 14px var(--glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
}
.send-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(rgba(255, 255, 255, 0.15), transparent);
  border-radius: 50% 50% 0 0;
}
.send-btn:hover {
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 10px 28px var(--glow);
}
.send-btn:active {
  transform: scale(0.93);
}
.send-btn:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}
.send-btn .material-symbols-rounded {
  font-size: 19px;
  position: relative;
  z-index: 1;
}
.input-hint {
  text-align: center;
  font-size: 10px;
  color: var(--text2);
  margin-top: 4px;
  opacity: 0.45;
  font-family: "Poppins", sans-serif;
}
.dev-tools-bar {
  width: min(720px, 100%);
  max-width: 720px;
  margin: 8px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}
.dev-tools-bar::-webkit-scrollbar {
  display: none;
}
.dev-tool-btn {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text2);
  border-radius: 999px;
  padding: 6px 11px;
  min-height: 30px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
}
.dev-tool-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(167, 139, 255, 0.08);
}
.dev-tool-btn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.28);
}
.dev-tool-btn.off {
  background: transparent;
  border-style: dashed;
}
.dev-tool-btn.off.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--glass-border);
  color: var(--text);
  box-shadow: none;
}
.site-footer {
  max-width: 720px;
  margin: 8px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text2);
  opacity: 0.72;
  flex-wrap: wrap;
}
.site-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(167, 139, 255, 0.4);
  transition: color 0.2s ease;
}
.site-footer a:hover {
  color: var(--text);
}
.particle {
  position: fixed;
  pointer-events: none;
  z-index: 9000;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: particleFly 0.8s ease-out forwards;
}
@keyframes particleFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.2) rotate(var(--rot));
  }
}

/* ═══════════════════════════════════════════
   MUSIC PANEL — FULL SCREEN
═══════════════════════════════════════════ */
#musicPanel {
  position: fixed;
  inset: 0;
  top: 100dvh;
  z-index: 200;
  background: var(--bg2);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-top: 1px solid var(--glass-border);
  box-shadow:
    0 -20px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 var(--glass-shine);
  transition: top 0.48s cubic-bezier(0.34, 1.15, 0.64, 1);
  display: flex;
  flex-direction: row;
  overflow: hidden;
}
#musicPanel.open {
  top: 0;
}

/* ── Light mode music panel — jelas & nyaman ── */
[data-theme="light"] #musicPanel {
  background: #f5f0ff;
}
[data-theme="light"] .mp-side-col {
  background: #ede8ff;
  border-top-color: rgba(109, 40, 217, 0.2);
}
[data-theme="light"] .mobile-tabs-bar {
  background: #ede8ff;
  border-top-color: rgba(109, 40, 217, 0.2);
}
[data-theme="light"] .music-panel-bg {
  background: linear-gradient(
    180deg,
    rgba(109, 40, 217, 0.06) 0%,
    transparent 60%
  );
}
[data-theme="light"] .ctrl-btn {
  color: #3b1f8c;
}
[data-theme="light"] .ctrl-btn:hover {
  color: var(--accent);
}
[data-theme="light"] .ctrl-btn.play-pause {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--glow);
}
[data-theme="light"] .ctrl-btn.play-pause:hover {
  box-shadow: 0 8px 30px var(--glow);
}
[data-theme="light"] .music-title {
  color: #1a1040;
  font-weight: 800;
}
[data-theme="light"] .music-artist {
  color: rgba(60, 30, 120, 0.75);
}
[data-theme="light"] .music-panel-title {
  color: rgba(60, 30, 120, 0.6);
}
[data-theme="light"] .time-row {
  color: rgba(60, 30, 120, 0.7);
}
[data-theme="light"] .time-row span {
  color: #3b1f8c; /* Ungu gelap solid agar lebih kontras */
  font-weight: 600;
}
[data-theme="light"] .progress-bar-wrap {
  background: rgba(109, 40, 217, 0.18);
}
[data-theme="light"] .progress-fill {
  background: var(--accent);
}
[data-theme="light"] .progress-fill::after {
  background: var(--accent);
  box-shadow: 0 0 6px var(--glow);
}
[data-theme="light"] input[type="range"].vol-slider {
  background: rgba(109, 40, 217, 0.2);
}
[data-theme="light"] .volume-row .material-symbols-rounded {
  color: rgba(60, 30, 120, 0.7);
}
[data-theme="light"] .yt-tab-btn {
  color: rgba(60, 30, 120, 0.6);
}
[data-theme="light"] .yt-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
[data-theme="light"] .yt-tab-btn:hover:not(.active) {
  color: #1a1040;
}
[data-theme="light"] .yt-tabs-bar {
  border-bottom-color: rgba(109, 40, 217, 0.2);
}
[data-theme="light"] .playlist-title {
  color: rgba(60, 30, 120, 0.65);
  letter-spacing: 1.5px;
}
[data-theme="light"] .playlist-item-name {
  color: #1a1040;
}
[data-theme="light"] .playlist-item-dur {
  color: rgba(60, 30, 120, 0.6);
}
[data-theme="light"] .playlist-item-num {
  color: rgba(60, 30, 120, 0.55);
}
[data-theme="light"] .playlist-item:hover {
  background: rgba(109, 40, 217, 0.07);
  border-color: rgba(109, 40, 217, 0.2);
}
[data-theme="light"] .playlist-item.active {
  background: rgba(109, 40, 217, 0.12);
}
[data-theme="light"] .playlist-empty {
  color: rgba(60, 30, 120, 0.6);
}
[data-theme="light"] .lyrics-content {
  color: #1a1040;
}
[data-theme="light"] .lyrics-source {
  color: rgba(60, 30, 120, 0.6);
}
[data-theme="light"] .lyrics-song-name {
  color: #1a1040;
  font-weight: 800;
}
[data-theme="light"] .music-track-count {
  color: rgba(60, 30, 120, 0.7);
  background: rgba(109, 40, 217, 0.08);
  border-color: rgba(109, 40, 217, 0.25);
}
[data-theme="light"] .add-btn-topbar {
  background: linear-gradient(
    135deg,
    rgba(190, 24, 93, 0.15),
    rgba(109, 40, 217, 0.15)
  );
  border-color: rgba(109, 40, 217, 0.3);
  color: var(--accent3);
}
[data-theme="light"] .music-panel-handle {
  background: rgba(109, 40, 217, 0.25);
}
[data-theme="light"] .like-btn {
  color: rgba(60, 30, 120, 0.5);
}
[data-theme="light"] .yt-top-bar {
  background: transparent;
}
[data-theme="light"] .mp-mobile-nowbar {
  background: linear-gradient(
    135deg,
    rgba(109, 40, 217, 0.08),
    rgba(109, 40, 217, 0.16)
  );
}
[data-theme="light"] .mp-mobile-icon-btn:hover {
  background: rgba(109, 40, 217, 0.12);
}

.music-panel-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(167, 139, 255, 0.08) 0%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 0;
}

/* ── Left/Main Column ── */
.mp-player-col {
  display: flex;
  flex-direction: column;
  width: 420px; /* Lebar default untuk player di desktop */
  min-width: 420px;
  position: relative;
  z-index: 1;
  overflow-y: auto;
  min-height: 100vh;
  min-height: 100dvh;
}
.mp-player-col::-webkit-scrollbar {
  width: 0;
}

.mp-side-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  background: rgba(0, 0, 0, 0.15);
  border-left: 1px solid var(--glass-border);
  position: relative;
  z-index: 5;
}

.mp-side-col.mobile-open {
  display: flex;
}

/* Mobile side handle — hidden */
.mp-side-handle {
  display: none;
}

/* ── Mobile tab backdrop — tap area kosong untuk close ── */
#mpSideBackdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 215;
  background: transparent;
  cursor: default;
  pointer-events: none;
}
#mpSideBackdrop.active {
  display: block;
  pointer-events: none;
}

/* Desktop tabs inside side col */
.desktop-side-tabs {
  display: none;
}

.mp-mobile-nowbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05),
    rgba(167, 139, 255, 0.08)
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: default;
}
.mp-mobile-nowbar-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.mp-mobile-nowbar-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f472b6, #a855f7, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 20px var(--music-glow);
  flex-shrink: 0;
}
.mp-mobile-nowbar-meta {
  min-width: 0;
  flex: 1;
}
.mp-mobile-nowbar-title,
.mp-mobile-nowbar-artist {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-mobile-nowbar-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.mp-mobile-nowbar-artist {
  font-size: 11px;
  color: var(--text2);
}
.mp-mobile-nowbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mp-mobile-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mp-mobile-icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}
.mp-mobile-icon-btn .material-symbols-rounded {
  font-size: 20px;
}
.mp-side-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease;
}
.mp-side-close-btn:hover {
  color: var(--text);
}
.mp-side-col:not(.mobile-open) .mp-mobile-nowbar {
  display: none;
}

/* Sembunyikan semua tab bar musik secara global jika panel tertutup agar tidak bocor di Desktop */
#musicPanel:not(.open) .yt-tabs-bar {
  display: none !important;
}

/* Mobile tabs bar — Gaya Liquid Glass iPhone (Estetik & Sleek) */
.mobile-tabs-bar {
  display: none !important; /* Force hidden on Desktop/Tablet */
  position: absolute;
  bottom: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 360px;

  /* Extreme Transparant Frosted Glass Effect */
  background: rgba(255, 255, 255, 0.01); /* Super transparan */
  backdrop-filter: blur(40px) saturate(200%) contrast(100%);
  -webkit-backdrop-filter: blur(40px) saturate(200%) contrast(100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 4px 10px;
  z-index: 100;

  /* Soft Shadow for Floating Effect */
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);

  justify-content: space-around;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-tabs-bar .yt-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: none;
  border: none;
  padding: 6px 0;
  color: rgba(255, 255, 255, 0.45); /* Warna redup agar efek kaca menonjol */
  transition: all 0.3s ease;
  flex: 1;
  position: relative;
}

.mobile-tabs-bar .yt-tab-btn.active {
  color: #fff;
  transform: scale(1.05);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); /* Glow tipis agar kontras di kaca */
}

.tab-icon-wrap {
  width: 44px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 2px;
}

.mobile-tabs-bar .yt-tab-btn.active .tab-icon-wrap {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-tabs-bar .yt-tab-btn .material-symbols-rounded {
  font-size: 22px;
  font-variation-settings:
    "FILL" 0,
    "wght" 300;
}

.mobile-tabs-bar .yt-tab-btn.active .material-symbols-rounded {
  font-variation-settings:
    "FILL" 1,
    "wght" 400;
}

.mobile-tabs-bar .yt-tab-btn span:not(.material-symbols-rounded) {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  opacity: 0.5;
}

.mobile-tabs-bar .yt-tab-btn.active span:not(.material-symbols-rounded) {
  opacity: 1;
}

/* Light Mode Liquid Glass — Transparansi Tinggi & Bersih */
[data-theme="light"] .mobile-tabs-bar {
  background: rgba(255, 255, 255, 0.25); /* Lebih transparan di mode terang */
  backdrop-filter: blur(35px) saturate(220%) brightness(1.02);
  -webkit-backdrop-filter: blur(35px) saturate(220%) brightness(1.02);

  /* Border tipis tapi tegas agar tidak nyatu */
  border: 1px solid rgba(109, 40, 217, 0.08);

  /* Soft Shadow */
  box-shadow:
    0 10px 30px rgba(109, 40, 217, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .mobile-tabs-bar .yt-tab-btn {
  color: rgba(60, 30, 140, 0.4); /* Kontras di kaca transparan */
}

[data-theme="light"] .mobile-tabs-bar .yt-tab-btn.active {
  color: var(--accent);
}

[data-theme="light"] .mobile-tabs-bar .yt-tab-btn.active .tab-icon-wrap {
  background: rgba(109, 40, 217, 0.06);
  box-shadow: 0 4px 10px rgba(109, 40, 217, 0.05);
}

/* ── Show desktop-side-tabs inside mp-side-col when mobile-open ── */
.mp-side-col.mobile-open .desktop-side-tabs {
  display: flex !important;
}

.music-panel-handle {
  width: 40px;
  height: 4px;
  background: var(--glass-border);
  border-radius: 4px;
  margin: 12px auto 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
  position: relative;
  z-index: 1;
}
.music-panel-handle:hover {
  background: var(--accent3);
}

.music-panel-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding-bottom: 55px; /* Disesuaikan agar lebih ringkas mengikuti tab bar baru */
  position: relative;
}

.yt-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.music-panel-title {
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text2);
  /* True center alignment (independent from left/right buttons) */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}
.yt-top-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.yt-album-section {
  display: flex;
  justify-content: center;
  padding: 8px 24px 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* ── Album art — NO pulse/denyut animation ── */
.album-art {
  --beat-scale: 1;
  --beat-glow: 20px;
  width: min(200px, 55vw);
  height: min(200px, 55vw);
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f472b6, #a855f7, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 4px 16px var(--music-glow);
  position: relative;
  overflow: hidden;
  transition:
    box-shadow 0.18s ease,
    transform 0.14s ease;
  transform: scale(var(--beat-scale));
  will-change: transform, box-shadow;
}
.album-art.playing {
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.55),
    0 6px var(--beat-glow) var(--music-glow);
}
.album-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12),
    transparent 50%
  );
  pointer-events: none;
  z-index: 1;
}
.album-art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.album-art-img.loaded {
  opacity: 1;
}
.album-art-emoji {
  position: relative;
  z-index: 0;
  transition: opacity 0.4s ease;
}

.yt-song-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 24px 0;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  gap: 12px;
}
.song-info-text {
  flex: 1;
  overflow: hidden;
}
.music-title {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  color: var(--text);
  letter-spacing: -0.2px;
}
.music-artist {
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.like-btn {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50%;
  border: none !important;
  background: transparent !important;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: none !important;
  box-shadow: none !important;
}
.like-btn:hover {
  transform: scale(1.2) !important;
  color: var(--accent3) !important;
  background: transparent !important;
}
.like-btn.liked {
  color: var(--accent3) !important;
}
.like-btn .material-symbols-rounded {
  font-size: 24px;
}

.music-track-count {
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  color: var(--text2);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 4px 8px;
  flex-shrink: 0;
}
.add-btn-topbar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: linear-gradient(
    135deg,
    rgba(244, 114, 182, 0.15),
    rgba(168, 85, 247, 0.15)
  );
  color: var(--accent3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 var(--glass-shine);
}
.add-btn-topbar:hover {
  transform: scale(1.12);
  background: linear-gradient(
    135deg,
    rgba(244, 114, 182, 0.3),
    rgba(168, 85, 247, 0.3)
  );
  border-color: var(--accent3);
  box-shadow: 0 0 12px var(--music-glow);
}
.add-btn-topbar .material-symbols-rounded {
  font-size: 17px;
}

.music-progress-wrap {
  padding: 14px 24px 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
/* Seek slider (YouTube Music-like filled track) */
input[type="range"].seek-slider {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  /* background is controlled by JS (linear-gradient) */
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
[data-theme="light"] input[type="range"].seek-slider {
  background: rgba(109, 40, 217, 0.15);
}
[data-theme="light"] input[type="range"].seek-slider::-webkit-slider-thumb {
  background: var(--accent);
  box-shadow: 0 2px 8px var(--glow);
}
[data-theme="light"] input[type="range"].seek-slider::-moz-range-thumb {
  background: var(--accent);
  box-shadow: 0 2px 8px var(--glow);
}
input[type="range"].seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
input[type="range"].seek-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* Favorites UI */
.like-btn.liked .material-symbols-rounded {
  font-variation-settings: "FILL" 1;
}
.playlist-item-love {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(244, 114, 182, 0.95);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    transform 0.18s ease,
    background 0.18s ease;
}
.playlist-item-love:hover {
  transform: scale(1.12);
  background: rgba(244, 114, 182, 0.12);
}
.playlist-item-love .material-symbols-rounded {
  font-size: 18px;
}
.playlist-item-love.is-liked {
  color: #ff3b6a;
}
.playlist-item-love.is-liked .material-symbols-rounded {
  font-variation-settings: "FILL" 1;
}
.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text2);
  margin-top: 6px;
  font-weight: 500;
}

.music-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.ctrl-btn:hover {
  color: var(--text);
  transform: scale(1.15);
}
.ctrl-btn .material-symbols-rounded {
  font-size: 22px;
}
.ctrl-btn.active-mode {
  color: var(--accent);
  position: relative;
}
.ctrl-btn.active-mode::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.ctrl-btn.play-pause {
  width: 56px;
  height: 56px;
  background: #fff;
  color: #000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .ctrl-btn.play-pause {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--glow);
}
.ctrl-btn.play-pause:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}
.ctrl-btn.play-pause .material-symbols-rounded {
  font-size: 28px;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 24px 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.volume-row .material-symbols-rounded {
  font-size: 18px;
  color: var(--text2);
  flex-shrink: 0;
}
input[type="range"].vol-slider {
  flex: 1;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}
input[type="range"].vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
[data-theme="light"] input[type="range"].vol-slider::-webkit-slider-thumb {
  background: var(--accent);
}
input[type="range"].vol-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

/* ── Tabs bar ── */
.yt-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}
.yt-tab-btn {
  flex: 1;
  padding: 8px 0; /* Ditipiskan sedikit */
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  font-size: 12.5px; /* Sedikit lebih kecil */
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -1px;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
  /* Always clickable */
  pointer-events: auto !important;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  border-radius: 0;
}
.yt-tab-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(167, 139, 255, 0.08),
    transparent
  );
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.yt-tab-btn:hover::after {
  opacity: 1;
}
.yt-tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--text);
}
[data-theme="light"] .yt-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.yt-tab-btn:hover:not(.active) {
  color: var(--text);
}
.yt-tab-btn:active,
.yt-tab-btn.tap-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .yt-tab-btn:active,
[data-theme="light"] .yt-tab-btn.tap-active {
  background: rgba(109, 40, 217, 0.1);
}

/* ── Tab content (Desktop: Horizontal Slide System) ── */
.yt-tab-content {
  position: absolute;
  inset: 0;
  top: 58px; /* Tambah jarak agar konten tidak menempel tab */
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  z-index: 1;
  display: block !important; /* Pakai sistem transform bukan display block/none */

  transition:
    transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
    opacity 0.4s ease,
    filter 0.4s ease;
  will-change: transform, opacity;
  opacity: 0;
  pointer-events: none;
}

/* Logic penumpukan & pergeseran tab desktop */
.mp-side-col[data-active-tab="queue"] .yt-tab-content#tabQueueContent,
.mp-side-col[data-active-tab="lyrics"] .yt-tab-content#tabLyricsContent,
.mp-side-col[data-active-tab="favs"] .yt-tab-content#tabFavsContent {
  transform: translateX(0);
  opacity: 1;
  filter: blur(0);
  z-index: 2;
  pointer-events: auto;
}

/* Queue Tab States */
.mp-side-col[data-active-tab="lyrics"] .yt-tab-content#tabQueueContent,
.mp-side-col[data-active-tab="favs"] .yt-tab-content#tabQueueContent {
  transform: translateX(-100%);
}

/* Lyrics Tab States */
.mp-side-col[data-active-tab="queue"] .yt-tab-content#tabLyricsContent {
  transform: translateX(100%);
}
.mp-side-col[data-active-tab="favs"] .yt-tab-content#tabLyricsContent {
  transform: translateX(-100%);
}

/* Favs Tab States */
.mp-side-col[data-active-tab="queue"] .yt-tab-content#tabFavsContent,
.mp-side-col[data-active-tab="lyrics"] .yt-tab-content#tabFavsContent {
  transform: translateX(100%);
}

.yt-tab-content::-webkit-scrollbar {
  width: 3px;
}
.yt-tab-content::-webkit-scrollbar-thumb {
  background: var(--accent3);
  border-radius: 4px;
}

.visualizer-wrap {
  padding: 10px 20px 4px;
  display: flex;
  justify-content: center;
}
#visualizerCanvas {
  width: 100%;
  max-width: 400px;
  height: 50px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.1);
}

.playlist-section {
  padding: 6px 16px 80px;
}
.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.playlist-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
/* add-music-btn dipermanently-hidden karena hanya pakai topbar button */
.add-music-btn {
  display: none !important;
}
.playlist-empty {
  text-align: center;
  padding: 24px 20px;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.8;
}
.playlist-empty-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 10px;
}
.playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  margin-bottom: 2px;
  border: 1px solid transparent;
  position: relative;
}
.playlist-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--glass-border);
}
[data-theme="light"] .playlist-item:hover {
  background: rgba(109, 40, 217, 0.06);
}
.playlist-item.active {
  background: rgba(167, 139, 255, 0.1);
}
.playlist-item-num {
  font-size: 12px;
  color: var(--text2);
  width: 20px;
  flex-shrink: 0;
  text-align: center;
  font-family: "Poppins", sans-serif;
}
.playlist-item.active .playlist-item-num {
  color: var(--accent);
  font-size: 14px;
}
.playlist-item-info {
  flex: 1;
  overflow: hidden;
}
.playlist-item-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  color: var(--text);
}
.playlist-item.active .playlist-item-name {
  color: var(--accent);
}
.playlist-item-dur {
  font-size: 11px;
  color: var(--text2);
}
.playlist-item-del {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s;
  flex-shrink: 0;
}
.playlist-item:hover .playlist-item-del {
  opacity: 1;
}
.playlist-item-del:hover {
  background: rgba(255, 107, 138, 0.15);
  color: var(--error);
}
.playlist-item-del .material-symbols-rounded {
  font-size: 15px;
}

/* ── Lyrics — Spotify Style ── */
.lyrics-container {
  padding: 20px 28px 80px;
  min-height: 200px;
  overflow-y: auto;
}
.lyrics-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text2);
}
.lyrics-empty-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 14px;
}
.lyrics-empty p {
  font-size: 14px;
  line-height: 1.8;
  font-weight: 500;
}
.lyrics-title-row {
  margin-bottom: 20px;
}
.lyrics-song-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.lyrics-source {
  font-size: 11px;
  color: var(--text2);
}
.lyrics-content {
  position: relative;
  font-size: 24px;
  line-height: 2;
  color: var(--text);
  white-space: pre-wrap;
  text-align: left;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.lyrics-content .lyrics-line {
  display: block;
  padding: 4px 0;
  transition:
    color 0.4s ease,
    opacity 0.4s ease,
    font-size 0.35s ease,
    transform 0.35s ease;
  cursor: default;
  transform-origin: left center;
  /* ensure always selectable/visible */
  pointer-events: auto;
}
.lyrics-content .lyrics-line.lyrics-active {
  color: var(--text);
  opacity: 1;
  font-size: 26px;
  transform: scale(1.01);
}
[data-theme="light"] .lyrics-content .lyrics-line.lyrics-active {
  color: #1a1040;
}
.lyrics-content .lyrics-line.lyrics-past {
  color: var(--text2);
  opacity: 0.45;
  font-size: 22px;
}
.lyrics-content .lyrics-line.lyrics-future {
  color: var(--text);
  opacity: 0.3;
  font-size: 22px;
}
.lyrics-content .lyrics-line.dim {
  color: var(--text2);
  opacity: 0.5;
}
.lyrics-content .lyrics-line-break {
  display: block;
  height: 16px;
}
[data-theme="light"] .lyrics-content {
  color: #1a1040;
}
[data-theme="light"] .lyrics-content .lyrics-line.lyrics-past {
  color: rgba(60, 30, 120, 0.45);
}
[data-theme="light"] .lyrics-content .lyrics-line.lyrics-future {
  color: rgba(60, 30, 120, 0.35);
}
.lyrics-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 20px;
  color: var(--text2);
  font-size: 13px;
}

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
#sideOverlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease;
  will-change: opacity;
}
#sideOverlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(6px);
}
#profileSidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(290px, 82vw);
  height: 100%;
  z-index: 1000;
  background: var(--glass);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-left: 1px solid var(--glass-border);
  border-radius: 28px 0 0 28px;
  box-shadow:
    -20px 0 60px rgba(0, 0, 0, 0.4),
    inset 1px 0 0 var(--glass-shine);
  transform: translate3d(100%, 0, 0);
  opacity: 0.98;
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease;
  will-change: transform, opacity;
  contain: paint layout style;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
#profileSidebar.open {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}
#profileSidebar::-webkit-scrollbar {
  width: 3px;
}
#profileSidebar::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}
.side-header-guest {
  padding: 52px 22px 24px;
  text-align: center;
  position: relative;
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.15), transparent);
  border-bottom: 1px solid var(--glass-border);
}
.side-cat-avatar {
  font-size: 60px;
  line-height: 1;
  animation: catBob 2s ease-in-out infinite;
  margin-bottom: 14px;
  display: block;
}
@keyframes catBob {
  0%,
  100% {
    transform: scale(1) rotate(-3deg);
  }
  50% {
    transform: scale(1.12) rotate(3deg);
  }
}
#sideGuestName {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
#sideGuestSub {
  font-size: 11.5px;
  color: var(--text2);
}
.side-header {
  padding: 52px 22px 24px;
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.15), transparent);
  border-bottom: 1px solid var(--glass-border);
  text-align: center;
  position: relative;
}
.side-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--glass-shine) 50%,
    transparent
  );
}

@media (max-width: 768px), (pointer: coarse) {
  #profileSidebar {
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow:
      -10px 0 26px rgba(0, 0, 0, 0.34),
      inset 1px 0 0 var(--glass-shine);
  }

  #sideOverlay.open {
    backdrop-filter: blur(2px);
  }

  .bg-orb {
    filter: blur(56px);
  }

  .bg-orb-1,
  .bg-orb-2,
  .bg-orb-3,
  .bg-orb-4 {
    animation-duration: 18s;
  }

  header::before,
  .welcome-icon,
  .side-cat-avatar {
    animation: none !important;
  }
}
#sideAvatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 14px;
  border: 2px solid var(--glass-border);
  box-shadow:
    0 0 0 4px var(--accent-dim),
    0 8px 24px var(--glow);
  transition: transform 0.3s;
}
#sideAvatar:hover {
  transform: scale(1.05) rotate(2deg);
}
#sideName {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
#sideEmail {
  font-size: 11.5px;
  color: var(--text2);
}
.side-menu {
  flex: 1;
  padding: 14px 10px;
}
.sidebar-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 8px 4px;
  border-radius: 1px;
}
.reply-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 6px 0 0 46px;
  width: fit-content;
  max-width: calc(100% - 46px);
  order: 3;
}
.reply-action-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text2);
  border-radius: 999px;
  padding: 5px 10px;
  min-height: 28px;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.reply-action-btn[data-qact="copy"],
.reply-action-btn[data-qact="ringkas"] {
  font-weight: 700;
}
.reply-action-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}
.reply-action-btn:active {
  transform: translateY(1px);
}
.sidebar-item {
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
  margin-bottom: 3px;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.sidebar-item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), var(--accent2));
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar-item:hover {
  background: var(--glass);
  backdrop-filter: blur(12px);
  color: var(--accent);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-shine);
  transform: translateX(-4px);
}
.sidebar-item:hover::after {
  opacity: 1;
}
.sidebar-item .material-symbols-rounded {
  font-size: 19px;
}
.sidebar-item.danger {
  color: var(--error);
}
.sidebar-item.danger:hover {
  background: rgba(255, 107, 138, 0.08);
  color: var(--error);
  border-color: rgba(255, 107, 138, 0.2);
}
.sidebar-item.danger::after {
  background: linear-gradient(to bottom, var(--error), #ff9eb0);
}
.sidebar-login-btn {
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.15),
    rgba(168, 85, 247, 0.1)
  ) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  font-weight: 700 !important;
}
.sidebar-login-btn:hover {
  background: var(--accent-dim) !important;
  transform: translateX(-4px) scale(1.01) !important;
}
.mobile-sidebar-item {
  display: none;
}
.side-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--glass-border);
  text-align: center;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  color: var(--text2);
  opacity: 0.4;
  letter-spacing: 1px;
}

/* ═══════════════════════════════════════════
   ALERT
═══════════════════════════════════════════ */
#alert {
  position: fixed;
  top: -80px;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  z-index: 9999;
  padding: 11px 18px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--glass-border);
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  transition:
    top 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: "Poppins", sans-serif;
}
#alert::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--glass-shine) 50%,
    transparent
  );
}
#alert.show {
  top: 14px;
  transform: translateX(-50%) scale(1);
}
#alert.error {
  border-color: var(--error);
  color: var(--error);
  box-shadow:
    0 0 20px rgba(255, 107, 138, 0.25),
    0 16px 40px rgba(0, 0, 0, 0.35);
  animation: shake 0.35s;
}
#alert.success {
  border-color: var(--success);
  color: var(--success);
  box-shadow:
    0 0 20px rgba(52, 211, 153, 0.25),
    0 16px 40px rgba(0, 0, 0, 0.35);
}
#alert .material-symbols-rounded {
  font-size: 18px;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  25% {
    transform: translateX(calc(-50% - 7px)) scale(1);
  }
  75% {
    transform: translateX(calc(-50% + 7px)) scale(1);
  }
}

/* ═══════════════════════════════════════════
   MODALS
═══════════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(0px);
  padding: 16px;
  transition:
    background 0.3s,
    backdrop-filter 0.3s;
}
.modal.active {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px) saturate(150%);
}
.modal-box {
  background: var(--glass);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 24px 20px;
  width: 92%;
  max-width: 400px;
  text-align: center;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 var(--glass-shine);
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
  position: relative;
}
.modal-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--glass-shine) 50%,
    transparent
  );
}
.modal-box.auth-modal-box::after {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(
    90deg,
    var(--accent3),
    var(--accent),
    var(--accent2)
  );
  box-shadow: 0 0 12px var(--glow);
}
.modal.active .modal-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.modal-icon {
  font-family: "Press Start 2P", monospace;
  font-size: 28px;
  margin-bottom: 14px;
  display: block;
  animation: iconBob 2s ease-in-out infinite;
}
@keyframes iconBob {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-6px) rotate(5deg);
  }
}
.modal-title {
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.8;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.modal-sub {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 16px;
  line-height: 1.6;
}
.auth-steps {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 8px;
}
.auth-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--glass-border);
  transition: all 0.3s;
}
.auth-step-dot.active {
  background: var(--accent);
  width: 18px;
  box-shadow: 0 0 8px var(--glow);
}
.auth-step-dot.done {
  background: var(--success);
}
.field {
  margin-bottom: 10px;
  text-align: left;
}
.field label {
  display: block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text2);
  margin-bottom: 6px;
  margin-left: 3px;
  text-transform: uppercase;
  font-family: "Press Start 2P", monospace;
}
.field-inner {
  position: relative;
}
.field input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 13px;
  color: var(--text);
  font-size: 14px;
  font-family: "Poppins", sans-serif;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
  backdrop-filter: blur(12px);
}
[data-theme="light"] .field input {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(109, 40, 217, 0.2);
}
.field input:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-dim),
    0 0 15px var(--glow);
  transform: translateY(-1px);
}
.field input.has-icon {
  padding-left: 44px;
}
.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text2);
  font-size: 18px;
  pointer-events: none;
  transition: color 0.2s;
}
.field-inner:focus-within .field-icon {
  color: var(--accent);
}
.pw-wrap {
  position: relative;
}
.pw-wrap input {
  width: 100%;
  padding: 12px 48px 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 13px;
  color: var(--text);
  font-size: 14px;
  font-family: "Poppins", sans-serif;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
  backdrop-filter: blur(12px);
}
[data-theme="light"] .pw-wrap input {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(109, 40, 217, 0.2);
}
.pw-wrap input:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-dim),
    0 0 15px var(--glow);
  transform: translateY(-1px);
}
.eye-btn {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text2);
  font-size: 19px;
  transition: color 0.2s;
  user-select: none;
  z-index: 2;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}
.eye-btn:hover {
  color: var(--accent);
}
.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.1);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--glow);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
}
.auth-modal-box {
  max-width: 440px;
  width: 92%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-radius: 32px;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 var(--glass-shine);
}

/* Custom Scrollbar for Modal - removed as per user request to disable scroll */
.auth-modal-box::-webkit-scrollbar {
  display: none;
}

[data-theme="light"] .auth-modal-box {
  background: rgba(255, 255, 255, 0.85);
  box-shadow:
    0 20px 40px rgba(109, 40, 217, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.auth-visual-bg {
  position: absolute;
  top: -150px;
  right: -150px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

.auth-header {
  padding: 16px 32px 8px;
  position: relative;
  z-index: 1;
  text-align: center;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-modal-box .modal-icon {
  font-size: 28px;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 12px var(--glow));
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-8px) rotate(3deg);
  }
}

.auth-modal-box .modal-title {
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-modal-box .modal-sub {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 4px;
}

.auth-form-container {
  padding: 0 32px 12px;
  position: relative;
  z-index: 1;
}

.auth-link {
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover {
  filter: brightness(1.2);
  text-decoration: underline;
}

.auth-submit {
  height: 52px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 12px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  box-shadow: 0 10px 20px var(--glow);
}
.auth-submit:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 15px 30px var(--glow);
}

.btn-arrow {
  font-size: 18px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: inherit;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(6px);
}

.auth-modal-box .divider {
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
}

.auth-modal-box .divider span {
  white-space: nowrap;
}

.auth-modal-box .divider::before,
.auth-modal-box .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.btn-google {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  height: 52px;
  border-radius: 16px;
  color: var(--text);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0;
}
.btn-google:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-google img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.auth-footer {
  padding: 12px 32px 16px;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--glass-border);
  position: relative;
  z-index: 1;
  text-align: center;
  margin-top: 0;
}

[data-theme="light"] .auth-footer {
  background: rgba(109, 40, 217, 0.04);
}

.auth-switch-link {
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  margin-left: 6px;
  transition: all 0.2s;
}

.auth-switch-link:hover {
  text-decoration: underline;
  filter: brightness(1.2);
}

.auth-close-link {
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  margin-top: 8px;
  display: inline-block;
  transition: all 0.2s;
  font-weight: 500;
}

.auth-close-link:hover {
  color: var(--error);
  transform: scale(1.05);
}

/* Interactivity */
.field input:focus {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px var(--accent-dim),
    0 10px 20px var(--glow);
}

/* Animations */
@keyframes fadeInUpAuth {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-form-container.animate > * {
  animation: fadeInUpAuth 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.auth-form-container.animate > *:nth-child(1) {
  animation-delay: 0.1s;
}
.auth-form-container.animate > *:nth-child(2) {
  animation-delay: 0.18s;
}
.auth-form-container.animate > *:nth-child(3) {
  animation-delay: 0.26s;
}
.auth-form-container.animate > *:nth-child(4) {
  animation-delay: 0.34s;
}
.auth-form-container.animate > *:nth-child(5) {
  animation-delay: 0.42s;
}
.auth-form-container.animate > *:nth-child(6) {
  animation-delay: 0.5s;
}
.auth-form-container.animate > *:nth-child(7) {
  animation-delay: 0.58s;
}

@media (max-width: 480px) {
  .auth-modal-box {
    border-radius: 24px;
  }
  .auth-header,
  .auth-form-container,
  .auth-footer {
    padding-left: 24px;
    padding-right: 24px;
  }
  .auth-header {
    padding-top: 36px;
  }
  .auth-modal-box .modal-icon {
    font-size: 36px;
  }
}

.btn-ghost {
  background: var(--glass);
  backdrop-filter: blur(12px);
  color: var(--text);
  border: 1px solid var(--glass-border);
  padding: 12px;
  border-radius: 13px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  flex: 1;
  transition: all 0.2s;
  box-shadow: inset 0 1px 0 var(--glass-shine);
}
.btn-ghost:hover {
  background: var(--surf2);
  transform: translateY(-1px);
}
.spin {
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading .spin {
  display: block;
}
.loading .btn-text {
  display: none;
}
.pw-strength-wrap {
  margin-top: 6px;
  display: none;
}
.pw-strength-bar {
  height: 4px;
  border-radius: 4px;
  background: var(--glass-border);
  overflow: hidden;
  margin-bottom: 4px;
}
.pw-strength-fill {
  height: 100%;
  border-radius: 4px;
  transition:
    width 0.3s,
    background 0.3s;
  width: 0%;
}
.pw-strength-label {
  font-size: 11px;
  color: var(--text2);
  text-align: right;
}
.avatar-upload-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
}
#editPhotoPreview {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  display: block;
  box-shadow: 0 0 20px var(--glow);
  transition: transform 0.3s;
}
#editPhotoPreview:hover {
  transform: scale(1.05);
}
.cam-btn {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 4px 12px rgba(124, 58, 237, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.2s;
}
.cam-btn:hover {
  transform: scale(1.18) rotate(10deg);
}
.cam-btn .material-symbols-rounded {
  font-size: 15px;
  color: #fff;
}

/* ═══════════════════════════════════════════
   CROP MODAL
═══════════════════════════════════════════ */
.crop-modal-box {
  max-width: 380px !important;
}
.crop-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent);
  box-shadow:
    0 0 0 4px var(--accent-dim),
    0 0 30px var(--glow);
  cursor: move;
  background: #111;
  flex-shrink: 0;
}
#cropCanvas {
  display: block;
  width: 260px;
  height: 260px;
  touch-action: none;
}
.crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 4px;
}
#cropZoom {
  flex: 1;
}

/* ═══════════════════════════════════════════
   THEME OVERLAY
═══════════════════════════════════════════ */
.theme-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  clip-path: circle(0% at 95% 5%);
  transition: clip-path 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-overlay.active {
  clip-path: circle(150% at 95% 5%);
}

/* ═══════════════════════════════════════════
   PIXEL STATUS & MISC
═══════════════════════════════════════════ */
.pixel-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 8px;
  padding: 3px 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  color: var(--success);
  margin-top: 8px;
  animation: statusPulse 2s ease-in-out infinite;
}
.pixel-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--success);
  animation: blinkGreen 1s step-end infinite;
  box-shadow: 0 0 4px var(--success);
}
@keyframes statusPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.75;
  }
}
@keyframes blinkGreen {
  50% {
    opacity: 0;
  }
}
.pixel-deco {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}
.pixel-deco-1 {
  top: 15%;
  left: 5%;
}
.pixel-deco-2 {
  bottom: 25%;
  right: 5%;
}
.fun-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9998;
  background: var(--glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  max-width: calc(100vw - 32px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.fun-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.fun-toast .toast-emoji {
  font-size: 20px;
}

/* ═══════════════════════════════════════════
   PERSONALITY MODAL
═══════════════════════════════════════════ */
.personality-modal-box {
  max-width: 440px !important;
  padding: 18px !important;
}

.personality-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.voice-clone-modal-box {
  max-width: 430px !important;
}
.voice-style-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin: 12px 0 10px;
}
.voice-style-card {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}
.voice-style-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px var(--glow);
}
.voice-style-card.active {
  border-color: var(--accent2);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(124, 58, 237, 0.1));
}
.voice-style-icon {
  font-size: 18px;
  margin-bottom: 2px;
}
.voice-style-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.voice-style-desc {
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
}
.voice-preview-row {
  display: flex;
  gap: 8px;
}
.voice-preview-row .btn-ghost {
  margin-top: 0;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.voice-manual-note {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text2);
  text-align: left;
}

.p-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: inset 0 1px 0 var(--glass-shine);
}

.p-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.p-card:hover {
  background: var(--surf2);
  transform: translateX(4px);
  border-color: var(--accent);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.1),
    0 0 10px var(--glow);
}

.p-card:hover::before {
  opacity: 1;
}

.p-card.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  box-shadow:
    0 0 15px var(--glow),
    inset 0 0 0 1px var(--accent);
}

.p-icon-wrap {
  width: 42px;
  height: 42px;
  background: var(--surf2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.p-card:hover .p-icon-wrap {
  transform: scale(1.05) rotate(5deg);
  background: var(--accent);
}

.p-card.active .p-icon-wrap {
  background: var(--accent);
  color: white;
}

.p-icon {
  font-size: 20px;
}

.p-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
}

.p-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.p-desc {
  font-size: 10.5px;
  color: var(--text2);
  line-height: 1.3;
  opacity: 0.8;
}

.p-active-indicator {
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: var(--accent);
}

.p-card.active .p-active-indicator {
  opacity: 1;
  transform: scale(1);
}

.p-active-indicator span {
  font-size: 20px;
}

/* Mobile adjustments for personality */
@media (max-width: 600px) {
  .personality-modal-box {
    max-width: 90vw !important;
    padding: 16px !important;
  }
  .p-card {
    padding: 6px 12px;
    gap: 10px;
    border-radius: 14px;
  }
  .p-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }
  .p-icon {
    font-size: 18px;
  }
  .p-name {
    font-size: 12.5px;
  }
  .p-desc {
    font-size: 10px;
  }
  .personality-grid {
    gap: 6px;
    margin-top: 10px;
  }
}

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — DESKTOP, LAPTOP & TABLET (>600px)
═══════════════════════════════════════════ */
@media (min-width: 601px) {
  #musicPanel {
    flex-direction: row;
    top: 100dvh;
  }
  #musicPanel.open {
    top: 0;
  }
  .mp-player-col {
    width: 420px;
    min-width: 420px;
    min-height: unset;
    border-right: 1px solid var(--glass-border);
  }

  /* Side column: always visible on right */
  .mp-side-col {
    position: relative;
    bottom: auto;
    flex: 1;
    height: auto;
    background: transparent;
    border-radius: 0;
    border-top: none;
    box-shadow: none;
    transition: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .mp-side-col.mobile-open {
    bottom: auto;
  }
  .mp-side-mini-info {
    display: none;
  }
  .mp-mobile-nowbar {
    display: none !important;
  }
  .mp-side-handle {
    display: none;
  }
  .mobile-tabs-bar {
    display: none !important;
  }
  .desktop-side-tabs {
    display: flex !important;
  }
  .mp-side-close-btn {
    display: none;
  }

  /* Desktop/Tablet: horizontal slide — stable, no flickering */
  .mp-side-col .yt-tab-content {
    position: absolute;
    inset: 0;
    top: 57px;
    overflow-y: auto;
    transition:
      transform 0.38s cubic-bezier(0.34, 1.15, 0.64, 1),
      opacity 0.32s ease;
    display: block !important; /* always block — prevents flicker */
    animation: none;
    pointer-events: none;
  }
  .mp-side-col .yt-tab-content#tabQueueContent {
    transform: translateX(0);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
  }
  .mp-side-col .yt-tab-content#tabLyricsContent {
    transform: translateX(100%);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
  }
  .mp-side-col .yt-tab-content#tabFavsContent {
    transform: translateX(200%);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
  }
  .mp-side-col[data-active-tab="queue"] .yt-tab-content#tabQueueContent {
    transform: translateX(0);
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
  }
  .mp-side-col[data-active-tab="lyrics"] .yt-tab-content#tabLyricsContent {
    transform: translateX(0);
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
  }
  .mp-side-col[data-active-tab="favs"] .yt-tab-content#tabFavsContent {
    transform: translateX(0);
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
  }

  /* Ensure lyrics container scrollable on desktop/tablet */
  .mp-side-col[data-active-tab="lyrics"] #tabLyricsContent .lyrics-container {
    pointer-events: auto;
    overflow-y: auto;
  }

  .album-art {
    width: 240px;
    height: 240px;
  }
  .music-title {
    font-size: 20px;
  }
  .lyrics-content {
    font-size: 20px;
  }
  .lyrics-content .lyrics-line.lyrics-active {
    font-size: 22px;
  }
  .lyrics-content .lyrics-line.lyrics-past,
  .lyrics-content .lyrics-line.lyrics-future {
    font-size: 18px;
  }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 600px)
═══════════════════════════════════════════ */
@media (max-width: 600px) {
  .ai-presence-chip {
    display: none;
  }
  .reply-actions {
    margin-left: 42px;
    gap: 5px;
  }
  .reply-action-btn {
    padding: 5px 8px;
    font-size: 9.5px;
    min-height: 26px;
  }
  .desktop-only {
    display: none !important;
  }
  .mobile-sidebar-item {
    display: flex;
  }
  header {
    padding: 8px 12px;
    min-height: 58px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .logo-text {
    font-size: 10px;
    letter-spacing: 0.8px;
  }
  .logo-dot {
    width: 28px;
    height: 28px;
    font-size: 8px;
  }
  .logo-pill {
    padding: 5px 12px 5px 6px;
    gap: 8px;
  }
  .header-music-mini {
    max-width: 110px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
  }
  .mini-song-name {
    max-width: 70px;
    font-size: 9px;
  }
  .playlist-item-del {
    opacity: 1;
  }
  #chatBox {
    padding: 14px 10px calc(160px + env(safe-area-inset-bottom));
  }
  #chatBox.welcome-mode {
    padding-bottom: calc(220px + env(safe-area-inset-bottom));
  }
  #welcomeText {
    font-size: 11px;
  }
  .welcome-sub {
    font-size: 12px;
  }
  .welcome-orb-wrap {
    width: 78px;
    height: 78px;
    margin-bottom: 16px;
  }
  .welcome-icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
  }
  .welcome-gif {
    width: 100% !important;
    height: 100% !important;
  }
  .chips-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 16px;
  }
  .chip {
    padding: 8px 10px;
  }
  .chip-text {
    font-size: 11px;
  }
  .chip-icon {
    font-size: 14px;
  }
  .bubble {
    max-width: 88vw;
    font-size: 13.5px;
    padding: 10px 14px;
  }
  .bottom {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  }
  .input-wrap {
    border-radius: 16px;
    min-height: 50px;
    padding: 0 6px 0 14px;
  }
  .input-ph {
    left: 58px;
    font-size: 14px;
    right: 58px;
  }
  #uIn {
    font-size: 14px;
    padding: 13px 0;
  }
  .send-btn {
    width: 38px;
    height: 38px;
  }
  .input-hint {
    font-size: 9px;
  }
  .site-footer {
    font-size: 10px;
    gap: 8px;
  }
  .dev-tools-bar {
    gap: 6px;
    margin-top: 7px;
    justify-content: flex-start;
  }
  .dev-tool-btn {
    padding: 5px 9px;
    min-height: 28px;
    font-size: 9.5px;
  }

  /* Mobile music panel */
  #musicPanel {
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
  }
  .mp-player-col {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 100dvh;
    margin: 0 auto;
    box-sizing: border-box;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .yt-top-bar {
    padding-top: max(8px, env(safe-area-inset-top));
  }
  .yt-album-section {
    padding: clamp(20px, 8vh, 72px) 24px clamp(20px, 4vh, 36px);
  }
  .mobile-tabs-bar {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: calc(100% - 32px);
    max-width: 420px;
    margin: auto auto calc(12px + env(safe-area-inset-bottom));
    flex-shrink: 0;
  }
  .mp-side-col {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    height: 100dvh; /* FULLSCREEN ala YouTube Music */
    border-radius: 0; /* Hilangkan radius biar fullscreen solid */
    z-index: 220;
    width: 100%;
    border-left: none;
    border-top: none;
    box-shadow: none;

    /* Frosted Glass Effect (YouTube Music Style) */
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(45px) saturate(250%);
    -webkit-backdrop-filter: blur(45px) saturate(250%);
    transition: bottom 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  }
  [data-theme="light"] .mp-side-col {
    background: rgba(255, 255, 255, 0.5);
  }
  .mp-side-col.mobile-open {
    bottom: 0;
  }
  .mp-side-handle {
    display: none;
  }
  .desktop-side-tabs {
    display: none;
  }
  .mobile-tabs-bar {
    display: flex !important;
  }

  /* Show tabs inside panel when open */
  .mp-side-col.mobile-open .desktop-side-tabs {
    display: flex !important;
    border-bottom: 1px solid var(--glass-border);
    border-top: none;
    flex-shrink: 0;
    padding: 0 20px;
    background: transparent; /* Paling penting: bikin transparan */
    position: relative;
    z-index: 10;
  }
  [data-theme="light"] .mp-side-col.mobile-open .desktop-side-tabs {
    background: transparent;
  }
  .mp-side-close-btn {
    display: inline-flex;
  }

  /* Mobile panel tabs: horizontal slide like YouTube Music */
  .mp-side-col .yt-tab-content {
    top: 88px; /* Tambah jarak supaya konten tidak nabrak tab */
  }

  /* Hilangkan duplikasi logic karena sudah dihandle secara global di atas */
  .mp-side-col[data-active-tab="queue"] .yt-tab-content#tabQueueContent,
  .mp-side-col[data-active-tab="lyrics"] .yt-tab-content#tabLyricsContent,
  .mp-side-col[data-active-tab="favs"] .yt-tab-content#tabFavsContent {
    transform: translateX(0);
    opacity: 1;
    filter: blur(0);
    z-index: 2;
    pointer-events: auto;
  }

  .album-art {
    width: min(160px, 48vw);
    height: min(160px, 48vw);
    font-size: 44px;
    border-radius: 10px;
  }
  .music-title {
    font-size: 15px;
  }
  .music-artist {
    font-size: 12px;
  }
  .yt-song-info {
    padding: 0 16px;
  }
  .music-progress-wrap {
    padding: clamp(12px, 2.5vh, 22px) 16px 4px;
  }
  .music-controls {
    padding: clamp(10px, 2vh, 18px) 12px 4px;
    gap: 0;
  }
  .ctrl-btn {
    width: 36px;
    height: 36px;
  }
  .ctrl-btn .material-symbols-rounded {
    font-size: 20px;
  }
  .ctrl-btn.play-pause {
    width: 52px;
    height: 52px;
  }
  .ctrl-btn.play-pause .material-symbols-rounded {
    font-size: 26px;
  }
  .volume-row {
    padding: 4px 16px clamp(10px, 2vh, 16px);
  }
  .yt-tabs-bar {
    padding: 0 16px;
  }
  .lyrics-container {
    padding: 12px 20px 80px;
    overflow-y: auto;
  }
  .lyrics-content {
    font-size: 20px;
    line-height: 1.9;
  }
  .lyrics-content .lyrics-line.lyrics-active {
    font-size: 22px;
  }
  .lyrics-content .lyrics-line.lyrics-past,
  .lyrics-content .lyrics-line.lyrics-future {
    font-size: 18px;
  }
}

@media (max-width: 380px) {
  .logo-text {
    font-size: 6px;
  }
  .chips-grid {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  .chip {
    padding: 7px 8px;
  }
  .chip-text {
    font-size: 10px;
  }
  #welcomeText {
    font-size: 9px;
  }
  .welcome-orb-wrap {
    width: 68px;
    height: 68px;
  }
  .welcome-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
  }
  .welcome-gif {
    width: 100% !important;
    height: 100% !important;
  }
  .album-art {
    width: 140px;
    height: 140px;
  }
  .music-controls {
    padding: 4px 8px;
  }
  .ctrl-btn {
    width: 32px;
    height: 32px;
  }
  .ctrl-btn.play-pause {
    width: 46px;
    height: 46px;
  }
}

@media (max-width: 600px) and (min-height: 760px) {
  .mp-player-col {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
  .yt-album-section {
    padding-top: clamp(40px, 12vh, 104px);
    padding-bottom: clamp(28px, 5vh, 52px);
  }
  .album-art {
    width: min(220px, 62vw);
    height: min(220px, 62vw);
    font-size: 56px;
    border-radius: 14px;
  }
  .yt-song-info {
    padding-top: clamp(8px, 2vh, 18px);
  }
  .music-progress-wrap {
    padding-top: clamp(20px, 4vh, 34px);
  }
  .music-controls {
    padding-top: clamp(18px, 3.2vh, 28px);
  }
  .volume-row {
    padding-top: clamp(14px, 2.8vh, 24px);
    padding-bottom: clamp(16px, 3vh, 28px);
  }
}

@media (max-width: 600px) and (min-height: 860px) {
  .yt-album-section {
    padding-top: clamp(56px, 14vh, 132px);
    padding-bottom: clamp(32px, 5.5vh, 60px);
  }
  .album-art {
    width: min(250px, 68vw);
    height: min(250px, 68vw);
    font-size: 64px;
  }
  .music-progress-wrap {
    padding-top: clamp(26px, 4.8vh, 40px);
  }
  .music-controls {
    padding-top: clamp(22px, 3.8vh, 32px);
  }
  .volume-row {
    padding-top: clamp(18px, 3.2vh, 28px);
    padding-bottom: clamp(22px, 4vh, 36px);
  }
}

@media (max-width: 360px) {
  .header-actions {
    gap: 3px;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
  }
}

/* ═══════════════════════════════════════════
   PERFORMANCE — MOBILE
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .bg-orb {
    filter: blur(28px) !important;
    animation: orbFloat 28s ease-in-out infinite;
    opacity: 0.45;
  }
  .bg-scanlines {
    display: none;
  }
  .bg-grid {
    background-size: 48px 48px;
  }
  header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .ai .bubble {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .input-wrap {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  #musicPanel {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: default;
  }
  #profileSidebar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .chip::before {
    display: none;
  }
  .bg-orb-3,
  .bg-orb-4 {
    display: none;
  }
  #chatBox {
    transform: translateZ(0);
    -webkit-overflow-scrolling: touch;
  }
  .logo-dot {
    animation: none;
    box-shadow: 0 0 10px rgba(124, 92, 252, 0.5);
  }
  .welcome-icon {
    animation: iconPulse 7s ease-in-out infinite;
  }
  header::before {
    animation-duration: 10s;
  }
  .yt-tab-content,
  #playlistContainer,
  #favsContainer,
  #lyricsContainer,
  #chatBox > * {
    content-visibility: auto;
  }
  #playlistContainer,
  #favsContainer,
  #lyricsContainer {
    contain-intrinsic-size: 1px 480px;
  }
  #chatBox > * {
    contain-intrinsic-size: 1px 96px;
  }
}
@media (max-width: 768px) and (max-height: 700px) {
  .bg-orb-1,
  .bg-orb-2 {
    display: none;
  }
  .bg-grid {
    display: none;
  }
}

/* ═══════════════════════════════════════════
   DEVICE COMPATIBILITY BOOST
═══════════════════════════════════════════ */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:where(
    .icon-btn,
    .send-btn,
    .btn-primary,
    .btn-google,
    .sidebar-item,
    .chip,
    .mobile-tab-btn,
    .ctrl-btn,
    .playlist-item-love
  ) {
  touch-action: manipulation;
}

@media (hover: none) and (pointer: coarse) {
  :where(
      .icon-btn,
      .send-btn,
      .btn-primary,
      .btn-google,
      .mobile-tab-btn,
      .ctrl-btn,
      .playlist-item-love
    ) {
    min-width: 44px;
    min-height: 44px;
  }
  .sidebar-item {
    min-height: 48px;
  }
}

@media (max-width: 600px) {
  #uIn,
  .pw-wrap input,
  #authEmail,
  #authPass,
  #regName {
    font-size: 16px;
  }
  .chip {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .auth-modal-box {
    width: min(94vw, 420px);
    max-height: min(88dvh, 720px);
  }
  #chatBox {
    scroll-padding-bottom: calc(170px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  header {
    padding: 10px 16px;
  }
  .header-music-mini {
    max-width: 180px;
  }
  .bubble {
    max-width: min(76ch, 78vw);
  }
  .auth-modal-box {
    width: min(560px, 92vw);
  }
  #profileSidebar {
    width: min(360px, 46vw);
  }
  .mp-player-col {
    width: clamp(360px, 42vw, 460px);
    min-width: clamp(360px, 42vw, 460px);
  }
}

@media (max-width: 1024px) {
  #chatBox {
    padding-left: clamp(10px, 2.5vw, 16px);
    padding-right: clamp(10px, 2.5vw, 16px);
  }
  .bubble {
    font-size: clamp(13px, 2.2vw, 15px);
    line-height: 1.55;
  }
}

/* ═══════════════════════════════════════════
   THEME OVERRIDE — PIXEL UI CLEAN
═══════════════════════════════════════════ */
:root {
  --bg: #0f141b;
  --bg2: #171d26;
  --surf: rgba(255, 255, 255, 0.035);
  --surf2: rgba(255, 255, 255, 0.055);
  --glass: rgba(24, 31, 41, 0.82);
  --glass2: rgba(255, 255, 255, 0.025);
  --glass-border: rgba(148, 163, 184, 0.18);
  --glass-shine: rgba(255, 255, 255, 0.08);
  --text: #e7edf5;
  --text2: rgba(207, 220, 235, 0.66);
  --accent: #8ab4f8;
  --accent2: #7fb8ff;
  --accent3: #9aa8ff;
  --accent-dim: rgba(138, 180, 248, 0.14);
  --user-bubble: linear-gradient(135deg, #5487d9, #6f9cf0);
  --border: rgba(148, 163, 184, 0.2);
  --glow: rgba(138, 180, 248, 0.16);
  --glow2: rgba(138, 180, 248, 0.1);
  --music-grad: linear-gradient(135deg, #5487d9, #7fb8ff);
  --music-glow: rgba(138, 180, 248, 0.16);
}

[data-theme="light"] {
  --bg: #f7f9fc;
  --bg2: #edf1f7;
  --surf: rgba(255, 255, 255, 0.86);
  --surf2: rgba(255, 255, 255, 0.95);
  --glass: rgba(255, 255, 255, 0.88);
  --glass2: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(148, 163, 184, 0.24);
  --glass-shine: rgba(255, 255, 255, 0.92);
  --text: #1f2937;
  --text2: rgba(55, 65, 81, 0.68);
  --accent: #3b82f6;
  --accent2: #60a5fa;
  --accent3: #6366f1;
  --accent-dim: rgba(59, 130, 246, 0.1);
  --user-bubble: linear-gradient(135deg, #3b82f6, #6366f1);
  --border: rgba(148, 163, 184, 0.22);
  --glow: rgba(59, 130, 246, 0.12);
  --glow2: rgba(96, 165, 250, 0.1);
  --music-glow: rgba(59, 130, 246, 0.12);
}

body {
  background:
    radial-gradient(900px 520px at 10% -15%, rgba(138, 180, 248, 0.09), transparent 62%),
    radial-gradient(820px 440px at 90% 0%, rgba(138, 180, 248, 0.06), transparent 62%),
    var(--bg);
}

.bg-orb {
  filter: blur(104px);
}
.bg-orb-1,
.bg-orb-2,
.bg-orb-3,
.bg-orb-4 {
  opacity: 0.06;
}
.bg-grid,
.bg-scanlines,
.pixel-deco {
  opacity: 0.2;
}

header {
  background: var(--glass);
  border-bottom-color: var(--glass-border);
  box-shadow:
    0 1px 0 var(--glass-shine),
    0 6px 22px rgba(2, 6, 23, 0.18);
}

.icon-btn,
.chip,
.input-wrap,
.mp-side-col,
.mobile-tabs-bar,
.yt-tabs-bar,
.playlist-item,
.modal-box,
.field-inner,
.dev-tool-btn,
.sidebar-item {
  border-color: var(--glass-border);
}

.icon-btn {
  background: var(--surf);
  color: var(--text2);
  box-shadow:
    inset 0 1px 0 var(--glass-shine),
    0 2px 10px rgba(2, 6, 23, 0.12);
}
.icon-btn:hover {
  color: var(--accent);
  border-color: rgba(138, 180, 248, 0.45);
  box-shadow:
    inset 0 1px 0 var(--glass-shine),
    0 6px 16px rgba(138, 180, 248, 0.14);
}

.chip {
  background: var(--surf);
  box-shadow:
    inset 0 1px 0 var(--glass-shine),
    0 2px 10px rgba(2, 6, 23, 0.12);
}
.chip:hover {
  border-color: rgba(138, 180, 248, 0.42);
  box-shadow:
    inset 0 1px 0 var(--glass-shine),
    0 8px 16px rgba(138, 180, 248, 0.12);
}

.ai-avatar {
  background: linear-gradient(145deg, #7fa9ee, #8ab4f8);
  box-shadow:
    0 4px 12px rgba(138, 180, 248, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.bubble {
  border-radius: 18px;
}
.user .bubble {
  box-shadow:
    0 5px 14px rgba(138, 180, 248, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.ai .bubble {
  background: var(--surf);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 5px 14px rgba(2, 6, 23, 0.12),
    inset 0 1px 0 var(--glass-shine);
}

.bottom {
  background: linear-gradient(transparent, rgba(15, 20, 27, 0.92) 44%);
}
[data-theme="light"] .bottom {
  background: linear-gradient(transparent, rgba(247, 249, 252, 0.94) 44%);
}

.input-wrap {
  background: var(--glass);
  box-shadow:
    0 8px 24px rgba(2, 6, 23, 0.14),
    inset 0 1px 0 var(--glass-shine);
}
.input-wrap:focus-within {
  border-color: rgba(138, 180, 248, 0.5);
  box-shadow:
    0 8px 24px rgba(138, 180, 248, 0.12),
    0 0 0 1px rgba(138, 180, 248, 0.24),
    inset 0 1px 0 var(--glass-shine);
}
.send-btn {
  background: linear-gradient(145deg, #7fa9ee, #8ab4f8);
  box-shadow:
    0 6px 16px rgba(138, 180, 248, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

#musicPanel {
  background: var(--bg2);
  box-shadow:
    0 -12px 36px rgba(2, 6, 23, 0.24),
    inset 0 1px 0 var(--glass-shine);
}
[data-theme="light"] #musicPanel {
  background: var(--bg2);
}

.music-panel-title,
.music-track-count {
  letter-spacing: 1px;
}

.yt-tab-btn.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.playlist-item {
  background: var(--surf);
}
.playlist-item.active {
  border-color: rgba(138, 180, 248, 0.48);
  box-shadow: 0 6px 16px rgba(138, 180, 248, 0.14);
}

.ctrl-btn {
  background: var(--surf);
  border: 1px solid var(--glass-border);
}
.ctrl-btn.play-pause {
  background: linear-gradient(145deg, #7fa9ee, #8ab4f8);
  box-shadow:
    0 7px 16px rgba(138, 180, 248, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.modal {
  background: rgba(15, 20, 27, 0.56);
}
.modal-box {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 14px 34px rgba(2, 6, 23, 0.2),
    inset 0 1px 0 var(--glass-shine);
}
[data-theme="light"] .modal-box {
  background: var(--glass);
}

.field-inner {
  background: var(--surf);
  border: 1px solid var(--glass-border);
}
.field-inner:focus-within {
  border-color: rgba(138, 180, 248, 0.5);
  box-shadow: 0 0 0 1px rgba(138, 180, 248, 0.22);
}

.btn-primary {
  background: linear-gradient(145deg, #7fa9ee, #8ab4f8);
  box-shadow:
    0 8px 18px rgba(138, 180, 248, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.btn-google {
  background: var(--surf);
  border-color: var(--glass-border);
}

.sidebar-item {
  background: var(--surf);
}
.sidebar-item:hover {
  border-color: rgba(138, 180, 248, 0.42);
  box-shadow: 0 8px 16px rgba(138, 180, 248, 0.12);
}

/* Auth modal cleanup: remove stacked decorative blocks */
.modal-box::before,
.modal-box.auth-modal-box::after {
  display: none;
}

.auth-visual-bg {
  display: none;
}

.auth-modal-box {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 14px 34px rgba(2, 6, 23, 0.2),
    inset 0 1px 0 var(--glass-shine);
}

.auth-form-container {
  padding: 0 28px 14px;
}

.auth-modal-box .divider {
  margin: 10px 0;
  color: var(--text2);
  background: transparent;
}

.auth-modal-box .divider::before,
.auth-modal-box .divider::after {
  background: var(--glass-border);
}

.auth-footer,
[data-theme="light"] .auth-footer {
  background: transparent;
  border-top: 1px solid var(--glass-border);
}

/* Auth input fix: remove double-box stacking on email/name/password fields */
.auth-modal-box .field-inner {
  background: transparent;
  border: none;
  box-shadow: none;
}

.auth-modal-box .field-inner:focus-within {
  border: none;
  box-shadow: none;
}

.auth-modal-box .field input,
.auth-modal-box .pw-wrap input {
  background: var(--surf2);
  border: 1px solid var(--glass-border);
  box-shadow: none;
}

.auth-modal-box .field input:focus,
.auth-modal-box .pw-wrap input:focus {
  border-color: rgba(138, 180, 248, 0.55);
  box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.18);
  transform: none;
}

/* Performance mode for low-end devices */
.perf-lite .bg-orb,
.perf-lite .bg-grid,
.perf-lite .bg-scanlines,
.perf-lite .pixel-deco,
.perf-lite .particle {
  display: none !important;
}

.perf-lite header,
.perf-lite .input-wrap,
.perf-lite .modal-box,
.perf-lite .auth-modal-box,
.perf-lite #musicPanel,
.perf-lite .ai .bubble,
.perf-lite .yt-tab-content {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.perf-lite .welcome-icon,
.perf-lite .chip,
.perf-lite .icon-btn,
.perf-lite .btn-primary,
.perf-lite .send-btn,
.perf-lite .ctrl-btn,
.perf-lite .playlist-item,
.perf-lite .sidebar-item,
.perf-lite .modal-box,
.perf-lite .auth-modal-box,
.perf-lite .msg,
.perf-lite .ai-avatar {
  animation: none !important;
  transition-duration: 0.12s !important;
}

.perf-lite .chip:hover,
.perf-lite .icon-btn:hover,
.perf-lite .btn-primary:hover,
.perf-lite .send-btn:hover,
.perf-lite .playlist-item:hover,
.perf-lite .sidebar-item:hover {
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
