:root{
  --ajustes-acento:#17B978;
  --ajustes-peligro:#c62f3e;
  --ajustes-peligro-bg:#fde8ea;
}



/* ---------- Botón de usuario ---------- */
button.usuario{
  border:0;
  font:inherit;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  transition:box-shadow .15s;
}
button.usuario:hover,
button.usuario[aria-expanded="true"]{box-shadow:0 0 0 3px rgba(255,255,255,.45)}
button.usuario:focus-visible{outline:2px solid #fff;outline-offset:3px}
button.usuario svg{width:18px;height:18px}

/* ---------- Menú ---------- */
.ajustes{position:relative}

.menu-ajustes{
  position:absolute;
  top:calc(100% + 14px);
  right:0;
  z-index:20;
  width:min(290px, calc(100vw - 32px));
  max-height:calc(100vh - 100px);
  overflow-y:auto;
  padding:8px;
  background:var(--card);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:0 16px 40px rgba(11,18,16,.18);
  animation:ajustes-entrada .14s ease-out;
}
.menu-ajustes[hidden]{display:none}

.menu-ajustes::before{
  content:"";
  position:absolute;
  top:-7px;
  right:14px;
  width:12px;
  height:12px;
  background:var(--card);
  border-top:1px solid var(--line);
  border-left:1px solid var(--line);
  transform:rotate(45deg);
}

@keyframes ajustes-entrada{
  from{opacity:0;transform:translateY(-6px)}
  to{opacity:1;transform:translateY(0)}
}

/* ---------- Cabecera ---------- */
.ajustes-perfil{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:6px;
  padding:10px 10px 12px;
  border-bottom:1px solid var(--line);
}
.ajustes-avatar{
  flex:none;
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  border-radius:50%;
  background:var(--ajustes-acento);
  color:#fff;
  font-weight:700;
}
.ajustes-avatar svg{width:20px;height:20px}
.ajustes-nombre{
  overflow:hidden;
  max-width:190px;
  font-size:14px;
  font-weight:700;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.ajustes-estado{font-size:12px;color:var(--muted)}

/* ---------- Opciones ---------- */
.ajustes-lista{display:grid;gap:2px}

.ajustes-sep{
  height:1px;
  margin:6px 4px;
  background:var(--line);
}

.ajustes-item{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  padding:10px 12px;
  border:0;
  border-radius:10px;
  background:none;
  color:var(--text);
  font:inherit;
  font-size:14px;
  text-align:left;
  text-decoration:none;
  cursor:pointer;
}
.ajustes-item:hover,
.ajustes-item:focus-visible{background:var(--bg);outline:none}
.ajustes-item:focus-visible{box-shadow:inset 0 0 0 2px var(--ajustes-acento)}
.ajustes-item svg{flex:none;width:18px;height:18px}

.ajustes-item.peligro{color:var(--ajustes-peligro)}
.ajustes-item.peligro:hover,
.ajustes-item.peligro:focus-visible{background:var(--ajustes-peligro-bg)}

/* ---------- Interruptor (modo oscuro) ---------- */
.ajustes-switch{
  position:relative;
  flex:none;
  width:34px;
  height:20px;
  margin-left:auto;
  border-radius:999px;
  background:var(--line);
  transition:background .15s;
}
.ajustes-switch::after{
  content:"";
  position:absolute;
  top:2px;
  left:2px;
  width:16px;
  height:16px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.3);
  transition:transform .15s;
}
.ajustes-item[aria-checked="true"] .ajustes-switch{background:var(--ajustes-acento)}
.ajustes-item[aria-checked="true"] .ajustes-switch::after{transform:translateX(14px)}

@media (prefers-reduced-motion:reduce){
  .menu-ajustes{animation:none}
  .ajustes-switch,.ajustes-switch::after{transition:none}
}