/* Iconos para mostrar/ocultar contraseña */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

.bi {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -.125em;
  font-size: 1.2em;
  user-select: none;
}

.app-thermal-alert {
  position: sticky;
  top: 0;
  z-index: 1045;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.98), rgba(185, 28, 28, 0.98));
  color: #fff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.app-thermal-alert-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.app-thermal-alert-title {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-thermal-alert-msg {
  font-weight: 600;
}

@media (max-width: 640px) {
  .app-thermal-alert-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
.bi-eye::before {
  content: '👁️'; /* Ojo para mostrar */
}
.bi-eye-slash::before {
  content: '🙈'; /* Ojo tapado para ocultar */
}
/* Modern app theme for server_project */
:root {
  --app-bg: #0b1220;
  --app-surface: rgba(255, 255, 255, 0.06);
  --app-surface-2: rgba(255, 255, 255, 0.09);
  --app-border: rgba(255, 255, 255, 0.10);
  --app-text: rgba(255, 255, 255, 0.92);
  --app-muted: rgba(255, 255, 255, 0.65);

  --app-accent: #7c3aed; /* violet */
  --app-accent-2: #22c55e; /* green */

  --app-radius: 16px;
  --app-radius-sm: 12px;
  --app-shadow: 0 18px 40px rgba(0,0,0,.35);
  --app-shadow-sm: 0 10px 26px rgba(0,0,0,.25);

  --sidebar-w: 300px;
  --sidebar-w-collapsed: 86px;
  --content-max: 1200px;
}

html, body {
  height: 100%;
}

body {
  min-height: 100vh;
  /* Seamless pattern + soft glows. The first layer repeats cleanly forever. */
  background-color: var(--app-bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath d='M0 0H160V160H0z' fill='none'/%3E%3Cpath d='M0 0L160 160M160 0L0 160' stroke='%23ffffff' stroke-opacity='0.03' stroke-width='1'/%3E%3Ccircle cx='80' cy='80' r='1' fill='%23ffffff' fill-opacity='0.06'/%3E%3C/svg%3E"),
    radial-gradient(1200px 600px at 20% -10%, rgba(124,58,237,.35), transparent 60%),
    radial-gradient(900px 450px at 90% 10%, rgba(34,197,94,.25), transparent 55%),
    radial-gradient(900px 550px at 40% 120%, rgba(59,130,246,.18), transparent 55%);
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
  background-size: 420px 420px, auto, auto, auto;
  background-position: 0 0, 0 0, 0 0, 0 0;
  color: var(--app-text);
}

html.perf-lite body {
  background-image:
    radial-gradient(1200px 600px at 20% -10%, rgba(124,58,237,.2), transparent 60%),
    radial-gradient(900px 450px at 90% 10%, rgba(34,197,94,.15), transparent 55%);
  background-repeat: no-repeat, no-repeat;
  background-size: auto, auto;
}

/* Make default bootstrap light backgrounds blend with dark theme */
.bg-light, .bg-white, .table-light {
  background-color: transparent !important;
}

a { color: inherit; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(11, 18, 32, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--app-border);
}

html.perf-lite .app-topbar {
  backdrop-filter: none;
  background: rgba(11, 18, 32, 0.94);
  border-bottom: 1px solid var(--app-border);
}

.app-topbar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: .45rem calc(.9rem + env(safe-area-inset-right)) .45rem calc(.9rem + env(safe-area-inset-left));
  justify-items: start;
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
}

.app-topnav {
  display: flex;
  gap: .5rem;
  padding: 0;
  border-top: none;
  justify-content: flex-end;
  flex-wrap: nowrap;
  background: transparent;
  box-shadow: none;
}

.app-navicon {
  width: 42px;
  height: 42px;
  font-size: 1.05rem;
}

.app-navicon.active {
  border-color: rgba(124,58,237,.55);
  box-shadow: 0 0 0 1px rgba(124,58,237,.15);
  background: rgba(124,58,237,.12);
}

.app-navform {
  margin: 0;
}

.app-topnav .app-navitem {
  cursor: grab;
  user-select: none;
}

.app-topnav .app-navitem:active {
  cursor: grabbing;
}

.app-topnav .app-navitem.is-dragging {
  opacity: .45;
  transform: scale(.96);
}

.app-topnav .app-navitem.drop-before {
  box-shadow: inset 3px 0 0 rgba(34, 211, 238, .9);
}

.app-topnav .app-navitem.drop-after {
  box-shadow: inset -3px 0 0 rgba(34, 211, 238, .9);
}

.app-iconbtn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--app-text);
  text-decoration: none;
}

.app-iconbtn:hover {
  background: rgba(255, 255, 255, 0.10);
}

.app-brand {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  --brand-size: 78px;
  margin-left: 0;
  margin-top: 0;
  padding: .2rem 0;
  line-height: 1.1;
  text-decoration: none;
  justify-self: start;
}

.app-brand picture {
  width: var(--brand-size);
  height: var(--brand-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
}

.app-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
  border: none;
  padding: 0;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 10px rgba(72, 200, 255, 0.35));
  transform: scale(1.08);
  transform-origin: center;
}

.app-brand-text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}

.app-brand-title {
  font-weight: 700;
  letter-spacing: .2px;
}

.app-brand-sub {
  font-size: .75rem;
  color: var(--app-muted);
}

@media (max-width: 1024px) {
  .app-brand {
    --brand-size: 72px;
  }
}

@media (max-width: 480px) {
  .app-brand {
    --brand-size: 62px;
  }
  .app-brand-title {
    font-size: .95rem;
  }
  .app-brand-sub {
    font-size: .7rem;
  }
}

.app-main {
  padding: 1rem;
}

.app-content {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* Typography */
h1 { font-size: clamp(1.35rem, 1.1rem + 1vw, 2rem); margin-bottom: .25rem; }
.lead { color: var(--app-muted); font-size: 1rem; }

/* Cards */
.card {
  border-radius: var(--app-radius);
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: var(--app-shadow-sm);
}

.card-header {
  background: rgba(255,255,255,0.04) !important;
  border-bottom: 1px solid var(--app-border);
}

.card-body {
  color: var(--app-text);
}

/* Tables */
.table {
  color: var(--app-text);
}

.table thead th {
  color: rgba(255,255,255,.78);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: rgba(255,255,255,0.03);
}

.table-responsive {
  border-radius: var(--app-radius-sm);
}

/* Inputs */
.form-control, .form-select {
  border-radius: 14px;
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--app-text);
}

/* Windows/Chrome: dropdown options often render with system (light) background;
   force readable option text so it doesn't look "blank" on open. */
.form-select option,
.form-select optgroup {
  color: #0b1220;
  background: #ffffff;
}

.form-control::placeholder {
  color: rgba(255,255,255,0.45);
}

.form-control:focus, .form-select:focus {
  border-color: rgba(124,58,237,.65);
  box-shadow: 0 0 0 .2rem rgba(124,58,237,.18);
  background: rgba(255,255,255,0.08);
}

.form-label, .form-text { color: var(--app-muted); }

/* Buttons */
.btn {
  border-radius: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(124,58,237,1), rgba(99,102,241,1));
  border: none;
}

.btn-outline-light {
  border-color: rgba(255,255,255,0.22);
}

/* Accordion */
.accordion-item {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  overflow: hidden;
  background: rgba(255,255,255,0.05);
}

.accordion-button {
  background: rgba(255,255,255,0.04);
  color: var(--app-text);
}

.accordion-button:not(.collapsed) {
  background: rgba(124,58,237,.16);
  color: var(--app-text);
}

/* Offcanvas */
.offcanvas {
  background: rgba(11, 18, 32, 0.92);
  color: var(--app-text);
  border-right: 1px solid var(--app-border);
  backdrop-filter: blur(14px);
}

html.perf-lite .offcanvas {
  backdrop-filter: none;
  background: rgba(11, 18, 32, 0.94);
}


html.perf-lite *,
html.perf-lite *::before,
html.perf-lite *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html.perf-lite .card,
html.perf-lite .btn,
html.perf-lite .app-iconbtn,
html.perf-lite .offcanvas,
html.perf-lite .accordion-item {
  box-shadow: none !important;
  filter: none !important;
}

html.perf-lite .app-brand-logo {
  filter: none;
}

/* Pro desktop drawer: floats under topbar */
@media (min-width: 992px) {
  :root {
    --topbar-h: 62px;
  }

  .offcanvas {
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
    box-shadow: var(--app-shadow);
  }
}

.offcanvas-backdrop.show {
  opacity: 0.55;
  backdrop-filter: blur(6px);
}

.offcanvas .list-group-item {
  background: transparent;
  border-color: rgba(255,255,255,0.06);
  color: var(--app-text);
}

.offcanvas .list-group-item:hover {
  background: rgba(255,255,255,0.06);
}

.offcanvas .list-group-item.active {
  background: rgba(124,58,237,.18);
  border-color: rgba(124,58,237,.35);
}

/* Make bootstrap alerts readable */
.alert {
  border-radius: var(--app-radius);
  border: 1px solid var(--app-border);
  background: rgba(255,255,255,0.06);
  color: var(--app-text);
}

/* --- Dashboard (Mi panel) --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  --dashboard-gap: 14px;
  --dashboard-cell-h: 170px;
  gap: var(--dashboard-gap);
  align-items: start;
}

.dashboard-widget {
  grid-column: 1 / -1;
  min-width: 0;
  --dashboard-h-units: 1;
  min-height: calc((var(--dashboard-cell-h) * var(--dashboard-h-units)) + (var(--dashboard-gap) * (var(--dashboard-h-units) - 1)));
}

.dashboard-widget[data-widget-shape$="x2"] {
  --dashboard-h-units: 2;
}

.dashboard-widget[data-widget-shape$="x3"] {
  --dashboard-h-units: 3;
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    --dashboard-cell-h: 180px;
  }
  .dashboard-widget {
    grid-column: span 1;
  }
  .dashboard-widget[data-widget-shape^="2x"],
  .dashboard-widget[data-widget-shape^="3x"] {
    grid-column: span 2;
  }
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    --dashboard-gap: 16px;
    --dashboard-cell-h: 185px;
    gap: var(--dashboard-gap);
  }
  .dashboard-widget {
    grid-column: span 1;
  }
  .dashboard-widget[data-widget-shape^="2x"] {
    grid-column: span 2;
  }
  .dashboard-widget[data-widget-shape^="3x"] {
    grid-column: span 3;
  }
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: .85rem;
  }
}

.dashboard-handle {
  display: none;
  user-select: none;
  opacity: 0.8;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: .35rem .5rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: var(--app-text);
}

body.dashboard-edit .dashboard-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.dashboard-edit .dashboard-handle:hover {
  background: rgba(255,255,255,0.10);
}

body.dashboard-edit .dashboard-widget {
  outline: 1px dashed rgba(255, 255, 255, 0.15);
}

body.dashboard-edit .dashboard-widget.dashboard-selected {
  outline: 2px solid rgba(124,58,237,.55);
  box-shadow: 0 0 0 3px rgba(124,58,237,.14);
}

body.dashboard-edit .dashboard-widget.dragging {
  opacity: 0.7;
  transform: scale(0.995);
}

/* --- Kcal widget chart sizing --- */
.kcal-widget-chart-wrap {
  position: relative;
  height: 170px;
  width: 100%;
  border-radius: var(--app-radius-sm);
  overflow: hidden;
}

.kcal-widget-chart-wrap > canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Quick lights widget: small square nodes */
.quick-node-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quick-node {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--app-text);
  position: relative; /* allow absolutely positioned children */
}
.quick-node.on { background: linear-gradient(135deg, rgba(34,197,94,0.18), rgba(124,58,237,0.06)); border-color: rgba(34,197,94,0.25); }
.quick-node.off { opacity: 0.65; }
.quick-node .mini-remove { position: absolute; top: -6px; right: -6px; font-size: 10px; }

/* Favorite (star) button for quick nodes and nodes list */
.favorite-btn, .quick-fav-btn {
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.75);
  padding: 0;
  margin: 0;
  line-height: 1;
  font-size: 14px;
  cursor: pointer;
  transition: transform 220ms cubic-bezier(.2,.9,.3,1), color 200ms ease, opacity 150ms linear;
  opacity: 0.95;
}
.favorite-btn:hover, .quick-fav-btn:hover { transform: scale(1.08); }
.favorite-btn.favorited, .quick-fav-btn.favorited { color: #FFD54D; opacity: 1; }

/* small pop animation */
.fav-anim { transform: scale(1.3); transition: transform 240ms cubic-bezier(.2,.9,.3,1); }

/* position quick favorite */
.quick-fav-btn { position: absolute; top: 4px; right: 4px; font-size: 12px; }

/* --- Fitness compact widget --- */
.dash-fitness-compact {
  padding: .25rem .1rem;
}

.dash-fitness-day-card {
  padding: .55rem .7rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.dash-fitness-day-card.is-done {
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.18);
}

.dash-fitness-day-exs {
  font-size: .8rem;
  color: var(--app-muted);
  margin-top: .15rem;
}

/* --- Neo-tech refresh (global, excluding ITD) --- */
:root {
  --app-bg: #060914;
  --app-surface: rgba(15, 23, 42, 0.62);
  --app-surface-2: rgba(30, 41, 59, 0.6);
  --app-border: rgba(148, 163, 184, 0.22);
  --app-text: rgba(244, 247, 255, 0.95);
  --app-muted: rgba(203, 213, 225, 0.72);
  --app-accent: #7c5cff;
  --app-accent-2: #22d3ee;
  --app-accent-3: #22c55e;
  --app-glow: rgba(99, 102, 241, 0.25);
}

body.app-body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background-color: var(--app-bg);
  background-image: none;
  color: var(--app-text);
  position: relative;
  overflow-x: hidden;
}

body.app-body::before,
body.app-body::after {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: -1;
}

body.app-body::before {
  background:
    radial-gradient(600px 320px at 15% 10%, rgba(124, 92, 255, 0.35), transparent 70%),
    radial-gradient(520px 280px at 90% 15%, rgba(34, 211, 238, 0.30), transparent 70%),
    radial-gradient(520px 320px at 40% 90%, rgba(34, 197, 94, 0.20), transparent 70%);
  filter: blur(10px);
  opacity: 0.85;
  animation: auroraShift 18s ease-in-out infinite alternate;
}

body.app-body::after {
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 18%, rgba(255, 255, 255, 0.20), transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 30%, rgba(255, 255, 255, 0.18), transparent 60%),
    radial-gradient(1.2px 1.2px at 30% 72%, rgba(255, 255, 255, 0.15), transparent 60%),
    radial-gradient(1.8px 1.8px at 82% 78%, rgba(255, 255, 255, 0.18), transparent 60%),
    radial-gradient(1px 1px at 55% 50%, rgba(255, 255, 255, 0.12), transparent 60%);
  opacity: 0.45;
  mix-blend-mode: screen;
  animation: sparkleDrift 14s linear infinite;
}

.app-topbar,
.app-main,
.app-content {
  position: relative;
}

.app-topbar {
  background: rgba(7, 12, 24, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 6px 16px rgba(5, 7, 16, 0.35);
}

.app-topnav {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.app-brand-title {
  text-shadow: 0 0 16px rgba(124, 92, 255, 0.35);
}

.app-iconbtn {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(135deg, rgba(17, 25, 45, 0.75), rgba(15, 23, 42, 0.45));
  box-shadow: 0 8px 18px rgba(5, 8, 16, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
}

.app-iconbtn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(124, 92, 255, 0.45), transparent 60%);
  opacity: 0;
  transition: opacity 200ms ease;
}

.app-iconbtn:hover::after {
  opacity: 0.65;
}

.app-navicon.active {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.15), 0 0 18px rgba(124, 92, 255, 0.2);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.25), rgba(34, 211, 238, 0.12));
}

.card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.75), rgba(8, 12, 24, 0.6));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 42px rgba(5, 8, 16, 0.45), 0 0 24px rgba(124, 92, 255, 0.08);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(34, 211, 238, 0.18), transparent 60%);
  opacity: 0.5;
  pointer-events: none;
}

.card::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -20%;
  width: 140%;
  height: 220%;
  background: conic-gradient(from 180deg, transparent, rgba(255, 255, 255, 0.12), transparent 30%);
  opacity: 0.2;
  animation: cardSheen 12s linear infinite;
  pointer-events: none;
}

.card > * {
  position: relative;
  z-index: 1;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(124, 92, 255, 1), rgba(34, 211, 238, 0.95));
  box-shadow: 0 12px 30px rgba(124, 92, 255, 0.25);
}

.btn-outline-light,
.btn-outline-secondary {
  border-color: rgba(148, 163, 184, 0.35);
}

.form-control,
.form-select {
  background: rgba(8, 12, 24, 0.65);
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.dashboard-header {
  padding: .6rem .8rem;
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.4));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 30px rgba(5, 8, 16, 0.35);
}

.dashboard-avatar,
.profile-avatar,
.app-avatar-btn {
  border-radius: 50%;
}

.dashboard-avatar {
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  flex: 0 0 auto;
  border: 2px solid rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 24px rgba(124, 92, 255, 0.35);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.8);
}

.dashboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}

.dashboard-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  background: radial-gradient(circle at 30% 20%, rgba(124, 92, 255, 0.85), rgba(15, 23, 42, 0.95));
}

.profile-avatar {
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  flex: 0 0 auto;
  border: 2px solid rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.3);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.8);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}

.profile-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  background: radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.85), rgba(15, 23, 42, 0.95));
}

.app-avatar-btn {
  padding: 0;
  min-width: 42px;
  min-height: 42px;
  flex: 0 0 auto;
}

.app-avatar-btn {
  aspect-ratio: 1 / 1;
}

.app-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  border-radius: 50%;
  display: block;
}

.app-avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .85rem;
  color: #fff;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, rgba(124, 92, 255, 0.85), rgba(15, 23, 42, 0.95));
}

@keyframes auroraShift {
  0% { transform: translate3d(-6%, -4%, 0) rotate(0deg); }
  50% { transform: translate3d(6%, 4%, 0) rotate(6deg); }
  100% { transform: translate3d(-4%, 6%, 0) rotate(-6deg); }
}

@keyframes sparkleDrift {
  0% { opacity: 0.35; background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  50% { opacity: 0.55; background-position: 200px -120px, -140px 120px, 120px 160px, -180px -140px, 90px -90px; }
  100% { opacity: 0.35; background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
}

@keyframes cardSheen {
  0% { transform: translateX(-50%) rotate(8deg); opacity: 0; }
  40% { opacity: 0.18; }
  100% { transform: translateX(50%) rotate(8deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  body.app-body::before,
  body.app-body::after,
  .card::after {
    animation: none;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 768px), (pointer: coarse) {
  body.app-body::before,
  body.app-body::after {
    position: absolute;
    inset: 0;
    animation: none;
    opacity: 0.25;
    background-attachment: scroll;
  }
}

/* ===== Global Floating Music Dock ===== */
.music-dock-shell {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 1082;
  width: min(312px, calc(100% - 22px));
  max-width: calc(100% - 22px);
  display: grid;
  gap: 10px;
  pointer-events: none;
  overflow-x: clip;
}

.music-dock-shell.is-expanded {
  width: min(368px, calc(100% - 22px));
}

.music-dock-shell:not(.is-expanded) {
  gap: 8px;
}

.music-dock-shell > * {
  pointer-events: auto;
}

.music-dock-chip {
  border: 1px solid rgba(124, 92, 255, 0.42);
  background:
    linear-gradient(130deg, rgba(15, 23, 42, 0.92), rgba(10, 18, 34, 0.9)),
    radial-gradient(circle at 15% 20%, rgba(34, 211, 238, 0.22), transparent 55%);
  color: var(--app-text);
  width: 100%;
  border-radius: 18px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  box-shadow: 0 14px 34px rgba(4, 7, 16, 0.55), 0 0 0 1px rgba(124, 92, 255, 0.1);
}

.music-dock-shell:not(.is-expanded) .music-dock-chip {
  border-radius: 16px;
  padding: 8px 10px;
  gap: 8px;
}

.music-dock-chip:hover {
  border-color: rgba(34, 211, 238, 0.5);
}

.music-dock-chip-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(124, 92, 255, 0.34), rgba(34, 211, 238, 0.22));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.music-dock-chip-copy {
  min-width: 0;
  display: grid;
}

.music-dock-chip-title {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-dock-chip-sub {
  color: var(--app-muted);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-dock-chip-pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.5);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
}

.music-dock-chip.is-playing .music-dock-chip-pulse {
  background: rgba(34, 197, 94, 0.95);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

.music-dock-shell:not(.is-expanded) .music-dock-chip-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.music-dock-shell:not(.is-expanded) .music-dock-chip-title {
  font-size: 0.86rem;
}

.music-dock-shell:not(.is-expanded) .music-dock-chip-sub {
  font-size: 0.72rem;
}

.music-dock-chip-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 2px;
}

.music-dock-shell:not(.is-expanded) .music-dock-chip-quick {
  gap: 6px;
  padding: 0;
}

.music-dock-chip-quick[hidden] {
  display: none !important;
}

.music-dock-chip[aria-expanded="true"] + .music-dock-chip-quick {
  display: none;
}

.music-dock-chip-btn {
  min-width: 0;
  height: 34px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(12, 18, 34, 0.78);
  color: var(--app-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease, opacity 180ms ease;
}

.music-dock-shell:not(.is-expanded) .music-dock-chip-btn {
  height: 32px;
  border-radius: 10px;
}

.music-dock-chip-btn:hover {
  border-color: rgba(34, 211, 238, 0.55);
  transform: translateY(-1px);
}

.music-dock-chip-btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
}

.music-dock-chip-btn-main {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.92), rgba(34, 211, 238, 0.8));
  border-color: rgba(124, 92, 255, 0.56);
  font-size: 0.96rem;
}

.music-dock-chip-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: 0.96;
}

.music-dock-chip-btn.is-muted {
  border-color: rgba(248, 113, 113, 0.56);
  background: rgba(127, 29, 29, 0.28);
  color: rgba(254, 226, 226, 0.95);
}

.music-dock-panel {
  border: 1px solid rgba(124, 92, 255, 0.32);
  background:
    linear-gradient(160deg, rgba(8, 14, 28, 0.94), rgba(7, 11, 22, 0.9)),
    radial-gradient(520px 220px at 20% 0%, rgba(34, 211, 238, 0.18), transparent 70%),
    radial-gradient(480px 180px at 100% 100%, rgba(124, 92, 255, 0.14), transparent 72%);
  border-radius: 20px;
  box-shadow: 0 24px 56px rgba(4, 7, 16, 0.62), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  padding: 12px;
  max-height: min(78vh, 620px);
  display: grid;
  gap: 10px;
  overflow: hidden;
  min-width: 0;
  transition: max-height 300ms cubic-bezier(0.22, 1, 0.36, 1), border-color 220ms ease, box-shadow 240ms ease;
}

.music-dock-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.music-dock-now {
  min-width: 0;
}

.music-dock-title {
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-dock-subtitle {
  color: var(--app-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-dock-head-actions {
  display: inline-flex;
  gap: 7px;
  flex-shrink: 0;
}

.music-dock-open,
.music-dock-min {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.5);
  color: var(--app-text);
  display: grid;
  place-items: center;
  text-decoration: none;
}

.music-dock-open:hover,
.music-dock-min:hover {
  border-color: rgba(34, 211, 238, 0.5);
}

.music-dock-progress-wrap {
  display: grid;
  gap: 5px;
}

.music-dock-progress-track {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.2);
}

.music-dock-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.95), rgba(34, 211, 238, 0.9));
}

.music-dock-time {
  justify-self: end;
  font-size: 0.72rem;
  color: var(--app-muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.music-dock-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.music-dock-btn {
  min-width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.68);
  color: var(--app-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.music-dock-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.music-dock-btn:hover {
  border-color: rgba(34, 211, 238, 0.5);
}

.music-dock-btn-main {
  min-width: 52px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.9), rgba(34, 211, 238, 0.75));
  border-color: rgba(124, 92, 255, 0.55);
}

.music-dock-btn-fav,
.music-dock-btn-queue {
  min-width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 1.02rem;
  margin-top: 2px;
}

.music-dock-btn-queue {
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1;
}

.music-dock-btn-fav.is-favorite {
  color: #ffd54d;
  border-color: rgba(255, 213, 77, 0.58);
  background: rgba(255, 213, 77, 0.14);
}

.music-dock-btn-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  opacity: 0.96;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.28));
}

.music-dock-volume {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 0 2px;
}

.music-dock-volume-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(226, 232, 240, 0.85);
}

.music-dock-volume-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.music-dock-volume-range {
  width: 100%;
  appearance: none;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  outline: none;
}

.music-dock-volume-range::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(124, 92, 255, 0.95), rgba(34, 211, 238, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
  cursor: pointer;
}

.music-dock-volume-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(124, 92, 255, 0.95), rgba(34, 211, 238, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
  cursor: pointer;
}

.music-dock-volume-label {
  min-width: 34px;
  text-align: right;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--app-muted);
  font-size: 0.72rem;
}

.music-dock-section {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.56);
  padding: 9px;
  display: grid;
  gap: 8px;
  transition: border-color 220ms ease, background 220ms ease, box-shadow 220ms ease, opacity 220ms ease;
}

.music-dock-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--app-muted);
}

.music-dock-section-meta {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.music-dock-clear {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: rgba(8, 12, 24, 0.55);
  color: var(--app-text);
  font-size: 0.7rem;
  padding: 3px 8px;
}

.music-dock-search {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(6, 10, 21, 0.72);
  color: var(--app-text);
  padding: 8px 10px;
  outline: none;
}

.music-dock-search:focus {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 0.18rem rgba(34, 211, 238, 0.12);
}

.music-dock-queue,
.music-dock-results {
  max-height: 165px;
  overflow: auto;
  overflow-x: hidden;
  display: grid;
  gap: 6px;
  padding-right: 2px;
  scrollbar-gutter: stable;
  transition: max-height 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease, transform 240ms ease;
}

.music-dock-panel.is-searching {
  max-height: min(88vh, 760px);
  border-color: rgba(34, 211, 238, 0.48);
  box-shadow: 0 30px 68px rgba(4, 7, 16, 0.68), inset 0 0 0 1px rgba(34, 211, 238, 0.2);
}

.music-dock-panel.is-searching .music-dock-queue {
  max-height: 96px;
  opacity: 0.74;
}

.music-dock-panel.is-searching .music-dock-section-search {
  border-color: rgba(34, 211, 238, 0.46);
  background:
    linear-gradient(160deg, rgba(8, 14, 28, 0.78), rgba(7, 11, 22, 0.76)),
    radial-gradient(380px 140px at 14% 0%, rgba(34, 211, 238, 0.18), transparent 70%);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.24), 0 12px 26px rgba(4, 7, 16, 0.3);
}

.music-dock-panel.is-searching .music-dock-search {
  border-color: rgba(34, 211, 238, 0.72);
  box-shadow: 0 0 0 0.2rem rgba(34, 211, 238, 0.16);
}

.music-dock-panel.is-searching .music-dock-results {
  max-height: 312px;
  transform: translateY(-1px);
}

.music-dock-row {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 11px;
  background: rgba(7, 11, 22, 0.6);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 7px 8px;
  align-items: center;
  min-width: 0;
}

.music-dock-row-main {
  min-width: 0;
}

.music-dock-row-title {
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-dock-row-meta {
  color: var(--app-muted);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-dock-row-actions {
  display: inline-flex;
  gap: 5px;
  flex-shrink: 0;
}

.music-dock-row-btn {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.7);
  color: var(--app-text);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
}

.music-dock-row-btn:hover {
  border-color: rgba(34, 211, 238, 0.48);
}

.music-dock-row-btn-fav.is-favorite {
  color: #ffd54d;
  border-color: rgba(255, 213, 77, 0.55);
  background: rgba(255, 213, 77, 0.14);
}

.music-dock-empty {
  color: var(--app-muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 8px 0;
}

.music-dock-status {
  font-size: 0.74rem;
  color: var(--app-muted);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 8px;
}

html.perf-lite .music-dock-panel,
html.perf-lite .music-dock-chip {
  backdrop-filter: none;
  box-shadow: 0 10px 24px rgba(4, 7, 16, 0.44);
}

@media (max-width: 780px) {
  .music-dock-shell {
    right: max(9px, env(safe-area-inset-right));
    bottom: max(9px, env(safe-area-inset-bottom));
    width: min(304px, calc(100% - 12px));
    max-width: calc(100% - 12px);
  }
  .music-dock-shell.is-expanded {
    width: min(362px, calc(100% - 12px));
  }
  .music-dock-panel {
    max-height: min(72vh, 560px);
  }
  .music-dock-panel.is-searching {
    max-height: min(82vh, 670px);
  }
  .music-dock-panel.is-searching .music-dock-results {
    max-height: 270px;
  }
}
